All Projects → nayanseth → sdn-loadbalancing

nayanseth / sdn-loadbalancing

Licence: GPL-3.0 license
To perform load balancing on fat tree topology using SDN Controller i.e. Floodlight and OpenDaylight.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to sdn-loadbalancing

pathman-sr
Pathman SR is an open-source app to compute paths and deploy routes in Segment Routing-enabled network.
Stars: ✭ 79 (-11.24%)
Mutual labels:  sdn, opendaylight
opendaylight-sample-apps
Sample applications for use with OpenDaylight (https://www.opendaylight.org/)
Stars: ✭ 56 (-37.08%)
Mutual labels:  sdn, opendaylight
Good Articles By Sort
本仓库用来存放我看过的认为比较好的文章---根据分类排序
Stars: ✭ 93 (+4.49%)
Mutual labels:  sdn
hybridnet
A CNI plugin, provides networking environment where overlay and underlay containers can run on the same node and have cluster-wide bidirectional network connectivity.
Stars: ✭ 188 (+111.24%)
Mutual labels:  sdn
Yabgp
Yet Another BGP Python Implementation
Stars: ✭ 177 (+98.88%)
Mutual labels:  sdn
Terraform Provider Zerotier
Create, modify and destroy ZeroTier networks and members through Terraform.
Stars: ✭ 113 (+26.97%)
Mutual labels:  sdn
Deep-Learning-Models
Deep Learning Models implemented in python.
Stars: ✭ 17 (-80.9%)
Mutual labels:  sda
Delta
PROJECT DELTA: SDN SECURITY EVALUATION FRAMEWORK
Stars: ✭ 55 (-38.2%)
Mutual labels:  sdn
python-openflow
Low level OpenFlow messages parser used by Kytos SDN Platform
Stars: ✭ 44 (-50.56%)
Mutual labels:  sdn
Stratum
Stratum is an open source silicon-independent switch operating system for software defined networks.
Stars: ✭ 176 (+97.75%)
Mutual labels:  sdn
basebox
A tiny OpenFlow controller for OF-DPA switches.
Stars: ✭ 39 (-56.18%)
Mutual labels:  sdn
Sdwannewhope
SD-WAN security and insecurity
Stars: ✭ 141 (+58.43%)
Mutual labels:  sdn
Corebgp
CoreBGP is a BGP library written in Go that implements the BGP FSM with an event-driven, pluggable model.
Stars: ✭ 124 (+39.33%)
Mutual labels:  sdn
ise-automation-ansible
Ansible playbooks to configure a freshly installed Cisco Identity Services Engine (ISE) for simple operations; specifically, a Cisco Software-Defined Access lab environment.
Stars: ✭ 16 (-82.02%)
Mutual labels:  sda
Fastclick
FastClick - A faster version the Click Modular Router featuring batching, advanced multi-processing and improved Netmap and DPDK support (ANCS'15). Check the metron branch for Metron specificities (NSDI'18).
Stars: ✭ 100 (+12.36%)
Mutual labels:  sdn
Beehive Netctrl
Distributed SDN controller built on top of beehive.
Stars: ✭ 56 (-37.08%)
Mutual labels:  sdn
Kathara
A lightweight container-based network emulation system.
Stars: ✭ 139 (+56.18%)
Mutual labels:  sdn
Computer Networking
Free resources for a self-taught education in Computer Networking
Stars: ✭ 201 (+125.84%)
Mutual labels:  sdn
v-switch
Virtual Encrypted Switch across the network, using UDP + AES + TAP
Stars: ✭ 27 (-69.66%)
Mutual labels:  sdn
Ryu-SDN-IP
SDN-IP project implemented by Ryu SDN framework.
Stars: ✭ 33 (-62.92%)
Mutual labels:  sdn

SDN Load Balancing

Note: Project is no longer being maintained. Have pushed a recent fix to fix the parsing issues. The script will work as long as the environment is setup correctly. The script is not at all optimized and was written to get a proof of concept.

Goal: To perform load balancing on any fat tree topology using SDN Controller i.e. Floodlight and OpenDaylight.

Note: The goal is to perform load balancing but at the same time ensure that the latency is minimum. We are using dijkstra's algorithm to find multiple paths of same length which enables us to reduce the search to a small region in the fat tree topology. It is also important to note that OpenDaylight by default forwards traffic to all ports. So specific rules might need to be pushed to get a proper load balancing output. Currently the program simply finds the path with least load and forwards traffic on that path.

Code is be a bit un-optimized, especially for the flow rules being pushed in ODL.

System Details

  1. SDN Controller - Floodlight v1.2 or OpenDaylight Beryllium SR1
  2. Virtual Network Topology - Mininet
  3. Evaluation & Analysis - Wireshark, iPerf
  4. OS - Ubuntu 14.04 LTS

Implementation Approach

Base Idea: Make use of REST APIs to collect operational information of the topology and its devices.

  1. Enable statistics collection in case of Floodlight (TX i.e. Transmission Rate, RX i.e. Receiving Rate, etc). This step is not applicable for OpenDaylight
  2. Find information about hosts connected such as their IP, Switch to which they are connected, MAC Addresses, Port mapping, etc
  3. Obtain path/route information (using Dijkstra thereby limiting search to shortest paths and only one segment of fat tree topology) from Host 1 to Host 2 i.e. the hosts between load balancing has to be performed.
  4. Find total link cost for all these paths between Host 1 and Host 2. In case of Floodlight it is the TX and RX but for OpenDaylight it gives only transmitted data. So subsequent REST requests are made to compute this. This adds latency to the application (when using OpenDaylight).
  5. The flows are created depending on the minimum transmission cost of the links at the given time.
  6. Based on the cost, the best path is decided and static flows are pushed into each switch in the current best path. Information such as In-Port, Out-Port, Source IP, Destination IP, Source MAC, Destination MAC is fed to the flows.
  7. The program continues to update this information every minute thereby making it dynamic.

Results We Achieved

Transfer (Gbytes) - BLB B/W(Gbits) - BLB Transfer (Gbytes) - ALB B/W(Gbits) - ALB
15.7 13.5 38.2 32.8
21.9 18.8 27.6 32.3
24.6 21.1 40.5 34.8
22.3 19.1 40.8 35.1
39.8 34.2 16.5 14.2
Average = 24.86 Average = 21.34 Average = 32.72 Average = 29.84

iPerf H1 to H3 Before Load Balancing (BLB) and After Load Balancing (ALB)

Transfer (Gbytes) - BLB B/W(Gbits) - BLB Transfer (Gbytes) - ALB B/W(Gbits) - ALB
18.5 15.9 37.2 31.9
18.1 15.5 39.9 34.3
23.8 20.2 40.2 34.5
17.8 15.3 40.3 34.6
38.4 32.9 18.4 15.8
Average = 23.32 Average = 19.96 Average = 35.2 Average = 30.22

iPerf H1 to H4 Before Load Balancing (BLB) and After Load Balancing (ALB)

Min Avg Max Mdev
0.049 0.245 4.407 0.807
0.050 0.155 4.523 0.575
0.041 0.068 0.112 0.019
0.041 0.086 0.416 0.066
0.018 0.231 4.093 0.759
Avg:0.0398 Avg:0.157 Avg:2.7102 Avg:0.4452

Ping from H1 to H4 Before Load Balancing

Min Avg Max Mdev
0.039 0.075 0.407 0.068
0.048 0.078 0.471 0.091
0.04 0.072 0.064 0.199
0.038 0.074 0.283 0.039
0.048 0.099 0.509 0.108
Avg:0.0426 Avg:0.0796 Avg:0.3468 Avg:0.101

Ping from H1 to H4 After Load Balancing

How To Use It?

Video Demo

Video Demo

Requirements

  1. Download Floodlight (v1.2) / OpenDaylight (Beryllium SR1)
  2. Install Mininet (v2.2.1)
  3. Install OpenVSwitch

Running The Program (OpenDaylight)

  1. Download the distribution package from OpenDaylight. Next unzip the folder.
  2. In Terminal, change directory to the distribution folder and run ./bin/karaf.
  3. Run Mininet sudo mn --custom topology.py --topo mytopo --controller=remote,ip=127.0.0.1,port=6633
  4. Perform pingall a couple of times till no packet loss occurs.
  5. Next run the odl.py script and specify the input. Read the Floodlight instructions to get better insight on what is happening and what input to feed in.

Running The Program (Floodlight)

Note: We are performing load balancing between h1, h3 and h4 at the moment. The best path for both is via Switch 1 Port 4. This is the best path selected by OpenFlow protocol. Please see the topology and why is it Port 4.

  1. Remove the official Floodlight Load Balancer

  2. Run the floodlight.sh shell script

  3. Run Floodlight

  4. Run the fat tree topology i.e. topology.py using Mininet

    sudo mn --custom topology.py --topo mytopo --controller=remote,ip=127.0.0.1,port=6653
    

    Note: Provide correct path to topology.py in command

    alt tag

    Note: Switch ID have been added next to Switches. Numbers near the links are the port numbers. These port numbers may change when you run mininet. For us this is the port numbers. From now on all references in the code will be with respect to this topology

  5. Type the following command in Mininet

    xterm h1 h1
    
  6. In first console of h1 type, ping 10.0.0.3

  7. In second console of h1 type, ping 10.0.0.4

  8. On Terminal open a new tab Ctrl + Shift + T and type sudo wireshark

  9. In wireshark, go to Capture->Interfaces and select s1-eth4 and start the capture.

  10. In filters section in wireshark type ip.addr==10.0.0.3 and check if you are receiving packets for h1 -> h3. Do same thing for h1->h4. Once you see packets, you can figure that this is the best path.

  11. But to confirm it is, repeat the above two steps for s1-eth3 and you will find that no packets are transmitted to this port. Only packets it will receive will be broadcast and multicast. Ignore them.

  12. Now in the second console of xterm of h1, stop pinging h4. Our goal is to create congestion on the best path of h1->h3, h1->h4 and vice versa and h1 pinging h3 is enough for that

  13. Go to your Terminal and open a new tab and run the loadbalancer.py script

  14. Provide input arguments such as host 1, host 2 and host 2's neighbor in integer format like for example 1,4,3 where 1 is host 1, 4 is host 2 and 3 is host 2's neighbor. Look at the topology above and you will find that these hosts are nothing but h1, h4 and h3 respectively.

  15. The loadbalancer.py performs REST requests, so initially the link costs will be 0. Re-run the script few times. This may range from 1-10 times. This is because statistics need to be enabled. After enabling statistics, it takes some time to gather information. Once it starts updating the transmission rates, you will get the best path and the flows for best path will be statically pushed to all the switches in the new best route. Here the best route is for h1->h4 and vice versa

  16. To check the flows, perform a REST GET request to http://127.0.0.1:8080/wm/core/switch/all/flow/json

  17. Now on second console of h1 type ping 10.0.0.4

  18. Go to wireshark and monitor interface s1-eth4 with the filter ip.addr==10.0.0.x where x is 3 and 4. You will find 10.0.0.3 packets but no 10.0.0.4 packets

  19. Stop the above capture and now do the capture on s1-eth3, s21-eth1, s21-eth2, s2-eth3 with the filter ip.addr==10.0.0.x where x is 3 and 4. You will find 10.0.0.4 packets but no 10.0.0.3 packets

Load Balancing Works!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].