SIP tool to generate test traffic and measure latency - voip

I'm looking for a tool (preferably open source) which could generate test traffic towards a SIP server, test traffic could be SIP INVITE/OPTIONS ping and verify the response from SIP server.
I also need the tool to provide some stats on the response to INVITE/OPTIONS message sent for testing, I need this information to verify my SIP server is up and I can use the average response time duration to get an estimate of the real time performance of the SIP server.
It would be great if I can connect the tool to a backend, to get the stats in a DB, this will greatly help in retrieving the stats.

You can use one of the most popular one which is SIPp but you may have a hard time connecting it to a DB. Alternatively you can also use SIPUnit if you're familiar with Java programming which would allow you to connect to a DB more easily

Related

ESP8266 sending data to web server

I need to make an WEB based monitoring system using ESP8266, which could display the data. The system will have a user registration form, which should allow to display the data for a particular user. For this purpose I got a remote server (domain). Now I'm facing with some problems, how could I send data to this domain from the ESP? My ESP module uses NodeMCU firmware and I can program it using Lua. I read that there is HTTP GET and POST request methods and I unsuccessfully spent a few days trying to implement one of these methods... Maybe someone could put me on the road What should be the sequence of steps to start sending data to the external server? That would be a big step forward if I could send f.e. constant value variable.
Assuming your NodeMCU is connected to a network and had internet access, you can just do
http.post(url, headers, body, callback)
and it should send a post request to the given URL. HTTPS also works here, but has limitations.
Note that you need to compile the firmware with the HTTP (and TLS if you want HTTPS) module(s) by uncommenting the corresponding line(s) in the app/include/user_modules.h file.

Prevent DDOS on websocket server nodejs

I have a app which lets yoy keep your notes at a single place its realtime bw all the devices you are logged in I am using a nodejs wesocket it was working fine but a recently i found out someone was sending a huge amount of requests to my websocket server. He sent a large amount of data through websockets to my mongodb and the data was sent just for the purpose of taking the app down (useless crap data just had 'aaaaa')
What i want is prevent those clients from using the websockets who are making more than 10requests per minute.
As mentioned in the comments its better to go with services like CloudFlare, but for your specific use case (to implement directly on server) you should look at ways to rate limit the requests.
Here is an example of an library to rate limit web-sockets in node
https://www.npmjs.com/package/ws-rate-limit

Which of the following SMPP architectures produces higher performance?

I am currently implementing an SMS application which requires that I connect to a telecom operator's SMPP server. I have decided to use Kannel running on Ubuntu as my SMPP client. I need to relay the messages from my SMPP client to my application server. When a message is received from the operator's SMPP server, Kannel forwards the said SMS message by performing an HTTP GET request on some configurable URL.
Which of the following attached alternatives would be more efficient?
You spend time on three occasions:
prepare data on the machine with SMPP client
send data
decode data on the machine with Node
The rest depends on your machines' configuration and network connection quality.
Sending data via WebSockets is generally faster due to a significant reduction in overhead (especially for SMS-messages, which are numerous but small). You will, however, spend extra time on converting Kannel GET to a WebSocket request.
There is no sane way to theoretically predict which alternative will work better, so you will have to try both in order to decide.

Use a reverse proxy do record all incoming HTTP request, then execute it in a clone server for performance testing

I find this issue on performance testing on Serverfault.
I used to do performance testing with Jmeter. Can it it record all the requests to my online server?
Similar approach can be used with JMeter Access Log Sampler for Get requests but in my opinion it is not as realistic as it sounds.
Because data used at the time of proxying interception can have changed meanwhile so just replaying traffic will not simulate initial traffic and can generate errors that would not happen in real life.
Finally if test does not check these can lead to too optimistic response time.

Node.js high-level servers' communication API

folks. I wander whether there is any high-level API for servers' communication in Node.js framework? For example, I have several servers, where my application runs and I want to control loading of this servers. Sometimes, if some server is overloaded I want to redirect some connection requests to another(more free one). Are there any functions which could help me? Or I have to implement my own functionality?
Try looking at cluster. This allows you to control multiple node proccess and scale nicely.
Alternatively just set up TCP sockets and pass messages around over TCP or pass messages around over a database like redis.
You should be able to pipe HTTP connection down streams. You have one HTTP server as a load balancer and this server just passes messages on to your other servers and passes them back.
You're looking for what's called a load balancer. There are many off-the-shelf solutions, nginx being one of the standards today (and VERY quick/easy to set up).
I don't know of a node-native solution, but it's not that hard to write one. In general, however, load balancers don't actually monitor server load, they monitor whether a server is live or not and distribute traffic relatively equally.
As for your communications question, no -- there's no standardized API to communicate to/from node.js servers. Again, however, not hard to set up -- Assuming you're already hosting HTTP (using express, or native), just listen for specific requests, perhaps to /comm/ or whatever you deem appropriate and pass JSON back-and-forth.
Not too sure for Nodejs but I've heard ppl using Capistrano with Nodejs

Resources