See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/287216671
Network Programmability Using POX Controller
Conference Paper · August 2014
DOI: 10.13140/RG.2.1.1950.6961
CITATIONS READS
141 21,966
3 authors:
Sukhveer Kaur Japinder Singh
INTI International University Shaheed Bhagat Singh State Technical Campus
9 PUBLICATIONS 333 CITATIONS 12 PUBLICATIONS 497 CITATIONS
SEE PROFILE SEE PROFILE
Navtej Ghumman
Shaheed Bhagat Singh State University
29 PUBLICATIONS 517 CITATIONS
SEE PROFILE
All content following this page was uploaded by Japinder Singh on 18 December 2015.
The user has requested enhancement of the downloaded file.
Network Programmability Using
POX Controller
Sukhveer Kaur1, Japinder Singh2 and Navtej Singh Ghumman3
1,2,3
Department of Computer Science and Engineering,
SBS State Technical Campus, Ferozepur, India
E-mail: 1bhullarsukh96@gmail.com, 2japitaneja@gmail.com,
3
navtejghumman@yahoo.com
Abstract—POX is a Python based open source system to control the data plane. Additional applications
OpenFlow/Software Defined Networking (SDN)
can be implemented on top of this operating system.
Controller. POX is used for faster development and
prototyping of new network applications. POX controller POX [2] is an open source controller for
comes pre installed with the mininet virtual machine. developing SDN applications. POX controller provides
Using POX controller you can turn dumb openflow an efficient way to implement the OpenFlow protocol Triển khai
devices into hub, switch, load balancer, firewall devices. which is the de facto communication protocol between
The POX controller allows easy way to run the controllers and the switches. Using POX controller
OpenFlow/SDN experiments. POX can be passed different you can run different applications like hub, switch, load
parameters according to real or experimental topologies, balancer, and firewall. Tcpdump packet capture tool can
thus allowing you to run experiments on real hardware, be used to capture and see the packets flowing between
testbeds or in mininet emulator. In this paper, first section
POX controller and OpenFlow devices.
will contain introduction about POX, OpenFlow and SDN,
then discussion about relationship between POX and Communication between the controller and the
Mininet. Final Sections will be regarding creating and switches is carried by communication protocol such as
verifying behavior of network applications in POX. OpenFlow [3], ForCES [4] (Fig. 2). OpenFlow is the
Keywords: POX, SDN, Open Flow, Mininet most popular standard protocol used in SDN. OpenFlow
switches behave as dumb forwarding devices. They are
I. INTRODUCTION unable to perform any actions without programmed by
SDN separates the control plane of networking the controller.
device (switch/ router) from its data plane, making it
possible to control, monitor, and manage a network
from a centralized controller.
Fig. 2 POX Controller
When a switch is powered on, it will immediately
connect to an OpenFlow controller. Initially, the flow
table of the switches is empty. When a packet arrives at
Fig. 1 Decoupled Control and Data Plane a switch, it does not know, how this packet is to be
handled. Then it send packet-in message to the
Software Defined Networking [1] tries to simplify controller. To handle the packet, controller inserts a
the development of new applications by separating the flow entries in flow table of switch. Flow entry in flow
data plane from control plane. Control plane is also table contains three parts, rule(match field), action,
called controller. This controller has a global view of counters. For each packet, that has to pass through a
the network and controls the flow through the network. switch, a flow entry will have to be installed so that the
switch can forward this traffic without further
Since most intelligence is now transferred to the
intervention of the controller [5]. Flow modification
controller, the switch only perform the actions that the messages are sent to the switches to install the flow
controller requests. This makes the switches very entries in flow table (Fig. 3). Once these are installed,
simple and inexpensive. But in traditional networks traffic belonging to this flow will be handled by the
(Fig. 1), each device has vendor-specific operating switches themselves.
Network Programmability Using POX Controller
Maestro (Java) [20] which are not considered because
they are deprecated and poorly documented.
A. POX
The POX is a python based SDN controller that is
inherited from the NOX controller.
B. Ryu
Ryu is a component-based SDN controller. Ryu has
a collection of built-in components. These components
can be changed, extended and composed for creating new
customized controller applications. Any programming
language can be used to develop a new component.
C. Trema
Fig. 3 SDN Architecture
Trema is a framework for Ruby and C that builds
II. POX AND MININET software platform for OpenFlow developers. It is easy
to use Open Source free software.
Mininet is an emulation tool that allows running a
number of virtual hosts, controllers, switches, and links. TABLE 1 DIFFERENT SDN CONTROLLERS
It uses container based virtualization to make a single POX Ryu Trema Floodlight Open Day
system act as a complete network. It is a simple, robust Light
and inexpensive network tool to develop and test Language Python Python C Java Java
OpenFlow based applications. Mininet [6] can create a Support Ruby
complex network topology for testing purposes, without OpenFlow v1.0 v1.0 v1.0 v1.0 v1.0
configuring the physical networks. It supports custom Support v1.2
topologies. It supports simple and extensible Python v1.3
API for network creation and testing. OpenSource Yes Yes Yes Yes Yes
Mininet combines the desirable features of
GUI Yes Yes No Web GUI Yes
simulators, testbeds and emulators. Mininet is cheaper,
REST API No Yes No Yes Yes
easily available, and quickly reconfigurable as
Platform Linux Linux Linux Linux Linux
compared to testbeds such as GENI [7], VINI [8], and
Support Mac Mac
Emulab [9]. It runs real, unmodified code as compared
Windows Windows
to simulators such as EstiNet [10], ns-3 [11]. The code
that is to be developed in Mininet, can also run in real D. Floodlight
network without any modifications. It supports large
scale networks containing large number of virtual hosts The Floodlight Open SDN Controller is an Apache
and switches. In short, Mininet's virtual hosts, switches, licensed, enterprise class, Java based OpenFlow
links, and controllers are just like the real thing. They controller. FloodLight controller contains a number of
are just created using software rather than hardware. modules, where each module provides a service to the
Mininet have built-in Controller classes to support other modules and to the control logic application
different network controllers such as reference through simple Java API or a REST API.
controller (controller), ovs-controller [12] and less used
NOX Classic [13]. E. OpenDayLight
được gọi
You can choose controller by invoking ‘mn’ OpenDayLight is an open source project. The goal
command. of the project is to create robust code that covers major
# mn --controller ref components of the SDN architecture, to gain acceptance
# mn --controller ovsc among the vendors and users, and to have a growing
# mn --controller nox community that contributes to the code and uses the
Five most important open source controllers (Table code for commercial products.
I) that can be used by Mininet remotly are POX, Ryu To use POX controller, type the following
[14], Trema [15], FloodLight [16], and OpenDaylight command in terminal window.
[17]. There are number of other SDN controllers like
NOX (C++) , Jaxon (Java) [18], Beacon (Java) [19], # python pox.py log.level –DEBUG
135
Internatiional Conferennce on Comm
munication, Co
omputing & Syystems (ICCC
CS–2014)
Using this comm mand POX controller
c runns in Wheen a packet arrrives at port 11, then it matcched against
DEBUG mode. m DEBU UG mode allows
a displaay of flow
w entry. Whenn match is fouund, then it iss flooded to
additional messages exxchanged witth the switchh. To all ports
p except thhe incoming port accordin ng to action
launch Minninet with deffault topologyy of 1 switch and
a 2 specified in floww entry. If noo match is found,f then
hosts run thhe following command.
c packket is forwarrded to conttroller. In on ne terminal
winddow, run thee following command to create an
# mn
expeeriment topoloogy.
In thiss case switch will connect to the defaullt ovs
# mn --macc --topo sinngle,5 --switcch ovsk --
controller. If you want to use POX controller runnning
contrroller remote
me Mininet maachine you neeed to run the ‘mn’
on the sam
command with the controller
c opption havingg the
parameterss set to ‘remote’. LoopbackL adddress
‘127.0.0.1’’ will be usedd as ip addreess. The folloowing
command will connectt the switches to remote POX
controller running
r on annother terminaal.
# mn –controller=re
– emote, ip=1277.0.0.1
But iff POX contrroller is on different maachine
(suppose 172.24.0.1), thhen run the following comm
mand
# mn --controller=re
- emote, ip=1722.24.0.1
You canc create coomplex pre defined
d or cuustom
defined toppologies usingg Mininet. Forr example
# mnn –mac --topo single,5 --switch ovssk --
controller remote
r
This will
w create 5 hosts
h and 1 sw
witch topologyy. The
different options that caan be used wiith ‘mn’ comm mand
are shown in Table II.
TABLE 2 MININET OPTION
NS
Fig. 4 Single
S Switch, 5 H
Hosts Topology
Command
ds Descriptiion
mn run Mininett
--topo singlee, 5 create 1 switch with 5 hosts
--mac makes macc address same as node numbeer on
hosts
--arp install staticc ARP entries
--switch ovssk use Open vSwitch
--controller use remote controller
remote
--ip remote conttroller ip address
III. POX
X APPLICATION
NS
There are various applications
a thhat can be crreated
using POXX. The networrk application could be a siimple
hub, switchh, and router or
o could be soophisticated middle
m
boxes suchh as firewall or load balaancer. This seection
contains sim
mple hub logiic and applicaation code.
A. Hub Application
A Listing 1 Hubb Application Code
If a floow entry in floow table contaains action to flood This will launch
l Miniinet network k topology
the packett that arrives at specific port
p of forwaarding conssisting of 1 OppenFlow switcch, 1 OpenFlow w controller
device, theen that devicee act like a huub. In the topoology and 5 hosts. The POX
P controllerr comes pre-in
nstalled with
shown in Fig.F 4, all hossts belong to the same netw work. the provided
p VM image.
i From aanother termin nal window,
When hostt h1 wants to send a packett to host h4, thhen it run the
t hub code (code file nam me is ‘hub.py y’) shown in
first sendss a packet too forwarding device at poort 1. Listiing 1 by using the followingg command.
136
Network Programmability Using POX Controller
# python pox.py log.level --DEBUG hub
This will launch the POX controller in verbose mode
for debugging purposes and also run the hub application.
B. Understanding Hub Application Code
Before implement a hub application, first you need
to import a core object that show a connection between
modules in POX and OpenFlow library that is used for
access a number of primitives.
1. ofp_action_output class: This class specifies a
switch port, where you want to send the
packet. There are various "special" port
numbers. For example in the hub application,
‘OFPP_FLOOD’ which sends the packet to all
ports except the incoming port.
2. ofp_flow_mod OpenFlow message: This
Fig. 5 Tcpdump Outputbefore Running 'Ping' Utility
message is send from controller to switch to
insert flow table entry. Flow table entries will Now from host h1 ping to the host h3 at address
be matched against fields of incoming packets 10.0.0.3. Ping packets will first go to the controller,
and then perform some actions on matching which will then flood the packets to all hosts except the
packets. interface which sent the packet. You will see identical
3. connection.send( ... ): Controller sends an ICMP and ARP packets related to the ping in all the
OpenFlow message to a switch by using this terminals. (Fig. 6) thus verifying the behavior of hub.
function. A ‘ConnectionUp’ event is fired,
When a connection to a switch starts. The
above code call a ‘_handle_ConnectionUp ()’
function that contains hub logic.
4. launch(): The launch() function is
automatically called, when the application is
started. The application registers all event
listeners in this function.
5. dpid_to_str(): Each OpenFlow switch has a
unique 64 bit datapath ID (DPID) and that is to
be passed to controller from switch during
handshaking. 48 bits are Ethernet address and
16 bits are implementation defined. It is a
decimal number that is not easy to understand.
POX define a pox.lib.util.dpid_to_str ()
function to format DPIDs.
IV. VERIFYING HUB BEHAVIOR
To verify hub behavior, Start a topology that
Fig. 6 Tcpdump Output after Running 'Ping' Utility
contains single switch and 5 hosts and run it with POX
controller. From host h1 sends icmp packets to the host V. CONCLUSION
h3. Here all the hosts see the same exact traffic which is POX controller can be used to convert cheap, dumb
the default behavior of hub. Launch an ‘xterm’ for each merchant silicon devices into hub, switch, router or
host and view the traffic simultaneously for each host middleboxes such as firewall, load balancer. POX is
by using ‘tcpdump’ (Fig. 5). For this purpose start 5 also great tool for deploying and testing SDN
xterm terminals, one for each host. applications. Its great strength lies in that it can be used
The command for viewing traffic is “tcpdump”. Pass with real hardware, in testbeds or with Mininet
emulator. The POX controller has some great features
the option ‘-XX’ for verbose output, ‘-i’ for specifying
but does not have GUI interface. Open Flow v1.0 is
the interface for listening, ‘-n’ for no name resolution. most widely used version. Open Flow version 1.3 will
137
International Conference on Communication, Computing & Systems (ICCCS–2014)
be the next version that is supposed to be widely [7] GENI at http://www.geni.net/
[8] VINI at http://www.fp7-federica.eu/pres_eventi/20081014-vini-
implemented in products. POX supports only v1.0. So bavier.pdf.
support for v1.3 could be future challenge area. [9] M. Hibler, R. Ricci, L. Stoller, J. Duerig, S. Guruprasad, T.
The network applications created in POX controller can Stack, K. Webb, and J. Lepreau. Large-scale virtualization in the
not be used with other controllers. Porting of POX emulab network testbed. In USENIX 2008 Annual Technical
Conference, pages 113-128. USENIX, 2008.
network applications to other controllers can be another [10] Wang, Shie-Yuan, Chih-Liang Chou, and Chun-Ming Yang.
research area. "OpenFlow Controllers over EstiNet Network Simulator and
Emulator: Functional Validation and Performance Evaluation."
ACKNOWLEDGMENT [11] Henderson, Thomas R., Mathieu Lacage, George F. Riley, C.
Dowell, and J. B. Kopena. "Network simulations with the ns-3
The authors would like to thank Mr. Vipin Gupta simulator." SIGCOMM demonstration (2008).
from U-Net Solutions, Moga, India for his valuable [12] OVS controller at http://yuba.stanford.edu/~casado/of-sw.html.
assistance for this work. [13] N. Gude, T. Koponen, J. Pettit, B. Pfaff, M. Casado, N.
McKeown,and S. Shenker. Nox: towards an operating system
REFERENCES for networks. ACM SIGCOMM Computer Commun. Review,
38(3):105–110, 2008.
[1] Nunes, B.; Mendonca, M.; Nguyen, X.; Obraczka, K.; Turletti, [14] Shalimov, Alexander, Dmitry Zuikov, Daria Zimarina, Vasily
T., "A Survey of Software-Defined Networking: Past, Present, Pashkov, and Ruslan Smeliansky. "Advanced study of
and Future of Programmable Networks," Communications SDN/OpenFlow controllers." In Proceedings of the 9th Central
Surveys & Tutorials, IEEE , vol.PP, no.99, pp.1,18. & Eastern European Software Engineering Conference in
[2] Fernandez, Marcial. "Evaluating OpenFlow controller Russia, p. 1. ACM, 2013.
paradigms." In ICN 2013, The Twelfth International Conference [15] Trema at https://github.com/trema/trema
on Networks, pp. 151-157. 2013. [16] Kim, Hyojoon, and Nick Feamster. "Improving network
[3] Lara, Adrian, Anisha Kolasani, and Byrav Ramamurthy. management with software defined networking."
"Network innovation using openflow: A survey." (2013): 1-20. Communications Magazine, IEEE 51, no. 2 (2013): 114-119.
[4] Zhou, Lei, Ligang Dong, and Rong Jin. "Research on ForCES [17] OpenDayLight at http://www.opendaylight.org/
Configuration Management Based on NETCONF." Information [18] “Jaxon,” accessed 11-June-2013 at http://jaxon.onuos.org/
Technology Journal 13, no. 5 (2014). [19] Erickson, David. "The beacon openflow controller." In
[5] Kim, Hyojoon, and Nick Feamster. "Improving network Proceedings of the second ACM SIGCOMM workshop on Hot
management with software defined networking." topics in software defined networking, pp. 13-18. ACM, 2013.
Communications Magazine, IEEE 51, no. 2 (2013): 114-119. [20] EugeneNg, ZhengCai AlanL Cox TS. "Maestro: Balancing
[6] Lantz, Bob, Brandon Heller, and Nick McKeown. "A network in Fairness, Latency and Throughput in the OpenFlow Control
a laptop: rapid prototyping for software-defined networks." In Plane."
Proceedings of the 9th ACM SIGCOMM Workshop on Hot
Topics in Networks, p. 19. ACM, 2010.
138
View publication stats