A comprehensive, production-grade implementation of a Routing Information Protocol (RIP) router with integrated OpenFlow switch control, Software-Defined Networking (SDN) capabilities, and an interactive web-based simulation interface.
- About The Project
- Architecture
- Directory Structure
- Getting Started
- Usage
- Key Features (Detailed)
- Protocol Details
- Development and Testing
- Performance Considerations
- Security Considerations
- Troubleshooting
- Roadmap
- Contributing
- License
- References
- Contact / Support
Modern network education and protocol development require hands-on experimentation with routing protocols in a safe, reproducible environment. This project solves the challenge of testing and visualizing complex routing behaviors without expensive physical hardware by providing a complete virtualized network environment with real routing protocol implementations.
This project implements a fully functional PWOSPF (Practical Widescale Open Shortest Path First) router that combines classical distance-vector routing protocols with modern SDN technologies and interactive network visualization. The system is packaged as a Docker container, providing a complete, reproducible network simulation environment suitable for:
- Educational purposes: Teaching networking concepts with hands-on labs
- Research: Protocol validation and network behavior analysis
- Development: Testing routing algorithms in controlled environments
The implementation consists of four core components working together seamlessly:
- C-based Router Core (
router/) - A lightweight, high-performance router implementation supporting RIP routing, ARP resolution, ICMP messaging, and packet forwarding - POX Controller Framework (
pox/) - A comprehensive network control platform providing OpenFlow switch management, topology discovery, and network monitoring - PWOSPF Module (
pox_module/pwospf/) - A bridge layer integrating the RIP router with OpenFlow switches through the VNS (Virtual Network System) protocol - Interactive Web Dashboard (
webapp/) - A modern Flask-based web application featuring real-time network visualization, traffic generation, fault injection, and integrated terminal access
Implemented Features:
- ✅ Distance-Vector RIP Routing: Dynamic routing using RIP protocol with continuous updates
- ✅ Multi-Protocol Support: ARP resolution, ICMP echo/error handling, IPv4 forwarding with TTL management
- ✅ OpenFlow 1.0 Integration: SDN controller with switch management and flow table control
- ✅ Interactive Web Dashboard: Real-time SVG topology with traffic generation (Ping, Traceroute, HTTP)
- ✅ Fault Injection: One-click link blocking/recovery to test routing convergence
- ✅ Dockerized Deployment: Complete environment with Mininet, POX controller, and 3 routers + 3 hosts
- ✅ Automated Testing Framework: 15 comprehensive test cases validating connectivity and convergence
- ✅ Integrated Terminal: xterm.js-based CLI for direct Mininet interaction
Major Technologies:
- Router Core: C (GCC compiler, ANSI C standard)
- Control Plane: Python 2.7 (POX Controller, Mininet)
- Web Application: Python 3.x (Flask, Socket.IO, eventlet)
- Frontend: HTML5, JavaScript, xterm.js, SVG visualization
- Virtualization: Docker, Mininet, Open vSwitch 2.9+
- Networking Protocols: RIP, ARP, ICMP, IPv4, OpenFlow 1.0, VNS
The complete system architecture consists of a Docker container environment running a full network simulation with an interactive web interface:
┌─────────────────────────────────────────────────────────────────────────┐
│ Docker Container │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Interactive Web Dashboard (Webapp) │ │
│ │ (Flask + Socket.IO + xterm.js) │ │
│ │ ┌──────────────────────────────────────────────────────────┐ │ │
│ │ │ Live Topology Visualization | Traffic Controls │ │ │
│ │ │ Fault Injection | Link Management | Integrated Terminal │ │ │
│ │ └──────────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ ↓ (HTTP/WebSocket) │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ POX Controller & PWOSPF Control Plane │ │
│ │ ┌──────────────────────────────────────────────────────────┐ │ │
│ │ │ OpenFlow Controller | PWOSPF Logic | Router Integration │ │ │
│ │ └──────────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ ↓ (OpenFlow) │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Mininet Virtual Network Topology │ │
│ │ ┌──────────────────────────────────────────────────────────┐ │ │
│ │ │ Client -- vhost1 -- Server1 │ │ │
│ │ │ | \ │ │ │
│ │ │ | \ │ │ │
│ │ │ vhost2--vhost3 -- Server2 │ │ │
│ │ │ │ │ │
│ │ │ (Open vSwitch | Router Instances | Host Nodes) │ │ │
│ │ └──────────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
The Mininet environment simulates a physical network topology with:
-
Network Nodes:
Client- Traffic generation source (Client machine)Server1- HTTP server and test destination (IP: 192.168.2.200)Server2- HTTP server and test destination (IP: 172.24.3.30)vhost1,vhost2,vhost3- Virtual router instances running the C-based SR router
-
Network Infrastructure:
- Open vSwitch (OVS) instances serving as L2 switches
- Virtual Ethernet interfaces with realistic network properties
- Configurable link rates and latencies
The control plane manages routing and network behavior:
- POX Controller: OpenFlow 1.0 compliant controller managing switch forwarding behavior
- PWOSPF Modules:
ofhandler.py- Manages OpenFlow switch connections and topology eventssrhandler.py- Handles Simple Router (SR) packet operations and routing protocol updatesVNSProtocol.py- Implements the Virtual Network System (VNS) protocol for router communication
A modern, interactive interface for network simulation and testing:
-
Backend (
webapp/app.py):- Flask web server providing REST API endpoints
- Socket.IO for real-time WebSocket communication
- PTY (pseudo-terminal) bridge for integrated Mininet CLI access
- Event routing for topology updates and traffic injection
-
Frontend (
webapp/templates/andwebapp/static/):- HTML/CSS/JavaScript dashboard
- SVG-based topology visualization with live link state indicators
- Interactive controls for traffic generation (Ping, Traceroute, HTTP GET)
- Fault injection interface for link up/down simulation
- Integrated xterm.js terminal for direct CLI access
- Real-time event updates via WebSocket
The router implementation (router/sr_*.c) provides:
- Packet Processing: IPv4 packet forwarding with TTL decrement and validation
- Routing: Distance-vector RIP routing with dynamic routing table updates
- ARP Protocol: ARP request/reply handling and ARP cache management with timeout mechanisms
- ICMP Protocol: ICMP echo (ping) support and error message generation (destination unreachable, time exceeded)
- Interface Management: Multi-interface support with MAC address and IP address binding
- Network Communication: VNS protocol integration for virtual network connectivity
Key files:
sr_router.c/h- Main packet handling and routing logicsr_main.c- Router initialization and command-line interfacesr_rt.c/h- Routing table managementsr_arpcache.c/h- ARP cache with timeout-based invalidationsr_if.c/h- Interface configuration and managementsr_vns_comm.c- VNS protocol communicationsr_protocol.h- Network protocol definitions and packet structures
The POX framework provides a robust foundation for SDN applications:
- OpenFlow Protocol Support: Full OpenFlow 1.0 implementation with extensible protocol handling
- Event-Driven Architecture: Reactive event handling for network events and controller actions
- Network Discovery: Automatic topology discovery and link-state monitoring
- Packet Processing: Raw packet capture and manipulation at the switch level
- Scalability: Support for multiple switch controllers and distributed deployments
Key components:
pox/openflow/- OpenFlow 1.0 protocol implementationpox/lib/packet/- Network packet parsing and construction (Ethernet, IPv4, ARP, ICMP, UDP, DNS)pox/lib/addresses.py- IP and MAC address handling utilitiespox/lib/util.py- General utility functionspox/forwarding/- L2/L3 forwarding implementations
The PWOSPF module bridges the router and OpenFlow controller:
- VNS Protocol Handler (
VNSProtocol.py): Implements the Virtual Network System protocol for communication between the router and virtual network infrastructure - OpenFlow Handler (
ofhandler.py): Manages OpenFlow switch connections and packet exchange - SR Handler (
srhandler.py): Handles Simple Router (SR) packet operations and routing updates
.
├── router/ # C-based router implementation
│ ├── sr_router.c/h # Core routing and packet forwarding
│ ├── sr_main.c # Router initialization
│ ├── sr_rt.c/h # Routing table management
│ ├── sr_arpcache.c/h # ARP cache implementation
│ ├── sr_if.c/h # Interface management
│ ├── sr_vns_comm.c # VNS protocol communication
│ ├── sr_protocol.h # Protocol definitions
│ ├── sr_utils.c/h # Utility functions
│ ├── sr_dumper.c/h # Packet dumping/debugging
│ ├── sha1.c/h # SHA-1 hashing for authentication
│ ├── vnscommand.h # VNS command definitions
│ └── Makefile # Build configuration
│
├── pox/ # POX controller framework
│ ├── pox/
│ │ ├── core.py # Core controller framework
│ │ ├── boot.py # Bootstrap and initialization
│ │ ├── openflow/ # OpenFlow protocol implementation
│ │ │ ├── libopenflow_01.py # OpenFlow 1.0 library
│ │ │ ├── of_service.py # OpenFlow service layer
│ │ │ └── ...
│ │ ├── lib/ # Utility libraries
│ │ │ ├── packet/ # Packet parsing/construction
│ │ │ ├── addresses.py # Address handling
│ │ │ ├── revent/ # Event framework
│ │ │ ├── recoco/ # Cooperative multitasking
│ │ │ └── ...
│ │ ├── forwarding/ # Forwarding implementations
│ │ ├── topology/ # Topology management
│ │ └── misc/ # Miscellaneous utilities
│ ├── tests/ # Unit tests
│ └── pox.py # Main entry point
│
├── pox_module/ # RIP/PWOSPF integration module
│ ├── setup.py # Python package configuration
│ └── pwospf/
│ ├── __init__.py
│ ├── ofhandler.py # OpenFlow switch handler
│ ├── srhandler.py # Simple Router packet handler
│ └── VNSProtocol.py # VNS protocol implementation
│
├── webapp/ # Interactive web dashboard
│ ├── app.py # Flask backend server
│ ├── static/ # Frontend assets
│ └── templates/ # HTML templates
│ └── index.html # Main dashboard UI
│
├── http_server1/ # Test HTTP server 1
│ ├── webserver.py
│ └── index.html
│
├── http_server2/ # Test HTTP server 2
│ ├── webserver.py
│ └── index.html
│
├── demo.py # Mininet topology definition for demo
├── topo.py # Standard topology definition
├── entrypoint.sh # Container startup script
├── Dockerfile # Container definition
├── docker-compose.yml # Docker Compose configuration
├── docker_run.bat # Windows Docker launcher
├── rtable.vhost1 # Routing table for virtual host 1
├── rtable.vhost2 # Routing table for virtual host 2
├── rtable.vhost3 # Routing table for virtual host 3
├── IP_CONFIG # IP configuration file
├── auth_key # Authentication credentials
├── testcases.py # Automated test case definitions
├── grader.py # Test validation utility
└── README.md # This file
Docker Installation (Recommended)
- Docker Desktop 4.0+ (Windows/Mac) or Docker Engine 20.10+ (Linux)
- 4GB+ RAM allocated to Docker
- 2GB+ free disk space
- Modern web browser (Chrome, Firefox, Safari, Edge)
Native Installation (Advanced)
- Ubuntu 18.04+ or Debian-based Linux distribution
- GCC compiler (
build-essentialpackage) - Python 2.7 (for Mininet/POX) and Python 3.x (for web app)
- Mininet 2.3+ network simulator
- Open vSwitch 2.9+
make,git
Windows:
# Clone or navigate to project directory
cd c:\Users\thism\sysdev\rip_router_test
# Run the Docker launcher
.\docker_run.batLinux/Mac:
# Build Docker image
docker build -t rip_router:latest .
# Run container with privileged mode (required for Mininet)
docker run -it --privileged -p 8060:8060 rip_router:latestUsing Docker Compose:
docker-compose up --buildThe container will automatically:
- Start Open vSwitch service
- Launch POX controller with PWOSPF modules
- Initialize Mininet network topology
- Compile and start 3 router instances (vhost1, vhost2, vhost3)
- Start HTTP test servers
- Launch web dashboard on port 8060
Access the dashboard at: http://localhost:8060
# 1. Install system dependencies
sudo apt-get update
sudo apt-get install -y mininet openvswitch-switch build-essential \
python2 python3 python3-pip net-tools iputils-ping traceroute wget curl
# 2. Install Python 2 pip (for Mininet/POX)
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python2 get-pip.py
pip2 install ltprotocol "Twisted==20.3.0"
# 3. Install Python 3 dependencies (for web app)
pip3 install flask flask-socketio eventlet gunicorn gevent gevent-websocket
# 4. Build the router
cd router
make clean && make
cd ..
# 5. Add PYTHONPATH for POX modules
export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/pox_module
# 6. Start components in separate terminals
# Terminal 1: Start POX controller
./pox/pox.py openflow.of_01 pwospf.ofhandler pwospf.srhandler
# Terminal 2: Start Mininet topology (wait 10s after POX starts)
sudo python2 demo.py
# Terminal 3: Start router instances (wait 10s after Mininet starts)
./router/sr -t 300 -s 127.0.0.1 -p 8888 -v vhost1 &
./router/sr -t 300 -s 127.0.0.1 -p 8888 -v vhost2 &
./router/sr -t 300 -s 127.0.0.1 -p 8888 -v vhost3 &
# Terminal 4: Start web dashboard
cd webapp
python3 app.pyAccess the dashboard at: http://localhost:8060
-
Build and Launch the Container:
On Windows:
.\docker_run.batOn Linux/Mac:
docker build -t pwospf-router:latest . docker run -it --privileged -p 8060:8060 pwospf-router:latest -
Access the Web Dashboard:
Once the container starts and you see the message
Listening on http://0.0.0.0:8060, open your web browser and navigate to:http://localhost:8060 -
Explore the Dashboard:
- Topology View: Visual representation of the network with real-time link status
- Traffic Controls: Generate Ping, Traceroute, and HTTP traffic between any nodes
- Link Management: Simulate link failures by blocking/unblocking connections
- Integrated Terminal: Direct CLI access to the Mininet environment
The Docker image (Dockerfile) includes:
- Ubuntu 20.04 LTS base image
- Mininet virtual network simulator
- POX Controller with PWOSPF modules
- C-based SR Router (pre-compiled)
- Flask Web Dashboard with Socket.IO backend
- xterm.js integrated terminal
- Python 2.7/3.x runtime
The entrypoint.sh script orchestrates:
- Starting Open vSwitch service
- Launching the POX controller with PWOSPF modules
- Starting the Mininet network topology (in background)
- Starting 3 router instances after 10-second warmup
- Running the Flask web dashboard
- Exposing the dashboard on port 8060
cd router
make clean
makeThis generates the sr executable binary for the router.
./router/sr -t <topology_id> -v <virtual_host_id> -s <server_hostname> -u <username> -p <port>Command-line Options:
-t <topo_id>- Topology ID (integer)-v <vhost>- Virtual host identifier (e.g., vhost1, vhost2)-s <server>- Server hostname for VNS connection-u <username>- Username for authentication-p <port>- Server port (default: 8888)-r <rtable>- Routing table configuration file-h- Display usage information
Example:
./router/sr -t 300 -v vhost1 -s 127.0.0.1 -p 8888 -r rtable.vhost1#include "sr_router.h"
#include "sr_if.h"
#include "sr_rt.h"
int main(int argc, char **argv) {
struct sr_instance sr;
/* Initialize router */
sr_init(&sr);
/* Add network interface */
sr_add_interface(&sr, "eth0");
sr_set_ether_ip(&sr, inet_addr("10.0.1.1"));
/* Load routing table from file */
sr_load_rt(&sr, "rtable.txt");
/* Connect to VNS server and begin packet processing */
sr_connect_to_server(&sr, 8888, "127.0.0.1");
sr_read_from_server(&sr); // Main packet processing loop
return 0;
}python pox.py <module_name>Common modules:
forwarding.hub- L2 hub functionalityforwarding.l2_learning- L2 learning switchpwospf.ofhandler- PWOSPF OpenFlow handlerpwospf.srhandler- Simple Router handler
Example:
./pox/pox.py openflow.of_01 pwospf.ofhandler pwospf.srhandler# Interactive demo with CLI support
sudo python2 demo.py
# Or standard topology
sudo python2 topo.pyThis launches the network topology, creating virtual switches and hosts for testing.
cd webapp
python3 app.pyThe Flask server will start on http://localhost:8060 by default.
The dashboard displays a real-time SVG visualization of the network:
- Nodes: Displayed as circles with labels (Client, Server1, Server2, vhost1-3)
- Links: Lines connecting nodes with color-coding:
- Green: Active/Up links
- Red: Blocked/Failed links
- Gray: Inactive links
- Real-time Updates: Link status changes immediately reflect topology changes
Generate network traffic to test routing behavior:
-
Ping: ICMP echo requests with response display
- Source/Destination selection dropdowns
- Round-trip time (RTT) and packet loss statistics
- Visual path highlighting on topology
-
Traceroute: IP-level hop-by-hop path discovery
- Shows complete path from source to destination
- Hop-by-hop latency display
- Identifies router hops in the path
-
HTTP GET: Web traffic generation
- Target server selection
- HTTP response status display
- Content retrieval verification
-
Command Output: Real-time display of command results with timestamp
Simulate network failures and recovery:
-
Block/Unblock Links: One-click toggles for any network link
- Block vhost1-vhost2 connection
- Block vhost2-vhost3 connection
- Block vhost1-vhost3 connection
-
Observe Convergence: Watch as PWOSPF routing protocol dynamically adjusts:
- Routing table updates
- Alternative path establishment
- Automatic recovery when links are restored
-
Failure Scenarios: Test network resilience with various topologies:
- Single link failure (alternate path exists)
- Double link failure (full isolation of nodes)
- Link recovery (re-convergence)
Direct command-line access to the Mininet environment:
-
Full Mininet CLI: Execute any Mininet commands
nodes- List all network nodeslinks- Display network connectivitynet- Show complete network configurationsh <command>- Execute Linux shell commands
-
Node Access: Direct console to any network node
server1 ifconfig- Check interface configurationclient ping <ip>- Run custom ping commandsvhost1 route -n- Display routing tables
-
Real-time Output: Command results display in integrated terminal
Routing tables are text files defining static routes. Format:
<destination_ip> <gateway_ip> <subnet_mask> <interface_name>
Example (rtable.vhost1):
10.0.1.0 10.0.1.1 255.255.255.0 eth1
10.0.2.0 10.0.2.2 255.255.255.252 eth2
10.0.3.0 10.0.3.2 255.255.255.252 eth3
The IP_CONFIG file specifies IP addresses for all network nodes:
# Format: <hostname> <ip_address>
server1 192.168.2.200
server2 172.24.3.30
client 10.0.1.100
vhost1-eth1 10.0.1.1
vhost1-eth2 10.0.2.1
vhost1-eth3 10.0.3.1
vhost2-eth1 10.0.2.2
vhost2-eth2 192.168.2.2
vhost2-eth3 192.168.3.1
vhost3-eth1 10.0.3.2
vhost3-eth2 172.24.3.2
vhost3-eth3 192.168.3.2
Credentials for VNS server connection:
YOUR_USERNAME
YOUR_AUTH_KEY_HASH
- Distance-Vector Routing: Dynamic routing using RIP protocol with continuous updates
- Multi-Interface Support: Configuration for multiple network interfaces per router
- Packet Forwarding: Efficient IPv4 packet forwarding with longest-prefix matching
- ARP Resolution: Automatic MAC address resolution with intelligent caching
- ICMP Support: Echo request/reply (ping) and error messages
- TTL Management: TTL decrement and validation on forwarded packets
- Error Handling: Proper error reporting for unreachable destinations and exceeded TTLs
- Switch Control: Direct OpenFlow 1.0 switch management
- Flow Table Management: Flow insertion and removal capabilities
- Packet Inspection: Raw packet access for advanced routing decisions
- Port Management: Per-interface traffic control
- Statistics: Collection of switch performance metrics
- Real-time Topology Visualization: Live SVG-based network diagram with link state indicators
- Traffic Generation: Built-in tools for Ping, Traceroute, and HTTP traffic
- Fault Injection: One-click link blocking/recovery to test routing convergence
- Integrated Terminal: xterm.js-based CLI for direct Mininet interaction
- Socket.IO Backend: Real-time communication between dashboard and network simulation
- Responsive Design: Works on desktop, tablet, and mobile browsers
- Topology Simulation: Virtual topology with Mininet (Client, 2 Servers, 3 Routers)
- HTTP Test Servers: Built-in HTTP servers for connectivity testing
- Packet Dumping: Raw packet capture and analysis capabilities
- Automated Test Cases: 15 predefined test scenarios in
testcases.py - Debug Logging: Comprehensive logging for troubleshooting
- Test Validation:
grader.pyutility for automated test case verification
The Routing Information Protocol (RIP) is a classical distance-vector routing protocol with the following characteristics:
- Metric: Hop count (maximum 15, with 16 representing infinity/unreachable)
- Update Mechanism: Periodic routing table updates via UDP port 520
- Convergence: Slow convergence (up to several minutes in large networks)
- Maximum Hops: Limited to 15 hops, limiting network size
- Split Horizon: Optional mechanism to prevent routing loops
- Dynamic Adaptation: Automatic route recalculation on link failures
This implementation supports RIPv1/RIPv2 packet formats and standard distance-vector algorithms, with real-time convergence visualization through the web dashboard.
While the primary implementation uses RIP, the PWOSPF module provides a bridge for more advanced routing behaviors:
- Protocol Type: Distance-vector with link-state characteristics
- Scalability: Improved over pure RIP with better convergence
- Event-Driven Updates: Triggered updates on topology changes
- OpenFlow Integration: Direct integration with SDN switches
- Real-time Monitoring: Live updates displayed in web dashboard
The interactive web dashboard provides a visual way to validate routing behavior:
- Monitor Link Status: Watch the topology diagram for real-time link status changes
- Test Connectivity: Use the Ping control to verify paths between nodes
- Trace Routes: View the hop-by-hop path with Traceroute
- Simulate Failures: Block links and observe routing convergence
- Monitor Recovery: Unblock links and verify automatic re-convergence
The project includes automated test cases defined in testcases.py:
# Run all 15 test cases
python2 grader.py
# Run specific test case (1-15)
python2 grader.py -t 5
# Enable debug mode with packet capture
python2 grader.py -d 1
# Example output:
# Test Case 1: Passed (0.5/0.5)
# Test Case 2: Passed (0.5/0.5)
# ...
# Total Score: 10.0/10.0Test scenarios cover:
- Basic connectivity (Ping/Traceroute)
- Single link failure and recovery
- Double link failure (isolation scenarios)
- Route convergence timing
- ICMP error handling
- ARP resolution verification
Unit tests are located in pox/tests/ and can be executed with:
python -m pytest pox/tests/Enable packet dumping to analyze network traffic:
-
Enable Debug Mode: Modify router compilation with debug flags
cd router make clean # Edit Makefile to add -g and -DDEBUG flags make
-
Capture Packets: The
sr_dumper.cmodule captures packet tracestcpdump -i any -w capture.pcap
-
Analyze Traces: Use Wireshark or tcpdump for offline analysis
wireshark capture.pcap
The dashboard includes a terminal for direct Mininet interaction:
# List all nodes
nodes
# Get complete topology information
net
# Access a specific node's CLI
server1
# Run commands on nodes
server1 ifconfig
client ping 10.0.1.1
vhost1 route -n
# Monitor traffic
sh tcpdump -i eth0 icmp
# Exit from node CLI
exitCompile with debug symbols for detailed logging:
cd router
make clean
# Makefile already includes -g flag
makeEnable verbose logging in POX:
./pox/pox.py --verbose pwospf.ofhandler pwospf.srhandler- Scalability: Supports networks with hundreds of routers in simulation
- Convergence Time: RIP convergence time scales with network diameter (30+ seconds typical)
- Memory Usage: Minimal memory footprint suitable for embedded systems (~10MB per router)
- CPU Overhead: Low CPU usage during normal operation (Mininet-limited)
- Docker Performance: Container overhead minimal on modern systems (<5% overhead)
- Web Dashboard: Real-time updates optimized for responsive UI (WebSocket latency <50ms)
- Authentication: VNS protocol supports SHA-1 based authentication (see
sha1.c) - Access Control: User authentication via credentials file (
auth_key) - ARP Spoofing: Standard ARP validation implemented
- Input Validation: Packet validation and malformed packet handling
- Routing Loop Prevention: Split-horizon and poison-reverse mechanisms
- Dashboard Security: Consider network isolation for production use (no authentication built-in)
Protocol Standards Compliance:
This implementation follows these networking standards:
- RFC 1058 - Routing Information Protocol (RIPv1)
- RFC 2453 - RIP Version 2 (RIPv2)
- RFC 791 - Internet Protocol (IPv4)
- RFC 792 - Internet Control Message Protocol (ICMP)
- RFC 826 - Address Resolution Protocol (ARP)
- RFC 3630 - OpenFlow 1.0 Protocol Specification
# Check Docker daemon is running
docker ps
# View container logs
docker logs <container_id>
# Run with verbose output
docker run -it --privileged pwospf-router:latest bash
# Then manually run: ./entrypoint.sh# If port 8060 is in use, try a different port:
docker run -it --privileged -p 8888:8060 pwospf-router:latest
# Then access: http://localhost:8888- Ensure Docker has sufficient CPU and memory allocated (4GB+ RAM, 2+ cores)
- Mininet requires 2+ cores; optimal with 4+ cores
- Close other applications to free resources
-
Verify Flask server is running in container
# Inside container ps aux | grep flask
-
Check firewall isn't blocking port 8060
# Windows: Check Windows Defender Firewall # Mac: Check System Preferences > Security & Privacy # Linux: Check iptables or firewall rules
-
Try accessing from different browser
http://localhost:8060 http://127.0.0.1:8060
- Verify Mininet topology is running
- Check POX controller logs for errors (
cat pox.log) - Restart the container
- Verify container terminal is active
- Check for errors in integrated terminal
- Monitor POX controller logs
- Verify VNS server is running and accessible
- Check authentication credentials in
auth_key - Ensure routing table files exist and are readable
ls -la rtable.vhost* - Review logs in the router output (
cat sr1.log,cat sr2.log,cat sr3.log)
-
Verify routing table entries are correct
# In Mininet CLI via dashboard terminal vhost1 route -n -
Check ARP cache for MAC address resolution
vhost1 arp -a
-
Ensure interfaces are properly configured
vhost1 ifconfig
-
Use packet dumping to diagnose packet flow
# In integrated terminal sh tcpdump -i vhost1-eth0 -
Check POX controller debug logs
# Check logs in container cat pox.log
-
Verify POX controller is running
# Inside container ps aux | grep pox
-
Check OpenFlow handshake in debug logs
./pox/pox.py --verbose pwospf.ofhandler pwospf.srhandler
-
Ensure network connectivity between switches and controller
# In Mininet CLI dump net -
Validate flow table entries
# In Mininet CLI sh ovs-ofctl dump-flows vhost1
"Connection refused":
- POX controller not running
- Wrong server hostname/port in router invocation
"No matching routing table entry":
- Routing table file not found or has incorrect format
- Network address mismatch between config and topology
"ARP timeout":
- MAC address resolution failing
- Check interface configurations
- Verify ARP cache timeout settings in
sr_arpcache.c
"WebSocket connection failed":
- Flask server not running
- Port binding issue
- Browser security policy issue (use http, not https locally)
- Core RIP Routing: Distance-vector routing with hop-count metric
- ARP Cache Management: Request/reply handling with timeout-based invalidation
- ICMP Protocol Support: Echo request/reply and error messages (Type 3, 11)
- OpenFlow 1.0 Integration: SDN switch management with POX controller
- Web Dashboard: Real-time topology visualization and integrated terminal
- Docker Containerization: One-command deployment with complete environment
- Automated Test Suite: 15 test cases covering connectivity, failures, and convergence
- RIPv2 Support: Authentication and subnet mask advertisement
- OpenFlow 1.3+ Support: Modern OpenFlow features and multi-table support
- Performance Metrics Dashboard: Real-time packet rate, latency graphs, and bandwidth monitoring
- Packet Capture Export: Download PCAP files directly from web interface
- REST API: Programmatic control for automated testing frameworks
- CI/CD Pipeline: Automated testing on GitHub Actions with test result badges
- IPv6 Support: Dual-stack routing for modern networks
- Additional Protocols: BGP, OSPF implementation for comparison
When contributing to this project:
-
Code Style: Follow existing code conventions
- C code: Linux kernel style (see
router/files) - Python code: PEP 8 style guide
- JavaScript: ES6+ with clear formatting
- C code: Linux kernel style (see
-
Testing: Include appropriate test coverage
- Add unit tests for new functionality
- Test with automated test suite (
python2 grader.py) - Validate with dashboard UI
-
Documentation: Update documentation for changes
- Document API changes and additions
- Update README for new features
- Add inline code comments for complex logic
-
Validation: Test across all components
- Test across all supported virtual hosts (vhost1-3)
- Verify backward compatibility
- Test both Docker and native installations
-
Pull Requests: When submitting changes
- Include clear description of changes
- Reference any related issues
- Include test results and validation steps
This project is ideal for:
- Computer Networking Courses: Hands-on routing protocol implementation
- SDN Research: Integration of traditional routing with OpenFlow
- Network Engineering: Understanding packet forwarding and routing
- System Design: Multi-layer architecture patterns
- Protocol Development: Implementing custom network protocols
To add new functionality to the router:
- New Protocol Support: Modify
sr_protocol.handsr_router.c - ARP Cache Optimization: Enhance
sr_arpcache.calgorithms - Routing Algorithm Changes: Modify
sr_rt.cfor different routing logic - Interface Management: Extend
sr_if.cfor additional interface types
To modify the dashboard interface:
- UI Changes: Edit
webapp/templates/index.htmland CSS - Topology Visualization: Modify topology rendering logic
- Backend APIs: Extend
webapp/app.pyfor new endpoints - Real-time Features: Add Socket.IO handlers in
app.py
To modify the network topology:
- Edit
demo.py: Change network structure, add nodes/links - IP Configuration: Update
IP_CONFIGfile - Routing Tables: Modify
rtable.vhost*files - Link Parameters: Adjust bandwidth, latency, loss in topology script
This project incorporates code from the POX controller framework and components developed for educational networking research.
POX Framework: Licensed under GNU General Public License v3.0
Custom Components: Licensed under GNU General Public License v3.0
For full license details, see the LICENSE file in the repository.
Distributed under the GPL-3.0 License. See LICENSE for more information.
- RFC 1058 - Routing Information Protocol (RIPv1)
- RFC 2453 - RIP Version 2 (RIPv2)
- RFC 791 - Internet Protocol (IPv4)
- RFC 792 - Internet Control Message Protocol (ICMP)
- RFC 826 - Address Resolution Protocol (ARP)
- RFC 3630 - OpenFlow 1.0 Protocol Specification (corrected from RFC 3610)
- RFC 5340 - OSPF Version 3 (for comparison to PWOSPF)
- POX Controller: https://github.com/noxrepo/pox
- Mininet: http://mininet.org/
- OpenFlow Specification: https://opennetworking.org/
- Open vSwitch: http://openvswitch.org/
- Wireshark: Packet analysis and inspection
- tcpdump: Command-line packet capture
- iperf: Network performance measurement
- netcat: Network utility for data transfer
For questions, issues, or contributions:
- Email: tran219jn@gmail.com
- Website: jasontran.pages.dev
Bug Reports & Feature Requests: Please provide detailed information including:
- Environment (Docker version, OS)
- Steps to reproduce
- Expected vs actual behavior
- Relevant log files (
pox.log,sr1.log,sr2.log,sr3.log, container logs)
Community Support: For general questions about networking protocols or implementation details, consider referencing the RFC documents listed in the References section.
Architecture Highlight: This project demonstrates the integration of legacy routing protocols (RIP) with modern Software-Defined Networking (SDN) using OpenFlow, bridged through a custom PWOSPF module. The VNS protocol enables communication between the C router and Python-based control plane, showcasing hybrid network architectures.
Educational Value: Ideal for computer science students studying network protocols, software engineers learning SDN concepts, or researchers prototyping new routing algorithms in a safe, reproducible environment.
- POX Controller Framework: James McCauley and contributors
- Mininet: Brandon Heller, Bob Lantz, and contributors
- Open vSwitch: Nicira Networks and community contributors
- RIP Router Core: Custom C implementation for educational purposes
- PWOSPF Module: Python/POX integration for PWOSPF protocol
- Web Dashboard: Interactive visualization and control interface
- Documentation: Comprehensive guides and examples
- Full PWOSPF router implementation with C core
- POX controller integration with OpenFlow 1.0
- Interactive web dashboard with real-time visualization
- Docker containerization for easy deployment
- Automated test cases and validation framework
- Comprehensive documentation and examples
- OpenFlow 1.3+ support
- IPv6 routing support
- Additional routing protocols (OSPF, BGP)
- Enhanced web UI with real-time metrics
- Performance optimization for larger topologies
- Kubernetes deployment templates

