Network Simulation: Bridge and Router Programs

Verified

Added on  2019/09/18

|3
|584
|321
Practical Assignment
AI Summary
This practical assignment requires students to develop two programs: one to simulate bridge processing and another to simulate packet routing. The bridge program should read a forwarding database and process frames, updating the database and forwarding or discarding frames as needed. The router program should use a routing table to determine how to handle incoming packets, outputting the forwarding path for each packet. Students are expected to submit source code and sample runs for both programs, demonstrating their understanding of network concepts.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
NE T WORKS
ASSIGNMENT
In this assignment, you will write two programs for simulation - one for bridge processing and one
for routing. You may use Java, C, C++ or Python as the language for building your progr a ms.
1. Write a simple program to simulate the bridge processing flowchart discussed in the lectures.
Th e program should read a text file that contains the forwarding database (FDB). The first line in
the te xt file contains the number of ports on the bridge. The program should then read another text
f ile containing randomly generate frames just the source and destination numbers and port numbers
of arrival. For each frame, the program should use the flowchart to make an update of the
forw a rd i ng database and/or to forward/discard the frame. Ignore the CRC error detection part (that is,
assume t h at the frames are error free). Include the source code and sample runs of the program.
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
As a simple example, the text file containing the FDB and port numbers could look like t h i s :
4
A 1
B 1
C 2
D 2
E 3
F 3
X 3
In the above example, the bridge has four ports (1, 2, 3 and 4) and the current FDB has 7 entries. (Port no.4
has not yet received any frame and hence there is no entry for port no. 4).
The second text file could be like t h i s :
A B 1
X B 3
A M 1
M X 4
Etc.
The first line means that the frame has source address A and destination address B and arrives at port 1 of
the bridge. In this case, the frame should be discarded by the br i dge.
The output would look something like t h i s :
A B 1 Frame discarded
X B 3 Frame sent on port 1
A M 1 Frame broadcast on all out ports
M X 4 FDB updated; Frame sent on port 3
Etc.
You should keep track of the updated FDB and also submit that as part of your ou t pu t .
2. Write a program that illustrates packet routing at a router. The program should accept as input t h e
fo ll ow i ng :
a. A text file containing a routing table (the five column generic routing table with m a sk,
destination address, next hop, flag and i nt e rf ace ).
Document Page
b. A text file containing a list of packets (with just destination a ddr e ss e s)
It should produce an output showing a list of how each packet will be handled by the router. For instance, it
should output
“Packet with destination address 192.168.1.1 will be forwarded to
192.168.5.2 out on interface S1”.
Your program should be written in a general manner, in the sense, it should work for any routing table a nd
any packet. It should work for both network specific and host specific entries. However, you need no t
consider subnetting, that is, the masks can be the default ones for Class A (255.0.0.0), Class B (255.255.0,0)
and Class C (255.255.255.0). Test your program for different types of packets and different types of e n t r ie s
in the routing table. Submit the source code and sample runs of the program.
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]