All posts by admin2

Hub

Note: Google Drive links may not work or might be expired. You can find the scripts here

Tutorial no 3

Testing layer 1 script hub.py

      Hub is physical layer dumb device which forward packets from incoming ports to all ports except incoming one. So we will design topology first then run hub.py script on controller and check the results.

1) To create topology we can use commands since we don’t have GUI like packet tracer right now. Start mininet in virtual box. Following command will give interface address of virtual machine.

ifconfig –a

eth0 Host-only interface and eth1 NAT interface.

2) Now to access VM from host machine, ssh to eth0 [host-only] interface. In my case, eth0 interface ip is 192.168.56.101 . password: mininet To create topology.

sudo mn – -topo single,8 –mac –switch ovsk –controller remote

{ sudo mn:- running mininet as root topo
single,8:- topology with single switch & 8 hosts
mac:-set mac automatically using ip
switch ovsk:- switch type is ovsk
controller remote:- controller running outside (remote) }

1

So we have single switch with one controller and eight hosts.

3) Lets check ping reachability using command pingall. We will not get connectivity since we haven’t run any script on controller.

2

4) Now we will run script for hub. SSH into mininet again.
cd pox
sudo python pox.py log.level –DEBUG forwarding.hub

And you can see we got connectivity between hosts.

4

5) To see flooding result we are going to use xterm and tcpdump utilities.
xterm h1 h2 h3
this command will give us windows for hosts
5

6)    sudo tcpdump –XX –i h1-eth0
        sudo tcpdump –XX –i h2-eth0
This will allow host to see ping reply

6

7) Our host has ip addresses
10.0.0.1
10.0.0.2
10.0.0.3
.
.
10.0.0.8
Lets ping host2 from host3

7
Here you can see host1 too gives ICMP echo reply i.e. flooding