opendayight loadbalancer

63
Ryerson University | Load Balancing Using SDN with Open Daylight Controller 4 Table of Contents Table of Figures ............................................................................................................................................................. 5 LIST OF TABLES......................................................................................................................................................... 8 LIST OF ABBREVIATION.......................................................................................................................................... 9 ABSTRACT ................................................................................................................................................................ 10 CHAPTER I – INTRODUCTION............................................................................................................................... 11 1.1 Open Daylight Controller (SDN .................................................................................................................. 11 1.2 How Does SDN or Software Defined Networking Work?........................................................................... 12 1.3 Advantages of SDN.....................................................................................................................................13 1.4 General SDN Framework ............................................................................................................................ 14 1.5 SDN & Open Flow .......................................................................................................................................15 1.6 Layers in SDN with Open Daylight (Current Stable Release.) ..................................................................... 16 1.7 Mininet Network topology emulator ....................................................................................................... 16 1.8 Iperf ............................................................................................................................................................ 17 1.9 OpenvSwitch with OpenFlow ..................................................................................................................... 17 1.10 Server Load Balancing ................................................................................................................................19 CHAPTER II – TECHNICAL BACKGROUND........................................................................................................ 20 2.1 Objective & Project Scope.......................................................................................................................... 20 2.2 Setup .......................................................................................................................................................... 21 CHAPTER III – DESIGN AND IMPLEMENTATION ............................................................................................. 23 3.1 Topology:.................................................................................................................................................... 23 3.2 Implementation: ........................................................................................................................................24 3.3 How to run our Project: ............................................................................................................................ 25 3.4 Observation and Results: ........................................................................................................................... 30 3.4.1 Network Load balancing ................................................................................................................... 30 Conclusion (Network Load balancing without STP enabled) ............................................................................. 41 Conclusion (Network Load balancing with STP ) .............................................................................................. 44 3.4.2 Server Load Balancing Round Robin Demonstration ....................................................................... 44 3.6.3 Server Load Balancing Random Demonstration ............................................................................... 49 Conclusion (Sever Load Balancing Round Robin/Random) .............................................................................. 55 Appendix ..................................................................................................................................................................... 56 References: .................................................................................................................................................................. 66

Upload: khubaib-mahar

Post on 13-Apr-2017

1.196 views

Category:

Technology


10 download

TRANSCRIPT

Page 1: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

4

  

Table of Contents Table of Figures ............................................................................................................................................................. 5 

LIST OF TABLES ......................................................................................................................................................... 8 

LIST OF ABBREVIATION .......................................................................................................................................... 9 

ABSTRACT ................................................................................................................................................................ 10 

CHAPTER I – INTRODUCTION ............................................................................................................................... 11 

1.1  Open Daylight Controller (SDN .................................................................................................................. 11 

1.2  How Does SDN or Software Defined Networking Work? ........................................................................... 12 

1.3  Advantages of SDN ..................................................................................................................................... 13 

1.4  General SDN Framework ............................................................................................................................ 14 

1.5  SDN & Open Flow ....................................................................................................................................... 15 

1.6  Layers in SDN with Open Daylight (Current Stable Release.) ..................................................................... 16 

1.7  Mininet ‐ Network topology emulator ....................................................................................................... 16 

1.8  Iperf ............................................................................................................................................................ 17 

1.9  OpenvSwitch with OpenFlow ..................................................................................................................... 17 

1.10  Server Load Balancing ................................................................................................................................ 19 

CHAPTER II – TECHNICAL BACKGROUND ........................................................................................................ 20 

2.1  Objective & Project Scope .......................................................................................................................... 20 

2.2  Setup .......................................................................................................................................................... 21 

CHAPTER III – DESIGN AND IMPLEMENTATION ............................................................................................. 23 

3.1   Topology: .................................................................................................................................................... 23 

3.2   Implementation: ........................................................................................................................................ 24 

3.3   How  to  run our Project: ............................................................................................................................ 25 

3.4   Observation and Results: ........................................................................................................................... 30 

3.4.1  Network Load balancing ................................................................................................................... 30 

Conclusion (Network Load balancing without STP enabled) ............................................................................. 41 

Conclusion (Network Load balancing with STP ) .............................................................................................. 44 

3.4.2   Server Load Balancing Round Robin Demonstration ....................................................................... 44 

3.6.3   Server Load Balancing Random Demonstration ............................................................................... 49 

Conclusion (Sever Load Balancing Round Robin/Random) .............................................................................. 55 

Appendix ..................................................................................................................................................................... 56 

References: .................................................................................................................................................................. 66 

 

Page 2: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

5

  

Table of Figures

Figure 1.1 SDN & Open Flow

Figure 1.2 Open Flow versions & their Release dates

Figure 1.3 High Level Plane distribution of SDN

Figure 1.4 SDN Frame Work

Figure 1.5 Opendaylight SDN Framework

Figure 1.6 SDN Open flow Integration

Figure1.7 Opendaylight Lithium layer Diagram

Figure1.8 Mininet high level layer Diagram

Figure1.9 Open flow Match Action

Figure 1.10 Flow table Components

Figure 2.1 Our Project Problem Description

Figure 3.1 Given Topology with Port Assignement

Figure 3.2 Port assignement in Python Script

Figure 3.3 Running Controller

Figure 3.4 Running Mininet Topology

Figure 3.5 Wireshark Filter

Figure 3.6 Ping Result

Figure 3.7 ODL portal Topology display

Figure 3.8 Shell script to create Server load Balancing Topologies

Figure 3.9 Running Round Robin Topology

Figure 3.10 Running Random Topology

Figure 3.11 Controller message when connecting to Mininet

Figure 3.12 Portal display of OSGI bundles

Figure 3.13 OSGI switch bundles

Figure 3.14 OSGI load Balancer Bundles

Figure 3.15 OSGI Host tracker bundle

Figure 3.16 OSGI Open flow bundle

Figure 3.17 OSGI Topology Manager

Page 3: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

6

  

Figure 3.18 Wireshark arp message display, OFPT_PACKET_IN

Figure 3.19 TCP Packet for ARP

Figure 3.20 ARP PACKET_IN and PACKET_OUT

Figure 3.21 IP Packet and Open flow Packet information

Figure 3.22 Controller instruction OFPT_FLOW_MOD

Figure 3.23 Open flow Packet Details, FLOW_MOD

Figure 3.24 Ports and links

Figure 3.25 Open flow switch port dumps

Figure 3.26 Ping between hosts in mininet

Figure 3.27 Port dump after ping

Figure 3.28 ODL Portal packet stats after ping port between switch 2 and switch 7

Figure 3.29 ODL Portal packet stats after ping port between switch 1 and switch 7

Figure 3.30 ODL Portal packet stats after ping ports between switch 2and switch 6

Figure 3.31 ODL Portal packet stats after ping ports between switch 5 and switch 2

Figure 3.32 ODL Portal packet stats after ping ports between switch 4 and switch 1

Figure 3.33 Enabling STP in ovsdb switches

Figure 3.34 STP convergence switch1 as Root

Figure 3.35 ODL Portal View when Switch1 is root

Figure 3.36 STP convergence switch2 as Root

Figure 3.37 H9 as client 32 iperf flow with only two servers listenin

Figure 3.38 H1 response, two host up and rest down

Figure 3.39 H3 response, two host up and rest down

Figure 3.40 Client H9 32 flows 20MB window and 1 sec delay all hosts up round Robin

Figure 3.41 Server H1 response ,all hosts up round Robin

Figure 3.42 Server H3 response ,all hosts up round Robin

Figure 3.43 Random topology creation

Figure 3.44 Random topology H9 Client 32 flows two servers up

Figure 3.45 Random topology H9 Client Server H1 response

Figure 3.46 Random topology H9 Client ,Server H1 response

Figure 3.47 Random topology H9 Client Server H3 response all servers up

Page 4: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

7

  

Figure 3.48 Random topology H9 Client Server H3 response all servers up

Figure 3.49 Random topology H9 Client Server H1 response all servers up

 

 

 

 

 

 

 

 

 

 

 

 

Page 5: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

8

  

LIST OF TABLES

 Table Contents

Table 3.1 Host IP Assignment

Table 3.2 Bundle and respective function description

Table 3.3 Filter details wireshark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Page 6: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

9

  

 

 

LIST OF ABBREVIATION

IP Internet Protocol LAN Local Area Network SDN Software Defined Networking ODL Open Day Light OVS Open Virtual Switch VIP Virtual IP ARP Address Resolution Protocol JDK Java Development Kit JRE Java Runtime Environment OSGI Open Service Gateway Initiative SAL Service Abstraction Layer

Page 7: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

10

  

ABSTRACT

Our Project is to implement and study server load balancing in the Software Defined Networking (SDN)

environment using Round Robin and Random Policy. The load balancing Policies are run at the SDN Controller. Load balancing is very important concept in Data centers where high availability as well as performance is required.

In this Project we used open source Opendaylight Controller which provides the North Bound interface to

implement the load balancing Policies and also provides the south bound interface to communicate with OpenFlow switches. The entire data center is emulated in the Mininet platform.

During our work on this project we learned about Software defined networking, how it is different from

traditional Networking, we got a greater insight about ODL, Mininet, and OpenFlow vSwitch.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Page 8: opendayight loadBalancer

 

  

 

The main iSDN controthe networcontroller a

1.1 Open

Open Dbuilt fabstracsouthb

SDN huses thopen sComm(Reprecontroswitch

The soFlow (SAL)determcontro

dea of SDN is oller. Only the rking devices tare made progra

Daylight Con

Daylight (ODLfor SDN deployction platform bound protocols

has becoming pohis protocol. Alsource project

munity Project esentational Staller provides f

hing, security etc

outhbound inter1.0, Open Flow. The SAL is

mine the best wller and the netw

Fo

CH

to decouple thedata plane fun

through the souammable throug

ntroller (SDN

L) is a highly avyments on modthat allows u

s.

opular with the lso Open Dayliwhich is writtunder (Open S

ate Transfer - a framework for c.

face provides suw 1.3, BGP-LSa service whic

way to achieve work devices.

Following figure

Source (htt

R

HAPTER I

e control plane nctions left in thuth bound progh the north bou

N)

vailable, moduladern heterogensers to write a

Open Flow Proight can use othten in Java, it Services Gatewweb based) APpluggable mo

upport for diffeS, etc. These mch links these s

service reques

e illustrates the

Figure 1tp://www.slides

Ryerson Univer

– INTROD

from the data phe networking dtocol, such as

und API.

ar, extensible, sneous multi-venapps that easil

otocol widely acher southbound

uses maven fway initiative) PI and implemeodules to perfo

erent protocols (modules can besouth bound dested and take c

Openflow as th

.1(Openflow as share.net/Vijaya

rsity | Load BalO

DUCTION

plane and movedevices. The coOpenFlow. N

scalable and mundor networks. ly work across

ccepted as indud protocol, not jfor Package D

for the north ents open flow orm network t

(via separate pe linked in realevices to northcare of the und

he component of

Part of SDN) aguruJayaram/c

lancing Using SOpen Daylight C

e the control plontroller comm

Network applica

ulti-protocol coIt provides a

s a wide varie

ustry Standard. Ojust open flow.eployment. Opbound interfabased policies

tasks. These ta

plugins); some ol time to Servi

h bound applicaderlying protoc

f SDN Platform

cisco-openflow)

SDN with Controller

11

lane to the centrmunicates and coations running

ontroller infrastrmodel-driven sety of hardwar

Open daylight P. Open Daylighpen Daylight isace it exposes

for Southbounasks include ro

of examples arece Abstraction ations. The SAcol used betwe

m:-

)

ralized ontrols at the

ructure service re and

Project ht is an s open REST

nd. The outing,

e Open Layer

AL will een the

Page 9: opendayight loadBalancer

 

  

Followflow sprotoc

1.2 How D

Trde

SanAanNco

wing is the Roadwitches for ourol.

Does SDN or

raditionally, moecouples contro

SDN Controllernd enables Adm

APIs to send insnd is used as s

Northbound APIontrol and polic

dmap of the Opr Project Imple

F

Software De

ost network deol plane from d

r works as the imin to program

truction to the southbound pros at the SDN co

ces.

R

pen flow Protocementation. As

Figure 1.2(Versi

fined Networ

evices have condata plane. The

intelligent part the underlying switches and ro

otocol to send ontroller to com

Ryerson Univer

col implementaof our Project

ions of OpenFlow

rking Work?

ntrol plane andcontrol plane is

of the networkNetwork (switcouters. OpenFloinstructions to

mmunicate with

rsity | Load BalO

ation. We are usOF1.4 specific

w with Release

d data plane in s moved to a ce

k, it offers centrches and routerow is the first s

o underlay netwexternal world

lancing Using SOpen Daylight C

sing mininet emcation is the c

Date)

the same netwentralized contro

ral control of ths).The controllestandard adoptework. The netwd to implement t

SDN with Controller

12

mulator to creatcurrent release

working deviceoller.

he complete neer utilizes southed by SDN prowork applicatiothe desirable Ne

te open of this

e. SDN

etwork, hbound viders,

ons use etwork

Page 10: opendayight loadBalancer

 

  

1.3 Adva • • •

ntages of SDN

Application DForwarding fuDynamic Codemand. Centralized Mthe network a

Diagram below

N

Driven: one canfunctions. ontrol: Separatin

Management: Nand for applicat

 

 

R

w shows high le

Figure

n directly progra

ng control from

Network control ions and instruc

 

Ryerson Univer

vel plane distri

1.3(Simplified S

am Network as

m forwarding

is centralizedctions provides

Applica

ControContr

Switc

South Interface

rsity | Load BalO

ibution of the SD

SDN Plane)

control is separ

allows users t

d in SDN controa single logical

ations

l Plane

roller

ches

North

 Interface

South

Interface

lancing Using SOpen Daylight C

DN based netwo

rated from

to adjust netwo

oller which mainl switch.

SDN with Controller

13

orks.

ork- traffic flo

ntains overall v

ows on

view of

Page 11: opendayight loadBalancer

 

  

InSiWsipr

Inbechau

1.4 Gener

H

Inw

Based on opedesign and op

n theory SDN shince control is m

When packet is lngle packet losroduction netwo

n SDN Control meen achieved vhannels betweeuxiliary connect

ral SDN Fram

Here is the Gene

Sn the above diag

was that SDN OS

en Standard anperation and elim

hould be Ideamoved to Centrlost between thess may be toleraork deployment

messages couldvia some sort oen one controlltion will be use

De

So

mework

ral conceptual v

ource (http://biggram two versiS and controller

R

nd vendor indminates Vendor

al solution to toralized Controlle Controller andated to some ext.

d get lost and coof parallelism bler and switch

ed for data mess

etailed explanat

ource (https://bo

view of SDN Fr

Figurgswitch.com/sitions of SDN frar have been bun

Ryerson Univer

dependent: As Sr dependency.

day’s data netwer, controller shd switches, it wxtent as these n

ould lead to delaby using multi

h. Primary connsages or for UD

tion for SDN pl

ooks.google.ca/

rame Work

re 1.4(SDN Framtes/default/filesamework has bndled together in

rsity | Load BalO

SDN follows o

working problemhould be capabl

will have larger networks have a

ay in transmissiiple controllers

nnections will bDP messages.

lanes can be fou

/sdn/ paul_goran

me Work) s/_/213479.1_sdbeen depicted, tn 2.0 framewor

lancing Using SOpen Daylight C

open Standard,

ms, but it has itle of handling limpact, where

always backup

ion or data losss with the switbe used for C

und at :

nsoon/)

dn-blog-graphicthe basic differerk.

SDN with Controller

14

it simplifies ne

ts own disadvanlot of processinas in legacy nepaths available

. Solution to thitch or using m

Control message

c.jpeg) ence between th

etwork

ntages. g load.

etwork, e in the

is have multiple

es and

he two

Page 12: opendayight loadBalancer

 

  

de

1.5 SDN &

Source (http:

In the diagrameal with physica

& Open Flow

://www-935.ibm

m . 1.5 ODL framal and virtual sw

has s

w

R

Figure 1.5(O

m.com/services/

mework has beewitches whereassome extension

Ryerson Univer

Open Daylight S

/image/systems

en shown, this ds northbound in

ns which perform

rsity | Load BalO

SDN Framework

s_networking_s

diagram clearlynterface deal wim all network f

lancing Using SOpen Daylight C

k)

olutions_od_di

y depicts that soith client and apfunctions.

SDN with Controller

15

agram3_rev6.jp

outhbound interpplications. Con

pg)

rfaces ntroller

Page 13: opendayight loadBalancer

 

  

 

1.6 Layer

S

1.7 Minin

MusmcoTo

ThN

rs in SDN wit

ource(https://w

net - Network

Mininet is the nesing single Lin

mininet run opeontroller). It proopologies.

he following dNetwork topolog

Source (http

th Open Dayl

ww.opendaylig

k topology em

etwork emulatonux kernel. It aen flow and conovides rich API

diagram shows gy quickly inste

R

Figure1.6

ps://www.clear.

light (Curren

Figure1.7(Ope

ght.org/sites/ww

mulator

or which providacts as a real Nnnects to remotI interface whic

how an emulaad of using exp

Ryerson Univer

6(SDN Openflow

rice.edu/comp5

t Stable Relea

n daylight Lithi

ww.opendayligham_lrgr.jpg

des user a tool Network once ete SDN controllch provides Ne

ated mininet nepensive hardwar

rsity | Load BalO

w Integration)

529/www/paper

ase.)

ium layer Diagr

ht.org/files/pageg)

to emulate Netemulated topoller(in our case

etwork engineer

etwork simulatire testbed.

lancing Using SOpen Daylight C

rs/tutorial_4.pd

ram)

es/images/opend

tworks, it runs logy is createdwe have used O

rs way to emul

ion helps Netw

SDN with Controller

16

df)

daylight_lithium

emulated Topo. Switches creaOpendaylight aate different Ne

work engineers

mdiagr

ologies ated in

as SDN etwork

to test

Page 14: opendayight loadBalancer

 

  

Thus

1.8 Iperf

• IpM

• It • Ip

Ei• It

1.9 Open

OOO

Afowim

Thw

he simulated Nsing mininet or

perf is a w used Measure the thro

can measure thperf has a client ither unidirectiois open source

vSwitch with

Openvswitch is Openvswitch hasOne of them is su

A switch functioorwarding/flow

which allows tamplement these

his setup is difwhich requires n

Source (h

Source

Networks can bevise versa.

network testingughput of a net

he bandwidth anand server func

onal or bidirectisoftware and ru

h OpenFlow

an alternate os made enhanceupport of Open

on can be broketable, and data

aking the contRules.

fferent from theetwork Admini

ttp://en.community

R

Figure1.8( M

(http://netsemi

e tested on the r

g tool that can ctwork that is carnd the quality ofctionality, and cional. uns on various p

f Linux bridgeement as compnFlow protocol.

en into: Controla plane will follrol plane func

e proprietary Vstrators to impl

y.dell.com/techcen

Ryerson Univer

Mininet high lev

nar.stanford.ed

real hardware te

create TCP and rrying them. f a network linkcan measure the

platforms includ

e module and ipared to other B

l plane, data plalow these rulesctionality to ce

Vendor setup inlement changes

nter/networking/w

rsity | Load BalO

vel layer Diagram

du/seminars/11_

est bed once the

UDP data strea

k. e throughput be

ding Linux, UN

it has been avBridges. The de

ane. The contros for the incomientral controlle

n which these ru at each node s

w/wiki/3820.openv

lancing Using SOpen Daylight C

m)

_14_13.pdf )

e Network topo

ams and

etween the two e

NIX and Windo

vailable since letail is availabl

ol plane is the ping packets. Oper and allows

ules are implemseparately.

vswitch-openflow-

SDN with Controller

17

ologies are fully

ends,

ws.

inux kernel 2.4e at openvswitc

plane which crepenFlow is a prcentral contro

mented at each

lets-get-started)

y tested

4. The ch.org.

eates a rotocol

oller to

h node,

Page 15: opendayight loadBalancer

 

  

O

OpenFlow Switc

• Po• Flo• Flo

• Ma• Mo

ch comprises of

orts ow tables ows

atch Classifiers odifiers and Ac

R

f switch data Pla

tions

Ryerson Univer

ane, which inclu

 

Figure1.9(Ope

rsity | Load BalO

udes:

 

en flow Match A

lancing Using SOpen Daylight C

Action)

SDN with Controller

18

Page 16: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

19

  

Figure 1.10(Flow table Components)

Above Diagrams shows how OpenvSwitch works and how match action counter is performed, and once match found it finally forward the packet to desired port otherwise packet is dropped.

1.10 Server Load Balancing

The main idea of using load balancing is to implement the following three things:-

Scalability: Load can be distributed to different servers Manageability: Application can be transferred from one server to another within same

cluster (server group). Availability: To reduce downtime in Production Systems.

In our case load balancer service is running on controller which acts as a reverse proxy to distributes network traffic across a number of servers based on predefined polices: Round Robin or Random.

Load Balancing in servers can be implemented by two methods:-

Stateless: The controller does not keep track of state of servers and will send the information based on policy to server even the particular server is down.

State-full: The controller keeps track of state of servers and monitors the state of the related servers.

Page 17: opendayight loadBalancer

 

  

2.1 O

Se

S1-S7 are Obetween s1bandwidth

The Open looking for

The first flo

The second

The third fl

The fourth

The fifth flo

Objectiv

etup the follow

OpenVswitches/s2 and s3/s4/s5of 400Mbps.

daylight shoulr is this:

ow between H9

d flow between

low between H9

flow between H

ow between H9

CHAPTE

ve & Pro

wing topology in

(OVSs), H1 to5/s6 should hav

ld have a built-

9 and a virtual se

H9 and a virtua

9and a virtual se

H9 and a virtual

9 and a virtual s

R

ER II – TEC

oject Sco

n the Mininet:

Figure2.1

o H8 are serversve a bandwidth o

-in network loa

erver will use th

al server uses S7

erver uses S7-S

l server uses S7

erver uses S7-S

Ryerson Univer

CHNICAL B

ope

1 (Our Project P

s. H9 is the hostof 100Mbps eac

ad balancer. T

he path S7-S1-S

7-S2-S4-H2;

S1-S5-H3;

7-S2-S6-H4;

S2-S3-H5;

rsity | Load BalO

BACKGRO

Problem Descrip

t that generates ch; the links bet

est if it is the c

S3-H1;

lancing Using SOpen Daylight C

OUND

ption)

traffic to the setween s7 and s1

case. The patte

SDN with Controller

20

ervers. The link1/s2 have the

rn that you are

s

e

Page 18: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

21

  

The sixth flow between H9and a virtual server uses S7-S1-S4-H6;

And so on …

Study if this is the case. If not, record the paths taken. Use iperf traffic generator to generate TCP traffic and measure the delay and throughput. Generate 32 flows with data rate of 20Mbps each.

Compare the results with only two servers (says H1 and H2). The idea here is to show that by using more servers, we can use more available network bandwidth, thus reduce the delay and increase the throughput.

Compare the delay and throughput between the round-robin and random policies.

To accomplish our desired project, we use the following devices and tools:

2.2 Setup

1. Two Virtual Machines each one with Ubuntu 14.04 32 bit 2. Oracle VirtualBox 3. GIT 4. Apache Maven 5. MobaXterm 6. VBox Guest Addition for Linux 7. WireShark 8. Mininet 9. ODL Controller Code

2.2.1: Two Virtual Machines each one with Ubuntu 14.04 32 bit:

We need to download Ubuntu with version 14.04 version 32bit and configure it as virtual Machine. We need two machines for our project, one will be used as controller and other will be used for Mininet.

2.2.2: Oracle VirtualBox

We have installed our Virtual machines using Oracle Virtual Box.

2.2.3: GIT

GIT is open source version control tool; we have used git to get the current version from ODL repository.

2.2.4: Apache Maven.

Apache Maven is the tool used to build Java projects; we have used Apache Maven to build ODL OSGI bundles after downloading them, details are in the installation appendix.

2.2.5: MobaXterm

We have used this tool as our ssh client .

2.2.6: VBox Guest Addition:

This is an ISO which is helpful to maximize the size of Linux OS while working in Windows

2.2.7: WireShark:

Page 19: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

22

  

We have used wireshark to analyze open flow packets. This can be configured on Linux and windows both. We have installed version which includes openflow plugin.

2.2.8: MiniNet:

This tool is used to emulate the network.

2.2.9: ODL :

We downloaded opendaylight(ODL) OSGI bundles using Git and compiled them locally using Maven.

 

 

 

 

Page 20: opendayight loadBalancer

 

  

3.1 T

The topoloOur Initial balancing a

S1-S7 are Obetween s1bandwidth

C

Topology

gy given to us Study scope

as well and stud

OpenVswitches1/s2 and s3/s4/of 400Mbps. C

CHAPTER I

y:

was with 4 serwas to impleme

dy which ODL b

s (OVSs), H1 t/s5/s6 should hontroller has Ro

R

III – DESIG

Figure3.1

rvers but later ient Server load bundle will be u

to H8 are servehave a bandwidound Robin and

Node IP AH1 10.0H2 10.0H3 10.0H4 10.0H5 10.0H6 10.0H7 10.0H8 10.0H9 10.0

Ryerson Univer

GN AND IM

1(Given Topolo

it was modifiedbalancing only

used for network

ers. H9 is the hdth of 100Mbpd Random Polic

Address Designa0.0.1 Serv0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8 0.0.9 Client

rsity | Load BalO

MPLEMENT

ogy with Port A

d to above topoy but later we wrk load balancin

host that generaps each; the lincies running in

ation vers

lancing Using SOpen Daylight C

TATION

Assignment)

ology with morewere advised to ong.

ates traffic to tnks between s7it.

SDN with Controller

23

e scope of workobserve Networ

the servers. The7 and s1/s2 ha

k to it. rk load

e links ave the

Page 21: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

24

  

3.2 Implementation:

Software tools requirements to install Opendaylight and Mininet. Opendaylight can be installed in more than one way depending on the intention of the future use; also it can be installed on Linux, UNIX and Windows machine. Opendaylight has 03 major releases for now, Hydrogen, Helium and Lithium, we have used current Stable release which is Helium. Also we need to have Java JDK, git and Maven installed on the box before one begins installation of the ODL.

Here are the 03 methods one can use to install ODL:

1. Using Karaf

2. Pulling the code from CLI and build locally using Maven. (We have used this method for our Project) 3. Import Code into Eclipse and re-compiling using Maven.

1) Installation Using Karaf

This is the easiest way one can install ODL, one needs to be familiar with Karaf commands, this link provides nice introduction to karaf.

http://www.liquid-reality.de/display/liquid/2011/02/15/Karaf+Tutorial+Part+1+-+Installation+and+First+application

To install ODL on Ubuntu, Opendaylight wiki provides step by step procedure.

https://wiki.opendaylight.org/view/Install_On_Ubuntu_14.04

2) Pulling the code from CLI and build locally using Maven.

