[P4-dev] Problem with OpenflowEnabledP4Switch

Antonin Bas antonin at barefootnetworks.com
Wed Dec 14 16:54:21 EST 2016

Hi Tanja,

I am not sure this is enough information for us to help you. Maybe if you
could share the relevant parts of the logs for each switch it would help.
I notice that in your Mininet script, you call start([c0]) for each switch.
When I look at the start method for the OpenflowEnabledP4Switch in
p4lang/p4factory (
I see that the "controllers" parameter is completely ignored and that
instead we rely on a command line parameter for the controller IP. I
suppose you updated OpenflowEnabledP4Switch to not ignore "controllers"?
You should also be starting one P4 openflow agent instance per switch (
https://github.com/p4lang/p4ofagent). As far as I know, there is no super
easy way to do this with bmv2 (except for switch.p4), so you are probably
using bmv1?



On Wed, Dec 14, 2016 at 5:52 AM, Tanja Ulmen <tanja.ulmen at rwth-aachen.de>

> Hi,
> I have a mininet topology with three OpenflowEnabledP4Switches that is
> build like this:
> def myNetwork():
>     behavioral_model = os.path.join(sys.path[0],
> '../targets/control_target/behavioral-model')
>     net = Mininet( topo= None, host= P4Host, build=False, switch =
> OpenflowEnabledP4Switch)
>     info( '*** Adding controller\n' )
>     c0=net.addController(name='c0', controller=RemoteController,
> ip='', port=6653)
>     info( '*** Add switches\n')
>     sw1 = net.addSwitch('sw1', sw_path = behavioral_model, dpid="01",
> thrift_port = 22223, pcap_dump = True)
>     sw2 = net.addSwitch('sw2', sw_path = behavioral_model, dpid="02",
> thrift_port = 22224, pcap_dump = True)
>     sw3 = net.addSwitch('sw3', sw_path = behavioral_model, dpid="03",
> thrift_port = 22225, pcap_dump = True)
>     info( '*** Add hosts\n')
>     sens1 = net.addHost('sens1', cls=P4Host, ip='',
> mac='00:00:00:10:01:10')
>     info( '*** Add links\n')
>     net.addLink(sens1, sw2)
>     net.addLink(sw1, sw2)
>     net.addLink(sw1, sw3)
>     info( '*** Starting network\n')
>     net.build()
>     info( '*** Starting switches\n')
>     net.get('sw1').start([c0])
>     net.get('sw2').start([c0])
>     net.get('sw3').start([c0])
> ...
> The class OpenflowEnabledP4Switch is similar to the one of the
> openflow_l2.py in p4factory/mininet/. The switches are connected to a Ryu
> controller. Sw2 and Sw3 have tables to forward the data to Sw1 and Sw1
> sends the data to the Ryu controller with an openflow_miss. All data that
> is sent from Sw1 to the controller is received by the controller, but my
> problem is that it is received three times. By analyzing the packets with
> wireshark, it seems that the controller receives one duplicate of this
> message from every switch. In the log files of the switches only Sw1 is
> sending the packet once to the controller.
> When I use the Ryu Topology Viewer only one switch is visible instead of
> three. When I use the same topology but with normal switches (not P4) then
> all three switches are visible. So maybe the three switches are not really
> separated?
> Do you have any ideas why the other switches also send messages to the
> controller without telling them to do so? I hope it's possible to
> understand my problem.
> Best regards,
> Tanja
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20161214/76644aa7/attachment-0002.html>

More information about the P4-dev mailing list