I am trying to trace the congestion window of a particular TCP connection in the kernel. The easiest way, I assume would be to use a printk
or a printf
and print out the corresponding variable which I assume is snd_cwnd
in the kernel.
Is there a more standard way to do this? Ideally, I would like to observe how various important TCP parameters change for a particular TCP connection.
You're quite right about using printk, to dump specific data actually printk is the best option.
To observe parameters of particular TCP connection, you might take help of netfilter hooking. Using netfilter kernel module (http://fcns.eu/2010/02/15/netfilter-hooks/) you can track a particular connection and can check every tcp packets you desire.