We have followed this procedure in our installation; following are the steps we have followed in our ODL setup. This is specific to Ubuntu.

The detailed Procedure is in the Appendix.

3) Eclipse Installation and build the code in Eclipse using Maven.

This method is used if one is developer and wants to see the code of all the packages or needs to write new custom application this method should be used; we have imported code in the Eclipse, but haven’t used it for the Project.

Following references can be used to use Eclipse:-

https://wiki.opendaylight.org/view/Getting_Started:Eclipse:Installing_Eclipse_on_Ubuntu https://wiki.opendaylight.org/view/GettingStarted:_Eclipse http://networkstatic.net/importing-opendaylight-into-eclipse/

3.4 Load Balancing Methods Used and VIP

VIP (Virtual IP), in server load balancing: VIP acts as the proxy between the external world and the server group. We have demonstrated opendaylight controller load Balancer bundle (org.opendaylight.controller.samples.loadbalancer.internal) two features round robin and random policies.

RoundRobin policy: This policy will send traffic to group of servers in orderly manner one after the other

Random policy: This policy will select servers randomly based on random algorithm

Page 22: opendayight loadBalancer

 

  

3.3 H

We have iminstalled, wVM’s to co

We have crscripts whic

As the snanumbers wh

On the ODLto Both VM

How to

