Packet to Upper Layer-Need Suggestion

57 views
Skip to first unread message

karthik karra

unread,
Jun 12, 2016, 1:17:07 PM6/12/16
to ns-3-users
I am receiving the packet,which I needed, at wifi mac layer and need to send to csma net device interface and both are on the same node.

Will it be a good idea to extract the data, form a new packet and send it to upper layer so that I can forward to other interface(CSMA). ?

By searching some of the posts,I got to know that I need to use PacketTags. Am I right ?

Any suggestions would be helpful.

Thanks,
Karra.

Tommaso Pecorella

unread,
Jun 12, 2016, 3:53:51 PM6/12/16
to ns-3-users
The only thing I can suggest is to explain your problem in a way that can be understood.
Remember that it's your duty to be understood, not viceversa.

Thanks,

T.

karthik karra

unread,
Jun 13, 2016, 6:37:45 AM6/13/16
to ns-3-users
Hi, (Sorry if it is verbose)

I am having an AccessPoint which has two interfaces 1. WifiMac 2.CsmaNetDevice.

WifiMac interface is connected to Mobile node and CsmaNetDevice is connected to openflow switch.

From mobile node I am receiving the "MGT_ASSOCIATION_REQUEST" header in "Receive" function in "Ap-Wifi-Mac".

Now, I need to extract the data from the above Header and send to Open flow controller via openflow switch.

For this, I need to send the information first to CsmaNetDevice(of AccessPoint) then from there to Openflow Switch.

First I thought that I would be able to send it directly using some methods(even I have tried few and few trail and errors) but didn't work.

Then I had seen the diagram in NS3 website with Two "ForwardUp" functions from WifiMac to WifiNetDevice.

So my idea was, Will I be able to forward the packet(newly formed) by forwarding to WifiNetDevice and from there to IP layer and then using routing to forward it to CsmaNetDevice.

Tommaso Pecorella

unread,
Jun 14, 2016, 9:58:46 AM6/14/16
to ns-3-users
Hi,

not really. Those messages are "consumed" inside the Wi-Fi part, and are not delivered up.
You can, of course, modify the Wi-Fi module to have a new function called upon association, and use that one to send a message to the other (middle) node.

Hope this helps,

T.

karthik karra

unread,
Jun 15, 2016, 9:10:03 AM6/15/16
to ns-3-users
I have tried almost the same thing. Defined a new function for which I have passed the WifiMacHeader as parameter which I got in Receive function and I am able to print the Addresses from the header.

Just for experimental purpose I have created a packet in "ap-wifi-mac" and trying it to send to "wifi-net-device" using "ForwardUp" function but I couldn't find any packet getting received.

ostringstream msg;
    msg
<<"Hello World!!!"<<"\0";
   
Ptr<Packet> pkt = Create<Packet>((uint8_t*)msg.str().c_str(),msg.str().length());
   
EthernetHeader header;
    header
.SetDestination("00:00:00:00:00:04");
    header
.SetSource("00:00:00:00:00:02");
    pkt
->AddHeader(header);
   
this->ForwardUp(pkt,"00:00:00:00:00:02","00:00:00:00:00:04");

The above piece of code in ApWifiMac::CsmaNet(WifiMacHeader hdr)

Tommaso Pecorella

unread,
Jun 15, 2016, 9:33:17 AM6/15/16
to ns-3-users
You can't use ForwardUp. Use some logic, if you use THAT function, the packet will go to the L3 - and you're lucky that it didn't crash anything.

T.

karthik karra

unread,
Jun 15, 2016, 9:38:47 AM6/15/16
to ns-3-...@googlegroups.com
Ok. From L3 can I forward it to CsmaNetDevice interface as it has an IP Address associated to it.
Or the Idea is itself totally wrong.

--
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/zcUFZx3N4w4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages