netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Quirky Behaviour while counting #tcp packets received.
@ 2004-03-23 20:02 Abhinav Gupta
  0 siblings, 0 replies; only message in thread
From: Abhinav Gupta @ 2004-03-23 20:02 UTC (permalink / raw)
  To: netdev, linux-net

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-23 20:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-23 20:02 Quirky Behaviour while counting #tcp packets received Abhinav Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).