3

How to dynamically move hosts in mininet? Any CLI commands or a script? I tried the code at https://github.com/mininet/mininet/blob/master/examples/mobility.py but I get this error:

anusha@anusha-Lenovo-IdeaPad-Z500:~$ sudo python ~/mininet/custom/mobility.py 
* Simple mobility test
* Starting network:
s1: h1(1) s2(2) 
s2: h2(1) s1(2) s3(3) 
s3: h3(1) s2(2) 
* Testing network
*** Ping: testing ping reachability
h1 -> h2 h3 
h2 -> h1 h3 
h3 -> h1 h2 
*** Results: 0% dropped (6/6 received)
* Identifying switch interface for h1
* Moving h1 from s1 to s2 port 13
Traceback (most recent call last):
  File "/home/anusha/mininet/custom/mobility.py", line 128, in <module>
    mobilityTest()
  File "/home/anusha/mininet/custom/mobility.py", line 115, in mobilityTest
    hintf, sintf = moveHost( h1, old, new, newPort=port )
  File "/home/anusha/mininet/custom/mobility.py", line 96, in moveHost
    oldSwitch.moveIntf( sintf, newSwitch, port=newPort )
  File "/home/anusha/mininet/custom/mobility.py", line 77, in moveIntf
    switch.attach( intf )
  File "/home/anusha/mininet/custom/mobility.py", line 45, in attach
    if self.isOldOVS():
AttributeError: 'MobilitySwitch' object has no attribute 'isOldOVS'

thanks!

Anusha
  • 647
  • 11
  • 29
  • Have you tried to run the "mobility" code again? I actually ran the code with Mininet branch/version 2.3.0. – Cloud Cho Feb 04 '23 at 07:54

1 Answers1

2

After doing a lot of research, I found that there are no direct commands or functions or scripts that will facilitate the movement of a host within the network in mininet.

Instead what you can do is simulate the movement of the host! mininet> link h1 s1 down ---->does only logical link down mininet> py net.addLink(s2,net.get(h1))

You are good to go :)

Anusha
  • 647
  • 11
  • 29
  • Thanks for sharing the method. I followed your suggestion, but I couldn't `> s2 ping h1` nor `> pingall`. Is there additoinal step to make topology run? – Cloud Cho Feb 03 '23 at 00:53