Iperf stuck in mininet custom topology












0















I am using mininet on a Vagrant virtual machine that emulates Ubuntu Xenial (my laptop runs Windows 10).



The topology is the following, with remote controller, static ARP and OVS Kernel Switch running in user-space:



h1---s1----s4---h3
| / |
| s3 |
| / |
h2---s2----s5---h4


and I have done it with the following Python script:



from mininet.topo import Topo
from mininet.node import Host

class MyTopo(Topo):
def __init__(self):
"Create custom topo."
Topo.__init__(self)

leftTopHost = self.addHost('h1')
leftBottomHost = self.addHost('h2')
rightTopHost = self.addHost('h3')
rightBottomHost = self.addHost('h4')
Switch1 = self.addSwitch('s1')
Switch2 = self.addSwitch('s2')
Switch3 = self.addSwitch('s3')
Switch4 = self.addSwitch('s4')
Switch5 = self.addSwitch('s5')

self.addLink(leftTopHost, Switch1)
self.addLink(Switch1, Switch2)
self.addLink(Switch1, Switch3)
self.addLink(Switch1, Switch4)

self.addLink(leftBottomHost, Switch2)
self.addLink(Switch2, Switch3)
self.addLink(Switch2, Switch5)

self.addLink(Switch3, Switch4)
self.addLink(Switch3, Switch5)

self.addLink(rightTopHost, Switch4)
self.addLink(Switch4, Switch5)

self.addLink(rightBottomHost, Switch5)

topos = {'mytopo': (lambda: MyTopo())}


The basic idea is an MPLS tunnel between h1 and h4, passing through the switches s1, s4 and s5. I include part of the Ryu app I have developed ('part' because the MPLS match and the subsequent ping h1 h4 works fine); assume the output port numbers are the one in the code



Flow rules in s1:



#path h1->h4
...
match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
actions = [parser.OFPActionOutput(4)]
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
instructions=inst)
datapath.send_msg(mod)

#path h4->h1
match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
actions = [parser.OFPActionOutput(1)]
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
instructions=inst)
datapath.send_msg(mod)


Flow rules in s4:



#path h1->h4
...
match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
actions = [parser.OFPActionOutput(4)]
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
instructions=inst)
datapath.send_msg(mod)

#path h4->h1
match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
actions = [parser.OFPActionOutput(1)]
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
instructions=inst)
datapath.send_msg(mod)


Flow rules in s5:



#path h1->h4
...
match = parser.OFPMatch(in_port=3, eth_type=0x800, ip_proto=6)
actions = [parser.OFPActionOutput(4)]
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
instructions=inst)
datapath.send_msg(mod)

#path h4->h1
match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
actions = [parser.OFPActionOutput(3)]
inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
instructions=inst)
datapath.send_msg(mod)


So getting to my issue: I want to generate TCP traffic between h1 and h4 but I can't understand why, when I type the iperf h1 h4 command in the mininet prompt, it results in a connection timeout; same result if I run both the client and the server on separate terminals.



For sure I know I must add something to my code, but I can't really see where.. Any help would be much appreciated!