mplemented ouwhereas on the sommunicate.

reated Python sch helped us in

apshot shows when the link is b

L box we have Ms via their Hos

run our

ur project usingsecond box we

script on the miidentifying por

we have used thbetween switch

wrapper shell sst only IP’s:

R

Project:

g two virtual mhave installed t

ininet box to rurt numbers when

Figure 3.

hree digit portand host.

scripts which w

Ryerson Univer

:

machines each hthe opendayligh

un the mininet tn running the te

2 (Port assignm

numbers when

will create the lo

rsity | Load BalO

having Ubuntu ht controller. W

topology; We ests.

ment in Python S

n the link is be

ad Balancer To

lancing Using SOpen Daylight C

Linux, One haWe are using ho

have port assig

Script)

etween switche

opologies. Open

SDN with Controller

25

as mininet, Wirost only IP of th

gnment in our P

es and two dig

n Secure CRT to

reshark he both

Python

git port

o login

Page 23: opendayight loadBalancer

 

  

ODL VM wcontroller t

Once the coon the mini

we have createdo be up and run

ontroller is runninet.

d alias $ctl in thnning fully. The

ning we will st

R

Figure 3.

he user .bashrc en you will notic

tart our Python

Figure 3.

Ryerson Univer

3( Running Con

file which startce a prompt as O

script for our t

4(Running Min

rsity | Load BalO

ntroller)

ts the controllerOSGI> which i

topology in the

ninet topology )

