Lab 4 - Introduction To SDN
Lab 4 - Introduction To SDN
Award 1829698
“CyberTraining CIP: Cyberinfrastructure Expertise on High-throughput
Networks for Big Science Data Transfers”
Lab 4: Introduction to SDN
Contents
Overview ............................................................................................................................. 3
Objectives............................................................................................................................ 3
Lab settings ......................................................................................................................... 3
Lab roadmap ....................................................................................................................... 3
1 Introduction ................................................................................................................ 3
1.1 Introduction to SDN ............................................................................................. 4
1.2 SDN data plane architecture ................................................................................ 5
1.3 SDN controller architecture ................................................................................. 6
2 Lab topology................................................................................................................ 7
2.1 Lab settings........................................................................................................... 8
2.2 Loading a topology ............................................................................................... 8
3 Starting ONOS ........................................................................................................... 10
3.1 Activating ONOS OpenFlow application............................................................. 13
3.2 Activating ONOS forwarding application ........................................................... 17
4 Navigating ONOS GUI................................................................................................ 20
4.1 Accessing the web user interface....................................................................... 20
4.2 Exploring network components ......................................................................... 21
References ........................................................................................................................ 28
Page 2
Lab 4: Introduction to SDN
Overview
Objectives
Lab settings
The information in Table 1 provides the credentials to access the Client’s virtual machine.
Lab roadmap
1. Section 1: Introduction.
2. Section 2: Lab topology.
3. Section 3: Starting ONOS
4. Section 4: Navigating ONOS GUI.
1 Introduction
The Software Defined Networking (SDN) posed a significant interest from academia and
industry just in few years. The concept of an open, vendor neutral, control-data plane
Page 3
Lab 4: Introduction to SDN
interface that enables network hardware and software to be managed and designed
independently, facilitates the migration from expensive, proprietary hardware and
firmware to a free, open source Network Operating System (NOS).
A key feature of SDN consists of managing the network resources and providing the
applications for interacting, managing, monitoring and programming network switches.
The NOS is responsible to provide an open platform that simplifies the creation of
innovative and beneficial network applications and services that is compatible with a wide
range of hardware2.
SDN is an emerging networking paradigm that gives hope to change the limitations of
current network infrastructures3. It breaks the control plane from the data plane and
implements each separately. The disaggregation of the control plane and the data plane
allows network switches to become simple forwarding devices and the control logic to be
implemented in a logically centralized controller. Thus, amplifying the flexibility in the
network, breaking the network control problem into tractable pieces, introducing new
abstractions, and facilitating network evolution and innovation3.
Consider Figure 1. The data plane is responsible of managing the major part of the packets
handled by the switch. The ports in the data plane manage the reception and transmission
of packets and a forwarding table is responsible to set the logic. The data plane handles
operations such as packet buffering, packet scheduling, header modification, and
forwarding. For example, if the header of a data packet contains information that matches
the forwarding table, the data plane may perform some header field modification in order
to be forwarded offloading the intervention of the other two planes4.
Some packets cannot be processed by the data plane directly, for example, their
information is not yet inserted in the forwarding table. Such packets are forwarded to the
control plane, which lies on top of the data plane. The control plane involves many
activities, mainly to maintain the forwarding table of the data plane. Essentially, the
control plane is responsible for processing different control protocols that may affect the
forwarding table.
SDN applications run on top of the controller. They are ultimately responsible for
managing the flow table on the network devices (data plane). For example, route packets
Page 4
Lab 4: Introduction to SDN
through the best path between two endpoints, or balance traffic loads across multiple
paths4.
Software-based
Centralized Controller
Proprietary or Global
RFC compliant Topology
Control Plane
Data Plane
Header Field Action OpenFlow
interface
SrcIP = 198/8 Forward (1)
DstIP = 98.3/16 Drop
Ingress Port=1 Forward (2)
Figure 1. The control plane is embedded in a centralized server and it is decoupled from data
plane devices in SDN networks.
The standard API used to communicate with the controller is OpenFlow1, or it could be
some proprietary alternative in certain SDN solutions4.
The abstraction layer embodies one or more flow tables, which are the fundamental data
structures in an SDN device. These flow tables allow the device to evaluate incoming
packets and take the appropriate action. Flow tables consist of a number of flow entries,
each of which typically consists of two components: match fields and actions. Match fields
are used to compare against incoming packets, for example, matching against the Media
Access Control (MAC) address, User Datagram Protocol (UDP) or Transmission Control
Protocol (TCP) port. Actions are the instructions that the forwarding device should
perform if an incoming packet matches a flow entry. These actions may include
forwarding the packet to a specific port, dropping the packet, or flooding the packet on
all ports, among others4.
The packet-processing logic consists of the mechanisms to take actions based on the
results of evaluating incoming packets. In a hardware switch, these mechanisms are
Page 5
Lab 4: Introduction to SDN
To controller
API OpenFlow
Abstraction Layer
Flow Table
Packet Processing
A controller actively monitors several variables within the entire network. Additionally, it
implements policy decisions, controls all the SDN devices that comprise the network
infrastructure and provides a northbound API for the application. Also, controllers
implement policy decisions about routing, forwarding, redirecting, and load balancing.
Controllers often come with their own set of common application modules, such as a
learning switch, a router, a basic firewall, and a simple load balancer. Such features are
really SDN applications. However, they are often bundled with the controller4.
Figure 3 depicts the components of the core functionalities supported by the controller,
both a northbound and southbound API, and a few sample applications. The southbound
API is used as an interface to communicate SDN device. Frequently, this API is OpenFlow.
The controller hides several details of the SDN controller-to-device protocol so that the
applications such as the GUI, learning switch, router and others can transparently
communicate with the SDN devices. Every controller provides core functionality between
these those interfaces. Core features in the controller are4:
Page 6
Lab 4: Introduction to SDN
2 Lab topology
Consider Figure 4. The topology consists of four end-hosts, three switches and a controller.
The blue devices represent OpenFlow switches. All switches are connected to the
controller c0.
Page 7
Lab 4: Introduction to SDN
h1 h1-eth0 10.0.0.1 /8
h2 h2-eth0 10.0.0.2 /8
h3 h3-eth0 10.0.0.3 /8
h2 h4-eth0 10.0.0.4 /8
c0 n/a 127.0.0.1 /32
In this section, the user will open MiniEdit and load the lab topology. MiniEdit provides a
Graphical User Interface (GUI) that facilitates the creation and emulation of network
topologies in Mininet5. This tool has additional capabilities such as: configuring network
elements (i.e IP addresses, default gateway), save the topology and export a layer 2 model.
Page 8
Lab 4: Introduction to SDN
Step 2. On Miniedit’s menu bar, click on File then open to load the lab’s topology. Open
the Lab4.mn topology file stored in the default directory, /home/sdn/SDN_Labs /lab4 and
click on Open.
Page 9
Lab 4: Introduction to SDN
Step 3. Click on the Run button to start the emulation. The emulation will start and the
buttons of the MiniEdit panel will gray out, indicating that they are currently disabled.
3 Starting ONOS
Step 2. Navigate into SDN_Labs/lab4 directory by issuing the following command. This
folder contains the script responsible for starting ONOS. The cd command is short for
change directory followed by an argument that specifies the destination directory.
Page 10
Lab 4: Introduction to SDN
cd SDN_Labs/lab4
Step 3. A script was written to run ONOS and enter its Command Line Interface (CLI). In
order to run the script, issue the following command.
./run_onos.sh
Once the script finishes executing and ONOS is ready, you will be able to execute
commands on ONOS CLI as shown in the figure below. Note that this script may take a
couple of minutes.
Page 11
Lab 4: Introduction to SDN
Step 4. ONOS supplies a set of its own commands, in order to list all available commands,
click the TAB key.
Step 5. To confirm displaying all 401 possibilities of ONOS commands, click the TAB key
one more time. This will display all ONOS commands on the left-hand side of the CLI, as
well as their explanation on the right-hand side of the CLI.
Step 6. To display the list of all currently known flows for the ONOS controller, type the
following command.
flows
Step 7. To display the list of all currently known devices (OVS switches), type the following
command.
Page 12
Lab 4: Introduction to SDN
devices
Step 8. To display the list of all currently known hosts, type the following command.
hosts
Step 9. To display the list of all currently known links, type the following command.
links
Consider Figures 15, 16, 17, and 18. No flows, devices, hosts, or link are displayed since
we have not activated the necessary applications that allow the controller to discover
them.
In this section you will activate OpenFlow application that comes with ONOS and allows
to speak OpenFlow protocol with the devices. You will notice how the Mininet topology
becomes visible, i.e., the devices (switches), and hosts are now recognized by ONOS.
Page 13
Lab 4: Introduction to SDN
Step 1. In ONOS terminal, issue the following command to activate the OpenFlow
application.
Step 3. Once the OpenFlow application is activated, you might not get accurate results
immediately, for example, not all the hosts are discovered yet. In order to stimulate ONOS
and the activated application, perform a pingall command. This command pings from
every host in the network to all other hosts. To do so, write the following command.
pingall
Figure 21. Pinging all hosts to stimulate host discovery in the Controller.
Consider Figure 21. The connectivity test resulted in 100% dropped. The pings sent from
a host to a destination are IP packets received by a switch. For example, pinging host h2
from h1 is received by switch s1. Since there are no flows inserted that deal with IP
packets, then the packets will be dropped immediately.
Page 14
Lab 4: Introduction to SDN
Step 5. To display the list of all currently known devices (OVS switches), type the following
command.
devices
Consider Figure 23. The three switches are displayed with their corresponding ids, as well
as additional attributes, such as its status ( available=true ), the type of the switch
( hw=Open vSwitch ), and which OpenFlow version the switch is running
( protocol=OF_10 ).
Step 6. ONOS commands might have multiple options, to display the list of options for
the flows command, write the command flows and click the TAB button.
flows
Consider Figure 24. The flows command has the multiple options according to the state
of the flow, which could be:
• pending_remove : the request to remove the flow has been submitted and
forwarded to the switch.
• removed : the rule has been removed.
• any : all flows.
Step 7. To display the list of all added switches, complete the above command by writing
added , then click the TAB button.
flows added
Figure 25. Displaying the current known added flows for switch 1.
Consider Figure 25. Once you click the TAB button, ONOS CLI automatically fills the
common prefix of all the switches’ ids (000000000000000). You can also alternate
between the displayed switches’ ids using the TAB button.
Step 8. To display the list of all added flows for switch 1 (id: 00000000000001), complete
the id of the switch (you only have to enter the number 1 for switch s1) and hit enter.
Figure 26. Displaying the current known added flows for switch 1.
Consider Figure 26. Three flows for switch s1 were added. ONOS provides many details
about the flows inserted in the switches. For example, each flow entry defines a selector
and treatment which are the set of traffic matched by the flow entry and how this traffic
should be handled, respectively.
The above flows are used for link and host discovery. Notice as well that each flow entry
is tagged by an appId (application id), this appId identifies which application installed
the corresponding flow entry. Other important details include:
Step 9. To display the list of all currently known hosts, type the following command.
hosts
Consider Figure 27. Each discovered host is displayed along some details, such as the id
of the host, the location where the host is connected to (with the id of the switch), and
the IP address of it. Notice that the id of the hosts, as well as their mac address might be
different than those depicted in Figure 27, since Mininet generates new values at each
execution.
In the previous section, when performing a connectivity test, 100% of the packets were
dropped. The pings sent from a host to a destination are IP packets received by a switch,
which does not have flows that match IP packets. In this section, you will activate a simple
Page 17
Lab 4: Introduction to SDN
forwarding application that comes with ONOS. This application installs flows in response
to every miss IP packet that arrives at the controller.
Step 1. To enable the forwarding application, type the command shown below.
Step 2. To display the flows of switch s1, type the following command.
Consider Figure 29. A new flow is added with ETH_TYPE:ipv4 that deals with IPv4 packet
by forwarding them the controller ( OUTPUT:CONTROLLER ), which in turns decides the
action on the corresponding packet.
Step 3. On host h1 terminal, run a connectivity test by issuing the command shown below.
To stop the test, press Ctrl+c .
ping 10.0.0.2
Page 18
Lab 4: Introduction to SDN
Step 4. To display the flows of switch s2, type the following command on ONOS terminal.
Consider Figure 31. After pinging host h2 from h1, two flows are installed on switch s2.
The first flow ( id=5f0000d16f6a7 ) instructs the switch to forward incoming packets at
port 1 ( IN_PORT:1 ) out of port 2 ( OUTPUT:2 ). Similarly, the second flow instructs the
switch to forward the packets from port 2 to port 1. The inserted flows allow switch s1 to
exchange packets between hosts h1 and h2 without relaying them to the controller.
Note that these two flows expire after a certain duration. This is because the forwarding
application sets an expiry time for the inserted flows to avoid overflowing the flow table
of the switches.
Page 19
Lab 4: Introduction to SDN
The ONOS GUI is a single-page web-application, providing a visual interface to the ONOS
controller. In this section, you will navigate through ONOS GUI and discover a number of
its features.
Step 1. Open the web browser by clicking on the shortcut located in the lower left-hand
side.
Step 2. Navigate to the following URL to access ONOS web user interface:
localhost:8181/onos/ui
Step 3. Provide the following credentials to access the web user interface:
• User: onos
• Password: rocks
Page 20
Lab 4: Introduction to SDN
Notice that the network components will show up in a random arrangement. The user
can click on the components and drag them to their preferred location.
ONOS web user interface provides the tools to monitor the specification of each device
that comprises the network.
Step 1. To open ONOS menu, click on the upper left-hand side icon. A drop-down menu
will be displayed. To check the devices, click on devices. A new window will emerge.
Page 21
Lab 4: Introduction to SDN
The emerging window will display three devices. Those three devices correspond to the
three switches that compounds the topology. The information provided in the GUI
include:
Page 22
Lab 4: Introduction to SDN
Step 2. From the menu list, click on hosts to verify the hosts’ information.
Similarly, the new window presents the information regarding the hosts that compound
the topology. The information provided in the GUI include:
Page 23
Lab 4: Introduction to SDN
Step 4. Click on the bar located in the lower left-hand side. A toolbox will show up. Select
the host icon to see the hosts connected to the topology.
Page 24
Lab 4: Introduction to SDN
Consider Figure 42. The information attached to the hosts include their IP addresses.
Step 6. To view a summary of a specific device, you can click on that device as shown in
the figure below.
Page 25
Lab 4: Introduction to SDN
Consider Figure 43. Upon clicking on switch s1, a panel opens on the right-hand side of
the topology. The panel displays a summary of the device. For example, if it is a switch, it
would display information such the name, number of ports, and flows in that switch.
Step 7. From the menu list, click on Applications to load the applications available in ONOS.
Consider Figure 45. A list of all the available applications is displayed. The activated
applications are checked in green (e.g., Default Drivers application), whereas the
deactivated applications are marked with a red square (e.g., Access Control Lists
application). Note that the activated applications are a result of activating the OpenFlow
and the forwarding application.
Step 8. To deactivate an application, you can click on the application, hit the deactivation
button (gray square on the right-hand side of the window), then confirm the operation.
The steps are shown in the below figure, where we deactivate the forwarding application
(reactive forwarding).
Step 9. To activate an application, you can click on the application, hit the activation
button (gray arrow on the right-hand side of the window), then confirm the operation.
The steps are shown in the below figure, where we activate the forwarding application
(reactive forwarding).
Page 27
Lab 4: Introduction to SDN
This concludes Lab 4. Stop the emulation and then exit out of MiniEdit and Linux terminal.
References
Page 28