Day 50: Tcpreplay and tcpliveplay approach

Today we shall be exploring how to copy and redirect the OpenFlow packets to more than one controller from the load balancer. The load balancer is anyway sending the OpenFlow packets to one of the slave controllers - c1 or c2. The packets sent to these two controllers needs to be sent to master controller so the master controller can update the new flows added by c1 or c2 on the switches. This ensures synchronization between controllers.

There are two implementation methods to achieve the same:
  • Copy all packets generated from the load balancer to the controller side. Only the packets having destination IP address of c1 and c2 can be redirected to the master controller. Thus we can prevent the packets which already are reaching the master controller to be sent as duplicates
  • Copy and redirect packets from the slave controllers - c1 and c2. We need not take care of duplicate packets reaching master controller. This will reduce the time taken to redirect packets.
Since the second approach is faster, I have implemented that strategy in the following code. These links helped me to know a little more about tcpreplay and tcpliveplay.

Implementation Details:

Requirement - To firstly create a .pcap file which stores all packets that we are interested in redirecting. This .pcap file contents are redirected to the desired controller by using tcpliveplay. I have used a bash script to automate the process of collecting and redirecting packets from slave controllers to the master controller.

> gedit multicast.sh

multicast.sh

#! /bin/bash

for value in {1..100000}
do
    sudo tcpdump -i enx00e04c360013 -G 15 -W 1 -n src host 20.0.0.30 -v -w capture.pcap
    sudo tcpliveplay enp2s0 capture.pcap 10.0.0.50 94:de:80:42:a6:49 6633
done

By doing the above, we can observe that the packets are getting redirecting as we had intended to. In tomorrow's post we shall be seeing what we can do with these redirected packets.

Refer to previous and next articles here.

Author: Shravanya
Co-author: Swati

Comments

Popular posts from this blog

Day 12: Master Slave SDN Controller Architecture

Day 10: Mininet Simulation of a basic distributed SDN controller architeture