Exercise 1: In this exercise, you will write a simple program to simulate the bridge-processing flowchart for
a bridge that we discussed in the lectures (Please see the flowchart given on Page 3).
You are given a text file (BridgeFDB.txt) that contains the forwarding database of a bridge with four ports.
The entries in the text file are arranged as shown below:
00-00-00-11-0b-0d Ã MAC address of the destination host
1 Ã Port number
You are given another text file (RandomFrames.txt) that contains the source MAC address, the destination
MAC address of a random frame on the network that the bridge is connected to, and the port number of the
bridge that it arrives on. The entries in this text file are arranged as shown below:
00-00-00-11-0b-0d Ã Source MAC address
00-13-46-c6-a5-35 Ã Destination MAC address
1 Ã Arrival port number
Your program should read the two text files, and for each random frame, it should make a decision either to
forward/discard/broadcast the frame. If the source MAC address is not in the database, then it should update
Ignore the CRC error detection part (that is, assume that the frames are error free). Store the resulting output
in another text file (BridgeOutput.txt).
Your output would look something like this (for the above three sample frames).
00-00-00-11-0b-0d 00-13-46-c6-a5-35 1 Forwarded on port 2
00-0c-29-51-33-c1 01-00-5e-7f-ff-64 4 Discarded
01-00-5e-7f-ff-64 00-00-4f-31-fa-fb 3 Broadcast
Note: The reason the last frame is broadcast is because the entry 00-00-4f-31-fa-fb is not in the FDB.
You should keep track of the updated FDB and also submit that as part
of your output. Your program will be tested using the sample BridgeFDB.txt and
The BridgeFDB.txt and RandomFrames.txt can be downloaded along with the assignment from the
You may use Java, C, C++ or Python as your programming language.