[P4-dev] Binding interfaces to bmv2

David Hancock dhancock at cs.utah.edu
Sat Sep 15 14:41:05 EDT 2018


Thanks both.  Packets now flow/don't flow as expected:

- I disabled Linux forwarding

- I ran simple_switch as root (previously, I did not run as root)

- I matched the port numbers between 1) the ports identified by '-i' 
option when starting simple_switch and 2) ports used in bmv2 runtime 
table commands (in my mininet setup, these had always been off by one).

I suspect the mininet issue may be unique to my own anomalous setup, but 
perhaps disabling forwarding and running as root warrant a mention on 
the behavioral-model README.  In any case, I'm good for now, and 
appreciate your help.

--David


On 09/15/2018 11:47 AM, Antonin Bas wrote:
> Also make sure that Linux forwarding is disabled 
> (net.ipv4.ip_forward), otherwise traffic will be forwarded by Linux 
> anyway.
>
> On Sat, Sep 15, 2018 at 7:43 AM, Vladimir Gurevich via P4-dev 
> <p4-dev at lists.p4.org <mailto:p4-dev at lists.p4.org>> wrote:
>
>     Hello David,
>
>     BMv2 implements P4 spec "to the t", meaning that it initializes
>     all metadata to 0 and that includes standard_metadata.egress_spec.
>     Therefore, a program that does "nothing" in reality will
>     unconditionally send all the packets to port 0.
>
>     Happy hacking,
>     Vladimir
>
>     *Vladimir Gurevich*
>     *
>     *
>     *Barefoot Networks*
>     *Technical Lead, Customer Engineering*
>     Email: vag at barefootnetworks.com <mailto:vag at barefootnetworks.com>
>     Phone: (408) 833-4505
>
>
>
>     On Fri, Sep 14, 2018 at 6:04 PM David Hancock
>     <dhancock at cs.utah.edu <mailto:dhancock at cs.utah.edu>> wrote:
>
>         Hello,
>
>         I'm trying to use bmv2 in a physical cluster (previously I've
>         always used mininet).  I'm trying to bind the interfaces of a
>         node to bmv2 and run a do-nothing P4 program on bmv2.  I
>         expect that packets should not flow through this node once I
>         have done this.  But packets still flow, suggesting that bmv2
>         is not handling the packets.  I have confirmed with traceroute
>         that the packets are traversing the interfaces that should be
>         bound to bmv2.
>
>         I start simple_switch as follows:
>
>             ./simple_switch -i 0@<iface 1> -i 1@<iface 2> -i 2@<iface
>             3> <path to .json>
>
>         The result:
>
>             Thrift port was not specified, will use 9090
>             Calling target program-options parser
>             Adding interface <iface 1> as port 0
>             Adding interface <iface 2> as port 1
>             Adding interface <iface 3> as port 2
>             Thrift server was started
>
>         I can connect to the CLI.
>
>         Am I missing something obvious?
>
>         Thanks,
>
>         David
>
>         _______________________________________________
>         P4-dev mailing list
>         P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
>         http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>         <http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org>
>
>
>     _______________________________________________
>     P4-dev mailing list
>     P4-dev at lists.p4.org <mailto:P4-dev at lists.p4.org>
>     http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>     <http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org>
>
>
>
>
> -- 
> Antonin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180915/7ee2c574/attachment.html>


More information about the P4-dev mailing list