{"id":26657705,"url":"https://github.com/breezy-codes/control-plane-simulator","last_synced_at":"2025-03-25T09:16:06.589Z","repository":{"id":193791484,"uuid":"689502346","full_name":"breezy-codes/Control-Plane-Simulator","owner":"breezy-codes","description":"This project simulates a basic network control plane using Dijkstra's shortest path algorithm. It allows users to understand how routing decisions are made in computer networks based on the shortest path between routers.","archived":false,"fork":false,"pushed_at":"2024-06-29T00:38:56.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-29T01:41:19.816Z","etag":null,"topics":["bellman-ford-algorithm","computer-networks","dijkstra-algorithm","networks","pyhthon","simulation"],"latest_commit_sha":null,"homepage":"https://briannalaird.com/tutorials/control-plane-simulator","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/breezy-codes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-10T02:27:28.000Z","updated_at":"2024-06-29T00:38:59.000Z","dependencies_parsed_at":"2024-06-29T01:41:01.798Z","dependency_job_id":"9f7ca549-fc9d-42e7-849e-09f1943fd496","html_url":"https://github.com/breezy-codes/Control-Plane-Simulator","commit_stats":null,"previous_names":["breezy-codes/control-plane-simulator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breezy-codes%2FControl-Plane-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breezy-codes%2FControl-Plane-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breezy-codes%2FControl-Plane-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/breezy-codes%2FControl-Plane-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/breezy-codes","download_url":"https://codeload.github.com/breezy-codes/Control-Plane-Simulator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245431725,"owners_count":20614184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bellman-ford-algorithm","computer-networks","dijkstra-algorithm","networks","pyhthon","simulation"],"created_at":"2025-03-25T09:16:05.317Z","updated_at":"2025-03-25T09:16:06.072Z","avatar_url":"https://github.com/breezy-codes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Network Control Plane Simulator\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.linkedin.com/in/brianna-laird/\" target=\"_blank\"\u003e\n    \u003cspan style=\"margin: 0 15px;\"\u003e\n      \u003cimg src=\"https://github.com/breezy-codes/breezy-codes/blob/main/Figures/linkedin.png\" style=\"height: 35px;\" alt=\"linkedin logo\" /\u003e\n    \u003c/span\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.youtube.com/@Breezy-Codes/\" target=\"_blank\"\u003e\n    \u003cspan style=\"margin: 0 15px;\"\u003e\n      \u003cimg src=\"https://github.com/breezy-codes/breezy-codes/blob/main/Figures/youtube.png\" style=\"height: 35px;\" alt=\"youtube logo\" /\u003e\n    \u003c/span\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://briannalaird.com/\" target=\"_blank\"\u003e\n    \u003cspan style=\"margin: 0 15px;\"\u003e\n      \u003cimg src=\"https://github.com/breezy-codes/breezy-codes/blob/main/Figures/portfolio.png\" style=\"height: 35px;\" alt=\"portfolio logo\" /\u003e\n    \u003c/span\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://orcid.org/0009-0005-9841-3691\" target=\"_blank\"\u003e\n    \u003cspan style=\"margin: 0 15px;\"\u003e\n      \u003cimg src=\"https://github.com/breezy-codes/breezy-codes/blob/main/Figures/orc-id.png\" style=\"height: 35px;\" alt=\"ORC-ID\" /\u003e\n    \u003c/span\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nThis project simulates a basic network control plane using both Dijkstra's shortest path algorithm and the Bellman-Ford algorithm. It allows users to understand how routing decisions are made in computer networks based on the shortest path between routers.\n\n## Introduction\n\nIn computer networking, understanding the decision-making process for routing packets is essential. The control plane, responsible for this task, sets the rules and paths that data should follow. This simulator presents the principles behind these routing decisions, making it easier for beginners to grasp the foundational ideas of network routing.\n\n## Code Structure \u0026 Explanation\n\n### Common Components\n\n1. **Network Topology (`routers` dictionary)**:\n   This dictionary describes our virtual network's layout. Each router (like 'A', 'B', 'C'...) has neighboring routers it's connected to, with connection strengths or costs represented numerically.\n   For instance:\n\n   ```python\n   'A': {'B': 1, 'C': 2, 'E': 3}\n   ```\n\n   Router 'A' connects to routers 'B', 'C', and 'E' with weights of 1, 2, and 3, respectively.\n\n### Dijkstra's Algorithm\n\n1. **Dijkstra's Algorithm Function (`dijkstra` function)**:\n   This well-known algorithm finds the shortest path from a starting router to all other routers in the network. It returns:\n   - `distances`: The shortest distance from the starting router to every other router.\n   - `predecessors`: Used for retracing the chosen path.\n\n2. **Path Determination (`get_path` function)**:\n   This function determines the optimal path from a source to a destination router using Dijkstra's results, backtracking via the `predecessors` from the destination to the source.\n\n### Bellman-Ford Algorithm\n\n1. **Bellman-Ford Algorithm Function (`bellman_ford` function)**:\n   Another essential algorithm in the networking realm, the Bellman-Ford algorithm determines the shortest path from a starting router to all others, accounting for possible negative-weight cycles. This function also returns distances and predecessors.\n\n2. **Path Determination using Bellman-Ford (`get_path_bf` function)**:\n   This function traces back the optimal path from source to destination using Bellman-Ford's results.\n\n### Main Execution\n\nSample test cases at the end of each script demonstrate the algorithms in action. This includes finding paths between specified router pairs.\n\n## Getting Started\n\nTo run the simulator:\n\n1. Ensure Python is installed.\n2. Clone this repository or download the scripts.\n3. Navigate to the directory and run the appropriate script:\n   - For Dijkstra's algorithm:\n\n     ```bash\n     python dijkstra_simulator.py\n     ```\n\n   - For Bellman-Ford's algorithm:\n\n     ```bash\n     python bellmanford_simulator.py\n     ```\n\nExecuting the scripts will display optimal paths for sample test cases and their associated costs.\n\n---\n\n## Improvements and Extensions\n\n1. **Dynamic Topology**: Currently, our network topology is static (hard-coded). An improvement could be a UI or CLI prompt for users to input their own topology, modifying routers and connections dynamically.\n\n2. **Visualization**: Design a GUI to visually depict routers and connections. Optimal routes can be highlighted as paths are determined, enhancing understanding.\n\n3. **Multiple Algorithm Comparison**: Users could select from several algorithms (e.g., Dijkstra, Bellman-Ford, A*) and compare results.\n\n4. **Network Failures Simulation**: Simulate network failures, such as particular routers or connections failing, to test routing algorithm resilience and highlight alternative routes when the primary is inaccessible.\n\n5. **Performance Metrics**: Measure routing decision execution times, examining how factors like network size or complexity impact performance.\n\n6. **Support for Additional Costs**: Beyond distance, metrics like bandwidth, congestion, or reliability could determine optimal paths.\n\n## Conclusion\n\nThe Network Control Plane Simulator serves as a foundational tool for delving into the intricacies of routing decisions in computer networks. As our digital landscape evolves and networks become more intricate, tools like this remain invaluable for students, professionals, and enthusiasts. Proposed improvements would further enhance this simulator into a platform for advanced network simulations, performance testing, and algorithm comparisons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreezy-codes%2Fcontrol-plane-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreezy-codes%2Fcontrol-plane-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreezy-codes%2Fcontrol-plane-simulator/lists"}