<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Phenomenal, thanks!</p>
    <p>--David<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 09/15/2018 07:10 PM, Vladimir
      Gurevich wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAKkdYEQbjQLpC6LCNrORpUAx=A9Q7QGc7_GAEoUncfkz87YRfQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">Hello David,
        <div><br>
        </div>
        <div>Since it looks like the basic interface setup, there are
          some other rules that you need to follow in order to be able
          to use an arbitrary interface successfully:</div>
        <div>
          <ol>
            <li>The interface should not have any IP addresses
              configured on it. This prevents the interface from "being
              taken care of" by the corresponding IP stacks (IPv4 or
              IPv6) and thus not only prevents routing, but also
              prevents Linux stack from responding to ARP packets and
              sending unsolicited ICMPv4 Router Advertisement packets to
              name a few</li>
            <li>All HW acceleration should be disable on the interface,
              otherwise, the packets received by the model will not
              generally be the same as sent from the outside and vice
              versa. Failure to disable HW acceleration leads to very
              subtle errors, like inability to forward TCP traffic at
              high rates (vs. very low rates), etc.</li>
          </ol>
          <div>To help you and others, I am attaching a basic script,
            iface_setup.sh that should take care of all these
            requirements. </div>
          <div><br>
          </div>
          <div>Basic usage:</div>
        </div>
        <blockquote style="margin:0 0 0 40px;border:none;padding:0px">
          <div>
            <div>sudo ./iface_setup.sh eth0 [eth1 .... ]</div>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div>You can use this script with any interfaces that already
          exist on your system (including veths, physical ethernet
          ports, dummy interfaces, etc.). Note: you might need to adjust
          MTU value on line since not all physical interfaces support
          10K value, specified in the script.</div>
        <div><br>
        </div>
        Happy hacking,
        <div>Vladimir</div>
        <div><br>
          <div>
            <div>
              <div dir="ltr" class="gmail_signature"
                data-smartmail="gmail_signature">
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div><font size="4"><b>Vladimir Gurevich</b></font></div>
                      <div><font size="4"><b><br>
                          </b></font></div>
                      <div><font size="4"><b>Barefoot Networks</b></font></div>
                      <div><b><font size="2">Technical Lead, Customer
                            Engineering</font></b></div>
                      <div><font size="2">Email: <a
                            href="mailto:vag@barefootnetworks.com"
                            target="_blank" moz-do-not-send="true">vag@barefootnetworks.com</a></font></div>
                      <div><font size="2">Phone: (408) 833-4505</font></div>
                      <div><br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <br>
          </div>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Sat, Sep 15, 2018 at 11:41 AM David Hancock
          <<a href="mailto:dhancock@cs.utah.edu"
            moz-do-not-send="true">dhancock@cs.utah.edu</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF">
            <p>Thanks both.  Packets now flow/don't flow as expected:</p>
            <p>- I disabled Linux forwarding</p>
            <p>- I ran simple_switch as root (previously, I did not run
              as root)</p>
            <p>- 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).</p>
            <p>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.<br>
            </p>
            <p>--David<br>
            </p>
            <br>
            <div class="m_2790324031130602088moz-cite-prefix">On
              09/15/2018 11:47 AM, Antonin Bas wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div dir="ltr">Also make sure that Linux forwarding is
                  disabled (net.ipv4.ip_forward), otherwise traffic will
                  be forwarded by Linux anyway.</div>
              </div>
              <div class="gmail_extra"><br>
                <div class="gmail_quote">On Sat, Sep 15, 2018 at 7:43
                  AM, Vladimir Gurevich via P4-dev <span dir="ltr"><<a
                      href="mailto:p4-dev@lists.p4.org" target="_blank"
                      moz-do-not-send="true">p4-dev@lists.p4.org</a>></span>
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    <div dir="ltr">Hello David,
                      <div><br>
                      </div>
                      <div>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.</div>
                      <div><br>
                      </div>
                      <div>Happy hacking,</div>
                      <div>Vladimir</div>
                      <div><br clear="all">
                        <div>
                          <div dir="ltr"
                            class="m_2790324031130602088m_-6361650418002448519gmail_signature"
                            data-smartmail="gmail_signature">
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div><font size="4"><b>Vladimir
                                        Gurevich</b></font></div>
                                  <div><font size="4"><b><br>
                                      </b></font></div>
                                  <div><font size="4"><b>Barefoot
                                        Networks</b></font></div>
                                  <div><b><font size="2">Technical Lead,
                                        Customer Engineering</font></b></div>
                                  <div><font size="2">Email: <a
                                        href="mailto:vag@barefootnetworks.com"
                                        target="_blank"
                                        moz-do-not-send="true">vag@barefootnetworks.com</a></font></div>
                                  <div><font size="2">Phone: (408)
                                      833-4505</font></div>
                                  <div><br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <br>
                      </div>
                    </div>
                    <br>
                    <div class="gmail_quote">
                      <div>
                        <div class="m_2790324031130602088h5">
                          <div dir="ltr">On Fri, Sep 14, 2018 at 6:04 PM
                            David Hancock <<a
                              href="mailto:dhancock@cs.utah.edu"
                              target="_blank" moz-do-not-send="true">dhancock@cs.utah.edu</a>>
                            wrote:<br>
                          </div>
                        </div>
                      </div>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div>
                          <div class="m_2790324031130602088h5">
                            <div bgcolor="#FFFFFF" text="#000000">
                              <p>Hello,</p>
                              <p>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.<br>
                              </p>
                              <p>I start simple_switch as follows:</p>
                              <blockquote>
                                <p>./simple_switch -i 0@<iface 1>
                                  -i 1@<iface 2> -i 2@<iface
                                  3> <path to .json></p>
                              </blockquote>
                              <p>The result:</p>
                              <blockquote>
                                <p>Thrift port was not specified, will
                                  use 9090<br>
                                  Calling target program-options parser<br>
                                  Adding interface <iface 1> as
                                  port 0<br>
                                  Adding interface <iface 2> as
                                  port 1<br>
                                  Adding interface <iface 3> as
                                  port 2<br>
                                  Thrift server was started</p>
                              </blockquote>
                              <p>I can connect to the CLI.</p>
                              <p>Am I missing something obvious?</p>
                              <p>Thanks,</p>
                              <p>David<br>
                              </p>
                            </div>
                          </div>
                        </div>
                        _______________________________________________<br>
                        P4-dev mailing list<br>
                        <a href="mailto:P4-dev@lists.p4.org"
                          target="_blank" moz-do-not-send="true">P4-dev@lists.p4.org</a><br>
                        <a
                          href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org"
                          rel="noreferrer" target="_blank"
                          moz-do-not-send="true">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
                      </blockquote>
                    </div>
                    <br>
                    _______________________________________________<br>
                    P4-dev mailing list<br>
                    <a href="mailto:P4-dev@lists.p4.org" target="_blank"
                      moz-do-not-send="true">P4-dev@lists.p4.org</a><br>
                    <a
                      href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org"
                      rel="noreferrer" target="_blank"
                      moz-do-not-send="true">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
                    <br>
                  </blockquote>
                </div>
                <br>
                <br clear="all">
                <div><br>
                </div>
                -- <br>
                <div class="m_2790324031130602088gmail_signature"
                  data-smartmail="gmail_signature">
                  <div dir="ltr">Antonin<br>
                  </div>
                </div>
              </div>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>