Saturday, 12 January 2013

Steady data transmission over WIFI - Part 3 - Socket buffering

Here is another issue that showed up on the transmission graphs:

On the reception side (the top timeline on the graph), a packet loss seems to translate into a long silence  (longer than just what to be expected from the lost packets) followed by a big burst of data. There's some buffering at play here and I don't want it. It wouldn't help at all with controlling an RC model!

Fortunately there's some control over that: it is possible to set the size of the sending and receiving buffers on a per-socket basis. This is done using the setsockopt function with SO_RCVBUF or SO_SND_BUF as parameters. 

So I went on to expose these buffer sizes as tweakable parameters of my test definition file.
By setting these buffer to the size of the packet I transmit, I expected to achieved a more steady transmission. And indeed, in the same test conditions, it seemed to fix this particular burst problem.

No comments:

Post a Comment