[ndnSIM] MTU, Payload Size and an Assert Message

Alex Afanasyev alexander.afanasyev at UCLA.EDU
Tue Feb 24 17:11:52 PST 2015


> On Feb 24, 2015, at 8:04 AM, Christian Kreuzberger <christian.kreuzberger at itec.aau.at> wrote:
> 
> Hi Alex,
> 
> though the problem is, unless you run ndnSIM in debug mode (which usually nobody does), you wouldn't notice the problem with those dummy consumers/producers. Would it make sense to catch this "exception" in Producer::StartApplication() (or even Producer::OnInterest() ) by checking whether m_virtualPayloadSize (or the actual packet size) is smaller than m_netDevice->GetMtu() (though I guess that checking the actual packet size for every interest would be possible, but could potentially slow down the simulations by a lot).

I could agree with exception throwing (however, it would not provide as good diagnostic information as assert), although the producer is not the place where such exception should be thrown.  Producer is just an NDN application and it should not be aware of anything else except that it has a face to communicate with the forwarder.  Such exception can be thrown only in netdeviceface and only if the underlying protocol is p2p.  Other types of devices may not even have "Mtu" property.

---
Alex

> I am able to provide a patch introducing a "sanity check" in Producer::StartApplication() as I have something similar for one of my custom consumers, if you'd like.
> 
> Example:
> 
> uint16_t
> Producer::GetFaceMTU(uint32_t faceId)
> {
>  Ptr<ns3::PointToPointNetDevice> nd1 =
>        GetNode ()->GetDevice(faceId)->GetObject<ns3::PointToPointNetDevice>();
>  return nd1->GetMtu();
> }
> 
> 
> 
> 
> Best regards,
> Christian
> 
> 
> On 2015-02-24 16:25, Alex Afanasyev wrote:
>> Hi Christian,
>> This is intended behavior. If you need to use larger MTU sizes, you
>> simply need to explicitly set MTU parameter on point to point link.
>> Without such an explicit setting, ns3 in debug mode is "reminding" you
>> that simulation parameters do not match.
>> ---
>> Alex
>> On Feb 24, 2015, at 4:51 AM, Christian Kreuzberger
>> <christian.kreuzberger at itec.aau.at> wrote:
>>> In line 80 of ndn-net-device-face.cpp, there is an ASSERT MESSAGE
>>> checking whether packet->Getsize() <= m_netDevice->GetMtu().
>> https://github.com/named-data/ndnSIM/blob/master/model/ndn-net-device-face.cpp#L80
>>> [1]
>>> The line does make sense, as fragmentation is not (yet) implemented
>>> (or is it?). However, this ASSERT Message is only triggered if
>>> ndnSIM is compiled in debug mode (e.g., not with –d optimized),
>>> hence if you run ndnSIM in debug mode, the simulation will stop if
>>> the payload+header+tags is to large. Though if you run it without
>>> debug mode, the simulation will continue even with payloads that go
>>> beyond the MTU.
>>> I’m wondering if this behaviour is intended, and I am also
>>> wondering what happens to too large payloads – I guess it could
>>> cause problems and produce inaccurate results in certain cases.
>>> Hope to help,
>>> Christian
>>> _______________________________________________
>>> ndnSIM mailing list
>>> ndnSIM at lists.cs.ucla.edu
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim [2]
>> Links:
>> ------
>> [1]
>> https://github.com/named-data/ndnSIM/blob/master/model/ndn-net-device-face.cpp#L80
>> [2] http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150224/9c51417d/attachment.bin>


More information about the ndnSIM mailing list