<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    You can certainly modify topo.py to permit more command line
    arguments so that you can specify a different .json for each
    switch.  Once you've done this, you'll be able to add those new
    command line arguments to run_demo.sh.  If it is not clear how to do
    this, you'll need to take a step back and learn more python,
    specifically, the argparse module.<br>
    <br>
    BUT you want to do this without using mininet.  Also certainly
    possible.  Yes, start each switch on a different port.  I haven't
    connected switches outside of mininet before.  But after glancing at
    veth_setup.sh and googling "linux virtual interface" I start getting
    the idea that when veths are created, pairs of veths can be set up
    as peers, which makes them act like two ends of a pipe.  So you
    either make use of the peer pairs already created by the veth_setup
    script and assign veths to your switches accordingly, or you make
    your own version of the veth_setup script to wire things the way you
    want.<br>
    <br>
    --David<br>
    <br>
    <div class="moz-cite-prefix">On 03/06/2016 07:02 PM, Swaroop Thool
      wrote:<br>
    </div>
    <blockquote cite="mid:BLU183-W57697D7D9C614228C5EE89CBB10@phx.gbl"
      type="cite">
      <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
      <div dir="ltr"><span style="color: rgb(68, 68, 68); font-family:
          Calibri; line-height: 22.72px; background-color: rgb(255, 255,
          255);">Hello Antonin and all,</span>
        <div style="line-height: 22.72px; color: rgb(68, 68, 68);
          font-family: Calibri; background-color: rgb(255, 255, 255);"><br
            style="line-height: 22.72px;">
        </div>
        <div style="line-height: 22.72px; color: rgb(68, 68, 68);
          font-family: Calibri; background-color: rgb(255, 255, 255);">Thank
          you very much. I got few pointers for my project. When I
          looked at topo.py which creates topology as mentioned in
          topo.txt and when we do ./run_demo.sh it uses
          source_routing.json file only. This means I can use the same
          single program on three different switch as per example.
          However, I want to use different .json file (means different
          p4 programs) on different switches. Is this possible by any
          modification? I want to keep copy_to_cpu like running
          procedure (not involving mininet) for real traffic that's why
          I want to find a way to run two different switches having
          different program which are connected by veth. Should I run
          switches with different thrift ports but how to connects there
          veths?...I am bit confuse.</div>
        <div style="line-height: 22.72px; color: rgb(68, 68, 68);
          font-family: Calibri; background-color: rgb(255, 255, 255);">Thank
          you for your time.</div>
        <div style="line-height: 22.72px; color: rgb(68, 68, 68);
          font-family: Calibri; background-color: rgb(255, 255, 255);"><br
            style="line-height: 22.72px;">
        </div>
        <div style="line-height: 22.72px; color: rgb(68, 68, 68);
          font-family: Calibri; background-color: rgb(255, 255, 255);">Thanks,</div>
        <div style="line-height: 22.72px; color: rgb(68, 68, 68);
          font-family: Calibri; background-color: rgb(255, 255, 255);">Swaroop</div>
        <div>
          <hr id="stopSpelling">Date: Fri, 4 Mar 2016 10:06:12 -0800<br>
          Subject: Re: [P4-dev] How to connect two different P4 switch
          via veths<br>
          From: <a class="moz-txt-link-abbreviated" href="mailto:antonin@barefootnetworks.com">antonin@barefootnetworks.com</a><br>
          To: <a class="moz-txt-link-abbreviated" href="mailto:swaroopthool1991@outlook.com">swaroopthool1991@outlook.com</a><br>
          CC: <a class="moz-txt-link-abbreviated" href="mailto:p4-dev@lists.p4.org">p4-dev@lists.p4.org</a><br>
          <br>
          <div dir="ltr">
            <div>If you want to run multiple switches, using Mininet is
              your best option. You don't need to use Docker images
              though, you can just reproduce what is done in the source
              routing tutorial exercise: <a moz-do-not-send="true"
