In traditional networking, link failures often lead to significant downtime and require manual reconfiguration or slow legacy protocols. This project demonstrates how Software-Defined Networking (SDN) can automate fault tolerance and path restoration. Using a Triangle Topology, the goal is to implement a system where a central POX Controller dynamically detects a link failure between two switches via OpenFlow and automatically reroutes traffic through a backup path to maintain connectivity.
The network is emulated in Mininet and follows a triangle design to provide redundancy.

- Hosts:
h1(10.0.0.1),h2(10.0.0.2) - Switches:
s1,s2,s3(Open vSwitches) - Controller: Remote POX Controller (127.0.0.1)
- Primary Path:
h1<->s1<->s2<->h2 - Backup Path:
h1<->s1<->s3<->s2<->h2
-
Initialize the POX Controller: In Terminal 1, run the controller with the necessary modules for discovery and loop prevention:
./pox.py forwarding.l2_learning openflow.discovery openflow.spanning_tree --hold-down=2
-
Launch the Network Topology: In Terminal 2, execute the custom Mininet script:
sudo python3 topo.py
-
Monitor Traffic with Wireshark: Open Wireshark on the
loopback (lo)interface and filter byopenflow_v1to observe the control channel. -
Execute the Test:
- Start a ping from
h1toh2. - Manually bring down the primary link using
link s1 s2 down. - Observe the automatic recovery and traffic rerouting.
- Start a ping from
Initially, the pings show low latency. When the s1-s2 link is disabled, the pings pause briefly during the STP Convergence period and then resume automatically via the backup switch s3.
Analysis: The Round Trip Time (RTT) increases after recovery (e.g., from 0.05ms to ~10ms+) because the data packets must now travel through an additional switch (s3).
We used ovs-ofctl to inspect the Flow Tables on s1 to prove the controller modified the data plane rules.
- Pre-Failure: Flow rule matches Destination IP and outputs to the port connected to
s2. - Post-Failure: Flow rule is updated by the controller to output to the port connected to
s3.
The "Detection" phase is validated by the OFPT_PORT_STATUS message. This is an asynchronous message sent by the switch to the POX controller to report that a link is down.
The project successfully demonstrates the core advantage of SDN: Centralized Control Plane Logic. By separating the control logic from the physical switches, the POX controller was able to detect a link failure in real-time and push new flow rules to the switches, achieving recovery with zero manual configuration.


