Coder Social home page Coder Social logo

nctulab2's Introduction

Network Topology with Mininet

This repository is lab for NCTU course "Introduction to Computer Networks 2018".


Abstract

In this lab, we are going to write a Python program which can generate a network topology using Mininet and use iPerf to measure the bandwidth of the topology.


Objectives

  1. Learn how to create a network topology with Mininet
  2. Learn how to measure the bandwidth in your network topology with iPerf

Execution

TODO:

  • Describe how to execute your program
  • Show the screenshot of using iPerf command in Mininet
  1. First run the topology.py by " [sudo] chmod +x topology.py "
  2. then can run by " [sudo] ./topology.py "
  3. after running , it will enter to Mininet's CLI mode
  4. use iPerf command to measure the topology

screenshot for using iPerf command in Mininet


Description

Mininet API in Python

TODO:

  • Describe the meaning of Mininet API in Python you used in detail
  • Mininet(topo= , link= , controller= ): Create Mininet object

  • addSwitch(): Add switch to topo

  • addHost(): Add host to topo

  • addLink(node1 , node2, bw= , delay= , loss= ): node2 link with node1 (bidirectional)


  • setLogLevel(): Setup loglevel (Convenience function to support lowercase names) 參數: 'info' / 'debug' / 'output'

  • dumpNodeConnections(): dump connections to/from a set of nodes

  • pingAll(): Ping between all hosts >> 檢測網路互通性


  • start(): Start controller and switches
  • stop(): Stop the controller(s), switches and hosts
  • CLI(Mininet object): Start and run interactive or batch mode CLI

  • TClink & OvScontroller for creating Mininet object's parameter

iPerf Commands

TODO:

  • Describe the meaning of iPerf command you used in detail
  • iPerf is a tool for measuring bandwidth on IP networks

for topo2.png , should use "h6 iperf -s -u -i 1 > ./out/result & " and "h3 iperf -c 10.0.0.6 -u -i 1"

  • -s: start up with server mode
  • -u: using UDP portocol
  • -i 1: interval time with 1 sec
  • -c 10.0.0.6: host start up with client mode (10.0.0.6 is server's address)

Tasks

TODO:

  • Describe how you finish this work step-by-step in detail
  1. Environment Setup
  • clone initial repository from github and login to container by SSH
  • run Mininet with OvS's controller ( to support topos )

if not using OvS, it will get error . By solving this error, use " service openvswitch-switch start ".

  1. Example of Mininet
  • change directory
  • change the .py into executable mode by " chmod +x example.py "

since the data in Mininet have no permission initial. +x : execute

  • then see the result of creation & connection of 2 hosts and 1 switch.
  1. Topology Generator
  • view topo2.png
  • generate topology.py by " touch topology.py " under /src/.
  • refer to example.py, finish topology.py
  • code part:
  1. create switches(numbers = 5) and hosts( = 10)
  2. construct each links (total 14 links) and set up bandwideth, delay, loss rate
  3. define simpleTest() and add two requirement in here (i) Dump every connections information (ii) Enter CLI mode instead of end the network immediatly
  1. Measurement
  • change topology.py executable as task 2 done with example.py
  • execute topology.py
  • after running , it will autoly enter into Mininet CLI mode
  • use iPerf command to test topology.py by " h6 iperf -s -u -i 1 > ./out/result & " and " h3 iperf -c 10.0.0.6 -u -i 1 "
  • it is success if loss rate is in range 13%~18%.

References

TODO:

  • Please add your references in the following

Contributors

TODO:

  • Please replace "YOUR_NAME" and "YOUR_GITHUB_LINK" into yours

License

GNU GENERAL PUBLIC LICENSE Version 3

nctulab2's People

Contributors

oao519p avatar yungshenglu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.