[Ndn-interest] How to calculate max data bytes per packet?

Junxiao Shi shijunxiao at email.arizona.edu
Sun Aug 2 19:34:57 PDT 2015

Hi Qihan

face.getMaxNdnPacketSize() gives the practical limit of NDN packet length.
For a Data packet, this length not only includes the Content payload, but also includes the Name, MetaInfo, and Signature.
There’s no general algorithm to compute the limit of payload size, because Signature is generated after Content is prepared, and theoretically its length can depend on the Content (although all defined signing algorithms don’t do that).
In most cases, it’s safe to limit your Content payload to be half of that practical limit.

On the other hand, I notice a problem in ndn-ccl-api description for getMaxNdnPacketSize:
This is a static method to get the practical limit of the size of a network-layer packet. If a packet is larger than this, the library or application MAY drop it.
This description permits the library to drop the packet when limit is exceeded instead of crashing, but you are observing a crash.
You may file a bug on the Redmine site of the specific library you are using (eg. ndn-cpp).

Yours, Junxiao

From: ndn ndn
Sent: Sunday, August 2, 2015 06:21
To: ndn-interest at lists.cs.ucla.edu
Subject: [Ndn-interest] How to calculate max data bytes per packet?

Hello everyone,
Recently,I want to send a large packet via NDN.When I using NDN-CCL,face.getMaxNdnPacketSize() can get the max packet size in NDN network.
But I use data.setContent() to set face.getMaxNdnPacketSize() bytes data,the program crashed,it tells me the size of data is too large than max NDN packet size.

So,How to get the max data size I can send?It make me confuse for a long time.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-interest/attachments/20150802/e8592525/attachment.html>

More information about the Ndn-interest mailing list