Fix: Docker build was broken due to double urllib dependecy.
[osm/vim-emu.git] / docs / index.md
1 ---
2 layout: default
3 ---
4
5
6 # [](#overview)Overview
7
8 Containernet is a fork of the famous [Mininet](http://mininet.org) network emulator and allows to use [Docker](https://www.docker.com) containers as hosts in the emulated network topologies. This enables interesting functionalities to build networking/cloud emulators and testbeds. One example for this is the [NFV multi-PoP infrastructure emulator](https://github.com/sonata-nfv/son-emu) created by the [SONATA](http://sonata-nfv.eu) project.
9
10 ## Containernet in action
11
12 <script type="text/javascript" src="https://asciinema.org/a/4eSesgrJL8t2VikiDnHoD9qRF.js" id="asciicast-4eSesgrJL8t2VikiDnHoD9qRF" async data-autoplay="true" data-size="medium" data-loop="true" data-rows="12"></script>
13
14 ## Cite this work
15
16 If you use [Containernet](containernet.github.io) for your work, please cite the following publication:
17
18 * M. Peuster, H. Karl, and S. v. Rossem: [MeDICINE: Rapid Prototyping of Production-Ready Network Services in Multi-PoP Environments](http://ieeexplore.ieee.org/document/7919490/). IEEE Conference on Network Function Virtualization and Software Defined Networks (NFV-SDN), Palo Alto, CA, USA, pp. 148-153. doi: 10.1109/NFV-SDN.2016.7919490. (2016)
19
20
21 # [](#get-started)Get started
22
23 Using Containernet is very similar to using Mininet with [custom topologies](http://mininet.org/walkthrough/#custom-topologies).
24
25 ## Create a custom topology
26
27 First, a Python-based topology has to be created as shown in the following example.
28
29 ```python
30 """
31 Example topology with two containers (d1, d2),
32 two switches, and one controller:
33
34           - (c)-
35          |      |
36 (d1) - (s1) - (s2) - (d2)
37 """
38 from mininet.net import Containernet
39 from mininet.node import Controller
40 from mininet.cli import CLI
41 from mininet.link import TCLink
42 from mininet.log import info, setLogLevel
43 setLogLevel('info')
44
45 net = Containernet(controller=Controller)
46 info('*** Adding controller\n')
47 net.addController('c0')
48 info('*** Adding docker containers using ubuntu:trusty images\n')
49 d1 = net.addDocker('d1', ip='10.0.0.251', dimage="ubuntu:trusty")
50 d2 = net.addDocker('d2', ip='10.0.0.252', dimage="ubuntu:trusty")
51 info('*** Adding switches\n')
52 s1 = net.addSwitch('s1')
53 s2 = net.addSwitch('s2')
54 info('*** Creating links\n')
55 net.addLink(d1, s1)
56 net.addLink(s1, s2, cls=TCLink, delay='100ms', bw=1)
57 net.addLink(s2, d2)
58 info('*** Starting network\n')
59 net.start()
60 info('*** Testing connectivity\n')
61 net.ping([d1, d2])
62 info('*** Running CLI\n')
63 CLI(net)
64 info('*** Stopping network')
65 net.stop()
66 ```
67
68 You can find this topology in [`containernet/examples/containernet_example.py`](https://github.com/containernet/containernet/tree/master/examples/containernet_example.py).
69
70 ## Run emulation and interact with containers
71
72 Containernet requires root access to configure the emulated network described by the topology script:
73
74 ```bash
75 sudo python containernet_example.py
76 ```
77
78 After launching the emulated network, you can interact with the involved containers through Mininet's interactive CLI as shown with the `ping` command in the following example:
79
80 ```bash
81 containernet> d1 ping -c3 d2
82 PING 10.0.0.252 (10.0.0.252) 56(84) bytes of data.
83 64 bytes from 10.0.0.252: icmp_seq=1 ttl=64 time=200 ms
84 64 bytes from 10.0.0.252: icmp_seq=2 ttl=64 time=200 ms
85 64 bytes from 10.0.0.252: icmp_seq=3 ttl=64 time=200 ms
86
87 --- 10.0.0.252 ping statistics ---
88 3 packets transmitted, 3 received, 0% packet loss, time 2002ms
89 rtt min/avg/max/mdev = 200.162/200.316/200.621/0.424 ms
90 containernet>
91 ```
92
93 To stop the emulation, do:
94
95 ```
96 containernet> exit
97 ```
98
99 # [](#installation)Installation
100
101 Automatic installation is provided using an Ansible playbook. Requires a bare-metal machine or VM with Ubuntu **16.04 LTS**.
102
103 ```bash
104 sudo apt-get install ansible git aptitude
105 git clone https://github.com/containernet/containernet.git
106 cd containernet/ansible
107 sudo ansible-playbook -i "localhost," -c local install.yml
108 ```
109
110 # [](#references)References
111
112 Containernet has been used for a variety of research tasks and networking projects. If you use Containernet, let us [know](mailto:containernet@peuster.de).
113
114 ## Publications
115
116 * S. v. Rossem, W. Tavernier, M. Peuster, D. Colle, M. Pickavet and P. Demeester: [Monitoring and debugging using an SDK for NFV-powered telecom applications](https://biblio.ugent.be/publication/8521281/file/8521284.pdf). IEEE Conference on Network Function Virtualization and Software Defined Networks (NFV-SDN), Palo Alto, CA, USA, Demo Session. (2016)
117
118 * M. Peuster, H. Karl: [Understand Your Chains: Towards Performance Profile-based Network Service Management.](http://ieeexplore.ieee.org/document/7956044/) Accepted in Fifth European Workshop on Software Defined Networks (EWSDN). IEEE. (2016)
119
120 * Qiao, Yuansong, et al. [Doopnet: An emulator for network performance analysis of Hadoop clusters using Docker and Mininet.](http://ieeexplore.ieee.org/document/7543832/) Computers and Communication (ISCC), 2016 IEEE Symposium on. IEEE, 2016.
121
122 * M. Peuster, S. Dräxler, H. Razzaghi, S. v. Rossem, W. Tavernier and H. Karl: [A Flexible Multi-PoP Infrastructure Emulator for Carrier-grade MANO Systems](https://cs.uni-paderborn.de/fileadmin/informatik/fg/cn/Publications_Conference_Paper/Publications_Conference_Paper_2017/peuster_netsoft_demo_paper_2017.pdf). In IEEE 3rd Conference on Network Softwarization (NetSoft) Demo Track . (2017) **Best demo award!**
123
124 * M. Peuster and H. Karl: Profile Your Chains, Not Functions: Automated Network Service Profiling in DevOps Environments. IEEE Conference on Network Function Virtualization and Software Defined Networks (NFV-SDN), Berlin, Germany. (2017) (accepted)
125
126 ## Links
127
128 * [Mininet website](http://mininet.org)
129 * [Maxinet website](http://maxinet.github.io)
130 * [Docker](https://www.docker.com)
131
132 # [](#contact)Contact
133
134 ## Support
135 If you have any questions, please use GitHub's [issue system](https://github.com/containernet/containernet/issues) or Containernet's [Gitter channel](https://gitter.im/containernet/) to get in touch.
136
137 ## Contribute
138 Your contributions are very welcome! Please fork the GitHub repository and create a pull request. We use [Travis-CI](https://travis-ci.org/containernet/containernet) to automatically test new commits. 
139
140 ## Lead developer
141
142 Manuel Peuster
143 * Mail: <manuel (dot) peuster (at) upb (dot) de>
144 * GitHub: [@mpeuster](https://github.com/mpeuster)
145 * Website: [Paderborn University](https://cs.uni-paderborn.de/cn/person/?tx_upbperson_personsite%5BpersonId%5D=13271&tx_upbperson_personsite%5Bcontroller%5D=Person&cHash=bafec92c0ada0bdfe8af6e2ed99efb4e)