<div dir="ltr">Hi Lu<br><div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I want to get the packet size as I want to calculate if there is any congestion. I would like to get the value and invoke this value by other functions in ForwardingStretegy.</div></div></blockquote><br></div><div class="gmail_quote">You may get Interest and Data size as follows:<br></div><div class="gmail_quote"><div style="margin-left:40px"><span style="font-family:monospace,monospace">size_t pktSize = interest.wireEncode().size(); <br></span></div><div><div style="margin-left:40px"><span style="font-family:monospace,monospace">size_t pktSize = data.wireEncode().size(); </span><br></div><div>These reflect the number of octets in the network-layer packet. Forwarding does not have access to the link-layer packet, so there's no way to get LpPacket size or Nack size. If you really need LpPacket size, you'll have to add a tag in LinkService.<br></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Most importantly, I want the value to be get once per second.</div></div></blockquote><div>Forwarding is event-driven and triggerred every time a packet arrives. It does not make sense to get the packet size of a given second if no packet arrives within that second.<br></div><div>For the periods in which there are packet arrivals, you may use the code above to collect the size of each packet, and do an average.<br>Collected information should be placed in the measurements table. Strategy instance itself must be stateless.<br></div><div><br></div><div>Yours, Junxiao <br></div></div></div></div></div>