[ndnSIM] ns-3 questions

Alex Afanasyev alexander.afanasyev at ucla.edu
Tue Dec 11 12:32:35 PST 2012


Hi Natalya,

I checked the NS-3 code, and see that it does not have any buffering on incoming interfaces, at least not with point-to-point links.  When packet is received by a NetDevice (e.g., Receive call in src/point-to-point/model/point-to-point-net-device.cc), it is immediately forwarded to higher level using a registered callback.

However, I agree that your trace is indeed confusing and I can't be sure what is wrong.  You probably want to log not only queues, but also other events, such as ndn.fw and ndn.fw.BestRoute (or ndn.fw.Flooding if you're using flooding strategy in ndnSIM).

I tried to run my own simple 3-node scenario (http://pastebin.com/skVd8UyC) and got expected results (http://pastebin.com/TmYJTNpM).

As I don't have your queue implementation, I put DropTailQueue between nodes 0 and 1, and RedQueue between nodes 1 and 2.

As you can see in the log output, queueing on a node starts only after DoPropagateInterest forwarding strategy call (e.g., lines 22-23 for node 0, and lines 34-36 for node 1).  For node 2 there are more queueing, as the Data packet is getting returned to the requester.

--
Alex

ps

I would recommend updating both ns-3 and ndnSIM code.  There were some nasty hidden bugs with logging system.


On Dec 11, 2012, at 9:10 AM, "Natalya Rozhnova -X (nrozhnov - AAP3 INC at Cisco)" <nrozhnov at cisco.com> wrote:

> Hi Alex,
> 
> Sorry for my late response, I just didn't have an access to my pc these
> days.
> I'm curious about the input queues in ns3. I thought that ns3 doesn't have
> the input queues but when I trace the queues I obtain the following:
> 
> 0s 0 DropTailQueue:DoEnqueue(0x7fca81c25480, 0x7fca81c2f8d0)
> 0s 0 DropTailQueue:DoEnqueue(): [LOGIC] Number packets 1
> 0s 0 DropTailQueue:DoEnqueue(): [LOGIC] Number bytes 30
> 0s 0 DropTailQueue:DoDequeue(0x7fca81c25480)
> 0s 0 DropTailQueue:DoDequeue(): [LOGIC] Popped 0x7fca81c2f8d0
> 0s 0 DropTailQueue:DoDequeue(): [LOGIC] Number packets 0
> 0s 0 DropTailQueue:DoDequeue(): [LOGIC] Number bytes 0
> 2.399e-06s 0 DropTailQueue:DoDequeue(0x7fca81c25480)
> 2.399e-06s 0 DropTailQueue:DoDequeue(): [LOGIC] Queue empty
> 0.0100024s 2 DropTailQueue:DoEnqueue(0x7fca81c26590, 0x7fca81c30570)
> 0.0100024s 2 DropTailQueue:DoEnqueue(): [LOGIC] Number packets 1
> 0.0100024s 2 DropTailQueue:DoEnqueue(): [LOGIC] Number bytes 30
> 0.0100024s 2 DropTailQueue:DoDequeue(0x7fca81c26590)
> 0.0100024s 2 DropTailQueue:DoDequeue(): [LOGIC] Popped 0x7fca81c30570
> 0.0100024s 2 DropTailQueue:DoDequeue(): [LOGIC] Number packets 0
> 0.0100024s 2 DropTailQueue:DoDequeue(): [LOGIC] Number bytes 0
> 0.0100024s 2 NDNQueue:Interest_DoEnqueue(): [INFO] Interest_enqueue
> 0x7fca81c26db0 0
> 0.0100024s 2 NDNQueue:Interest_DoEnqueue(): [INFO] Interest Packet
> Enqueued 30p size30
> 
> 0.0100024s 2 NDNQueue:DoDequeue(): [LOGIC] NDNQueue_Dequeue Simple Round
> Robin
> 0.0100024s 3 NDNQueue:Interest_DoEnqueue(): [INFO] Interest_enqueue
> 0x7fca81c27600 0
> 
> A node 0 is connected to node 2 which is connected to node 3. I installed
> the different queue types on these nodes to see what will happen : p2p for
> 0->2 has DropTailQueue and p2p for 2->3 has NDNQueue installed. So, as you
> can see, the node 2 executes enqueue function of TailDropQueue before a
> packet will be enqueued to the output NDNQueue…
> 
> Does it mean that ns3 has the concept of incoming interface buffers or it
> just my fault?
> 
> Thanks,
> Natalya
> 
> On 12/7/12 6:45 AM, "Alexander Afanasyev" <afanasev at cs.ucla.edu> wrote:
> 
>> I'm not sure that ns3 simulates the concept of incoming interface
>> buffers.  If I remember correctly, queues are emulated only for sending
>> data out, while incoming processing is done "instantaneously" via
>> callback.
>> 
>> If you really want to just have access to the data packet before PIT
>> lookups, ndnSIM provides this functionality via custom forwarding
>> strategy (there is a study example on the website). You would only need
>> to overwrite OnData method, do some magic, and depending on the magic
>> allow further processing by the base class, or simply stop processing.
>> 
>> Let me know if this can / would be better for your task.
>> 
>> ---
>> Alex
>> 
>> On Dec 6, 2012, at 4:10 PM, "Natalya Rozhnova -X (nrozhnov - AAP3 INC at
>> Cisco)" <nrozhnov at cisco.com> wrote:
>> 
>>> Hi Alex,
>>> 
>>> Thanks for the answer, I'll try to explain in more detail what we want.
>>> In general, the question is that we want to get access to Data packet, just when
>>> it arrives on a router and has not been distributed (using PIT search)
>>> in
>>> a queue to som output interface. Largely speaking, intercept
>>> the event of receiving packet on an incoming interface (marked on a figure as
>>> in) and send size of this packet into output interface queue
>>> (on figure, marked as out).
>>> 
>>> +------+out ->Interests
>>> |Router|
>>> +------+in <- Data
>>> 
>>> 
>>> Best regards,
>>> Natalya
>>> 
>>> On 12/6/12 6:25 PM, "Alex Afanasyev" <afanasev at cs.ucla.edu> wrote:
>>> 
>>>> Hi Ashok,
>>>> 
>>>> I'm not sure that I'm answering the right question, but in NS-3 you can
>>>> always get the size of a packet (packet->GetSize ()), as all packets
>>>> "emulate" (to some extent) packets in real protocols.  That is, calling
>>>> GetSize() method on a packet received in the queue will return a full
>>>> size of the packet, including all link-layer headers.
>>>> 
>>>> Let me know if I misunderstood the question.
>>>> 
>>>> Sincerely,
>>>> Alex
>>>> 
>>>>> On Dec 6, 2012, at 2:31 PM, Ashok Narayanan wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> Natalya and I are slogging through ns-3 and are running into some
>>>>>> basic questions. Specifically we want to compute packet statistics
>>>>>> (interest & data sizes) for both incoming and outgoing faces
>>>>>> independently. Are these counts available attached to each packet as
>>>>>> we
>>>>>> receive the output-queue event and queue the packet? 
>>>>>> 
>>>>>> Thanks
>>>>>> -Ashok




More information about the ndnSIM mailing list