[Ndn-interest] NDN packet size

Junxiao Shi shijunxiao at email.arizona.EDU
Tue Mar 28 14:56:55 PDT 2017


Hi Klaus

The setting of 8800 octets is indeed based on the reasons given by Nick
Briggs, which he posted to CCNx mailing list years ago. But that doesn't
answer why 8800 octets is a limit in the code rather than a recommendation.

The reason for having the practical limit is to reduce memory usage.
To receive a packet via socket API, NFD needs to allocate a buffer before
asking the kernel to copy the packet into this buffer. Since the packet
size is unknown at that time, NFD allocates a buffer of 8800 octets.
After the packet is received, assuming it is not fragmented by NDNLP, the
buffer stays around as long as the packet is needed (in PIT or CS), even if
the packet is much smaller than 8800 octets. The alternative would be
truncating the buffer to fit the actual packet size, but that involves
another copying, and we decide to save a copying at the expense of wasting
some memory (the difference between 8800 octets and the actual packet size).
Suppose we increase the practical limit to 1MB, NFD would allocate a 1MB
packet before receiving a packet. If most packets we are dealing with is
much smaller than 1MB, a lot of memory will be wasted.

Yours, Junxiao

On Tue, Mar 28, 2017 at 2:40 PM, Nick Briggs <nicholas.h.briggs at gmail.com>
wrote:

> It gets you 8K bytes of data along with necessary metadata and a name that
> isn't too long in a Content packet.
> It can be encapsulated in a UDP packet with about 6 fragments when you're
> do IP encapsulation. (max UDP is 64K bytes)
> It fits within a 9000 byte jumbo ethernet frame if you're doing direct
> ethernet encapsulation.
>
> -- Nick Briggs
>

On Tue, Mar 28, 2017 at 2:35 PM, Klaus Schneider <klaus at cs.arizona.edu>
wrote:

> Btw, what was the reason for setting the default max packet size to 8800
> in the first place?
>
> Is there any drawback to increasing the default, to let's say 1 Megabyte?
>
> Best regards,
> Klaus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-interest/attachments/20170328/004e262d/attachment.html>


More information about the Ndn-interest mailing list