In summary hubs reside at the physical layer of the OSI model.
They are not intelligent.
They do not understand the frames that they are repeating
they simply amplify the signal that they receive out of all other ports
except the ports on which it was received.
Hubs were good for their time, but in general today have been replaced by switches.
Now there's always an exception to the rule.
Wireless networks act like hubs, if you have a 54 Mbps wireless network
be careful, it’s not 54 Mbps dedicated or if you have a 200 Mbps wireless network
be careful it’s shared between all devices on the wireless network
So you need to divide the speed of your wireless network
by the devices connected to a access point.
Wireless network also have other issues which reduce the throughput even more
but the moral of the story is wireless networks operate as hubs.
Hubs are shared devices that would good for their time
but are very slow when compared to today's switches.
So overtime hubs were replaced by bridges
and bridges in turn have been receives by switches.
A bridge is a layer 2 device, in other words it resides at the data link layer
of the OSI model, bridges are more intelligent than hubs.
They use something called a MAC address table
to learn where devices are in the topology.
So rather than simply just repeating the signal
and sending traffic out of all ports without understanding it.
Bridges maintain a table with a list of MAC addresses learned in this topology.
So in our sample network we have 4 devices A, B, C and D
and the hub is being replaced by a bridge.
The topology is still a star topology.
So the main change here, is the hub has been replaced with the bridge.
Bridges store Mac address in the Mac address table
and that in turn is stored in software.
Bridges are therefore very slow in comparison to modern day devices like switches.
Switches and bridges operate in a very similar way, but bridges do the processing
and software where as switches do the processing and hardware.
Switches use something called an ASIC or Application Specific Integrated Circuit
which allows for high throughput, very quick table lookups and forwarding of traffic
often at line rate, in other words switches don’t slow the traffic down.
Bridges were the predecessors to switches and did things in software.
They were a lot slower, but from a forwarding point of view bridges and switches
forward traffic on a layer 2 segment in the same way
except switches do it in hardware and bridges do it in software.
So what does a bridge do when it receives a frame?
So in the similar way to the previous example.
Host A is sending traffic to host C, the source MAC address in the frame is A
the destination address in the frame is C, when the bridge boots up
its MAC address table is empty
in other words its do not contain dynamically learned MAC addresses.
MAC addresses can be statically configured by an administrator
but in this example let’s assume that Mac address are gonna be learned dynamically.
So at the moment the table is empty, when a frame arrives on port 1
on the bridge sent by host A, the bridge now knows that host A is connected to port 1
and can add MAC address A to its MAC address table
and essentially creates a mapping saying that MAC address A can be found on port 1
So it’s now learned where A is in the topology.
However it doesn't know where C is in the topology
because that information is not in its MAC address table yet.
In other words because it doesn’t know where C is, its gonna send the frame out of all
ports except the port on which would was received to ensure that C receives the frame.
Now because the frame is sent out of all ports, both B and D receive a copy of the
frame but they will drop it because the frame is not destined to them.
So in other words the network interface cards on NICs on Pc's B and D
will read the destination MAC address and see that it's destined to C
and not themselves and therefore drop the frame.
The network interface card on host C will receive the frame, strip the layer 2 headers
and pass the information to high layer protocols
and it does that because the destination MAC address on the frame is C.