encapsulate a packet

71 views
Skip to first unread message

Rabia Saleh

unread,
Apr 14, 2023, 9:42:58 AM4/14/23
to ns-3-users
Hi all
How can I encapsulate a packet? I really appreciate any help you can provide.

Tommaso Pecorella

unread,
Apr 14, 2023, 6:37:32 PM4/14/23
to ns-3-users
Encapsulate in what?

Please, don't offer yourself to my sarcastic side, I was about to answer "print its content on a piece of paper and put the paper in an envelope - close the envelope and you have a packet encapsulated".

If you want to avoid to trigger my sarcasm, please be a bit more specific.

Rabia Saleh

unread,
Apr 14, 2023, 8:17:17 PM4/14/23
to ns-3-...@googlegroups.com
Hi Tom
Many thanks for your reply, it is much appreciated. I am sorry for my question.
I want to encapsulate a packet as the concept of gre tunnelling.

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/3xcjK0TNsQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/4985ec8d-a2f8-489e-907c-59b97ae69cb2n%40googlegroups.com.

Tommaso Pecorella

unread,
Apr 15, 2023, 10:46:10 AM4/15/23
to ns-3-users
Well, it depends on what you want to do for real, but the basic concept is: add more headers.

Suppose you have a packet that has already an IP and an UDP header (so a full packet).
Add the GRE header and another IP header.
Now you have a packet inside another packet (with GRE encapsulation).

How and where you do that, and how and where you decapsulate the inner packet is another problem.

Rabia Saleh

unread,
Apr 16, 2023, 7:09:39 PM4/16/23
to ns-3-users
Hi Tommaso

Thank you very much for your response, 
I have added wifi interfaces to OpenFlow switch, but as you know Open vSwitch is based on the IEEE 802.3 standard.
The problem for MANETs is that wireless ad hoc nodes do not support the IEEE 802.3 standard. However, they do support
the ad hoc mode of the IEEE 802.11 standard. Therefore, the IEEE 802.3 frame (without transforming to the IEEE 802.11
frame) cannot be successfully transmitted or received over the wireless link. there are two options to successfully
transmit (or receive) the frame generated by the forwarding table of Open vSwitch on a wireless link: (1)
performing MAC rewriting according to the IEEE 802.11 standard before transmitting a packet on a wireless link
(2) supporting the 4addr mode on the wireless interface. In the former case, an additional MAC rewriting component
is required for packet header modification. In the latter case, the wireless interface driver will correctly replace the MAC addresses of the IEEE 802.3 (Ethernet) frame with the IEEE 802.11 format. So I want  to encapsulate traffic coming from
Open vSwitch data-path (e.g., Ethernet traffic) with GRE or header to transport over a wireless link.

Rabia Saleh

unread,
Apr 16, 2023, 7:13:40 PM4/16/23
to ns-3-users
I have used 4-addr on wifi interfaces (AdhocWifiMac) but I got the below error

Build commands will be stored in build/compile_commands.json
'build' finished successfully (0.637s)
assert failed. cond="!address.IsGroup ()", +0.206689475s 3 file=../src/wifi/model/wifi-remote-station-manager.cc, line=486
terminate called without an active exception
Command ['/home/rabia/Ns3/bake/source/ns-3.32/build/scratch/ofswitch13-wifi'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --gdb").

On Saturday, April 15, 2023 at 3:46:10 PM UTC+1 Tommaso Pecorella wrote:

Tommaso Pecorella

unread,
Apr 17, 2023, 4:25:28 AM4/17/23
to ns-3-users
I'd suggest to stop the implementation and work a bit on the architecture of your idea. Forcing an architecture because the simulation gives you errors is... not the right way to proceed.

First decide your architecture. THEN find a way to implement it.

As a side note, the sentence "the wireless interface driver will correctly replace the MAC addresses of the IEEE 802.3 (Ethernet) frame with the IEEE 802.11 format" is wrong, because the MAC addresses of 802.11 and 802.3 are exactly the same.

Reply all
Reply to author
Forward
0 new messages