0

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 to the IP network level?

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

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
Calin-Andrei Burloiu
  • 1,481
  • 2
  • 13
  • 25
  • maybe a little off topic but if you want to add some priority on TCP connections, you can do it, with QoS management take a look [here](http://www.prout.be/qos/QoS-connection-tuning-HOWTO.html) or there [Linux Advanced Routing & Traffic Control](http://lartc.org/howto/) – Cédric Julien Jun 17 '11 at 11:59

1 Answers1

1
  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

Calin-Andrei Burloiu
  • 1,481
  • 2
  • 13
  • 25