[ndnSIM] How to calculate size of Interest/Data packet

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Thu May 5 14:14:02 PDT 2016


Hi Anil,

potentially you could do something like the following examples:

https://github.com/named-data-ndnSIM/ndnSIM/blob/master/tests/unit-tests/helper/ndn-link-control-helper.t.cpp#L62-L65 <https://github.com/named-data-ndnSIM/ndnSIM/blob/master/tests/unit-tests/helper/ndn-link-control-helper.t.cpp#L62-L65>
https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/face/face-counters.hpp#L188-L212 <https://github.com/named-data-ndnSIM/NFD/blob/NFD-0.3.4-ndnSIM/daemon/face/face-counters.hpp#L188-L212>

Hope that this helps.

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA


> On May 4, 2016, at 4:05 PM, Anil Jangam <anilj.mailing at gmail.com> wrote:
> 
> Hi.
> 
> Calculating the size of Interest/Data packet wire, L3 tracer is done using the wireEncode() API. 
> 
> https://github.com/named-data-ndnSIM/ndnSIM/blob/master/utils/tracers/ndn-l3-rate-tracer.cpp#L294 <https://github.com/named-data-ndnSIM/ndnSIM/blob/master/utils/tracers/ndn-l3-rate-tracer.cpp#L294>
> 
> if (interest.hasWire()) {
>     std::get<1>(m_stats[face.shared_from_this()]).m_outInterests +=
>     interest.wireEncode().size();
> }
> 
> In the implementation of wireEncode() also, the same check is being done. 
> 
> https://github.com/named-data-ndnSIM/ndn-cxx/blob/36ec104e23ba5395a8b4df411b776cdbef9c5cd4/src/interest.cpp#L279 <https://github.com/named-data-ndnSIM/ndn-cxx/blob/36ec104e23ba5395a8b4df411b776cdbef9c5cd4/src/interest.cpp#L279>const Block&
> Interest::wireEncode() const
> {
>     if (m_wire.hasWire())
>     return m_wire;
>     ...
> }
> 
> Perhaps this is a redundant check inside L3 tracer. But, is this the only way to know the size of data being transferred over or received from the face?
> 
> /anil.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160505/7ee744fc/attachment.html>


More information about the ndnSIM mailing list