[ih] UDP Length Field?

Wayne Hathaway wayne at playaholic.com
Sat Nov 28 21:44:23 PST 2020


I worked for a few years for Auspex Systems, which made network-attached storage systems using NFS, which uses UDP.  I don't know the reasoning behind including a length field, but note that the NFS header within the UDP datagram is variable length.  I noticed that by using the UDP length field, I could do a significant optimization when reading incoming datagrams.

For example, if the UDP length was 8284 bytes, it was a very good guess that the arriving packet had an NFS header of 92 bytes and a data field of 8192 bytes.  So I would arrange to read the packet into a location such that the assumed 8192-byte data field would be aligned on a page boundary, allowing me to use the paging hardware rather than physically copying the data.   (The Auspex hardware allowed me to make such a decision as data was arriving.)  If the assumption was wrong then I would do copies to handle it, but the vast majority of the time the assumption was correct, providing a significant performance boost.  In fact, because of optimizations like this, my first release of the paging-swapping network code slightly more than doubled Auspex's already-impressive NFS performance.

So for whatever reason UDP included a length field, thank you!  :-)



More information about the Internet-history mailing list