I want to measure bandwidth for message transfer between client and server using different protocols: in both case, like client(raspberry pi) to server and server to client(raspberry pi).
Let's say I am sending/receiving the following json message from Ruby or Java program to either AMQP (RabbitMQ broker), Mqtt (Mosquito broker) or HTTP server (rails application).
Message:
{
"unit1": { "state": [ { "ON": "200", "time": "12212" } ] }
}
How can I calculate the amount of bandwidth required (kilobytes or bytes) to send/receive this message? Event if I use Ruby or Java REST program to send this message to HTTP server, how can I calculate these required data?
Is there any API in Ruby or Java to calculate from application layer, or in TCP layer, can I use any tools to calculate a particular port and IP address? Can anyone tell me what other approaches are there to do this measurement?
I have made some approach with different tools like tcpdump, but I got Wireshark, provide a lot of convenient features and it has nice graphical front-end, plus some integrated sorting and filtering options. Solved this query sending individual JSON data from client to server and find easy way to measure bandwidth information for individual communication.