Mininet Custom Topologies
ฝัง
- เผยแพร่เมื่อ 18 พ.ย. 2013
- Twitter: @davidmahler
LinkedIn: / davidmahler
Links:
My intro to Mininet video: • Introduction to Mininet
My mininet remote controllers video: • Mininet and Remote SDN...
Mininet website: mininet.org
Mininet team's Python API intro on github: github.com/mininet/mininet/wi...
Getting Started with Floodlight: www.projectfloodlight.org/gett...
Mininet Custom Topologies
How to create custom topologies with mininet
I created the same mesh few days ago but not with a tricky loop as you did. When I tested it using pox L3.learning controller, I got stuck in loops which proved to me that this L3.Learning is not even near any router as they were claiming on documentation that its simple router. It was great to learn that floodlight can handle loops !
Thanks for the all the videos !!
Hey David, love the videos and found them incredibly useful
Glad you like them!
Nicely crafted videos! Thanks for posting thoses
yun yaw chu You're welcome!
Thank you David !👍
Can you explain how did youcreat the py files. Because my real problem is about creating topologies not running them. Do you have a video about how to create custom topologies from scratch?
Awesome video!
Very helpful.
Thank you very much
🙏🙏🙏🙏🙏🙏
Thanks David. I have a question, your help would be greatly appreciated. How do I add a Router in mininet?
@swapnil- you're welcome!
This's really great! thanks!
You're welcome Victor!
thanks David for this video,
how can we limit link bandwidth and add delay between s1-eth1 to s2-eth1 & s1-eth3 to s3-eth1, , and if we set lower bandwidth and delay(in topology you have shown in this video ) will packet changes its path dynamically to reach destination
sir ,can you please tell me how to receive a text file/audio/video in form of output if a request is made from one host to another host in mininet
Good explanation. But the mesh topology doesn't work with POX controller running in the background. As soon as I run the sudo mn command, pox controller closes. Any reason?
Hi, can you help me if we can generate the image of the network that is built using MININET.
can you help me ? , i'll create custom topologi link aggregation (with lacp) between switch1 and switch2 with ryu controller. i'm newbie in mininet, what should i do?
My professor has given out python assignments that use the mininet VM, but he has not taught a single thing about python or mininet. When I asked an assistant during office hours, they told me to use google or youtube. So here I am and thank you
Oh, thats very cool, thanks for the message!
What should be done if there is no connectivity ? I tried the basic 2host 2 switch but the ping doesn't seem to work. Any idea where could be the problem or maybe where am i supposed to edit ?
Is it possible to add a switch that is not OpenFlow enabled? I'm new to mininet and networking itself, and I'm doing research for my bachelor's degree to compare the performance of a tradition network with an SDN. If not, please advice me on the best way to do this
I'm trying to find the home/mininet directory on my laptop but I don't know where it is. How do I find it?
Thanks David.
I have a doubt, in the begining of the tutorial you mentioned that you experienced loops because of the mesh topology. But when you use Floodlight Controller you said it was removed, using the forwarding module in the controller.
My doubt is if the switch doesn't have the flow for a particular destination, it will forward the packet to the Controller and Controller will broadcast ( as like traditional Switch learning). And this broadcast will turn into loop. In that case the only way to avoid loops is to install the flows automatically in the switches.
Will the Floodlight controller knows all the switches,hosts and port details, if so how?
And am sorry if I have understood wrongly.
Please clear my doubts.
Floodlight discovers links and how devices are connected : docs.projectfloodlight.org/display/floodlightcontroller/LinkDiscoveryManager+%28Dev%29
Floodlight stores topology information: docs.projectfloodlight.org/display/floodlightcontroller/TopologyService+%28Dev%29
and Floodlight builds a loop free tree for broadcast (if I recall correctly) using the forwarding service
You can search around the mailing list probably to confirm/validate what I just said :-)
David Mahler Thanks a lot...
How can i add a RADIUS server to the mininet?
Is it the same as adding controller?
Hi david
I tried to modify a emptynet.py file and I didn't find the file in my computer.
I mean I f I want modify any file in examples folder or custom how can find it in my computer
Hi David, thanks for all the awesome videos, I learnt a lot from them. Just one query, I was trying to create my own custom topology, how do I run the Floodlight Controller in the background ?(time: 3:52)
Great, thanks Sohini.
Did you see my Video on mininet and remote controllers? :-)
Mininet and Remote SDN Controllers (Floodlight + Pox)
I was about to ask the same question again.
Hello David ,
could you Tell me how to connect a specific switch to a controller .. and let other OVSS talk to Controller through The 1st OVSS
Thanks.
hey david how can i run a mininet CLI command from a python code
i m trying to change topology in onos basic tutorial but i m not able to do it
can you please help me ?
How i create any custom topology ? commands ?
Dear David Mahler,
I wrote a topology but I face an error saying an exception caught.
I was wondering if you'd mind sending a link for me about a custom topology, I'm new to mininet.
Bests,
Hello David,
Thanks for the video, it's really helpful and it would be great if you can create a video using RYU controller.
Hi Harsh, sorry but I won't have time to do that!
There is big problem with ring or mesh SDN typologies which creates a loop. I have tested ODL all versions and POX but none of them worked well with these kind of topos, so it is only possible to use spanning tree protocol in our topology to prevent loops.
in this tutorial you are believing that floodlight controller can prevent such kind of loops by defult automatically?
e.g: is it possible to create this topo with floodlight correctly?
sudo mn --topo torus,3,3
?
DAvid, thanks for the video.. I have a problem setting the BW, Delay, loss. I mean , I want to change the network's performance parameter but I always get this error : line 32, in emptyNet
net.addLink( leftHost, leftSwitch, **linkopts) #, bw=10, delay='5ms', loss=10, max_queue_size=1000, use_htb=True )
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/mininet/net.py", line 245, in addLink
return cls( node1, node2, **defaults )
TypeError: __init__() got an unexpected keyword argument 'delay'
I've added the library : from mininet.link import TCLink.. however I still have the error.
Hi thanks for your awesome videos ! Can you please explain how you handled the loops between the switches with floodlight and how you prevented the crash you mentioned.
You're welcome! I'm rusty on this one - but I believe the default forwarding application simply disables links in the way similar to how spanning tree protocol would have done so that frames can't complete a loop. This is from a central point which has awareness of the complete topology though, instead of the switches having to use a dedicated distributed protocol like STP amongst themselves. I think ;-).
Thanks again!
Hi David
Thanks for the video.
Can you please tell me, how to run traceroute between hosts here. I want to see the path of the packet flow between h1 and h2. I tried "traceroute h2" from h1 xterm with no success.
Hello Arun - using the host name instead of an IP address can only be done form the mininet prompt. When you have an xterm session use the actual IP address of h2. By default that would be 10.0.0.2, unless you set a different IP in your custom topology script/file.
hey good information there.. i have a question, how do we create a fan-in type topology with n no. of hosts.. i believe we need to use the loop here.. can you please give me an example. thanks.
Thanks!
Hi everybody,
I'm traying to change mininet link properties but i can't.
Anyone know some way to do it?
For example after add "net.addLink(h1, s4, 0, 3, bw=100, delay='5ms', loss=0, max_queue_size=1000, use_htb=True )" in python script.
There are any command to change the delay or the bandwidth with mininet running?
mininet>----
Thanks
Hi David, I have a script used in hedera/dctopo.py that I would like to run in Mininet. I just do not know where to put the file and what command should I type!
hi, can you help me? i wanna know if it is posibble to put a router and a switch in the same topo, thnks for share this video
IsaacStrike A router needs an SDN controller/application
super, thanks
You're welcome again!!
Hey david, I tried implementing a Peterson graph topology using a python script with 5 hosts and 10 switches, but the hosts are not able to ping each other.
PS: I tried including all of the available controllers, but none of them yielded the desired result.
Any idea how to fix this?
Thank you!
+John Stephan Heh, had to google that one - no but that is a lot of loops, that could be related I suppose - although that would be obvious b/c your CPU should tank. I suggest examining the flow entries carefully to troubleshoot how packets are moving around the network. I'd also start with a very basic topo first to make sure that works with the given controller before getting to the more complex topo. You can always try mailing lists for the particular controllers.
Can I calculate trust & energy for each node, while implementing IOT purpose?
Also is there any process to setup a database for each node to store information?
+Shankha Shubhra Das I have no idea, sorry!
SDN scope is limited to nodes of wired network at this point with an abstraction of physical layer. It does not address sensor node features yet. If you are a research scholar, it could be a good area to get started.
Hi David, thank you very much. I'm really passionate about learning mininet. I have a small query, any help would be greatly appreciated. I want to setup a Ipv6 network with 2 hosts and 2 routers. Is it possible to create a ipv6 network within mininet even if my internet service provider doesn't provide the Ipv6 internet service.
Well your ISP doesn't have to have anything to do with it for a self-contained lab environment which is what Mininet is really for. Yes IPv6 has been suported in OpenFlow since version 1.2, and OVS supports this as well. You'll just need to set the hosts to have IPv6 interfaces and use a controller supporting IPv6 or manually add flow entries for IPv6.
David Mahler Thank you David. You are Awesome! You are very humble person.
Thank you so much for all video you share with us.
it's very helpfull.
I tried to create the same topology but using a default controller of mininet.
but when Pingall I got the error bellow.
** Ping: testing ping reachability
h1 -> X
h2 -> X
*** Results: 100% dropped (2/2 lost)
do you think that this topology is not working with default controller?
Hi BoDonald,
The topology has loops in it so you have to use a controller/SDN application that builds loop free paths for traffic - otherwise you will have broadcast storms. Check your CPU when you do that, I bet it's at 100% :-)
SDN provides a way to more easily/programmatically control the behavior of your network - but you still need applications that actually do that.
Check out this FAQ post on just this from the mininet github page documentation....
github.com/mininet/mininet/wiki/FAQ#ethernet-loops
hello ,
do you have mybe some videos about Maxinet and how can two networks see each other on Maxinet ?
woah, I didn't hear of maxinet, of course I haven't looked at this space for a while.
@@DavidMahler macinet is great for doing small SDN emulations, and it still making steps for its swing to enter wide in SDN space
How did you ~copy and update the python script in gnu nano
Hello Stephanie - I'm not sure what you're asking about - can you provide more detail and the minutes and seconds time stamp of the video you are referencing?
Hi Dave I'm using controllers2.py file to create a 2 controller network and c1-s1 and c2-s2 when I do a ping why c1update s2 not c1 how can I change c2 to update s2 please (c=controller s=switch)
Hello,
I don't know - I haven't run that. I tried it real quick and on the surface it seems OK...
mininet> sh ovs-vsctl show
fc881c5c-41dd-4904-91e9-591c7a851011
Bridge "s1"
Controller "tcp:127.0.0.1:6633"
is_connected: true
fail_mode: secure
Port "s1"
Interface "s1"
type: internal
Port "s1-eth1"
Interface "s1-eth1"
Port "s1-eth3"
Interface "s1-eth3"
Port "s1-eth2"
Interface "s1-eth2"
Bridge "s2"
Controller "tcp:127.0.0.1:6634"
is_connected: true
fail_mode: secure
Port "s2-eth2"
Interface "s2-eth2"
Port "s2-eth3"
Interface "s2-eth3"
Port "s2-eth1"
Interface "s2-eth1"
Port "s2"
Interface "s2"
type: internal
ovs_version: "1.10.2"
mininet> dump
s1 is set in ovsdb to use c1, s2 to use c2 - at least it looks like it's OK
I'd suggest checking on the mininet mailing list for any past questions. If there isn't an answer post a question with more detail (what exactly makes you think this is happening/what evidence....).
I tried the command line, it says it can't find the file I want to use.
it look like you are also new to this, the problem is he already has the py files in computer i suppose and he doesnt tell how to create them he just runs them so... we need to learn how to create topology files in computer.
Hi David, I tried to create the same topology using MiniEdit and when I tried to ping h2 from h1, I wasn't getting any response. Can you please help me here? I am not able to understand why the two hosts aren't talking to each other.
Hi, you should examine the flow tables of all the switches (ovs-ofctl). Also if you have a loop and not a controller to handle that, it shouldn't work well.
Thank you so much. I'll look into it.
How can i reach to ~/mininet/custom$ file ?
ru shu ~/mininet/custom is a directory with custom topology files (.py) inside....not sure if that's the question though....
Hi David.
Could you please tell me how can we have multiple links between mininet host and a switch.
I tried to create a custom topology like this but it did not work.
pastebin.com/m1y5NnZT
In the above topology I used "self.addLink(H1,S1)" twice.
The net command gives me the following result which is totally weird.
mininet> net
h1 h1-eth1:s1-eth2
h2 h2-eth0:s2-eth1
s1 lo: s1-eth2:s2-eth2
s2 lo: s2-eth1:h2-eth0 s2-eth2:s1-eth2
c0
here is one more for your reference :
aditya@ubuntu:~/mininet/custom$ sudo mn --custom r1.py --topo mytopo --controller=remote,ip=10.0.0.11
--------------------------------------------------------------------------------
Caught exception. Cleaning up...
TypeError: custom() got multiple values for keyword argument 'self'
--------------------------------------------------------------------------------
aditya@ubuntu:~/mininet/custom$
hey , as per your video and other contents online I added my topology file - router.py at this location - home-mininet-custom then I did this :
aditya@ubuntu:~/mininet/custom$ dir
README topo-2sw-2host.py
aditya@ubuntu:~/mininet/custom$ sudo mn --custom route.py --topo mytopo
--------------------------------------------------------------------------------
Caught exception. Cleaning up...
TypeError: custom() got multiple values for keyword argument 'self'
--------------------------------------------------------------------------------
aditya@ubuntu:~/mininet/custom$
how can I remove this error???
Hello - not sure something about your script I suppose. If you want you can connect to me on linkedin and I can see if it's anything I can sort out quickly - otherwise you can try the mininet mailing list.
OK can you please share your LinkedIn details...I will add you there
Aditya Kushwaha www.linkedin.com/in/davidmahler
Hi
Thanks for your screenshot and nice teaching.
I did all of the steps the same as you did.
but I donot know why I cannot run my custom topology.
Unfortunatly I encountered to this error!!!
mininet@mininet-vm:~/mininet/custom$ sudo mn --custom mesh.py --topo mytopo
Traceback (most recent call last):
File "/usr/local/bin/mn", line 5, in
pkg_resources.run_script('mininet==2.0.0', 'mn')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_scr ipt
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1239, in run_sc ript
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/ scripts/mn", line 280, in
MininetRunner()
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/ scripts/mn", line 111, in __init__
self.parseArgs()
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/ scripts/mn", line 145, in parseArgs
self.parseCustomFile( filename )
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/ scripts/mn", line 132, in parseCustomFile
execfile( fileName, customs, customs )
File "mesh.py", line 24
S1 = self.addSwitch( 's1' )
^
IndentationError: unindent does not match any outer indentation level
would you mind help me about that??!!!
thanks so much
Thats a python error - in python all the indentations have to line up - perhaps you have an extra space on that line compared to lines above it...
David Mahler Hi Thanks your reply.
yes I understood that it is a Python error. but I cannot solve it. Also when I run topo-2sw-2host.py it gave me this error.
mininet@mininet-vm:~/mininet/custom$ sudo mn --custom topo-2sw-2host.py --topo mytopo
Traceback (most recent call last):
File "/usr/local/bin/mn", line 5, in
pkg_resources.run_script('mininet==2.0.0', 'mn')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1239, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn", line 280, in
MininetRunner()
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn", line 111, in __init__
self.parseArgs()
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn", line 145, in parseArgs
self.parseCustomFile( filename )
File "/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn", line 132, in parseCustomFile
execfile( fileName, customs, customs )
File "topo-2sw-2host.py", line 13, in
from mininet.topo import Topo, Node
ImportError: cannot import name Node
David Mahler
finally I can solve it. thanks
By following this... www.projectfloodlight.org/getting-started/ @cool inno
just to complete my question this is the result I obtained after created the network and run the dump command.
mininet@mininet-vm:~/mininet/custom$ sudo mn --custom test.py --topo mytopo
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding switches:
s1 s2 s3 s4
*** Adding links:
(h1, s1) (h2, s3) (s1, s2) (s1, s3) (s1, s4) (s2, s3) (s2, s4) (s3, s4)
*** Configuring hosts
h1 h2
*** Starting controller
*** Starting 4 switches
s1 s2 s3 s4
*** Starting CLI:
mininet> dump
mininet> pingall
*** Ping: testing ping reachability
h1 -> X
h2 -> X
*** Results: 100% dropped (2/2 lost)
mininet>
thank you ,
can you give me your email to connect you ?
Houssem Eddine Hello, you can connect to me on Linkedin.
Thanks David. I have a question, your help would be greatly appreciated. How do I add a Router in mininet? or how I can ensure the reachability if we create 2 edge in 2 different network
hey david how can i run a mininet CLI command from a python code