
Mininet: Emulating a network on your laptop - xtacy
http://mininet.github.com
======
LukeShu
GNS3 is another tool for emulating a network. It is a graphical tool where you
draw network diagrams, and nodes are emulated with Qemu/VirtualBox , Dynamips
(Cisco hardware), or another emulator.

~~~
zokier
Seems like the major advantage of Mininet (vs GNS3) is that Mininet is based
on light-weight virtualization, so that emulating large number of nodes should
be more feasible. Of course the downside being that all the nodes are Linux-
based

------
DoubleCluster
Very very interesting. I had somehow not heard about OpenFlow before, which
looks very promising (software + hardware based implementations), and network
simulation is the easiest way to learn about all the tech. How does Mininet
compare to GNS3?

Also, could you run virtualization software like Dynamips inside Mininet?

~~~
xtacy
I have not tried Dynamips so I cannot comment much. But Mininet uses features
in Linux: veth pairs, bridge, OpenVSwitch, etc. to glue together a network. If
Dynamips works with the above components, it's highly likely to work with
Mininet as well.

------
thomasreggi
I read some documentation and I don't think I entirely get the whole "emulate
a network" thing. What can be done with that? What exactly is a network? What
this project makes me think of is as if one would replace the internet with
another substitute internet or intranet, but I don't think thats the case.
Something that it makes me think of is the idea of downloading a website with
something like sitesucker and then changing your host file so that you can
browse the internet via saved pages on your computer. But I don't think that
this Mininet project has anything to do with that. I'm interested in trying to
"get-it" if anyone has a clearer more non-obscure definition of what this
project entails.

~~~
xtacy
It can mean different things to different people.

If you're a distributed systems developer, you can use Mininet to create a
topology and emulate the interaction of 100s of, say, bittorrent clients.

If you're a graduate student in networking, you can use Mininet to experiment
with your new routing protocol and compare it against existing ones such as
OSPF, BGP, etc.

You can also use it to put existing research papers to the test:
<http://reproducingnetworkresearch.wordpress.com>

~~~
thomasreggi
I really like the example you give and am starting to ge the academic usage.
Thanks for this reply!

~~~
xtacy
You're welcome. There's a Mininet AMI too if you want to get started quickly!

------
jacques_chester
When I was studying networking we used a network simulation tool called
cnet[0], which has the nice property that it can do network simulation at
different protocol _layers_ as well as having different topologies. It can
also simulate things like wide-area networks, noisy connections and so on.

Most of the assignments built around cnet were of the form of "Here is a
network protocol that is half-completed. Write the transport layer", or "here
is a fully completed network protocol that works with this topology. Now we
introduce wireless nodes, modify the protocol to support wireless mobility".

[0] <http://www.csse.uwa.edu.au/cnet/>

~~~
mineo
At the TU Ilmenau we used OMNeT++ (<http://www.omnetpp.org/>) which had the
benefit of having built-in classes for statistics collection and looking at
graphs while the simulation ran - mininet doesn't seem to offer such
functionality (yet?). But then it sometimes felt like omnet had too many
layers of indirection and C++ was not everybodys language of choice.

Our assignments were similar, I remember doing stuff with link state and
distance vector routing, implementing parts of a tcp state machine and others.

~~~
waps
It depends what you're doing with networks. These tools are good for
calculating statistics on large scale configs.

If you want a "real" network GNS3 is so much better.

------
bellbind
It seems to be a good tool for teaching networking. Back in school we used to
do that with VDN (which is still maintained
<http://opale.u-clermont1.fr/vdn/wiki/doku.php>).

~~~
xtacy
Yes, Mininet is used for networking courses in Stanford/Princeton. There are a
number of programming assignments readily available for Mininet:
<https://github.com/mininet/mininet/wiki/Assignments>

~~~
whitewhim
Wow reading through these assignments I'm blown away this is for a first year
course. At this time in my first year half of the class couldn't handle an if
statement. Wish I could of went to Stanford.

~~~
xtacy
No worries! The Stanford undergraduate networking class was offered online
last quarter. The videos are up here: <http://networking.class.stanford.edu>

~~~
whitewhim
Thanks. I'd found those but what I'm really interested in are the course
assignments which only seem to be available for the actual course. The first
two are the only ones I can't find right now

~~~
xtacy
The first two programming assignments can be found here:
[http://www.scs.stanford.edu/10au-
cs144/lab/reliable/reliable...](http://www.scs.stanford.edu/10au-
cs144/lab/reliable/reliable.html). The 2012 assignments were the same.

~~~
whitewhim
Thanks your awesome :)

------
jimeister
I've used this for classes at Stanford. We used it in conjunction with EC2 and
it was very handy for creating specific topologies that could be accessed from
anywhere.

------
jtchang
Is this based on FreeBSD's dummynet? I use to use that a long time ago and it
was really cool.

I was kind of sad when Linux didn't really have anything close to it.

~~~
xtacy
No, but Mininet uses dummynet like features in Linux: netem [1], htb [2], etc.

[1]
[http://www.linuxfoundation.org/collaborate/workgroups/networ...](http://www.linuxfoundation.org/collaborate/workgroups/networking/netem)

[2] <http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm>

------
tekromancr
I kind of want to use this to build a hacking game. You get to use real world
tools to uncover bits of story scattered across a virtual network. You could
even write little "agents" that run on the nodes that cause traffic to happen
between nodes, or react to things happening on the network.

~~~
DoubleCluster
Uplink with real (virtualized) servers? Count me in!

------
dkhenry
Another cool project that Mininet uses to do some heavy lifting is this.

<http://openvswitch.org/>

------
orofino
Obligatory: <http://xkcd.com/350/>

------
mihaifm
how does this work under the hood? in particular, how are the hosts emulated?
by separate processes?

~~~
xtacy
Yes. Virtual hosts are in isolated containers with their own pid and network
namespace. So each host can have its own routing table, IP address, etc.
without interfering with one another.

~~~
edwintorok
Mininet doesn't actually use PID namespaces yet. They warn that the PID
namespace and host filesystem are shared:
[https://github.com/mininet/mininet/wiki/Introduction-to-
Mini...](https://github.com/mininet/mininet/wiki/Introduction-to-Mininet#wiki-
limits)

