$30
## Instructions
Complete the following assignment by yourself, or in a group of two.
Submit your work on D2L into the "Programming Assignment 3" folder.
Please have only one member of the group submit.
## Learning Objectives
In this programming assignment you will:
- Packetize streams at the network layer
- Implement packet segmentation
- Implement forwarding through routing tables
## Assignment
During this project, you will implement several key data plane functions of a router, including stream packetization, packet segmentation, and forwarding.
The next assignment will complement these functions at the control plane.
### Starting Code
The starting code for this project provides you with the implementation of 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.
![network_1](https://github.com/msu-netlab/MSU_CSCI_466_PAs/blob/data_plane/images/simple.png)
At a high level a network defined in `simulation.py` includes hosts, routers and links.
`Hosts` generate and receive traffic.
`Routers` forward traffic from one `Interface` to another based on routing tables that you will implement.
`Links` connect network interfaces of routers and hosts.
Finally, the `LinkLayer` runs a thread to forward traffic along links.
### Program Invocation
To run the starting code you may execute:
```
python simulation.py
```
The current `simulation_time` in `simulation.py` is one second.
As the network becomes more complex and takes longer to execute, you may need to extend the simulation to allow the time for all the packets to transfer.