Examples of using MiniNAM to Visualize Mininet Networks


We provide three distinct network protocol examples to illustrate the usage of MiniNAM. These three examples are:

  1. LOAD BALANCER: This example uses Ryu SDN controller to implement Server Load Balancing. This example is a part of Open-State SDN Project.
  2. NAT: This example uses the simple linuxrouter example provided in Mininet to create a network with one NAT-enabled router connected to three switches.
  3. ROUTING: Taken from Spanning Tree in Ryu conrtoller, this example creates a network with multiple paths between hosts. If a path is broken, the controller tries and updates the path, if possible.

For each example, two cases are provided. One with good and correctly working code and the other with some faulty logic. The good case demonstrates how MiniNAM can help in understanding or analyzing network concepts. The bad case shows how MiniNAM can be useful in debugging faulty network protocols.


Setting Up Examples

The easiest way to set up these examples is to download and use the pre-configured VM which includes all the tools and dependencies required to run these examples. (A link will be provided soon.)

To manually set up the examples, follow the instructions below:

  1. Make sure you have Mininet installed on your machine. 
  2. Download and install Ryu SDN controller.
  3. OpenState is needed for Load Balancing example. OpenState can be installed using this command:

    $ bash -c "$(wget -O - http://openstate-sdn.org/install.sh)"

  4. Download MiniNAM.tar.gz and extract it. It includes all our files that we use in these examples.
  5. Install paping that allows to ping specific ports. The paping binary is included in MiniNAM directory. Just set permissions for it:
  6. $ sudo chmod +x paping"

  7. Files goodNAT.py and badNAT.py in MiniNAM directory will be used to create networks for NAT example.
  8. The spanning_tree.py file in MiniNAM directory is for creating network for Routing example.
  9. The simple_switch_stp_13.py file is the controller app for Routing example. Place it in ryu app directory (/ryu/ryu/app/).
  10. MiniNAM binary is a one-file binary that includes MiniNAM tool. Set permissions for it:

    $ sudo chmod +x MiniNAM"

  11. You are all set. If you encounter any problems, you can always go through the webpages of Server Load Balancing or Spanning Tree Routing examples.

Running Examples

LOAD BALANCER

NAT

ROUTING

  1. Launch server load balancing controller application in Mininet by typing the following command:
    $ ryu-manager ~/ryu/ryu/app/openstate/forwarding_consistency_1_to_many.py
  2. cd to the directory where you have MiniNAM (/Desktop/MiniNAM in the provided VM). Start MiniNAM with a single topology with 4 hosts:
    $ sudo ./MiniNAM --topo single,4 --mac --switch ovsk --controller remote
    As sudo is must for Mininet therefore MiniNAM should also always be run with sudo.
  3. Open terminals for h1, h2, h3, h4 by right-clicking them and clicking on 'Open Terminal'.
  4. Write inside the terminals of h2-h3-h4 the following commands to start the Echo Servers:
    h2#  python ~/ryu/ryu/app/openstate/echo_server.py 200
    h3#  python ~/ryu/ryu/app/openstate/echo_server.py 300
    h4#  python ~/ryu/ryu/app/openstate/echo_server.py 400
  5. Open terminal for h1 by right-clicking on it. Enter the following command:
    h1#  ./paping 10.0.0.2 -p 80 -c 20
    This will send 20 pings to servers. The load balancing of servers can be monitored in MiniNAM with pings divided among three servers.
  6. To check how many packets a certain server/node has sent or received, just hover the mouse over that node. Full statistics of all interfaces can also be seen by using 'Show interface Summary' in the Run menu.
  1. Make sure that goodNAT.py and badNAT.py are in the same directory as MiniNAM binary.
  2. Start MiniNAM with custom topology using goodNAT.py or badNAT.py: 
    $ sudo ./MiniNAM --custom goodNAT.py --topo mytopo
    $ sudo ./MiniNAM --custom badNAT.py --topo mytopo 
  3. To observe NAT, it is a good idea to look at the IP address of packets and view it change when crossing the router. Enable that option from Preferences in the Edit menu.
  4. Open terminal for h1 (and/or h2) by right-clicking its icon and clicking on 'Open Terminal'.
  5. Send some pings to h3 from h1 (or h2):
    h1#  ping 10.0.0.100 -c 3
  6. ICMP packets can be observed travelling from h1 (or h2) to h3 and the IP address changing at the router.
  7. For badNAT.py the forwarding rule is not installed correctly and hence packets will be unable to pass through the router.
  1. Make sure that spanning_tree.py is in the same directory as MiniNAM binary.
  2. Start MiniNAM with custom topology using spanning_tree.py and a remote controller: 
    $ sudo ./MiniNAM --custom spanning_tree.py --topo mytopo --controller remote
  3. Set the created switches to use OpenFlow1.3:
    # ovs-vsctl set Bridge s1 protocols=OpenFlow13
    # ovs-vsctl set Bridge s2 protocols=OpenFlow13
    # ovs-vsctl set Bridge s3 protocols=OpenFlow13
  4. Configure Preferences in the Edit menu as desired.
  5. Start the controller as follows: 
    $ ryu-manager ./simple_switch_stp_13.py
  6. Open terminal for h1 by right-clicking its icon and clicking on 'Open Terminal'.
  7. Send some pings to h2 from h1:
    h1#  ping 10.0.0.2 -c 5
  8. ICMP packets can be observed travelling from h1 to h2 through the shortest path. (Once the controller is configured which can take a while.)
  9. Now right-click on the link between s1 and s2 and click on Link Down to simulate a broken link. The controller will re-configure switches to update the path.
  10. Send some pings to h2 from h1 and you can observe ICMP packets flowing through the alternate path. 

Screenshots of MiniNAM Examples

LOAD BALANCER

NAT

ROUTING

MiniNAM: Load Balancer Example
The traffic from three servers (h2,h3,h4) can be viewed in different colors traveling towards the client.
MiniNAM: NAT Example
The change in IP address of packets can be seen once a packet crosses router r0.
MiniNAM: Routing Example
A broken data link (shown in dotted) results in packets following a different route (s1-s3-s2).

Video Demos/Tutorials

LOAD BALANCER

NAT

ROUTING


Last update: Sun 31 July 2016   16:20:00 GMT
Mail any comments or suggestions to Ahmed Khalid