netdev
[Top] [All Lists]

Quirky Behaviour while counting #tcp packets received.

To: netdev@xxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx
Subject: Quirky Behaviour while counting #tcp packets received.
From: Abhinav Gupta <kernelnetworkguy@xxxxxxxxxx>
Date: Tue, 23 Mar 2004 13:02:27 -0700
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
I am not sure if this is the correct mailing list for my question or not. If it isn't could someone please direct me to the correct one.

Here's what I am doing and the problem emanating from it:
I wanted to keep a track of tcp packets received from the network, so I started keeping a count of that by incrementing pkts_recv variable in the function tcp_recv_established in usr/src/linux/net/ipv4/tcp_input.c , everytime I receive a packet. The structure(tcp_opt) that contains pkts_recv variable is defined in usr/src/linux/include/net/sock.h.

The problem that I am facing is that this count(pkts_recv) increments by one each time I receive a tcp packet, but then something goes wrong and the next time it receives a packet it(pkts_recv) increments by some random quantity (like 36,3, 55 ...). But after this incrementation by the random value, the next time it receives a packet it increments by 1 again (instead of the random value)! And there are several instances where the incrementation takes place by the random quantity (3-7 times when 1000 packets are received). I have checked in the source and the only place I am incrementing the count is in tcp_recv_established function.

Does anyone have views on this quirky behavior?

Any help would be greatly appreciated.

Thanks,
Abhinav.


<Prev in Thread] Current Thread [Next in Thread>
  • Quirky Behaviour while counting #tcp packets received., Abhinav Gupta <=