lancing Using SOpen Daylight C

r. It takes from is prompt of con

Mininet VM, a

)

SDN with Controller

26

3 to 5 minutes ntroller.

and run the wir

for the

reshark

Page 24: opendayight loadBalancer

 

  

We have amessages.

Once we pi

applied filter on

ing between the

n the particular

e hosts the topol

R

Figure 3.

r port, between

logy will be upd

Figure 3.

Ryerson Univer

5( Wireshark F

n mininet and

dated in the in t

6(Ping Result)

rsity | Load BalO

Filter)

ODL VM, and

the ODL portal

lancing Using SOpen Daylight C

d it only filter

.

SDN with Controller

27

s openflow and

d TCP

Page 25: opendayight loadBalancer

 

  

Then we haRobin and R

Above snapWe will run

ave to open anoRandom Policy

pshot shows then Round robin P

other instance oy.

e related scripts Policy as follow

R

Figure3.7

of Secure CRT

Figure 3.

on the ODL VMws:-

Ryerson Univer

7(ODL portal T

and connect it t

8(Shell script to

M:

rsity | Load BalO

Topology displa

to controller in

o create Server

lancing Using SOpen Daylight C

ay)

order to run ot

load Balancing

SDN with Controller

28

ther scripts for

g Topologies)

Round

Page 26: opendayight loadBalancer

 

  

We have crcan run Ran

The messag

reated round rondom Topology

ge below shows

obin pool with 8y by following s

s OSGI info me

R

Figure 3.

8 hosts and addscript.

Figure 3.

essage when min

Ryerson Univer

9(Running Rou

ded them in the

10(Running Ra

ninet connects t

rsity | Load BalO

und Robin Topo

e Pool, and assi

andom Topolog

to controller.

lancing Using SOpen Daylight C

ology)

igned VIP to th

gy)

SDN with Controller

29

hat Pool. Similaarly we

