Packet (in)efficiency
Phil Pilgrim (PhiPi)
Posts: 23,514
Is there any way to force the W5100 to slow down and send larger packets? I think it would lead to higher overall throughput. For example, I'm seeing an HTML page with 5K bytes of data requiring 781 (!) packets and 38K overall bytes to send! That's about 6.5 characters per packet, and a data efficiency of 13%. It might not matter on a 100 Mbaud Ethernet local network, but once it leaves from here for the internet, things get choked down to 256 Kbaud or less. So any inefficiency does make a difference.
-Phil
-Phil
Comments
In an ordinary TCP implementation, this would be controlled by Nagels algorithm, but with the limited resources in the W5100 chip, I guess it will always try to flush its buffers, and if you don't want this, buffer yourself.
-Phil
Who's up to the task?
-Phil
Later in the PASM driver main loop, a timeout condition invoking the transmit command after a specified number of milliseconds.
Two new methods needed: setNdelay(ms) to set the timeout (or zero to disable, forcing the driver to behave as today), and flush() to invoke the transmission command immediate.
With those modifications, the driver will still be backward complaint with old applications without need of modifications.
-Phil
All this is how TCP transmission is implemented in almost every system.
http://en.wikipedia.org/wiki/Nagle%27s_algorithm