- Pritish Panda (1005970914)
- Yuto Omachi (1006005163)
- Shannon Budiman (1006863770)
- Project Proposal: Load Balancer with Dynamic Algorithm Selection Using POX and Mininet in an SDN Environment
- Specific Goals and Targets
- Tentative Timeline with Clear Goals and Targets
- How the Project Relates to the Field of "Computer Networks"
- Installation Steps
Project Proposal: Load Balancer with Dynamic Algorithm Selection Using POX and Mininet in an SDN Environment
This project aims to implement a load balancer using Software-Defined Networking (SDN) principles, with a specific focus on the POX SDN controller and the Mininet network emulator. The rationale behind this project is to explore how SDN can enhance network performance through load balancing and gain practical experience in SDN application development. This project will include the ability to dynamically select and run different load balancing algorithms.
-
Load Balancing Logic: Develop and implement multiple load balancing algorithms (e.g., round-robin, least connections) within the POX SDN controller to distribute incoming network traffic across multiple backend servers.
-
Dynamic Algorithm Selection: Create a dynamic configuration method that allows users to select and switch between different load balancing algorithms during runtime.
-
Flow Rule Definition: Use the OpenFlow protocol supported by the POX controller to define flow rules for directing network packets to backend servers based on the selected load balancing algorithm.
-
Basic Testing: Conduct initial testing using Mininet to verify that the load balancer performs load distribution correctly for each selected algorithm.
-
Documentation: Create concise project documentation that covers architecture, design decisions, and usage instructions for the load balancer with dynamic algorithm selection.
-
User Interface (UI) Development: Develop a user-friendly web-based UI that allows users to configure, monitor, and interact with the load balancer, including dynamic algorithm selection.
- Week 1: Project setup, research on load balancing algorithms, initial design of the network topology.
- Week 2: Implementation of load balancing logic for multiple algorithms, dynamic algorithm selection, and the beginning of testing.
- Week 3: Continued testing, UI development, and configuration method.
- Week 4: Final testing, refinement, documentation completion, and project wrap-up.
This project aligns with the field of computer networks by addressing the fundamental concept of load balancing within SDN. It demonstrates the potential of SDN technologies in providing flexible and dynamic load balancing solutions for various network scenarios. Here's the corrected version:
Ensure that the VM is connected to the internet.
Make sure you have the following prerequisites and fixes installed on the Mininet VM:
-
Update the package list:
sudo apt-get update
-
Install curl:
sudo apt-get install curl
-
Fix this line of code in
./pox/lib/packet/packet_utils.py
:Update the line around 105 in check_sum function , fixes a type conversion err :
# start += struct.unpack('H', data[-1]+'\0')[0] # Specify order?
to:
start += struct.unpack('H', bytes([data[-1], 0]))[0]
-
Clone this repository and cd into the LoadBalancer folder:
git clone https://github.com/Lordpritish/LoadBalancer.git
-
To copy the files to the appropiate folder run this cmd .This moves the pox related file to ~/pox/ext and mininet files to ~/mininet/examples:
chmod +x copy_files.sh ./copy_files.sh
This POX controller implements both Static and Dyanamic load balancing algorithm. It supports 4 load balancing algorithms:
-
Random Balancer (
RANDOM
): Servers are selected randomly. -
Round Robin Balancer (
ROUND_ROBIN
): Servers are selected in a circular sequence. -
Weighted Round Robin Balancer (
WEIGHTED_ROUND_ROBIN
): Servers are selected based on weights assigned to each server. -
Weighted response time (
LEAST_RESPONSE_TIME
): Averages the response time of each server, and combines that with the number of connections each server has open to determine where to send traffic.
To run the load balancer controller, use the following command:
./pox.py log.level --DEBUG LoadBalancer --ip=<controller_ip> --servers=<comma_separated_servers> --alg=<algorithm> --weights=<comma_separated_weights>
<controller_ip>
: IP address of the controller.<comma_separated_servers>
: Comma-separated list of server IP addresses.<algorithm>
: (Optional) Load balancing algorithm. Available options: 1=RANDOM
, 2=ROUND_ROBIN
, 3=WEIGHTED_ROUND_ROBIN
, 4=LEAST_RESPONSE_TIME
(default is 1=RANDOM
).<comma_separated_weights>
: (Optional) Comma-separated list of weights corresponding to each server (required forWEIGHTED_ROUND_ROBIN
algorithm).
-
Navigate to the POX directory:
cd ./pox
-
Terminate any existing controllers:
sudo pox.py killall controller
-
Run the load balancer controller:
./pox.py log.level --DEBUG LoadBalancer --ip=10.0.1.1 --servers=10.0.0.1,10.0.0.2,10.0.0.3,10.0.0.4
./pox.py log.level --DEBUG LoadBalancer --ip=10.0.1.1 --servers=10.0.0.1,10.0.0.2,10.0.0.3,10.0.0.4 --alg=1
./pox.py log.level --DEBUG LoadBalancer --ip=10.0.1.1 --servers=10.0.0.1,10.0.0.2,10.0.0.3,10.0.0.4 --alg=3 --weights=1,2,3,4
./pox.py log.level --DEBUG LoadBalancer --ip=10.0.1.1 --servers=10.0.0.1,10.0.0.2,10.0.0.3,10.0.0.4 --alg=4
-
Go to the root folder of the VM and navigate to the Mininet examples directory:
cd ~/mininet/examples/
-
Clear any existing Mininet configurations:
sudo mn -c
-
Run this command to use xterm
sudo cp ~/.Xauthority ~root/
-
Run the Mininet topology:
sudo python ./mytop.py
-
After terminating LoadBalancer, it will generate req_count.txt file which contains log of which server the loader balancer redirected the request to.
-
Run the following command to generate a to get summary plots of the traffic through the load balanecr. Note the generators is in ~/pox/ext and the req_count.txt is in ~/pox
python3 <Path-to-UIGenerator.py> <Path-to_req_count.txt>
Following are sample outputs