Commit 071af813 authored by Martín Ferrari's avatar Martín Ferrari

Template for the lightning talk at DC12.

parent 223ef2ea
IMGS = openlogo.svg
PDF_IMGS := $(patsubst %.svg,%.pdf,$(patsubst %.dia,%.pdf,$(IMGS)))
DVI_IMGS := $(patsubst %.svg,%.eps,$(patsubst %.dia,%.eps,$(IMGS)))
ALL = nemu.pdf
all: $(ALL)
%.eps: %.dia
inkscape -E $@ $<
%.pdf: %.dia
inkscape -A $@ $<
%.eps: %.svg
inkscape -E $@ $<
%.pdf: %.svg
inkscape -A $@ $<
%.ps: %.dvi
dvips $<
nemu.dvi: nemu.tex $(DVI_IMGS)
latex $<
latex $<
nemu.pdf: nemu.tex $(PDF_IMGS)
pdflatex $<
pdflatex $<
clean:
rm -f $(PDF_IMGS) $(DVI_IMGS) *.aux *.out *.log *.dvi *.nav *.snm \
*.toc *.vrb *.bak $(ALL)
% vim:ts=2:sw=2:et:ai:sts=2
\documentclass{beamer}
\mode<presentation>
{
\usetheme{Boadilla} % simple
\usecolortheme{seahorse}
\useinnertheme{rectangles}
}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[normalem]{ulem}
\DeclareRobustCommand{\hsout}[1]{\texorpdfstring{\sout{#1}}{#1}}
\pgfdeclareimage[height=0.5cm]{debian-logo}{openlogo}
\pgfdeclareimage[height=2cm]{debian-logo-big}{openlogo}
\title{Introducing Nemu}
\subtitle{Network EMUlator in a \hsout{box} Python library}
\author{Martín Ferrari}
\institute[DebConf 12]{\pgfuseimage{debian-logo-big}}
\date{July 14, 2012}
\subject{Talks}
\logo{\pgfuseimage{debian-logo}}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{What is Nemu?}
\begin{itemize}
\item A \alert{python} library,
\item to create \alert{emulated networks},
\item and run \alert{tests and experiments}
\item that can be \alert{repeated}.
\item[]{}
\item[] \em{A by-product of research that found a practical use.}
\end{itemize}
\end{frame}
\begin{frame}{What can I use it for?}
\begin{itemize}
\item Test your new peer-to-peer application.
\item[] \small{\em{Run 50 instances in your machine!}}
\vfill
\item Observe behaviour on unreliable networks.
\item[] \small{\em{Configure packet loss, delay, throughput...}}
\vfill
\item Justify your changes with experimental data.
\item[] \small{\em{Make your script output nice GNUPlot graphs!}}
\vfill
\item Verify configuration changes before applying to the production network.
\item[] \small{\em{Change iptables and routing configuration with
confidence!}}
\vfill
\item Distribute your experiment/test easily, no configuration needed!
\item[] \small{\em{Here, execute this and see for yourself!}}
\end{itemize}
\end{frame}
\begin{frame}{Resources}
Related projects:\\
\begin{itemize}
\item NEPI: original project that spawned the development of Nemu.\\
High-level network description, GUI, multiple back-ends.
\item Mininet: similar project from Stanford, developed at the same time.
\end{itemize}
\hfill
Links:\\
\begin{itemize}
\item Nemu homepage: http://code.google.com/p/nemu/
\item NEPI homepage: http://nepi.pl.sophia.inria.fr/
\item Mailing list: http://groups.google.com/group/nemu-devel
\end{itemize}
\end{frame}
\end{document}
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 10.0, SVG Export Plug-In . SVG Version: 3.0.0 Build 77) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg
xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" i:viewOrigin="251 467" i:rulerOrigin="0 0" i:pageBounds="0 792 612 0"
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
width="108.758" height="144.133" viewBox="0 0 108.758 144.133" overflow="visible" enable-background="new 0 0 108.758 144.133"
xml:space="preserve">
<metadata>
<variableSets xmlns="&ns_vars;">
<variableSet varSetName="binding1" locked="none">
<variables></variables>
<v:sampleDataSets xmlns="&ns_custom;" xmlns:v="&ns_vars;"></v:sampleDataSets>
</variableSet>
</variableSets>
<sfw xmlns="&ns_sfw;">
<slices></slices>
<sliceSourceBounds y="322.867" x="251" width="108.758" height="144.133" bottomLeftOrigin="true"></sliceSourceBounds>
</sfw>
</metadata>
<g id="Layer_1" i:layer="yes" i:dimmedPercent="50" i:rgbTrio="#4F008000FFFF">
<g>
<path i:knockout="Off" fill="#D70751" d="M60.969,47.645c-1.494,0.02,0.281,0.768,2.232,1.069
c0.541-0.422,1.027-0.846,1.463-1.26C63.451,47.751,62.215,47.758,60.969,47.645"/>
<path i:knockout="Off" fill="#D70751" d="M68.986,45.646c0.893-1.229,1.541-2.573,1.77-3.963
c-0.201,0.99-0.736,1.845-1.244,2.749c-2.793,1.759-0.264-1.044-0.002-2.111C66.508,46.104,69.096,44.589,68.986,45.646"/>
<path i:knockout="Off" fill="#D70751" d="M71.949,37.942c0.182-2.691-0.529-1.839-0.768-0.814
C71.459,37.274,71.68,39.026,71.949,37.942"/>
<path i:knockout="Off" fill="#D70751" d="M55.301,1.163c0.798,0.142,1.724,0.252,1.591,0.443
C57.768,1.413,57.965,1.239,55.301,1.163"/>
<path i:knockout="Off" fill="#D70751" d="M56.893,1.606l-0.561,0.117l0.523-0.048L56.893,1.606"/>
<path i:knockout="Off" fill="#D70751" d="M81.762,38.962c0.09,2.416-0.705,3.59-1.424,5.666l-1.293,0.643
c-1.057,2.054,0.105,1.304-0.652,2.937c-1.652,1.467-5.006,4.589-6.08,4.875c-0.785-0.017,0.531-0.926,0.703-1.281
c-2.209,1.516-1.773,2.276-5.152,3.199l-0.098-0.221c-8.33,3.92-19.902-3.847-19.75-14.443c-0.088,0.672-0.253,0.504-0.437,0.774
c-0.43-5.451,2.518-10.926,7.49-13.165c4.863-2.406,10.564-1.42,14.045,1.829c-1.912-2.506-5.721-5.163-10.232-4.917
c-4.421,0.072-8.558,2.881-9.938,5.932c-2.264,1.425-2.528,5.496-3.514,6.242c-1.329,9.76,2.497,13.975,8.97,18.936
c1.016,0.686,0.286,0.791,0.422,1.313c-2.15-1.006-4.118-2.526-5.738-4.387c0.86,1.257,1.787,2.479,2.986,3.439
c-2.029-0.685-4.738-4.913-5.527-5.085c3.495,6.258,14.178,10.975,19.775,8.634c-2.59,0.096-5.879,0.053-8.787-1.022
c-1.225-0.629-2.884-1.93-2.587-2.173c7.636,2.851,15.522,2.158,22.128-3.137c1.682-1.31,3.518-3.537,4.049-3.567
c-0.799,1.202,0.137,0.578-0.477,1.639c1.672-2.701-0.729-1.1,1.73-4.664l0.908,1.25c-0.34-2.244,2.785-4.966,2.467-8.512
c0.717-1.084,0.799,1.168,0.039,3.662c1.055-2.767,0.279-3.212,0.549-5.496c0.291,0.768,0.678,1.583,0.875,2.394
c-0.688-2.675,0.703-4.503,1.049-6.058c-0.342-0.15-1.061,1.182-1.227-1.976c0.025-1.372,0.383-0.719,0.52-1.057
c-0.268-0.155-0.975-1.207-1.404-3.224c0.309-0.475,0.832,1.229,1.256,1.298c-0.273-1.603-0.742-2.826-0.762-4.057
c-1.24-2.59-0.439,0.346-1.443-1.112c-1.32-4.114,1.094-0.955,1.258-2.823c1.998,2.895,3.137,7.385,3.662,9.244
c-0.4-2.267-1.045-4.464-1.834-6.589c0.609,0.257-0.979-4.663,0.791-1.405c-1.889-6.945-8.078-13.435-13.773-16.479
c0.695,0.637,1.574,1.437,1.26,1.563c-2.834-1.685-2.336-1.818-2.742-2.53c-2.305-0.939-2.459,0.077-3.984,0.002
c-4.35-2.308-5.188-2.063-9.191-3.507l0.182,0.852c-2.881-0.96-3.357,0.362-6.47,0.002c-0.189-0.147,0.998-0.536,1.976-0.677
c-2.786,0.368-2.656-0.55-5.382,0.101c0.671-0.471,1.383-0.784,2.099-1.184c-2.271,0.138-5.424,1.322-4.451,0.244
c-3.705,1.654-10.286,3.975-13.979,7.438l-0.116-0.776c-1.692,2.031-7.379,6.066-7.832,8.699l-0.453,0.105
c-0.879,1.491-1.45,3.18-2.148,4.713c-1.151,1.963-1.688,0.756-1.524,1.064c-2.265,4.592-3.392,8.45-4.363,11.616
c0.692,1.035,0.017,6.232,0.278,10.391c-1.136,20.544,14.418,40.489,31.42,45.093c2.492,0.893,6.197,0.861,9.349,0.949
c-3.718-1.064-4.198-0.563-7.822-1.826c-2.613-1.232-3.185-2.637-5.037-4.244l0.733,1.295c-3.63-1.285-2.111-1.59-5.065-2.525
l0.783-1.021c-1.177-0.09-3.117-1.982-3.647-3.033l-1.288,0.051c-1.546-1.906-2.371-3.283-2.31-4.35l-0.416,0.742
c-0.471-0.809-5.691-7.158-2.983-5.68c-0.503-0.458-1.172-0.747-1.897-2.066l0.551-0.629c-1.301-1.677-2.398-3.826-2.314-4.542
c0.695,0.938,1.177,1.114,1.655,1.275c-3.291-8.164-3.476-0.449-5.967-8.31l0.526-0.042c-0.403-0.611-0.65-1.27-0.974-1.919
l0.23-2.285c-2.368-2.736-0.662-11.645-0.319-16.53c0.235-1.986,1.977-4.101,3.3-7.418l-0.806-0.138
c1.542-2.688,8.802-10.799,12.166-10.383c1.629-2.046-0.324-0.008-0.643-0.522c3.579-3.703,4.704-2.616,7.119-3.283
c2.603-1.545-2.235,0.604-1.001-0.589c4.503-1.149,3.19-2.614,9.063-3.197c0.62,0.352-1.437,0.544-1.953,1.001
c3.75-1.836,11.869-1.417,17.145,1.018c6.117,2.861,12.994,11.314,13.266,19.267l0.309,0.083
c-0.156,3.162,0.484,6.819-0.627,10.177L81.762,38.962"/>
<path i:knockout="Off" fill="#D70751" d="M44.658,49.695l-0.211,1.047c0.983,1.335,1.763,2.781,3.016,3.821
C46.561,52.804,45.892,52.077,44.658,49.695"/>
<path i:knockout="Off" fill="#D70751" d="M46.979,49.605c-0.52-0.576-0.826-1.268-1.172-1.956
c0.33,1.211,1.006,2.252,1.633,3.312L46.979,49.605"/>
<path i:knockout="Off" fill="#D70751" d="M88.063,40.675l-0.219,0.552c-0.402,2.858-1.273,5.686-2.605,8.309
C86.711,46.769,87.66,43.742,88.063,40.675"/>
<path i:knockout="Off" fill="#D70751" d="M55.598,0.446C56.607,0.077,58.08,0.243,59.154,0c-1.398,0.117-2.789,0.187-4.162,0.362
L55.598,0.446"/>
<path i:knockout="Off" fill="#D70751" d="M20.127,19.308c0.233,2.154-1.62,2.991,0.41,1.569
C21.627,18.423,20.113,20.2,20.127,19.308"/>
<path i:knockout="Off" fill="#D70751" d="M17.739,29.282c0.469-1.437,0.553-2.299,0.732-3.132
C17.178,27.804,17.875,28.157,17.739,29.282"/>
<path i:knockout="Off" d="M13.437,125.506c-0.045,0.047-0.045,7.506-0.138,9.453c-0.092,1.574-0.232,4.957-3.568,4.957
c-3.429,0-4.263-3.939-4.541-5.652c-0.324-1.9-0.324-3.477-0.324-4.17c0-2.225,0.139-8.436,5.375-8.436
c1.576,0,2.456,0.465,3.151,0.834L13.437,125.506z M0,130.975c0,13.066,6.951,13.066,7.97,13.066
c2.873,0,4.727-1.576,5.514-4.309l0.093,4.123c0.881-0.047,1.761-0.139,3.197-0.139c0.51,0,0.926,0,1.298,0.047
c0.371,0,0.741,0.045,1.158,0.092c-0.741-1.482-1.297-4.818-1.297-12.049c0-7.043,0-18.951,0.602-22.566
c-1.667,0.789-3.105,1.299-6.256,1.576c1.251,1.344,1.251,2.039,1.251,8.154c-0.879-0.277-1.992-0.602-3.892-0.602
C1.344,118.369,0,125.598,0,130.975"/>
<path i:knockout="Off" d="M25.13,128.609c0.047-3.846,0.835-7.275,4.124-7.275c3.615,0,3.891,3.984,3.799,7.275H25.13z
M37.64,129.074c0-5.422-1.065-10.752-7.923-10.752c-9.452,0-9.452,10.475-9.452,12.697c0,9.406,4.216,13.113,11.306,13.113
c3.149,0,4.68-0.461,5.514-0.695c-0.046-1.668,0.185-2.734,0.465-4.17c-0.975,0.604-2.226,1.391-5.006,1.391
c-7.229,0-7.322-6.582-7.322-8.852H37.55L37.64,129.074"/>
<path i:knockout="Off" d="M52.715,131.066c0,4.309-0.787,10.102-6.162,10.102c-0.742,0-1.668-0.141-2.27-0.279
c-0.093-1.668-0.093-4.541-0.093-7.877c0-3.986,0.416-6.068,0.742-7.09c0.972-3.289,3.15-3.334,3.566-3.334
C52.02,122.588,52.715,127.453,52.715,131.066z M39.417,136.117c0,3.43,0,5.375-0.556,6.857c1.9,0.742,4.262,1.158,7.09,1.158
c1.807,0,7.043,0,9.869-5.791c1.344-2.688,1.807-6.303,1.807-9.037c0-1.668-0.186-5.328-1.529-7.646
c-1.296-2.176-3.382-3.289-5.605-3.289c-4.449,0-5.746,3.707-6.44,5.607c0-2.363,0.045-10.611,0.415-14.828
c-3.011,1.391-4.866,1.621-6.857,1.807c1.807,0.74,1.807,3.801,1.807,13.764V136.117"/>
<path i:knockout="Off" d="M66.535,143.855c-0.928-0.139-1.578-0.232-2.922-0.232c-1.48,0-2.502,0.094-3.566,0.232
c0.463-0.881,0.648-1.299,0.787-4.309c0.186-4.125,0.232-15.154-0.092-17.471c-0.232-1.762-0.648-2.039-1.297-2.502
c3.799-0.371,4.865-0.648,6.625-1.482c-0.369,2.037-0.418,3.059-0.418,6.162C65.561,140.242,65.514,141.955,66.535,143.855"/>
<path i:knockout="Off" d="M81.373,130.74c-0.092,2.92-0.139,4.959-0.928,6.58c-0.973,2.086-2.594,2.688-3.799,2.688
c-2.783,0-3.383-2.316-3.383-4.586c0-4.355,3.893-4.682,5.652-4.682H81.373z M68.629,136.441c0,2.92,0.881,5.838,3.477,7.09
c1.158,0.51,2.316,0.51,2.688,0.51c4.264,0,5.699-3.152,6.58-5.098c-0.047,2.039,0,3.289,0.139,4.912
c0.834-0.047,1.668-0.139,3.059-0.139c0.787,0,1.529,0.092,2.316,0.139c-0.51-0.787-0.787-1.252-0.928-3.059
c-0.092-1.76-0.092-3.521-0.092-5.977l0.047-9.453c0-3.523-0.928-6.998-7.879-6.998c-4.586,0-7.273,1.391-8.617,2.086
c0.557,1.02,1.02,1.898,1.436,3.893c1.809-1.576,4.172-2.41,6.58-2.41c3.848,0,3.848,2.549,3.848,6.162
c-0.881-0.045-1.623-0.137-2.875-0.137C72.521,127.963,68.629,130.23,68.629,136.441"/>
<path i:knockout="Off" d="M108.063,139.268c0.047,1.576,0.047,3.244,0.695,4.588c-1.021-0.092-1.623-0.232-3.521-0.232
c-1.113,0-1.715,0.094-2.596,0.232c0.184-0.602,0.279-0.834,0.371-1.623c0.139-1.064,0.232-4.633,0.232-5.885v-5.004
c0-2.178,0-5.33-0.141-6.441c-0.092-0.787-0.322-2.918-3.012-2.918c-2.641,0-3.521,1.945-3.846,3.521
c-0.369,1.621-0.369,3.383-0.369,10.24c0.045,5.932,0.045,6.486,0.508,8.109c-0.787-0.092-1.76-0.184-3.15-0.184
c-1.113,0-1.854,0.045-2.779,0.184c0.324-0.742,0.51-1.113,0.602-3.707c0.094-2.549,0.279-15.061-0.141-18.025
c-0.23-1.809-0.695-2.225-1.203-2.688c3.754-0.186,4.957-0.789,6.117-1.389v4.91c0.555-1.438,1.713-4.635,6.348-4.635
c5.793,0,5.838,4.217,5.885,6.996V139.268"/>
<path i:knockout="Off" fill="#D70751" d="M66.926,111.533l-3.838,3.836l-3.836-3.836l3.836-3.836L66.926,111.533"/>
</g>
</g>
</svg>
#!/usr/bin/env python
# vim:ts=4:sw=4:et:ai:sts=4
import os, nemu, subprocess, time
xterm = nemu.environ.find_bin("xterm")
X = "DISPLAY" in os.environ and xterm
# each Node is a netns
node = []
switch = []
iface = {}
SIZE = 5
for i in range(SIZE):
node.append(nemu.Node(forward_X11 = X))
next_pair = (i, i + 1)
prev_pair = (i, i - 1)
if i < SIZE - 1:
iface[(i, i + 1)] = nemu.NodeInterface(node[i])
iface[(i, i + 1)].up = True
iface[(i, i + 1)].add_v4_address(address='10.0.%d.1' % i, prefix_len=24)
if i > 0:
iface[(i, i - 1)] = nemu.NodeInterface(node[i])
iface[(i, i - 1)].up = True
iface[(i, i - 1)].add_v4_address(address='10.0.%d.2' % (i - 1),
prefix_len=24)
switch.append(nemu.Switch())
switch[-1].connect(iface[(i, i - 1)], iface[(i - 1, i)])
switch[-1].up = True
# Configure routing
if i < SIZE - 2:
node[i].add_route(prefix='10.0.%d.0' % (SIZE - 2), prefix_len=24,
nexthop='10.0.%d.2' % i)
if i > 1:
node[i].add_route(prefix='10.0.0.0', prefix_len=24,
nexthop='10.0.%d.1' % i - 1)
print "Nodes started with pids: %s" % str([n.pid for n in nodes])
#switch0 = nemu.Switch(
# bandwidth = 100 * 1024 * 1024,
# delay = 0.1, # 100 ms
# delay_jitter = 0.01, # 10ms
# delay_correlation = 0.25, # 25% correlation
# loss = 0.005)
# Test connectivity first. Run process, hide output and check
# return code
null = file("/dev/null", "w")
app0 = node[0].Popen("ping -c 1 10.0.%d.2" % (SIZE - 2), shell=True,
stdout=null)
ret = app0.wait()
assert ret == 0
app1 = node[-1].Popen("ping -c 1 10.0.0.1", shell = True, stdout = null)
ret = app1.wait()
assert ret == 0
print "Connectivity IPv4 OK!"
if X:
app1 = node1.Popen("%s -geometry -0+0 -e %s -ni %s" %
(xterm, nemu.environ.TCPDUMP_PATH, if1b.name), shell = True)
time.sleep(3)
app0 = node0.Popen("%s -geometry +0+0 -e ping -c 10 10.0.1.2" % xterm,
shell = True)
app0.wait()
app1.signal()
app1.wait()
# Now test the network conditions
# When using a args list, the shell is not needed
app2 = node2.Popen(["ping", "-q", "-c100000", "-f", "10.0.1.2"],
stdout = subprocess.PIPE)
out, err = app2.communicate()
print "Ping outout:"
print out
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment