Day 52: Switchover mechanism vs tcpliveplay

In Day 50's article we familiarized ourselves with tcpliveplay and how to use the same to redirect OpenFlow packets to the master controller. Yesterday, I tried to create TCP connections from master controller to the switch from which the duplicated packets reached the master controller.

These were few findings that made me rethink my tcpliveplay approach:
  • Zodiac FX switch cannot forward packets to the required port if it is not connected to any controller. This is irrespective of whether the flows are already installed in it or not.
  • Whenever a Zodiac FX switch contacts any controller, it informs the controller of all the flows it already has installed in it. Only new flows get installed from then on. Thus the controller automatically becomes aware of the previously installed flows. This does not take perceivable amount of time.
  • The flows installed in the FX switch keep getting updated and this is the reason the FX switch needs to be connected to a controller at all times. Failing which, the FX switch fails to forward packets.
Considering the above newly found facts, we need to reconsider if our tcpliveplay strategy is even necessary. By tcpliveplay we can definitely ensure synchronization between slave and master controllers as the packets that reach slave controllers also reach master controller. But the master controller doesn't have the liberty to respond to this OpenFlow request message as slave controller is responsible of the same. Imagine a scenario where both the slave and master controller send OpenFlow replies to the FX switch. Here comes a race condition. The FX switch could either receive slave controller reply first which would get replaced by master controller's reply, the reverse of this situation could happen or worse, no flow gets installed since both come in simultaneously and FX switch doesn't have any priority or race condition resolving algorithm or strategy.

This is when I thought of another strategy that could work: continuous switch-over between slave and master controllers. In this scenario, say s1 has slave controller as c1 and master controller as mc. It will first contact c1, install few flows for a particular amount of time. A switch-over happens and now the switch s1 is connected to mc. The first communication they have, the FX switch makes mc aware of all flows installed and thus mc can install more flows if there are any or keep on updating the existing flows. In our previous strategy, a switch-over would happen only if the controller went down. But now, it happens every few seconds or minutes based on the load each slave and master controller are subjected to.

In case s1 is under a DDoS attack and thus floods the controller with request packets, this switch-over frequency increases. This also ensures that not too many resources of a particular controller gets exhausted. The switch-over functionality is implemented on the load balancer by mentioning two backend servers for one ACL rule.

If unfortunately the slave controller comes down, the other slave controller c2 will take-over. Thus the switch migration task is also taken care by the load balancer.

We are yet to address the case when the master controller is down. We shall look into a back-up master controller and using keepalived to automatically activate it when the actual master controller is down. I shall discuss the same in the near future.

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 50: Tcpreplay and tcpliveplay approach

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