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.