mininet / openflow-tutorial

Openflow Tutorial on Mininet
Other
401 stars 121 forks source link

iperf crashing "sudo mn --topo single,3 --mac --controller remote --switch user" #2

Closed nop0x0f closed 7 years ago

nop0x0f commented 8 years ago

Following the wiki and forgive me if this is the wrong location, using the mininet vm on a host-only network in mininet/openflow-tutorial/wiki/Learn-Development-Tools#benchmark-controller-wiperf at the location " Start the same Mininet with the user-space switch:

$ sudo mn --topo single,3 --mac --controller remote --switch user

Run one more iperf test with the reference controller:

mininet> iperf " when running iperf in a mn session with --controller remote --switch user having already set up controller ptcp: mininet crashes with the following output

mininet> iperf
*** Iperf: testing TCP bandwidth between h1 and h3 
no route to 10.0.0.3:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.0.0.0       U     0      0        0 h1-eth0
--------------------------------------------------------------------------------
Caught exception. Cleaning up...

Exception: Could not connect to iperf on port 5001
--------------------------------------------------------------------------------
*** Removing excess controllers/ofprotocols/ofdatapaths/pings/noxes
killall controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2> /dev/null
killall -9 controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2> /dev/null
pkill -9 -f "sudo mnexec"
*** Removing junk from /tmp
rm -f /tmp/vconn* /tmp/vlogs* /tmp/*.out /tmp/*.log
*** Removing old X11 tunnels
*** Removing excess kernel datapaths
ps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/'
***  Removing OVS datapaths
ovs-vsctl --timeout=1 list-br
ovs-vsctl --timeout=1 list-br
*** Removing all links of the pattern foo-ethX
ip link show | egrep -o '([-_.[:alnum:]]+-eth[[:digit:]]+)'
( ip link del s1-eth1;ip link del s1-eth2;ip link del s1-eth3 ) 2> /dev/null
ip link show
*** Killing stale mininet node processes
pkill -9 -f mininet:
*** Shutting down stale tunnels
pkill -9 -f Tunnel=Ethernet
pkill -9 -f .ssh/mn
rm -f ~/.ssh/mn/*
*** Cleanup complete.
mni025 commented 7 years ago

Could you solve your problem? I facing the same problem!

annabom commented 7 years ago

I also have the same problem. Please share if you find a solution!

lantz commented 7 years ago

I've updated the page to note that you can't (currently) use --mac with --switch user because of https://github.com/mininet/mininet/issues/156

Note that --controller remote implies that you're running the controller separately, as specified earlier on that page.

Huangmachi commented 7 years ago

I jsut got the same problem, how to solve it? help

WANGYantong commented 4 years ago

Hi, I also got a similar problem like this. My case is a loop is introduced in my topology. However, the default setting of Mininet open vswitch (ovs) disables Spanning Tree Protocol (STP). So the solution for my case is to enable the STP when setting ovs. The error for the original issue is "no route to 10.0.0.3". Please check the connectivity first. Just for reference :)

JackDiSalvatore commented 3 years ago

Hi, I also got a similar problem like this. My case is a loop is introduced in my topology. However, the default setting of Mininet open vswitch (ovs) disables Spanning Tree Protocol (STP). So the solution for my case is to enable the STP when setting ovs. The error for the original issue is "no route to 10.0.0.3". Please check the connectivity first. Just for reference :)

Like this? It is still not working for me :(

self.net = Mininet(topo=None, listenPort=6634, ipBase='10.0.0.0/8', controller=self.controller)

self.h1 = self.net.addHost('host1', mac='00:00:00:00:00:01', ip='10.0.0.1')
self.h2 = self.net.addHost('host2', mac='00:00:00:00:00:02', ip='10.0.0.2')

self.s1 = self.net.addSwitch('s1', cls=OVSKernelSwitch, protocols='OpenFlow13', stp=True)
self.s2 = self.net.addSwitch('s2', cls=OVSKernelSwitch, protocols='OpenFlow13', stp=True)

self.net.addLink(self.h1, self.s1, cls=Link)
self.net.addLink(self.h2, self.s2, cls=Link)
self.net.addLink(self.s1, self.s2, cls=TCLink, bw=self.link_bw)

self.net.addController(name=self.controller)
self.net.start()

self.net.iperf([self.h1, self.h2])
WANGYantong commented 3 years ago

Hi, I also got a similar problem like this. My case is a loop is introduced in my topology. However, the default setting of Mininet open vswitch (ovs) disables Spanning Tree Protocol (STP). So the solution for my case is to enable the STP when setting ovs. The error for the original issue is "no route to 10.0.0.3". Please check the connectivity first. Just for reference :)

Like this? It is still not working for me :(

self.net = Mininet(topo=None, listenPort=6634, ipBase='10.0.0.0/8', controller=self.controller)

self.h1 = self.net.addHost('host1', mac='00:00:00:00:00:01', ip='10.0.0.1')
self.h2 = self.net.addHost('host2', mac='00:00:00:00:00:02', ip='10.0.0.2')

self.s1 = self.net.addSwitch('s1', cls=OVSKernelSwitch, protocols='OpenFlow13', stp=True)
self.s2 = self.net.addSwitch('s2', cls=OVSKernelSwitch, protocols='OpenFlow13', stp=True)

self.net.addLink(self.h1, self.s1, cls=Link)
self.net.addLink(self.h2, self.s2, cls=Link)
self.net.addLink(self.s1, self.s2, cls=TCLink, bw=self.link_bw)

self.net.addController(name=self.controller)
self.net.start()

self.net.iperf([self.h1, self.h2])

Hi, what is the exception thrown in your case? Is every node in the connection? For the stp enabling, according to the reference(http://mininet.org/api/classmininet_1_1node_1_1OVSSwitch.html#ab5db2ef0d48302217833ce1538270310), it would be False until the failMode=standalone (the default is secure). So I run the following common in CLI: sudo mn XXXX(your topo setting etc.) --switch=ovsk,failMode='standalone',stp=True

Probably you consider the failMode when do 'addSwitch' I guess...

Good luck~

dsnunes07 commented 3 years ago

Hello, everyone

as a workaround to this issue, I started the controller as a background process before running the commands sudo mn --topo single,3 --mac --controller remote --switch ovsk followed by iperf

In order to start the controller in background, run

sudo controller ptcp:6633