Simulation scripts on real OFCTL

Tutorial no 4

                   Here we will run scripts that we have ran during simulation session. There will not be any big difference. Remember each  time you have to start openflow so I will avoide this step and show you how to handle with controller. Let’s start with some default scripts.

1) Hub.py

Start openflow

Start controller

python pox.py log.level – -DEBUG forwarding.hub openflow.keepalive

hub

Verify result with ping and tcpdump utility. Also hubifying on controller.

2) L2_learning.py

Start openflow

Start controller

python pox.py log.level – -DEBUG forwarding.l2_learning openflow.keepalive

l2_learning

Verify result with ping and tcpdump utility. Also MAC learning on controller,

3) L3_learning.py

Start openflow

Start controller

python pox.py log.level – -DEBUG forwarding.l3_learning fakeways=192.168.10.1,192.168.50.1 openflow.keepalive

l3_learning

Assign IP from different network(I have used from 192.168.10.0 & 192.168.50.0) to hosts and give fake gateways since openflow doesn’t care about gateways its juast to keep hosts happy. Verify result with ping and tcpdump utility. Also observe ARPing on controller.

4) L2_firewall.py

Firewall script available here download and save it. I have saved in pox>pox>forwarding folder. Edit MAC of hosts as needed. It forward packets listed in script and drops others.

Start openflow

Start controller

python pox.py log.level – -DEBUG forwarding.l2_learning openflow.keepalive

l2_firewall

MAC address 00:26:82:cd:dd:d5 is listed in script hence packets related to it are forwarded else dropped.

5) Port_blocker.py

Download script from here save in pox>pox>ext folder. I have saved with name blocker.py, Also you have to pass port number parameter. I have given port number 8080.

Start openflow

Start controller

python pox.py log.level – -DEBUG forwarding.l2_learning blocker –ports=8080

port_blocker

Verify result by requesting 8080 or HTTP service from host. You can see 8080 packets are get blocked.

6) dhcpd.py

Start openflow

Start controller

python pox.py log.level – -DEBUG proto.dhcpd –-network=10.1.1.0/24 –-ip=10.1.1.1 -–first10 –-last=None –-router=None –-dns=4.2.2.1 openflow.keepalive

dhcp

You can see two IP addresses from given IP network are leased.