Doubt in Openflow Example

33 views
Skip to first unread message

karthik karra

unread,
May 31, 2016, 1:28:12 PM5/31/16
to ns-3-users
Ptr<Node> switchNode = csmaSwitch.Get (0);
 
OpenFlowSwitchHelper swtch;

 
if (use_drop)
   
{
     
Ptr<ns3::ofi::DropController> controller = CreateObject<ns3::ofi::DropController> ();
      swtch
.Install (switchNode, switchDevices, controller);
   
}
 
else
   
{
     
Ptr<ns3::ofi::LearningController> controller = CreateObject<ns3::ofi::LearningController> ();
     
if (!timeout.IsZero ()) controller->SetAttribute ("ExpirationTime", TimeValue (timeout));
      swtch
.Install (switchNode, switchDevices, controller);
}

Above is the snippet from Openflow example given in NS3. As "use_drop" is set as false, the control always executes the "else" part.

The controller which is set as "Learning Controller" will learn about new packet whenever it comes in and installs the flow.

For this to happen, "ReceiveFromSwitch" method should be called and I tried to follow the trail of calling functions but of no use.

I couldn't find anywhere a call to the above function. I don't know if I am missing something or lost somewhere.

Could any one please help.

Thanks,
Karra.

Tommaso Pecorella

unread,
May 31, 2016, 6:32:59 PM5/31/16
to ns-3-users
Hi,

use_drop is set by SetDrop, which is called if you -d=true in the command-line arguments.

About ReceiveFromSwitch, it is used in OpenFlowSwitchNetDevice::SendOpenflowBuffer, which in turns is used in multiple places.

Hope this helps,

T.

karthik karra

unread,
Jun 1, 2016, 1:30:18 AM6/1/16
to ns-3-...@googlegroups.com
Thanks for the reply.

Yes, I was able to find the same. The "SendOpenflowBuffer" method in which "ReceiveFromSwitch" method is called.

OpenSwitchHelper::Install, where the switch node is created, ports are added and switch is added to the controller and no where I could find a call to the "SendOpenflowBuffer" (not only in the install method but even in the calls inside the install method and further)which is needed to forward the packet to the controller.

Actually I am wondering how the switch is passing the unknown packet to the controller and installing the open flow rules.

Thanks,
Karra.

--
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/VSJXUVG4uNY/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