Problems Adding Headers in QueueDiscs

69 views
Skip to first unread message

Kurt Erikson

unread,
May 9, 2017, 5:53:47 PM5/9/17
to ns-3-users
Hi,

I am trying to implement a new Header. I did the "Header - Tutorial"  https://www.nsnam.org/docs/release/3.6/doxygen/packet-header-trailer.html

And now iam trying to test it.

My SetUp is:
n0 -----> n1 ------> n2------> n3

i installed QueueDiscs on the channels n1-n2 and n2-n3.
I turned off the Second QueueDiscs which gets installed on every channel with a boolean, thus i am having only one QueueDisc on each Channel. But if a QueueDisc is turned off, it forwards everything it gets.

If i Add my Header on the n1-n2 QueueDisc  (during Enqueue(item)) the Size gets up from 52 to 58. Thus i assume the header is added.
If I check the Packet-Size during Dequeue(), the size is still 58.


But in the QueueDisc from n2-n3 the Packet size is only 52. Thus i assume my Header gets lost?


My question is now:


How do I add a Header to a QueueDiscItem without loosing it during the transmission to another QueueDisc?

Right now i am dooing:
            CTPHeader header;
            header.SetData(0x1);
            item->GetPacket()->AddHeader(header);


"item" is the Ptr<QueueDiscItem> which the DoEnqueue function gets passed.



With Kind Regards,
Kurt

Tommaso Pecorella

unread,
May 9, 2017, 8:04:38 PM5/9/17
to ns-3-users
Hi Kurt,

please use a more up-to-date documentation, or you'll risk to have issues.
The document is basically the same, but you was referring to the one shipped with ns-3.6... 20 releases ago

About the size enlarge/shrink, it is possible that the enqueueing adds more data to the queued item just for the purpose to help the TC processing (AQM and pro schedulers). These bytes are removed before the actual transmission.
As a final remark, I wouldn't add a header *after* the enqueueing, because the packet size is checked in the enqueue function, and a new header will enlarge the packet.

Cheers,

T.

Kurt Erikson

unread,
May 10, 2017, 4:35:51 AM5/10/17
to ns-3-users
Hi Tomasso,

Hi Thank you for the updated Tutorial.


Am Mittwoch, 10. Mai 2017 02:04:38 UTC+2 schrieb Tommaso Pecorella:
About the size enlarge/shrink, it is possible that the enqueueing adds more data to the queued item just for the purpose to help the TC processing (AQM and pro schedulers). These bytes are removed before the actual transmission.

I think this is whats happening, my Header gets removed before the transmission. The Increase of size i noticed fits exactly my header size. But how do i stop this behavior?
I need to transmission the header to other nodes. Is this possible using queuediscs or do i have to use a "normal" network-queue?


With kind regards,
Kurt

Tommaso Pecorella

unread,
May 10, 2017, 1:23:16 PM5/10/17
to ns-3-users
Hi,

you have to add the header before the QDisc is called (or after).
Most probably you're trying to do a shim layer. I'd suggest to check what SixLowPan does, it looks something similar to me.

Cheers,

T.

Kurt Erikson

unread,
May 11, 2017, 5:30:22 PM5/11/17
to ns-3-users
Hi,

Thank you for your tips and this class.
It looks at first very intimidating and i am not sure how much of it I can use. But i think this is what i have to do.
I actually managed to send packets with a new header via the Channel queue.
My problem is: My header includes informations how many Packets/Bytes were able to Pass the queue. Thus I have to count the forwarded Bytes for every IP, inside the queue.
I think i have to do it inside of a queue but i am very unsure about it.


Also i have to send Feedback from one Node to Another ( which contains information about another queue )
Basically i am implementing a Tunnel. At the tunnels beginning i am adding the Forwarded Bytes(for every IP) at the end of the tunnel I am Using those bytes. To do some computations with it and send my Feedback back to the Tunnels beginning. The feedback has to be send every Nth second or every Nth packets
Do I have to Implement new Apps / NetDevices for something like this?

I there something like that I could look at which could help me?


With kind Regards
Kurt

Kurt Erikson

unread,
May 11, 2017, 6:58:22 PM5/11/17
to ns-3-users
Hi,
I am adding my full Setup, maybe someone has an idea or tips for me:


n0 ----- > n1 ----> n2 -----> n3 -----> n4


n0 is my client ( multiple possible). n0 sends to n4(UDP or TCP packets)
n1 adds a New Header to the Packets. in this header is written how much Bytes got forwarded (by IP-Address)
n2 has a Bottleneck on its links. it adds congestion information to the New Header.
n3 Removes the Header. It uses the new Header to do computations and then sends a Feedback to n1.


I am  able to add and change the new Header (Via DeviceQueue, which i don't like)

But i have no idea how to send Packets from n3 to n2 containing the feedback.


with kind regards.
Kurt


Tommaso Pecorella

unread,
May 11, 2017, 9:27:28 PM5/11/17
to ns-3-users
Hi,

you already have the answer. If it should behave like a tunnel, do it like a tunnel.
A new NetDevice with a "controlling" application - there's nothing strange in this.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages