Create a simulated software defined network and run least-cost paths Dijkstra's algorithm.
This project aims to simulate SDN LSRouting and data delivering using OpenFlow on small self-traffic network.
- TestNet - used to create and test software defined networks with switches implementing OpenFlow protocol. Networks are created using custom topology presets where each switch-to-switch link has a weight assigned to it.
- LSRouting - performs link-state routing using Dijkstra's least-cost paths algorithm. The results of the algorithm are used to configure flow table entries in every switch in the network.
Clone the repository, install Python packages on the VM, and run run.py
script.
View detailed installation instructions.
TestNet includes multiple preset networks. The name of a preset describes its relative size. Most presets were reconstructed from familiar examples to demonstrate correctness of the routing algorithm.
- Baby – very small network with 3 switches and 3 links (network diagram).
- Tiny (default) – simple network with 4 switches and 5 links in-between them (network diagram).
- Small – a network with 6 switches and 10 links (network diagram).
- ...
- ...
View all network diagrams here.
-
Run a TestNet simulation.
$ sudo python ~/sdn-routing/run.py
-
Choose a preset network from the list.
< SELECT NETWORK TOPOLOGY > 1. Baby Topology - very small network with 3 switches and 3 links. 2. Tiny Topology (default) - simple network with 4 switches and 5 links. 3. Small Topology - a network with 6 switches and 10 links. 4. Large Topology - network of 16 connected switches (debug). 5. Massive Topology - 200 switches and 1000 links, on average (debug). (see network diagrams in the project definition) Input the index (1 to 5) of a network you want to test:
-
First configuration command-line interface (CLI) will start. Here you can enter commands to monitor network traffic (
tcpdump
,wireshark
, etc.) or view initial network configuration (all
,flows
, etc.).< STARTING CONFIGURATION INTERFACE > Input commands (optional): (E.g., track packets with 'sudo wireshark &', 'tcpdump', etc.) When you are ready to start the simulation tests, type 'exit' or press CTRL-D.
-
Type
exit
to exit the configuration phase and begin the tests. Upon selecting, the network will launch. Next LSRouting algorithm will determine the shortest paths from hosts to hosts. The following tests will be conducted:TestNet> exit < RUNNING TESTS... >
-
Initial Setup Test: Check host reachability before adding flow tables.
Expected results: The hosts should not reach other hosts because routing has not been set up yet.
-
Routing Test: Check host reachability after adding flow tables.
Expected results: The hosts should reach other hosts after the controller constructs flow tables determined by the link-state routing algorithm. A path from one host to another has the lowest possible cost.
-
Network Conditions Test: Check host reachability after disabling a link.
Expected results: A link between two nodes is no longer available. Some hosts may lose connection to other hosts because their traffic is routed through that link.
-
Second Routing Test: Recompute the least-cost paths and update flow table entries considering the change in network conditions.
Expected results: All hosts should be able to communicate. A path from one host to another has the lowest possible cost.
-
-
When the tests finish, the second CLI will start. View network statistics with
all
or any other debugging command. Typeexit
to exit the simulation phase and leave.
View sample outputs.
- Multiple commands (sample output):
all
– run multiple relevant tests on a network, one by one
- Link-State routing (sample output):
weights
– weight of linkscosts
– cost of the lowest-cost path to every other switchroutes
– first-hop switches with the lowest costpaths
– all shortest paths
- OpenFlow (sample output):
stats
– traffic statistics for each switchflows
– flow table entries of every switchdeleteFlows
– delete all flows
- Run on every node (sample output):
ips
– IP addressesarps
– ARP cachesnetstats
– routing tablesifconfigs
– interface configurations
- Tiny Network:
- Initially, Host 1 cannot reach Host 2 because the flow tables of SDN-controlled switches are not computed. Wireshark and tcpdump show that Host 1 sends 3 ARP packets to find Host 2, but does not receive a reply
- When the flows tables are computed and updated, the least-cost path from Switch 1 to Switch 2 is going through Switch 4. The packets from Host 1 travel to Switch 1 (left), Switch 4 (middle), and then Switch 2 (right) before reaching the destination Host 2
- Host 2 replies to Host 1.
- Maxim Puchkov
- Xiyu Zhang
See latest CHANGES.md (display as plaintext).
GitLab repository: https://csil-git1.cs.surrey.sfu.ca/471-project-6/sdn-routing.git
Submission commit: fc0d92894f57bba92ee192848637363dcf56e3d8 (Nov 21, 2019)
Presentation commit: 8608fcc5712eef882d29a005759e99982857abb0 (Nov 26, 2019)