Page 27: opendayight loadBalancer

 

  

The above

3.4 O

3.4.1 N First step foFor this we Here is the

snapshot shows

Observa

Network Load

or us was to stue identified the O

snap shot of th

s OSGI bundle

ation and

d balancing udy the Open daOSGI bundles w

e bundles (Swit

R

Figure 3.

Figure 3.

information in O

d Result

aylight should hwhich will be us

tch bundles)

Ryerson Univer

11( Controller m

12(Portal displa

ODL Portal.

ts:

have a built-in nsed during this

rsity | Load BalO

message when

ay of OSGI bun

network load bastudy,

lancing Using SOpen Daylight C

connecting to M

ndles)

alancer,

SDN with Controller

30

Mininet)

Page 28: opendayight loadBalancer

 

  

Load Balan

Host Track

Openflow

Topology M

We have instudy.

Package/O

org.opendayligh

ncer Bundles

ker bundle

bundle

Manager bundle

ncluded the OS

SGi Bundle  

ht.controller.arphand

e

SGI bundle and

dler.internal

R

Figure 3.

Figure 3.

Figure 3.

Figure 3.

Figure 3.

the functions d

Exporte

Ryerson Univer

13 ( OSGI swit

14(OSGI load B

15(OSGI Host

16(OSGI openf

17(OSGI Topo

description from

ed Interfaces  

IHostFinder

rsity | Load BalO

tch bundles)

Balancer Bundl

tracker bundle)

flow bundle)

ology Manager b

m the ODL wik

lancing Using SOpen Daylight C

les)

)

bundle)

ki which are be

Descriptio

Component rehost location.

SDN with Controller

31

eing used in ou

on  

esponsible for learnin. It achieves the goal

ur Case

ng about by

Page 29: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

32

  

IListenDataPacket looking at the ARP conversation between an host and the controller. This is an application that show case a possible host tracking mechanism, especially useful in the cases like OpenFlow where the controller can see all the packets if instructed to.

org.opendaylight.controller.forwarding.staticrouting.internal IForwardingStaticRouting

ICacheUpdateAware

IfNewHostNotify

IConfigurationContainerAware

Provide the necessary hooks to inject in the area controlled by the controller, routes to reach traditional IP networks.

org.opendaylight.controller.forwardingrulesmanager.internal IContainerListener

ISwitchManagerAware

IForwardingRulesManager

IInventoryListener

ICacheUpdateAware

IConfigurationContainerAware

IFlowProgrammerListener

Manager of all the Forwarding Rules, this component take case of forwarding rules and is the one that manage conflicts between them.

org.opendaylight.controller.hosttracker.internal ISwitchManagerAware

IInventoryListener

IfIptoHost

IfHostListener

ITopologyManagerAware

Track the location of the host relatively to the SDN network.

org.opendaylight.controller.protocol_plugin.openflow.internal IContainerListener

IController

IDataPacketListen

IDataPacketMux

IDiscoveryService

IFlowProgrammerNotifier

IInventoryShimExternalListener

IMessageListener

Protocol plugin for OpenFlow 1.0. Include the openflow J library as well the necessary glue logic to adapt to SAL layer along with a discovery mechanism for learning the graph of the OpenFlow network portion.

Page 30: opendayight loadBalancer

 

  

org.opendayligh

org.opendayligh

org.opendayligh

org.opendayligh

org.opendayligh

Table3.2( B

Mininet sen

ht.controller.samples

ht.controller.samples

ht.controller.statistic

ht.controller.switchm

ht.controller.topolog

Bundle and resp

nd Packet_IN op

s.loadbalancer.interna

s.simpleforwarding.in

smanager.internal

manager.internal

ymanager.internal

pective function

penflow messag

R

al

nternal

n description)

ge to controller

Ryerson Univer

IOFStatisticsMan

IPluginInDataPac

IPluginInFlowPro

IPluginInInventor

IPluginInReadSer

IPluginInTopolog

IPluginReadServi

IRefreshInternalP

IStatisticsListener

ITopologyService

IListenDataPacke

IConfigManager

IInventoryListene

IfNewHostNotify

IListenRoutingUp

IStatisticsManage

IListenInventoryU

ISwitchManager

ICacheUpdateAw

IConfigurationCo

IListenTopoUpda

ITopologyManag

IConfigurationCo

r to get the path

rsity | Load BalO

nager

cketService

ogrammerService

ryService

rvice

gyService

iceFilter

Provider

r

eShimListener

et

er

y

pdates

er

Updates

ware

ontainerAware

ates

ger

ontainerAware

information.

lancing Using SOpen Daylight C

ImplementatiThis componeusage of the f

Sample implesimulating a tcomponent wof the functio

Component inReadService several statist

Component hinformation fcontroller. Alto have accesnode name orwill find themcomponent.

Component hgraph. Providupdates to wh

SDN with Controller

33

ion of a simple load-bent wants to show cafunctional modules.

ementation of an apptraditional IP network

wants to show case thonal modules.

n charge of using thefrom SAL, in order ttics from the SDN ne

holding the inventoryfor all the known nodll the components thass to let say a port namr any inventory informm via query to this

holding the whole netde notifications on edho wants to listen abo

balancer. ase the

plication rk. This e usage

e to collect etwork.

y des in the at wants me or mation,

twork dges out it.

Page 31: opendayight loadBalancer

 

  

The ARP b

broadcast is showw as below, wh

R

Figure 3.

Figure 3.

hich is sent betw

Figure 3.

Ryerson Univer

18(Wireshark a

19(TCP packet

ween controller

20 (ARP PACK

rsity | Load BalO

arp message dis

t for ARP)

and switches w

KET_IN and PA

lancing Using SOpen Daylight C

splay ,OFPT_PA

when there is no

ACKET_OUT)

SDN with Controller

34

ACKET_IN)

matching entryy.

Page 32: opendayight loadBalancer

 

  

Controller w

used openf

 

will decide the 

flow 1.0 protoco

best path with

ol between con

R

Figure 3.

 FLOW_MOD w

ntroller and  sw

Figure 3.

Ryerson Univer

21(IP Packet an

which contains 

itches , which u

22 ( Controller

rsity | Load BalO

nd Open flow P

flow instructio

use one table fo

instruction OF

lancing Using SOpen Daylight C

Packet informati

on in this case it

or the flows. 

FPT_FLOW_MO

SDN with Controller

35

ion)

t is flow 0 as w

OD)

e have 

Page 33: opendayight loadBalancer

 

  

We have us

Message OFPT_PA

OFPT_PAOFPT_FL

This is thebetween co

We have ta

sed following fi

ACKET_IN

ACKET_OUT LOW_MOD

e snapshot we ontroller and Op

aken the list of p

ilters for the wir

TypeSwitc

ContrContr

had taken befopenflow switche

ports and links i

R

Figure 3.

reshark trace.

e ch->Controlle

roller->Switchroller->Switch

Table 3.3

ore Network dies for network d

in mininet

Ryerson Univer

23 (Openflow P

Descr A pa

tableinstr

h Conth Cont

table

3 (Filter details

iscovery in thediscovery.

rsity | Load BalO

Packet Details,

cription acket receivede entry , switchruction troller sends totroller sends toe

wireshark)

e controller, wh

lancing Using SOpen Daylight C

FLOW_MOD)

d doesn’t match sends to con

o switch one oo switch to ad

hich were indic

SDN with Controller

36

)

ch switch flowntroller for

or more ports.dd entry in the

cation arp bein

w

e flow

ng sent

Page 34: opendayight loadBalancer

 

  

R

Figure 3.

Ryerson Univer

24(Ports and lin

rsity | Load BalO

nks)

lancing Using SOpen Daylight C

SDN with Controller

37

Page 35: opendayight loadBalancer

 

  

As we havefrom each hsnapshot in

e used ping betwhost to host 9 an

n the ODL porta

ween the hosts tnd once ping coal and OVSDB s

R

Figure 3.

to observe the Nompleted, we obswitch interface

Ryerson Univer

