SDN Lab Manual
SDN Lab Manual
Name : …………………………………….
Semester : ……………………………………
CERTIFICATE
This is to Certify that the Bonafide record of the practical work done
by………………………………… Register Number ........................................................ of
IIIrd year B.E (Computer Science and Engineering) submitted for the B.E-Degree practical
examination (VIth Semester) in CCS365 – SOFTWARE DEFINED NETWORKS
LABORATORY during the academic year 2023 – 2024.
PAGE
SL.NO DATE NAME OF THE EXPERIMENTS SIGN
NO
3
EX: NO: 1 Setup your own virtual SDN lab
AIM:
To install virtual Box/Mininet environment for setup your own virtual Software definition network.
PROCEDURE:
Step 1 : Download Mininet from http:mininet.org and start installation.
4
Step 2 : Then open oracle VM virtual box and choose File –> Import Appliance.
Step 4 : Click Next and Type Name as Mininet , select guest OS type as ubuntu 64bit or windows 2016
64bit ,CPU as 1 and RAM as 1024MB.
5
Step 5 : Click Import
6
Step 6 : To Start Mininet. Click Start button to start a mininet…
Which takes some time to start to compile and updates of mininet in VM…
Username : mininet
password: mininet
7
Step 7: After started mininet and again go to the settings then click the NEXT, after go to “attach to”
select NAT option
Then advance to click the port forwarding. Then assign name=ssh, host port=2223,guest port=22
then click on OK.
8
Step 8: After this step open command prompt and Type cmd “>ssh Mininet@localhost -p 2223” &
password: Mininet” too see the virtual network established in virtualbox.
Type the commands $ls to list the open APIs and again use $cd Mininet to see
the mininet environment and use $exit command to exit from that network.
ii) https://www.kathara.org
iii) GNS3
Step 2: Extract the GNS3 file . then go to virtual box - import appliance
To import GNS 3.OVA
Step 3: GNS 3 loading process
9
RESULT:
10
EX.NO: 2 Create a simple mininet topology with SDN controller and use
Wireshark to visualize the OpenFlow messages such as
DATE: OpenFlow FLOW MOD, PACKET IN, PACKET OUT etc,.
AIM:
PROCEDURE:
1. Install Mininet:
Ensure you have Mininet installed on your system. You can use a Linux distribution for
this task.
2. Install Ryu SDN Controller:
Install Ryu, a popular SDN controller, using pip:
pip install ryu
3. Create the Mininet Topology:
Create a Python script (e.g., `mininet_topology.py`) to define your Mininet network
topology and start Mininet with the Ryu controller. Here's an example topology with a
single switch and two hosts:
```python
from mininet.net import Mininet
from mininet.topo import SingleSwitchTopo
from mininet.node import RemoteController
# Create a Mininet instance
net = Mininet(topo=SingleSwitchTopo(2), controller=RemoteController)
# Start Mininet
net.start()
```
4. Start the Ryu Controller:
In a separate terminal, start the Ryu controller:
```
ryu-manager
```
5. Capture OpenFlow Messages with Wireshark:
Start Wireshark and select your network interface (e.g., `eth0`).
Apply a display filter to capture only OpenFlow messages. Use the
filter expression: `of`.
Begin capturing packets by clicking the "Start" button in Wireshark.
11
To add a flow rule (FLOW_MOD):
```
mininet> h1 ovs-ofctl add-flow s1 in_port=1,actions=output:2
```
To generate traffic (PACKET_OUT):
```
mininet> h1 ping -c 1 h2
```
7. Stop Wireshark Capture:
Stop capturing packets in Wireshark when you've generated enough OpenFlow messages.
OUTPUT:
The Wireshark capture should display OpenFlow messages exchanged between the
Ryu controller and the Mininet switch. You will see messages like FLOW_MOD,
PACKET_IN, and PACKET_OUT, along with their details.
12
Use Wireshark's visualization tools to analyze and inspect the captured OpenFlow
messages. You can filter, sort, and drill down into specific messages to understand the
communication between the controller and switches.
RESULT:
This setup allows you to observe and analyze the OpenFlow messaging in a simple SDN
network. You can further customize the Mininet topology and generate more complex
OpenFlow scenarios for testing and analysis.
13
EX.NO: 3
Create a SDN application that uses the Northbound API to program flow
DATE: table rules on the , Traffic Engineering, Firewall etc
AIM:
To Develop an SDN application that uses the Northbound API to program flow table
rules on SDN switches for different use cases: L2 learning switch, Traffic Engineering, and
Firewall.
PROCEDURE:
14
OUTPUT:
• For the L2 learning switch use case, the application should program flow rules that
enable the switch to learn and forward traffic based on MAC addresses.
• In the traffic engineering use case, the application should optimize traffic paths or
prioritize certain types of traffic as per your defined rules.
• In the firewall use case, the application should allow or block traffic based on your
defined criteria.
• The application's output should include log messages or other forms of feedback,
showing that it is functioning correctly.
15
RESULT:
The result is a working SDN application that leverages the Northbound API to program flow
table rules on SDN switches for different use cases. The application should effectively
control network traffic based on the specified policies and rules.
16
EX.NO: 4 Create a simple end-to-end network service with two VNFs
Using vim-emu https://github.com/containernet/vim-emu
DATE:
AIM:
To create a simple end-to-end network service with two VNFs using vim- emu.
PROCEDURE:
1. Set Up the Environment:
Make sure you have a Linux system. You can set up a virtual machine or a dedicated
system.
- Install the required dependencies, including Docker and Docker Compose.
2. Install vim-emu:
Follow the instructions in the vim-emu GitHub repository
(https://github.com/containernet/vim-emu) to install vim-emu.
3. Create Network Topology:
Define a network topology using vim-emu. You can create a Python script that specifies
the network, VNFs, and their interconnections. For example, create a file named
`network_topology.py`:
```python
from mininet.net import Containernet
from mininet.node import Docker
from mininet.link import TCLink
from mininet.cli import CLI
net = Containernet()
17
4. Create VNF Docker Images:
Build Docker images for your VNFs. Create a `Dockerfile` for each VNF, specifying its
requirements and configurations. Build the images using Docker commands.
5. Launch the Network Topology:
Run your network topology with vim-emu:
```
sudo python network_topology.py
```
This will start the network and deploy the VNFs.
OUTPUT:
When running the network topology script with vim-emu, you should see the network
and VNFs being deployed. You can test connectivity and traffic between VNFs.
18
RESULT:
The result is a fully orchestrated end-to-end network service with two VNFs, established
using vim-emu and OSM. The network service is now ready to accept and process traffic as
specified in your descriptor.
19
EX.NO: 5
Install OSM and onboard and orchestration network service
DATE:
AIM:
To Install OSM and onboard and orchestrate the network service.
PROCEDURE:
1. Install OSM:
Follow the instructions on the OSM GitHub repository (https://osm.etsi.org) to install
OSM, which includes installing the OSM client and server components.
2. Onboard the Network Service:
Use the OSM client to onboard your network service. You'll need to provide a descriptor
(e.g., a TOSCA YAML file) for your service.
```
osm ns-create <your_network_service_descriptor_file>
```
3. Instantiate the Network Service:
Instantiate the network service using OSM:
```
osm ns-instantiate <ns-instance-name> <your_network_service_name>
```
Replace `<ns-instance-name>` with a suitable name for your instantiated service.
20
OUTPUT:
After installing OSM and onboarding the network service descriptor, you should see
your network service listed within OSM.
When instantiating the network service, OSM will orchestrate the deployment of the
VNFs and connect them according to your descriptor.
RESULT:
Thus the result of install OSM and onboard and orchestrate the network service. The network
service is now ready to accept and process traffic as specified in your descriptor.
21