Complete the following assignment by yourself, or in a group of two. Submit your work on D2L into the “Programming Assignment 5” folder. All partners will submit the same solution and we will only grade one solution for each group.
In this programming assignment you will:
- Implement MPLS forwarding on routers
- Control forwarding paths using MPLS labels
- Implement priority-based forwarding on routers
In this project, you will implement MPLS forwarding and priority-based forwarding at routers. You will also have a greater autonomy over and responsibility for the design of your protocol based on the requirements.
The code provides you with the implementation several network layers that cooperate to provide end-to-end communication.
NETWORK LAYER (network.py)
DATA LINK LAYER (link.py)
The code also includes simulation.py
that manages the threads running the different network objects. Currently, simulation.py
defines the following network.
At a high level the network includes hosts, routers and links.
Hosts
generate and receive traffic.
Routers
forward packets between interfaces.
Links
connect network interfaces of routers and hosts.
Finally, the LinkLayer
implements a thread that forwards traffic along links.
In this assignment forwarding speed is restricted by link capacity.
Please consult the video lecture for a more in-depth explanation of the code.
To run the starting code you may execute:
python simulation.py
The current simulation_time
in simulation.py
is 10 seconds to account for the delay of packet forwarding.
As the network becomes more complex and takes longer to execute, you may need to extend the simulation to allow all the packets to be transfered.
-
[10 points] Implement MPLS forwarding such that only links incident on hosts carry
NetworkPackets
and links between routers only carryMPLSFrames
.a. [4 points] Implement the
MPLSFrame
class to encapsulateNetworkPackets
as MPLS frames. In the lectures slides we presented the MPLS frame structure and position with respect to link (Ethernet) and network (IP) layer packets as:In this project we simplify Ethernet frame as
LinkFrame
inlink.py
and IP asNetworkPacket
innetwork.py
.LinkFrame
carries bothMPLSFrames
andNetworkPackets
and itstype_S
field allows the network process at theRouter
to differentiate between the two and handle them appropriately.Your task is to implement
MPLSFrame
to encapsulateNetworkPackets
. Encapsulation should take place on the first hop router according the the rules defined inencap_tbl_D
parameter to theRouter
. The structure of that table is up to you to define. Similarly, you do not need to implement all the fields of an MPLS frame. The MPLS frame should contain the label at the least. You may add experimental bits, S bit, and time to live if you choose. You will need to modifyRouter.process_network_packet()
to implement MPLS encapsulation.b. [4 points] Implement MPLS forwarding based on MPLS forwarding tables passed to the
Router
constructor asfrwd_tbl_D
. The structure offrwd_tbl_D
is up to you, but the tables should contain the in label, in interface, out label, and out interface. For each router, pass in correctly designed forwarding tables so that your routers achieve end-to-end connectivity. You will need to modifyRouter.process_queues()
andRouter.process_MPLS_frame()
to implement MPLS forwarding.c. [2 points] Implement MPLS decapsulation at last hop router to deliver
NetworkPacket
to end hosts. Decapsulation should take place according to the rules defined indecap_tbl_D
parameter to theRouter
. The structure of that table is up to you to define. You will need to modifyRouter.process_MPLS_frame()
to implement MPLS decapsulation and forwarding.Submit your code as
link_1.py
,network_1.py
, andsimulation_1.py
. Submit a YouTube video link showing the execution ofsimulation_1.py
. We will grade you based on correct forwarding actions and content of your MPLS frames. Make sure that all of these are clearly visible in your output and the video. -
[5 points] Implement MPLS forwarding, such that packets from different hosts follow different paths. Configure the more complex network shown below in
simulation.py
. Add transmissions fromHost 1
andHost 2
toHost 3
and configure MPLS tables such that routers encapsulateNetworkPackets
asMPLSFrames
and forward the packets from the different hosts on different paths.Submit your code as
link_2.py
,network_2.py
, andsimulation_2.py
. Submit a YouTube video link showing the execution ofsimulation_2.py
. We will grade you based on correct forwarding actions. Make sure these are clearly visible in your output and the video. -
[10 points] Implement strict priority forwarding on the MPLS routers.
a. [2 points] Recall that the IP header has a type of service (TOS) field that carries packet priority.
NetworkPacket
constructor in this assignment has apriority
argument, though it is currently unused. Theudt_send()
function insimulation.py
sends packet with priorities 0 and 1. Assume higher number priorities are higher priorities, i.e. 1 is higher than 0. ExtendNetworkPacket
to carry the priority number with which it was sent.b. [3 points] Recall that forwarding time in this assignment (at the link layer) accounts for link capacities. You will notice a bottleneck at
Router B
in problem 1, where queued packets take a while to offload. Implement a similar bottleneck atRouter D
in the network from problem 2. Change the program output to show how many packets of each priority remain queued at each router. You may inspect the priority in the encapsulatedNetworkPackets
to do so, or devise another method.c. [5 points] Implement strict priority forwarding at each router. While in 3.b you may 'cheat' by looking at
NetworkPacket
priority, MPLS forwarding should be done while looking only at the MPLS header. However, the MPLS header does not carry a priority field and you should not extend it to do so. Devise and implement another method, such that the MPLS routers encapsulateNetworkPackets
at the edge and forward them (on different paths as in problem 2) with strict priority.Submit your code as
link_3.py
,network_3.py
, andsimulation_3.py
. Submit a YouTube video link showing the execution ofsimulation_3.py
. We will grade you based on correct implementation of strict priority forwarding in MPLS. Make sure these to explain your approach to 3.c and clearly show that you achieve strict priority forwarding in your output and the video. -
[1 point] BONUS: Implement Weighted fair queuing (WFQ) instead of strict priority in question 3.
Submit
link_4.py
,network_4.py
, andsimulation_4.py
. -
[1 point] BONUS: Implement a central controller to automatically configure MPLS forwarding tables in question 2 based on a global knowledge of network topology.
Submit
link_5.py
,network_5.py
, andsimulation_5.py
.