So here’s our topology which is very similar to the previous topology
but notice the bridge has been replaced by a switch.
Switches are once again layer 2 devices or data link layer devices
and also have a MAC address table in the similar way to a bridge.
The network topology is also a star topology where devices are cabled directly
to ports on the switch, as an analogy, think of the switch as a bridge
but it’s much more powerful and quicker.
If you had a problem in a bridge environment
and you replace the bridge with a switch, you would still have the same problems
but they would occur a lot quicker.
Bridge problem are not solved by switches. Switches simply increase the performance.
So here’s our sample topology once again,
but in this case we have replaced the bridge with the switch.
How will traffic flow in this example?
So we once again using easy to read MAC addresses ike A, B, C and D
rather than full 48 bit MAC addresses and we're doing that to simplify these examples.
So if A sends a frame to C and the frame arrived at the switch on port 1.
What would the switch do with the frame?
Now in this example let’s assume that the switch is just started up.
So the MAC address table is empty, it hasn’t learnt where devices are on the topology.
Now the switch just like a bridge will flood the frame out of all ports
because it doesn’t know where C is
when the frame arrives at the switch to an unknown destination MAC address
that frame is flooded out of all ports except the port on which the frame arrived.
However just like a bridge the switch doesn’t just flood the frame out of all ports
but it also learns where devices are in the topology.
So because the frames was received on port 1
and the source MAC address in the frame is A
that information is written to the MAC address table of the switch.
The switch now knows that MAC address A can be found on port 1.
When C replies to A, the frame would be received on port 3 of the switch.
And the switch would update its MAC address table with that information
in other words the switch knows that MAC address C can be found on port 3
but in this case because it knows where the destination MAC address is
in other words A, it will only send the traffic out of port 1 and that’s because A
is found in the MAC address table as being available out of port 1.
The switch doesn’t flood the frame out of all ports.
So in the same way as a bridge all subsequent frames between A and C are forwarded
only out of those 2 ports, when A sends another frame to C
the frame is only sent out of port 3
because the switch knows that MAC address C can be found on port 3.
when C replies sending traffic to a destination MAC address of A.
the switch only forwards that traffic out of port 1 because that is learnt
that MAC address A can be found on port 1.
So all traffic between these 2 devices will only flow between port 1 and port 3.
Traffic is not sent out of port 2 or port 4 in a similar way to how a bridge operates.
In the same way as a bridge
each interface on the switch is a separate collision domain.
So if a collision took place on this hub
it would not affect other ports on the switch.
Each port on a switch is a separate collision domain.
They are therefore 4 collision domains in this topology.
A hub once again is a single collision domain.
So this interface is a single collision domain
separated from the other interfaces on the switch.
A switch however, will flood broadcast and multicast traffic by default.
So this is a single broadcast domain.
If A sends a broadcast that broadcast will be flooded out of all ports
and will be received by all devices in the topology.
This is very similar to the way bridges operated.
You once again have the same issues in a switch environment
as you would have in a bridge environment.
But switches operate at much higher speeds and support a greater number of ports.
So typically you wouldn’t have only 4 ports on the switch.
But in this example we have 4 collision domains and the single broadcast domain.
Now the reason why a broadcast is flooded out of all ports except
the ingress port is not a broadcast address consist of 8 hexadecimal Fs at layer 2.
So when a switch receives the frame with a destination address of 8 Fs it will flood
that frame out of all ports because this address of 8 Fs at layer 2 indicates everyone.
In other words the switch will flood this out of all ports
except the port on which it received.
So in this example, it was received from A and that frame is then flooded everywhere
because of broadcast is supposed to go to everyone at layer 2.
That’s what a broadcast is designed to do.
Broadcast addresses also indicate all devices rather than
a single device so the MAC address table is never populated with the broadcast address.
This information is not written to the MAC address table
as the Unicast MAC address would have been.
Broadcast addresses are not associated with specific
or an individual ports on which the broadcast is received
it is always flooded out of all ports except the port on which it's received.
Now as always there are exceptions and we'll talk more about those exceptions later.
There are some major advantages to using switches over hubs and bridges.
The first advantage is that, switches can support many ports
and some switches can support 100 of ports.
The second advantage is that switches can operate at wire speed.
So as I've mentioned previously the switch will not slow frames down.
The switch can physically move a frame from one port to another port
without slowing the frame down.
Some switches have backplanes that operate a terabits per second.
In other words a very, very fast backplanes in comparison to interface speeds.
So the back plain of the switch is operating at the much greater speed
than the physical ports. So what does that mean?
The switch can move traffic from 1 port to another port
faster or quicker than it can received traffic on an interface or port.
So traffic from A to D is not slowdown by the switch.
Another major advantage of switches over hubs is that
each device is directly connected to a switch port.
So A is connected to port 1, B to port 2, C to port 3, D to port 4.
Each device is individually cabled to port on the switch.