Question

TCP does not prioritize traffic like IP. When there are a lot of TCP background connections opened that are uploading data (like when BitTorrent is seeding in background) delay may occur for a particular socket because TCP will choose only one socket at a time to send its packets to the IP level. So a particular socket must wait its turn besides a lot other connections without having any priority resulting a delay.

I am currently doing some experiments and I am trying to measure the delay created by TCP in such congestion situations. Because this delay occurs at the transport (TCP) level I am thinking to do a precise measurement of the delay by hooking the precise moments when some Linux system calls are used.

I am willing to upload data to a server using TCP (I can use Iperf tool). For hooking the system calls I want to use SystemTap. This tool can tell me the exact moment when a particular system call is called.

I want to know which are the names of two system calls used when sending a packet:

  1. The first TCP level function called for a packet (is it *tcp_sendmsg*);
  2. The last TCP level function called for a packet which passes it the the IP network level?

The difference (delta) between the moment of calling these two system functions is the delay I want to know.

Was it helpful?

Solution

  1. The first TCP level function called for a packet is *tcp_sendmsg* from 'net/ipv4/tcp.c' system source file.
  2. The last TCP level function called for a packet is *tcp_transmit_skb* from 'net/ipv4/tcp_output.c' system source file.

An interesting site with information about TCP source files from Linux is this: tcp_output

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top