Day 3 Session 2: Building an SDN network

In this session, we shall initially be building a basic SDN network with 1 Controller, 1 Zodiac FX switch and 2 Hosts. Later, we shall look into how OpenFlow protocol installs flows in the Zodiac FX switch using 2 software packages:

  • putty
  • Wireshark
After this, we shall create DDoS attacks and see how the controller reacts. We shall also see how to detect DDoS attacks from the controller.

Here is a recap of Day 2, which is necessary to understand tomorrow's session:

Step 1: Connect a USB cable to power the Zodiac FX switch and the other end to the laptop. Note that the Zodiac FX switch can be powered from any device and not just the controller.

Step 2: Open a terminal and execute the command

dmesg | grep tty

Note the port of the system the USB ACM device is connected to. It's usually ttyACM0 or ttyACM1.

Step 3: Open putty terminal by executing this command

sudo putty

Go to the Serial Connection Type and give /dev/ttyACM0 or /dev/ttyACM1 in the Serial line depending on the output of Step 2. Once the terminal opens, press Enter.
In case you haven't downloaded putty, type the below command:

sudo apt install putty

Step 4: Configure the switch by typing the following commands


config
show config
set name ZodiacFX1
set ip-address 192.168.1.10
set netmask 255.255.255.0
set gateway 192.168.1.20
set of-controller 192.168.1.20
save

Re-check your configuration through the `show config` command and close the putty terminal.

Step 5: Configure the controller device by connecting an Ethernet cable between the fourth port of Zodiac FX switch and ethernet port of the controller. Set the IP address of the controller -

ifconfig

(Observe the output and note the ethernet interface name)

sudo ip addr add 192.168.1.20/24 dev <interface-name>
ping 192.168.1.20 (to check if IP address is installed properly)
ping 192.168.1.10 (to check the reachability of Zodiac FX switch)

Step 6: Run the Ryu controller

cd ryu
ryu-manager ryu.app.ofctl_rest ryu.app.simple_switch_13

This was a recap of Day 2. 

Now we shall see the requirements for Day 3's session:


1. Ryu controller - Just check the below commands are executed. Just execute the below commands once again to be on the safe side. If you get any errors while executing any command, leave a comment below, I shall reply as soon as possible.

git clone git://github.com/osrg/ryu.git
cd ryu
sudo apt-get install python-dev python-pip python-setuptools 
sudo pip install .
sudo pip install webob eventlet paramiko routes

2. Hping3 - This is a software package used to create and execute DoS or DDoS attacks

sudo apt install hping3

3. Curl - Used to send REST API commands from controller to Zodiac FX switch

sudo apt install curl

4. The python code in the below link:

Once you go the link, click on the Raw button to open only the code. Copy-paste this code and create a python file and name it detect.py

Place the detect.py file in the path - ryu/ryu/app

Be ready with the above to best experience tomorrow's hands-on session.

Happy Networking!

Comments

Popular posts from this blog

Day 2 Session 1: Introduction to Zodiac FX switch