Publication date: Mar. 2016
33600 Rev B
32
-
How does a switch operate?
A Layer 2 switch uses some features of the Data Link layer in OSI model to
forward the packet to the destination port(s). Here we introduce some important
features of a switch and how they work.
-
MAC address table
When a packet is received on a port of switch, the switch first checks if the
packet good or bad and extracts the source MAC address (SA) and destination
MAC address (DA) to find 1) if SA is existed in the MAC address table, if no, puts it
in the MAC address table, if yes, 2) looks up DA and its associated port to which the
traffic is forwarded. If DA does not exist, have the packet broadcasted.
Due to the size of the MAC address limited, MAC address aging function is
applied. When the MAC address has resided and keeps no update in the table for a
long time, this means the traffic using that entry has yet come for a while. If this time
period is more than the aging time, the entry will be marked invalid. The vacancy is
now available for other new MAC.
Both learning and forwarding are the most important functions in a switch.
Besides that, VLAN can be one of the rules to forward the packet. There are ingress
rule and egress rule applied. The ingress rule is used to filter the incoming packet
by VLAN ID and so on and to decide whether the packet is allowed to enter the
switch or not. The egress rule is used to forward the packet to the proper port.
-
Mac address aging
There is a field in MAC address table used to put the entry’s Age time which
determines how long a MAC entry can reside in a switch. The age time is refreshed
when a packet with that SA. Usually, the age time is programmable.
-
Transmission schedule
In most layer 2 switches, the QoS is supported. QoS in a switch must
associate a transmission schedule to transmit the packet. This function is much to
do with the priority level a packet has. With the given priority, the scheduler will do
the proper action on it. The scheduler has many ways to implement, and different
Fig. 3-7