href="https://github.com/p4lang/tutorials/blob/master/SIGCOMM_2015/source_routing/topo.py"
                target="_blank">https://github.com/p4lang/tutorials/blob/master/SIGCOMM_2015/source_routing/topo.py</a>.
              This exercise uses a 3-switch & 3-host Mininet
              topology (<a moz-do-not-send="true"
href="https://github.com/p4lang/tutorials/blob/master/SIGCOMM_2015/resources/images/source_routing_topology.png"
                target="_blank">https://github.com/p4lang/tutorials/blob/master/SIGCOMM_2015/resources/images/source_routing_topology.png</a>).
              You can still use scapy on the 3 hosts to inject
              individual packets. As a matter of fact, that is exactly
              how the source_routing exercise operates.<br>
            </div>
            Of course you don't need to do that, you can always do your
            plumbing manually even though that would be shooting
            yourself in the foot. If you have a veth0-veth1 pair, you
            can connect veth0 to your first switch and veth1 to your
            second switch. Mininet has the advantage that it takes care
            of the plumbing for you, as well as start linux containers
            for the hosts which lets you do more interesting things than
            just send individual packets with scapy (e.g. you can run a
            tcp flow).<br>
          </div>
          <div class="ecxgmail_extra"><br>
            <div class="ecxgmail_quote">On Thu, Mar 3, 2016 at 12:24 PM,
              Swaroop Thool <span dir="ltr"><<a
                  moz-do-not-send="true"
                  href="mailto:swaroopthool1991@outlook.com"
                  target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:swaroopthool1991@outlook.com">swaroopthool1991@outlook.com</a></a>></span>
              wrote:<br>
              <blockquote class="ecxgmail_quote" style="border-left:1px
                #ccc solid;padding-left:1ex;">
                <div>
                  <div dir="ltr"><span style="font-size:12pt;"><span
                        dir="ltr">Hello John and All,
                        <div><br>
                        </div>
                        <div>Can you please elaborate? I never used it
                          before.How Docker gonna help ? I dont want to
                          use mininet now as I am using scapy. Moreover,
                          I am able to run two different P4 program only
                          after mentioning different thrift-port while
                          starting each switch. So
                          how to connect this two switches via veth?</div>
                        <div><br>
                        </div>
                        <div>Thanks,</div>
                        <div>Swaroop</div>
                      </span></span><br>
                    <br>
                    <div>
                      <hr>Subject: Re: [P4-dev] How to connect two
                      different P4 switch via veths<br>
                      From: <a moz-do-not-send="true"
                        href="mailto:john@barefootnetworks.com"
                        target="_blank">john@barefootnetworks.com</a><br>
                      Date: Wed, 2 Mar 2016 11:00:52 -0800<br>
                      CC: <a moz-do-not-send="true"
                        href="mailto:p4-dev@lists.p4.org"
                        target="_blank">p4-dev@lists.p4.org</a><br>
                      To: <a moz-do-not-send="true"
                        href="mailto:swaroopthool1991@outlook.com"
                        target="_blank">swaroopthool1991@outlook.com</a>
                      <div>
                        <div class="h5"><br>
                          <br>
                          <div>See</div>
                          <div><br>
                          </div>
                          <div><a moz-do-not-send="true"
                              href="https://github.com/p4lang/p4factory#integration-with-mininet"
                              target="_blank">https://github.com/p4lang/p4factory#integration-with-mininet</a></div>
                          <div><a moz-do-not-send="true"
href="https://github.com/p4lang/p4factory#integration-with-mininet-and-docker"
                              target="_blank">https://github.com/p4lang/p4factory#integration-with-mininet-and-docker</a></div>
                          <div><br>
                          </div>
                          <div>John</div>
                          <div><br>
                          </div>
                          <div><br>
                          </div>
                          <div>
                            <blockquote>
                              <div>On Mar 2, 2016, at 10:51 AM, Swaroop
                                Thool <<a moz-do-not-send="true"
                                  href="mailto:swaroopthool1991@outlook.com"
                                  target="_blank">swaroopthool1991@outlook.com</a>>
                                wrote:</div>
                              <br>
                              <div>
                                <div dir="ltr"
style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">Hello
                                  All,
                                  <div><br>
                                  </div>
                                  <div>I want to know, How to connect
                                    two veths(ports) of two different P4
                                    switch?</div>
                                  <div>I want to send data process by
                                    one P4 switch to another P4 switch
                                    which implements different P4
                                    programs. As of now, we can send
                                    packets from veth1(port1) and  sniff
                                    on veth6(port3) by scapy (from
                                    copy_to_cpu example).</div>
                                  <div>How to connect same port 3 of
                                    veth6 of 1st P4 switch to some
                                    incoming port of 2nd P4 switch?</div>
                                  <div><br>
                                  </div>
                                  <div>Moreover, as I cannot run two
                                    instances (programs)on same P4
                                    switch. Do I need to make another
                                    copy or folder of that switch
                                    (/targets/simple_switch)? and how to
                                    connect to other?Please help</div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>Thanks,</div>
                                  <div>Swaroop Thool</div>
                                </div>
                                <span
                                  style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline
                                  !important;">_______________________________________________</span><br
style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">
                                <span
                                  style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline
                                  !important;">P4-dev mailing list</span><br
style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">
                                <a moz-do-not-send="true"
                                  href="mailto:P4-dev@lists.p4.org"
style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"
                                  target="_blank">P4-dev@lists.p4.org</a><br
style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">
                                <a moz-do-not-send="true"
                                  href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org"
style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"
                                  target="_blank">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a></div>
                            </blockquote>
                          </div>
                          <br>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <br>
                _______________________________________________<br>
                P4-dev mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:P4-dev@lists.p4.org">P4-dev@lists.p4.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org"
                  rel="noreferrer" target="_blank">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
              </blockquote>
            </div>
            <br>
            <br clear="all">
            <br>
            -- <br>
            <div class="ecxgmail_signature">
              <div dir="ltr">Antonin<br>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
P4-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:P4-dev@lists.p4.org">P4-dev@lists.p4.org</a>
<a class="moz-txt-link-freetext" href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a></pre>
    </blockquote>
    <br>
  </body>
</html>