Simulating smaller MTU? ie sending small packets.



Hi, for various reasons I'm writing a little stress test app which tries to simulate the effects of varying sized TCP packets on the overall transfer speed.

So I have written a little app which acts as a server, waits for a connection and then spews data in fixed sized chunks of your choice. I also turn off nagle, turn on autoflush, and as far as I can tell ask for the data to go out immediately

What I observe (using an ethernet dump) is that once the receiver is not keeping up with the speed the sender is spewing packets, the *sender* (which in this case is linux 2.6.12) is starting to coallesce the packets

So for example if I ask it to send 1000 byte packets I can see from the network trace that it starts to send lots of MTU sized packets instead (larger).

This is not what I was expecting at all, in fact I had no idea that there was some clever process in linux to coallesce small network packets? Am I tripping over some perl buffering instead? Any thoughts on where to look?

Note, that it's not a mis-measurement problem at the receiving side. A Network trace is showing me that the packets are coming out at MTU sized (in general, but with a smattering of packets the size I requested).

If I slow down the sending rate, or speedup the receiver then the packets go through at the correct size...

Grateful for any help trying to work around this

Ed W
.



Relevant Pages

  • Re: Deaf CAsyncSocket on Windows Service.
    ... To read them out I need a buffer to ... Short packets at the sender are coalesced into longer packets. ... THe receiver says "I have this much buffer space" and the sender is free to send ... You get an OnReceive notification if there is input data to be read. ...
    (microsoft.public.vc.mfc)
  • Re: bad networking related lag in v2.6.22-rc2
    ... 1233 active connections openings ... 12 delayed acks further delayed because of locked socket ... 4867 packets directly queued to recvmsg prequeue. ... times receiver scheduled too late for direct processing ...
    (Linux-Kernel)
  • interpreting netstat -s
    ... 529092 duplicate acks ... what does the tcp output "embryonic connections ... 11772048 total packets received ... IP Multicast packets dropped due to no receiver ...
    (comp.unix.aix)
  • Re: Statistics Extraction
    ... 546 confirmed frames sent succesfully ... 549 packets sent successfully ... 105 transmits aborted due to rx ... packets dropped due to no receiver ...
    (comp.lang.perl.misc)
  • Re: Packet loss every 30.999 seconds
    ... Back to back test with no ethernet switch between two em interfaces, ... Receiver test application reports 3699 missed packets ... Receiver netstat -i: ...
    (freebsd-net)