I understand that there are queuing delays and processing delays prior to sending out a packets. However, do you measure those delays in linux or specifically ubuntu?
It's difficult to reply anything accurate. First of all because TCP packets makes no sense. TCP implements a continuous data flow over IP, so a program using a TCP connection will have to:
- Elaborate the data and write it to the TCP socket. Maybe this is what you mean by "process delay".
- Optionally, something like SSL can process the data (encryption, VPN)
- The data is passed to the IP protocol which slices the stream, creating packets.
- The packets are routed/masqueraded at need.
- The packets are encapsulated in Ethernet packets (most of time).
- The Ethernet packets are sent, and maybe with some random delay (network congestion).
On each layer of the TCP/IP stack, delays can occur (and I said nothing about error recovery). This imply you should be more accurate about which delay you want to measure. Maybe some tool like wireshark or tcpdump will help you, maybe not.
Reading your last comment,it's more clear you're investigating on application level. A profiling tool should help you then. Most IDE have one, but... the profiling itself introduces some overhead ! :-)