...

/

Programming Challenge: Routing Information Protocol

Programming Challenge: Routing Information Protocol

In this lesson, you'll be writing code for the routing information protocol that we looked at previously.

Problem Statement #

In this challenge, you will implement the routing information protocol that we just studied in the last lesson! You’re given some starter code files.

Starter Code #

For this coding challenge, we are providing you with a network simulator written in python3. The implementation of our simplified version of RIP is also required in Python. Let’s look at the starter code module by module.

topology_reader.py #

This is the entry point to our code. It takes a network topology in the form of a Python list as input and returns a list of router objects that reflect that topology. Here’s what the topology looks like:

Sample Input #

Press + to interact
topology = [
[1, [11, 2, 21, 1], [12, 4, 41, 1]], # Routers and ports
[2,[21, 1, 11, 1],[22, 5, 53, 1], [23,3,31,1]], #[IP of router, [port of router, IP of destination router, IP of port of destination router, cost]]
[3,[31,2,23,1],[32,5,52,1]],
[4,[41,1,12, 1],[42,5,51,1]],
[5,[51,4,42,1],[52,3,32,1],[53,2,22,1]]
]

The list consists of sublists. Each sublist represents one router. So [1, [11, 2, 21, 1], [12, 4, 41, ...