Bridges Learn Where Destination Stations Are Located
So, as discussed in the previous essay, a transparent bridge examines a packet’s Destination Data Link Address and looks up the Address in its internal tables to determine which of its ports, if any, to forward the packet onto. In this essay, we will discuss exactly how the bridge’s internal tables get filled.
A learning bridge can be added to a network, and it will learn the network topology without help from humans. If a station is moved, the bridge will realize it and update its tables appropriately. Originally, there were some transparent bridges that did not have learning capability, but today, the terms “transparent bridge” and “learning bridge” are used interchangeably.
The Learning Algorithm
A learning bridge tracks Source Addresses. Because it knows what ports different addresses come from, it knows onto what port to send packets going to those addresses. The Learning Algorithm can be written in PseudoCode as follows:
If the address is in the tables then
Forward the packet onto the necessary port.
If the address is not in the tables, then
Forward the packet onto every port except for
the port that the packet was received on,
just to make sure the destination gets the
Add an entry in your internal tables linking
the Source Address of the packet to whatever
port the packet was received from.
Take, for example, a simple network consisting of a four-port transparent bridge with five stations attached to it. The ports on the bridge shall be numbered one through four, with Station A and Station B on port 1, no station on port 2, Station C on port 3, and Station D and Station E on port 4 (see Fig. 1). If you have a non-graphical browser, it may help you draw this out on paper. The bridge has just been brought on-line, and its tables are empty.
Station B transmits a packet destined for Station C. Since the bridge doesn’t know what port station B is on yet, it puts the packet out onto every port except Port 1 (the packet came from Port 1, so the bridge knows that the packet has already been seen by stations on Port 1). This behavior is know as flooding. The bridge also examines the Source Address in the packet and determines that Station B is attached to Port 1. It updates its tables to reflect this (see Fig. 2).
Now that the bridge knows where Station B is, it will forward packets destined for Station B only onto Port 1. As stations transmit packets, the bridge will learn the location of more and more stations until, finally, it knows the location of every station that is attached to its ports. The beauty of the system is that even if the bridge doesn’t know the location of a station, packets still get sent to their destination, just with a tiny bit of wasted bandwidth.
Finally, the bridge ages each entry in its internal tables and deletes the entry if, after a period of time known as the aging time, the bridge has not received any traffic from that station. This is just an extra safeguard to keep the bridge’s tables up-to-date.