share|improve this question



























    0















    I am using mininet on a Vagrant virtual machine that emulates Ubuntu Xenial (my laptop runs Windows 10).



    The topology is the following, with remote controller, static ARP and OVS Kernel Switch running in user-space:



    h1---s1----s4---h3
    | / |
    | s3 |
    | / |
    h2---s2----s5---h4


    and I have done it with the following Python script:



    from mininet.topo import Topo
    from mininet.node import Host

    class MyTopo(Topo):
    def __init__(self):
    "Create custom topo."
    Topo.__init__(self)

    leftTopHost = self.addHost('h1')
    leftBottomHost = self.addHost('h2')
    rightTopHost = self.addHost('h3')
    rightBottomHost = self.addHost('h4')
    Switch1 = self.addSwitch('s1')
    Switch2 = self.addSwitch('s2')
    Switch3 = self.addSwitch('s3')
    Switch4 = self.addSwitch('s4')
    Switch5 = self.addSwitch('s5')

    self.addLink(leftTopHost, Switch1)
    self.addLink(Switch1, Switch2)
    self.addLink(Switch1, Switch3)
    self.addLink(Switch1, Switch4)

    self.addLink(leftBottomHost, Switch2)
    self.addLink(Switch2, Switch3)
    self.addLink(Switch2, Switch5)

    self.addLink(Switch3, Switch4)
    self.addLink(Switch3, Switch5)

    self.addLink(rightTopHost, Switch4)
    self.addLink(Switch4, Switch5)

    self.addLink(rightBottomHost, Switch5)

    topos = {'mytopo': (lambda: MyTopo())}


    The basic idea is an MPLS tunnel between h1 and h4, passing through the switches s1, s4 and s5. I include part of the Ryu app I have developed ('part' because the MPLS match and the subsequent ping h1 h4 works fine); assume the output port numbers are the one in the code



    Flow rules in s1:



    #path h1->h4
    ...
    match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
    actions = [parser.OFPActionOutput(4)]
    inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
    mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
    instructions=inst)
    datapath.send_msg(mod)

    #path h4->h1
    match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
    actions = [parser.OFPActionOutput(1)]
    inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
    mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
    instructions=inst)
    datapath.send_msg(mod)


    Flow rules in s4:



    #path h1->h4
    ...
    match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
    actions = [parser.OFPActionOutput(4)]
    inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
    mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
    instructions=inst)
    datapath.send_msg(mod)

    #path h4->h1
    match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
    actions = [parser.OFPActionOutput(1)]
    inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
    mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
    instructions=inst)
    datapath.send_msg(mod)


    Flow rules in s5:



    #path h1->h4
    ...
    match = parser.OFPMatch(in_port=3, eth_type=0x800, ip_proto=6)
    actions = [parser.OFPActionOutput(4)]
    inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
    mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
    instructions=inst)
    datapath.send_msg(mod)

    #path h4->h1
    match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
    actions = [parser.OFPActionOutput(3)]
    inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
    mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
    instructions=inst)
    datapath.send_msg(mod)


    So getting to my issue: I want to generate TCP traffic between h1 and h4 but I can't understand why, when I type the iperf h1 h4 command in the mininet prompt, it results in a connection timeout; same result if I run both the client and the server on separate terminals.



    For sure I know I must add something to my code, but I can't really see where.. Any help would be much appreciated!










    share|improve this question

























      0












      0








      0








      I am using mininet on a Vagrant virtual machine that emulates Ubuntu Xenial (my laptop runs Windows 10).



      The topology is the following, with remote controller, static ARP and OVS Kernel Switch running in user-space:



      h1---s1----s4---h3
      | / |
      | s3 |
      | / |
      h2---s2----s5---h4


      and I have done it with the following Python script:



      from mininet.topo import Topo
      from mininet.node import Host

      class MyTopo(Topo):
      def __init__(self):
      "Create custom topo."
      Topo.__init__(self)

      leftTopHost = self.addHost('h1')
      leftBottomHost = self.addHost('h2')
      rightTopHost = self.addHost('h3')
      rightBottomHost = self.addHost('h4')
      Switch1 = self.addSwitch('s1')
      Switch2 = self.addSwitch('s2')
      Switch3 = self.addSwitch('s3')
      Switch4 = self.addSwitch('s4')
      Switch5 = self.addSwitch('s5')

      self.addLink(leftTopHost, Switch1)
      self.addLink(Switch1, Switch2)
      self.addLink(Switch1, Switch3)
      self.addLink(Switch1, Switch4)

      self.addLink(leftBottomHost, Switch2)
      self.addLink(Switch2, Switch3)
      self.addLink(Switch2, Switch5)

      self.addLink(Switch3, Switch4)
      self.addLink(Switch3, Switch5)

      self.addLink(rightTopHost, Switch4)
      self.addLink(Switch4, Switch5)

      self.addLink(rightBottomHost, Switch5)

      topos = {'mytopo': (lambda: MyTopo())}


      The basic idea is an MPLS tunnel between h1 and h4, passing through the switches s1, s4 and s5. I include part of the Ryu app I have developed ('part' because the MPLS match and the subsequent ping h1 h4 works fine); assume the output port numbers are the one in the code



      Flow rules in s1:



      #path h1->h4
      ...
      match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(4)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)

      #path h4->h1
      match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(1)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)


      Flow rules in s4:



      #path h1->h4
      ...
      match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(4)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)

      #path h4->h1
      match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(1)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)


      Flow rules in s5:



      #path h1->h4
      ...
      match = parser.OFPMatch(in_port=3, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(4)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)

      #path h4->h1
      match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(3)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)


      So getting to my issue: I want to generate TCP traffic between h1 and h4 but I can't understand why, when I type the iperf h1 h4 command in the mininet prompt, it results in a connection timeout; same result if I run both the client and the server on separate terminals.



      For sure I know I must add something to my code, but I can't really see where.. Any help would be much appreciated!










      share|improve this question














      I am using mininet on a Vagrant virtual machine that emulates Ubuntu Xenial (my laptop runs Windows 10).



      The topology is the following, with remote controller, static ARP and OVS Kernel Switch running in user-space:



      h1---s1----s4---h3
      | / |
      | s3 |
      | / |
      h2---s2----s5---h4


      and I have done it with the following Python script:



      from mininet.topo import Topo
      from mininet.node import Host

      class MyTopo(Topo):
      def __init__(self):
      "Create custom topo."
      Topo.__init__(self)

      leftTopHost = self.addHost('h1')
      leftBottomHost = self.addHost('h2')
      rightTopHost = self.addHost('h3')
      rightBottomHost = self.addHost('h4')
      Switch1 = self.addSwitch('s1')
      Switch2 = self.addSwitch('s2')
      Switch3 = self.addSwitch('s3')
      Switch4 = self.addSwitch('s4')
      Switch5 = self.addSwitch('s5')

      self.addLink(leftTopHost, Switch1)
      self.addLink(Switch1, Switch2)
      self.addLink(Switch1, Switch3)
      self.addLink(Switch1, Switch4)

      self.addLink(leftBottomHost, Switch2)
      self.addLink(Switch2, Switch3)
      self.addLink(Switch2, Switch5)

      self.addLink(Switch3, Switch4)
      self.addLink(Switch3, Switch5)

      self.addLink(rightTopHost, Switch4)
      self.addLink(Switch4, Switch5)

      self.addLink(rightBottomHost, Switch5)

      topos = {'mytopo': (lambda: MyTopo())}


      The basic idea is an MPLS tunnel between h1 and h4, passing through the switches s1, s4 and s5. I include part of the Ryu app I have developed ('part' because the MPLS match and the subsequent ping h1 h4 works fine); assume the output port numbers are the one in the code



      Flow rules in s1:



      #path h1->h4
      ...
      match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(4)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)

      #path h4->h1
      match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(1)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)


      Flow rules in s4:



      #path h1->h4
      ...
      match = parser.OFPMatch(in_port=1, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(4)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)

      #path h4->h1
      match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(1)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)


      Flow rules in s5:



      #path h1->h4
      ...
      match = parser.OFPMatch(in_port=3, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(4)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)

      #path h4->h1
      match = parser.OFPMatch(in_port=4, eth_type=0x800, ip_proto=6)
      actions = [parser.OFPActionOutput(3)]
      inst = [parser.OFPInstructionActions(ofproto.OFPIT_APPLY_ACTIONS, actions)]
      mod = parser.OFPFlowMod(datapath=datapath, priority=1, match=match,
      instructions=inst)
      datapath.send_msg(mod)


      So getting to my issue: I want to generate TCP traffic between h1 and h4 but I can't understand why, when I type the iperf h1 h4 command in the mininet prompt, it results in a connection timeout; same result if I run both the client and the server on separate terminals.



      For sure I know I must add something to my code, but I can't really see where.. Any help would be much appreciated!







      python virtual-machine mininet ryu






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 '18 at 10:59









      Raffaele ViterboRaffaele Viterbo

      12




      12
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53429451%2fiperf-stuck-in-mininet-custom-topology%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53429451%2fiperf-stuck-in-mininet-custom-topology%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith