<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.MsoQuote, li.MsoQuote, div.MsoQuote
        {mso-style-priority:29;
        mso-style-link:"Quote Char";
        margin-top:10.0pt;
        margin-right:.6in;
        margin-bottom:8.0pt;
        margin-left:.6in;
        text-align:center;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:#404040;
        font-style:italic;}
span.QuoteChar
        {mso-style-name:"Quote Char";
        mso-style-priority:29;
        mso-style-link:Quote;
        color:#404040;
        font-style:italic;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US><div class=WordSection1><p>Hi Qihan</p><p><o:p> </o:p></p><p><span style='font-family:Consolas'>face.getMaxNdnPacketSize()</span> gives the practical limit of NDN packet length.</p><p>For a Data packet, this length not only includes the Content payload, but also includes the Name, MetaInfo, and Signature.</p><p>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).</p><p>In most cases, <b>it’s safe to limit your Content payload to be half of that practical limit</b>.</p><p><o:p> </o:p></p><p><o:p> </o:p></p><p>On the other hand, I notice a problem in ndn-ccl-api description for getMaxNdnPacketSize:</p><p class=MsoQuote align=left style='text-align:left'><span style='background:white'>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.</span></p><p>This description permits the library to drop the packet when limit is exceeded instead of crashing, but you are observing a crash.</p><p>You may file a bug on the Redmine site of the specific library you are using (eg. ndn-cpp).</p><p><o:p> </o:p></p><p>Yours, Junxiao</p><p><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p style='border:none;padding:0in'><br><b>From: </b>ndn ndn<br><b>Sent: </b>Sunday, August 2, 2015 06:21<br><b>To: </b>ndn-interest@lists.cs.ucla.edu<br><b>Subject: </b>[Ndn-interest] How to calculate max data bytes per packet?</p></div><p class=MsoNormal><span style='font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Times New Roman",serif'><o:p> </o:p></span></p><div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'>Hello everyone,</span><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'>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.<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'>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.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'>So,How to get the max data size I can send?It make me confuse for a long time.<o:p></o:p></span></p></div></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>