25(Openflow sw

Network load bbserved the pathes.

rsity | Load BalO

witch port dum

alancing featurhs taken by the

lancing Using SOpen Daylight C

mps)

re of the ODL, wpackets to reac

SDN with Controller

38

we have sent onch host 9 by taki

ne ping ing the

Page 36: opendayight loadBalancer

 

  

We observeinterface du

ed that the conumps at the con

ntroller does loantroller portal an

R

Figure 3.

ad Balancing usnd in the ovsdb

Ryerson Univer

26(ping betwee

sing simple loadump On minin

rsity | Load BalO

en hosts in mini

ad Balancer monet side.

lancing Using SOpen Daylight C

inet)

odule which is

SDN with Controller

39

clear from the switch

Page 37: opendayight loadBalancer

 

  

This snapsh

This is snap

This snapshbetween the

hot shows the d

pshot of switch

hot is between ese switches) S

dump from ovsd

2 to switch 7 w

switch1---switcame is the case

R

Figure 3.

db interfaces

Figure 3.28

which indicates

Figure 3.29

ch 7 and show between acces

Ryerson Univer

27(Port dump a

8 (ODL Portal pac

4 packets were

9(ODL Portal pack

4 packets weres level switches

rsity | Load BalO

after ping)

cket stats after pin

sent between tw

ket stats after ping

e sent betweens

lancing Using SOpen Daylight C

ng port between sw

wo switches.

g port between swi

n them (which i

SDN with Controller

40

witch 2 and switch

itch 1 and switch 7

indicates load s

7)

7)

sharing

Page 38: opendayight loadBalancer

 

  

Switch 6 sn

Switch 5 sn

And all the

From our Odoes the Ne

We have ta

napshot 2 pack

napshot 2 packe

e ports connect

CObservation weetwork load bal

aken the results

kets received fro

ets received fro

ted have been u

Conclusion (Ne have concludancing along w

one more time,

R

Figure 3.30

om h9

Figure 3.31

om h9

Figure 3.32

used almost equa

Network Loaded that ODL b

with Server load

this time we ha

Ryerson Univer

0(ODL Portal pack

1(ODL Portal pack

2(ODL Portal pack

ally.

ad balancingbundle (org.opebalancing when

ave enabled ST

rsity | Load BalO

ker stats after ping

ker stats after ping

ket stats after ping

without STPendaylight.contn STP is not en

TP in the switch

lancing Using SOpen Daylight C

g port between swi

g port between swi

g port between swi

P enabled) troller.samples.nabled.

es.

SDN with Controller

41

itch 2and switch 6

itch 5 and switch 2

itch 4 and switch 1

loadbalancer.in

)

2)

1)

nternal)

Page 39: opendayight loadBalancer

 

  

We observeed that all the h

Figu

osts discovered

R

Figure 3.33

ure 3.34( STP con

d H9 by using sw

Ryerson Univer

3(Enabling STP in

nvergence switch

witch1 this time

rsity | Load BalO

n ovsdb switches)

1 as Root )

e, switch 2 was

lancing Using SOpen Daylight C

s not used due t

SDN with Controller

42

to STP.

Page 40: opendayight loadBalancer

 

  

Whereas on

n the 2nd occasio

Fig

on switch 2 was

Figu

R

ure 3.35( ODL Po

s used and Swit

ure 3.36( STP con

Ryerson Univer

ortal View when S

tch 1 was not us

nvergence switch2

rsity | Load BalO

Switch1 is root, all

sed to discover

2 as Root )

lancing Using SOpen Daylight C

l )

H9.

SDN with Controller

43

Page 41: opendayight loadBalancer

 

  

From our Odoes the Netimes this w

3.4.2 S We have sdescribe ouusing 32 ipH3 as servewe will hav

Observation weetwork load balwas the case afte

erver Load Buccessfully dem

ur observations perf flows each ers and H9 as cve time outs wh

Concluse have concludlancing at the coer STP was full

Balancing Romonstrated both

for Round Robwith 20MB wi

client, and havehen client wants

Figu

R

sion (Networkded that ODL bore level switchly converged.

ound Robin Dh round Robin abin policies. Asindow, and sende generated resp to send traffic

ure 3.37 (H9 as cli

Ryerson Univer

k Load balanbundle (org.opehes and it takes

Demonstratiand Random Ses our Case studd these flows epective flows. Wto those hosts ,T

ent 32 iperf flow w

rsity | Load BalO

ncing with Sendaylight.conta while before

ion ever Load-balandy was to demoevery 1sec.In thWe have kept rThere snapshot

with only two serv

lancing Using SOpen Daylight C

TP ) troller.samples.it is fully conv

ncing Policies. Ionstrate server Rhe first section wrest of the hostst clearly indicat

vers listening)

SDN with Controller

44

loadbalancer.inverged. We tried

In this section wRound Robin Pwe have used Hs down, which tes these time ou

nternal) d many

we will Policies H1 and means

uts.

Page 42: opendayight loadBalancer

 

  

We have uswhen some

The above max:7.5 wh

sed jperf, whiche of the Paths w

snapshot indichich indicates t

h is GUI based ere down betwe

Figu

cates we have hthere was clear

R

iperf and our obeen host and cli

ure 3.38(Server 1 r

had input bandloss of bandwid

Ryerson Univer

bservation indicient.

response, two host

dwidth of aroundth and not all b

rsity | Load BalO

cates we were n

t up and rest down

nd 32 MB/s anbandwidth was

lancing Using SOpen Daylight C

not able to utiliz

n)

nd each of the h utilized.

SDN with Controller

45

ze the max band

host through pu

dwidth

ut was

Page 43: opendayight loadBalancer

 

  

Same is the

2nd case: wtime it was

e case of H3.

hen all the hostfully distribute

Figu

ts are up. We hed. All servers ru

R

ure 3.39(Server 3 r

have achieved aunning and 32 f

Ryerson Univer

response, two host

almost 100% effflows generated

rsity | Load BalO

t up and rest down

fficiency, we had by following s

lancing Using SOpen Daylight C

n)

ad same bandwiscript.

SDN with Controller

46

idth available bbut this

Page 44: opendayight loadBalancer

 

  

Snap shot oof the client.

Figu

R

ure 3.40(Client H9

Ryerson Univer

9 32 flows 20MB w

rsity | Load BalO

window and 1 sec

lancing Using SOpen Daylight C

delay all hosts up

SDN with Controller

47

round Robin )

Page 45: opendayight loadBalancer

 

  

We have tasever was g

aken host H1 angetting approx.

Figu

nd H3 snap shotat 4MB, and w

R

ure 3.41(Server H1

t this time and wwe have almost r

Ryerson Univer

1 response ,all hos

we can see maxreached 100% e

rsity | Load BalO

sts up round Robin

x bandwidth waefficiency.

lancing Using SOpen Daylight C

n )

s utilized as we

SDN with Controller

48

e had 32 MB annd each

Page 46: opendayight loadBalancer

 

  

3.6.3 SThis time wtwo servers

erver Load Bwe used STP ens running, which

Figu

Balancing Ranabled Networkh was the case o

Figu

R

ure 3.42 (Server H

andom Demok and the rest ofof Round Robin

ure 3.43 (Random

Ryerson Univer

3 response ,all hos

onstration f the simulationn sever Simulat

topology creation

rsity | Load BalO

sts up round Robi

n setting were stion. 

)

lancing Using SOpen Daylight C

in )

same, which me

SDN with Controller

49

eans first time w

we had

Page 47: opendayight loadBalancer

 

  

Figu

R

ure 3.44 (Random

Ryerson Univer

topology H9 Clien

rsity | Load BalO

nt 32 flows two se

lancing Using SOpen Daylight C

ervers up )

SDN with Controller

50

Page 48: opendayight loadBalancer

 

  

Figu

R

ure 3.45 (Random

Ryerson Univer

m topology H9 Clie

rsity | Load BalO

ent Server H1 resp

lancing Using SOpen Daylight C

ponse )

SDN with Controller

51

Page 49: opendayight loadBalancer

 

  

We almost servers are

have same resuup as we can se

ults as Round Ree from the snap

R

Figure 3.46 (Rand

Robin, even we pshot.

Ryerson Univer

dom topology H9

changed Netwo

rsity | Load BalO

Client Server H3 r

ork to STP enab

lancing Using SOpen Daylight C

response )

bled, we have lo

SDN with Controller

52

osses when not

all the

Page 50: opendayight loadBalancer

 

  

Figu

R

ure 3.47 (Random

Ryerson Univer

topology H9 Clien

rsity | Load BalO

nt 32 flows all ser

lancing Using SOpen Daylight C

rvers up)

SDN with Controller

53

Page 51: opendayight loadBalancer

 

  

Figu

R

ure 3.48 (Random

Ryerson Univer

topology H9 Clien

rsity | Load BalO

nt Server H3 respo

lancing Using SOpen Daylight C

onse all servers up

SDN with Controller

54

p )

Page 52: opendayight loadBalancer

 

  

When we Robin topo

We have received ma

Note:- Thisbut if this is

have all the selogy also.

C

successfully deax throughput w

s is Ideal condits not the case th

ervers in listenin

Conclusion (S

emonstrated bowhen all the ser

tion, for STP enhen we will hav

R

Figure 3.49 (Ran

ng mode in Ran

Sever Load B

oth Round Robrvers are availab

nabled Networkve less throughp

Ryerson Univer

ndom topology H9

ndom LB, we g

Balancing Ro

bin and Randomble irrespective

k, as network input as not all the

rsity | Load BalO

Client Server H1

get 100% effici

ound Robin/R

m Server Loadof the load bala

n not overloadede links are utiliz

lancing Using SOpen Daylight C

response all serve

iency, which w

Random)

d-balancing anancing method.

d , we can achiezed when STP i

SDN with Controller

55

ers up )

was the case of

nd concluded th.

eve 100% throuis enabled.

Round

hat we

ughput,

Page 53: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

56

  

Appendix Openday light Wrapper scripts for Load Balancer 

Create_8_load_balance_Round_Robin_topo.bash

echo "Create load balancer pool with round robin load balancing policy "

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/pool -d '{"name":"PoolRR","lbmethod":"roundrobin"}'

if [[ $? == 0 ]] ; then

echo " load balancer pool Created "

fi

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/vip -d '{"name":"VIP-RR","ip":"10.0.0.20","protocol":"TCP","port":"5550","poolname":"PoolRR"}'

echo " Create load balancer VIP "

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://192.168.56.105:8080/one/nb/v2/lb/default/update/vip -d '{"name":"VIP-RR","poolname":"PoolRR"}'

if [[ $? == 0 ]] ; then

echo " load balancer VIP Created "

fi

echo "Creating Pool Members"

for members in 1 2 3 4 5 6 7 8

do

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/poolmember -d '{"name":"PM'$members'","ip":"10.0.0.'$members'","poolname":"PoolRR"}'

Page 54: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

57

  

if [[ $? == 0 ]] ; then

echo " Pool Member PM"$members" Created "

fi

done

Create_load_balance_random.bash

echo "Create load balancer pool with Random load balancing policy "

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/pool -d '{"name":"PoolRA","lbmethod":"random"}'

if [[ $? == 0 ]] ; then

echo " load balancer pool Created "

fi

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/vip -d '{"name":"VIP-RA","ip":"10.0.0.20","protocol":"TCP","port":"5550","poolname":"PoolRA"}'

echo " Create load balancer VIP "

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X PUT http://192.168.56.105:8080/one/nb/v2/lb/default/update/vip -d '{"name":"VIP-RA","poolname":"PoolRA"}'

if [[ $? == 0 ]] ; then

echo " load balancer VIP Created "

fi

echo "Creating Pool Members"

for members in 1 2 3 4 5 6 7 8

do

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.56.105:8080/one/nb/v2/lb/default/create/poolmember -d '{"name":"PM'$members'","ip":"10.0.0.'$members'","poolname":"PoolRA"}'

if [[ $? == 0 ]] ; then

Page 55: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

58

  

echo " Pool Member PM"$members" Created "

fi

done

deletepools_topo.bash

for members in 1 2 3 4 4 5 6 7 8

do

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://192.168.56.105:8080/one/nb/v2/lb/default/delete/poolmember/PM"$members"/PoolRR

done

echo "Delete VIP"

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://192.168.56.105:8080/one/nb/v2/lb/default/delete/vip/VIP-RR

echo "Delete Pool"

curl --user "admin":"admin" -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://192.168.56.105:8080/one/nb/v2/lb/default/delete/pool/PoolRR

Mininet Scripts

Python topology Script

from mininet.topo import Topo

from mininet.net import Mininet

from mininet.link import Link

from mininet.util import quietRun

from mininet.log import setLogLevel, info

from mininet.node import Controller, RemoteController, OVSController

from mininet.node import CPULimitedHost, Host, Node

from mininet.node import OVSKernelSwitch, UserSwitch

from mininet.util import dumpNodeConnections

from mininet.cli import CLI

from mininet.log import setLogLevel, info

from mininet.link import TCLink, Intf

from subprocess import call

Page 56: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

59

  

setLogLevel('info')

net = Mininet(link=TCLink)

# Servers

Host1 = net.addHost('h1',cls=Host, ip="10.0.0.1")

Host2 = net.addHost('h2',cls=Host, ip="10.0.0.2")

Host3 = net.addHost('h3', cls=Host,ip="10.0.0.3")

Host4 = net.addHost('h4', cls=Host,ip="10.0.0.4")

Host5 = net.addHost('h5', cls=Host,ip="10.0.0.5")

Host6 = net.addHost('h6', cls=Host,ip="10.0.0.6")

Host7 = net.addHost('h7', cls=Host,ip="10.0.0.7")

Host8 = net.addHost('h8', cls=Host,ip="10.0.0.8")

# Clients

Host9 = net.addHost('h9', ip="10.0.0.9")

Switch1 = net.addSwitch('s1')

Switch2 = net.addSwitch('s2')

Switch3 = net.addSwitch('s3')

Switch4 = net.addSwitch('s4')

Switch5 = net.addSwitch('s5')

Switch6 = net.addSwitch('s6')

Switch7 = net.addSwitch('s7')

# Adding Switches

#

linksw400 = dict(bw=400)

linksw100 = dict(bw=100)

linkclients = dict(bw=100)

Page 57: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

60

  

linkservers = dict(bw=100)

# links between switches and hosts

net.addLink(Host1, Switch3,port1=13,port2=31 ,**linkservers)

net.addLink(Host5,Switch3,port1=53,port2=35 , **linkservers)

net.addLink(Host2,Switch4,port1=24,port2=42 , **linkservers)

net.addLink(Host6 , Switch4,port1=64,port2=46 ,**linkservers)

net.addLink(Host3 ,Switch5, port1=35,port2=53 ,**linkservers)

net.addLink(Host7, Switch5, port1=75,port2=57 ,**linkservers)

net.addLink(Host4, Switch6 , port1=46,port2=64, **linkservers)

net.addLink(Host8, Switch6 ,port1=86,port2=68 , **linkservers)

net.addLink(Host9, Switch7,port1=97,port2=79 ,**linkclients)

#net.addLink(Host5, Switch7,port1=5711,port2=7511,intf1Name='h7s70-eth570', intf2Name='s7h50-eth70', **linkclients)

# links between switches

# links between switch 2 and 4

net.addLink(Switch2, Switch4 , port1=240, port2=420, intf1Name='s24-eth240', intf2Name='s42-eth420' ,**linksw100)

net.addLink(Switch2, Switch5,port1=250, port2=520, intf1Name='s25-eth250', intf2Name='s52-eth520' , **linksw100)

net.addLink(Switch2, Switch6 , port1=260, port2=620, intf1Name='s26-eth260', intf2Name='s62-eth620' , **linksw100)

net.addLink(Switch2, Switch3 ,port1=230, port2=320, intf1Name='s23-eth230', intf2Name='s32-eth320' ,**linksw100)

net.addLink(Switch1, Switch4 ,port1=140, port2=410, intf1Name='s14-eth140', intf2Name='s41-eth410' ,**linksw100)

net.addLink(Switch1, Switch5 ,port1=150, port2=510, intf1Name='s15-eth150', intf2Name='s51-eth510' ,**linksw100)

Page 58: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

61

  

net.addLink(Switch1, Switch6,port1=160, port2=610, intf1Name='s16-eth160', intf2Name='s61-eth610' ,**linksw100)

net.addLink(Switch1, Switch3 ,port1=130, port2=310, intf1Name='s13-eth130', intf2Name='s31-eth310' ,**linksw100)

net.addLink(Switch7, Switch1, port1=710, port2=170, intf1Name='s71-eth710', intf2Name='s17-eth170' , **linksw400)

net.addLink(Switch7, Switch2, port1=720, port2=270, intf1Name='s72-eth720', intf2Name='s27-eth270' , **linksw100)

net.addController('c0', controller=RemoteController, ip='192.168.56.105', port=6633)

net.build()

net.start()

CLI(net)

#simpleTest()

net.stop() 

Get Interface Stats Script

echo "Port , Transmitted , Recieved " > result.txt

sudo ovs-vsctl list interface|grep name |grep "-"|awk -F":" '{print $2}'|sed -e 's/"//' -e 's/"//' > a.txt

>b.txt

>c.txt

line=$(sudo ovs-vsctl list interface|grep -n name |grep "-"|awk -F":" '{print $1}')

for X in $line

do

let Y=$X;

let Z=$Y+5

sudo ovs-vsctl list interface|awk '(NR=='$Z') {print $0}' |awk -F"rx_packets=" '{print $2}'|awk -F"," '{print ","$1}' >>b.txt

sudo ovs-vsctl list interface|awk '(NR=='$Z') {print $0}' |awk -F"tx_packets=" '{print ","$2}'|sed -e "s/}//" >> c.txt

done

paste a.txt b.txt c.txt >>result.txt 

Enable STP Script

sudo ovs-vsctl set bridge s1 stp_enable=true

sudo ovs-vsctl set bridge s2 stp_enable=true

sudo ovs-vsctl set bridge s3 stp_enable=true

Page 59: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

62

  

sudo ovs-vsctl set bridge s4 stp_enable=true

sudo ovs-vsctl set bridge s5 stp_enable=true

sudo ovs-vsctl set bridge s6 stp_enable=true

sudo ovs-vsctl set bridge s7 stp_enable=true

echo "Bridge s1 status"

sudo ovs-vsctl get bridge s1 stp_enable

echo "Bridge s2 status"

sudo ovs-vsctl get bridge s2 stp_enable

echo "Bridge s3 status"

sudo ovs-vsctl get bridge s3 stp_enable

echo "Bridge s3 status"

sudo ovs-vsctl get bridge s3 stp_enable

echo "Bridge s4 status"

sudo ovs-vsctl get bridge s4 stp_enable

echo "Bridge s5 status"

sudo ovs-vsctl get bridge s5 stp_enable

echo "Bridge s6 status"

sudo ovs-vsctl get bridge s6 stp_enable

 

echo "Bridge s7 status"

sudo ovs-vsctl get bridge s7 stp_enable 

 

Page 60: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

63

  

Installation steps ODL ( Pulling Code from Git Repository and compiling it Locally using Maven

Install Java JDK 8

sudo apt-add-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

set path

------------

sudo vi .bashrc

------------

#----------------------------

#Java home

#----------------

JAVA_HOME=/usr/lib/jvm/java-8-oracle

export JAVA_HOME

#------------

PATH=$PATH:$JAVA_HOME

export PATH

Maven Install

sudo mkdir -p /usr/local/apache-maven

sudo wget http://ftp.wayne.edu/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz

sudo mv apache-maven-3.3.3-bin.tar.gz /usr/local/apache-maven

sudo tar -xzvf /usr/local/apache-maven/apache-maven-3.3.3-bin.tar.gz -C /usr/local/apache-maven/

sudo update-alternatives --install /usr/bin/mvn mvn /usr/local/apache-maven/apache-maven-3.3.3/bin/mvn 1

sudo update-alternatives --config mvn

sudo apt-get install vim

vim ~/.bashrc

------------add

export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.3

export MAVEN_OPTS="-Xms256m -Xmx512m" # Very important to put the "m" on the end

Resource:

https://wiki.opendaylight.org/view/Install_On_Ubuntu_14.04

Page 61: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

64

  

Git Install

sudo add-apt-repository ppa:git-core/ppa -y

sudo apt-get update

sudo apt-get install git

git –version

Resource

http://unix.stackexchange.com/questions/33617/how-can-i-update-to-a-newer-version-of-git-using-apt-get

ODL installation

Once Environment is setup , we can pull code from ODL repository, we have used anonymous

Pull in our setup. Following are the steps:

Move the desired directory, in our case it is user $HOME

git clone https://git.opendaylight.org/gerrit/p/controller.git

saif@saif-SDN:~$ wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml

saif@saif-SDN:~$ cd controller/

saif@saif-SDN:~/controller$ sudo git checkout stable/helium

Checking out files: 100% (3975/3975), done.

Branch stable/helium set up to track remote branch stable/helium from origin.

Switched to a new branch 'stable/helium'

saif@saif-SDN:~/controller$

mvn clean install –DskipTests

It takes a while to install depending on the Machine hardware and memory.

Once Installation is successful , it will show summary of installation on the Screen.

setting up Mininet

git clone git://github.com/mininet/mininet

mininet/util/install.sh -n3f

sudo apt-get install scons

git clone https://github.com/CPqD/ofdissector

cd ofdissector/src

scons install

It may fail with complain

scons: Reading SConscript files ...

Page 62: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

65

  

scons: done reading SConscript files.

scons: Building targets ...

g++ -o openflow-common.os -c -fPIC -I. -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include openflow-common.cpp

In file included from openflow-common.cpp:5:0:

./openflow-common.hpp:10:20: fatal error: config.h: No such file or directory

you need to install

apt-get install wireshark-dev

after that you may get lib missing

scons install

scons: Reading SConscript files ...

scons: done reading SConscript files.

scons: Building targets ...

g++ -o openflow-common.os -c -fPIC -I. -I/usr/include/wireshark -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include openflow-common.cpp

In file included from openflow-common.cpp:9:0:

./of13/openflow-130.hpp:12:0: warning: "PROTO_TAG_OPENFLOW_VER" redefined [enabled by default]

apt-get install libgtk2.0-dev

apt-get install glade

pkg-config --list-all | grep glib

vi openflow-common.cpp

scons install

substitute 'dissector_add' with 'dissector_add_uint', not with 'dissector_add_unint'

scons install

resources:

https://github.com/CPqD/ofdissector/issues/14

http://sdn-lab.com/2014/03/19/how-to-analyze-openflow-packets-in-wireshark-at-ubuntu-12-04/

https://github.com/CPqD/ofdissector/issues/13

Page 63: opendayight loadBalancer

 

Ryerson University | Load Balancing Using SDN with Open Daylight Controller

66

  

References:  

https://www.opendaylight.org/sites/opendaylight/files/bk-user-guide.pdf

http://roan.logdown.com/posts/191801-set-openvswitch

http://conferences.sigcomm.org/sigcomm/2012/hotsdn.php

https://wiki.opendaylight.org/view/OpenDaylight_dlux:Dlux_Karaf_Feature

https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main

http://blog.jcuff.net/2013/09/my-first-steps-with-openflow.html

https://wiki.opendaylight.org/view/OpenDaylight_Controller:Eclipse_Setup

http://askubuntu.com/questions/420281/how-to-update-maven-3-0-4-3-1-1

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation

https://wiki.opendaylight.org/view/OpenDaylight_Controller:Load_Balancer_Service

https://wiki.opendaylight.org/view/OpenDaylight_Toolkit:Main:Windows

http://www.slideshare.net/joelwking/introduction-to-openflow-41257742