Classification and marking is the process of identifying traffic
for proper prioritization as that traffic traverses the campus network. Traffic
is classified by examining information at various Layers of the OSI model. All
traffic classified in a certain manner will receive an associate mark or QoS
value. IP Traffic can be classified according to any values configurable in an
ACL or any of the following criteria:
-
Layer 2 parameters – MAC address, Multiprotocol Label Switching
(MPLS), ATM cell loss priority (CLP) bit, Frame Relay discard eligible (DE)
bit, ingress interface
-
Layer 3 parameters – IP precedence, DSCP, QoS group, IP address,
ingress interface
-
Layer 4 parameters – TCP or UDP ports, ingress interface
-
Layer 7 parameters – application signatures, ingress interface
All traffic classified or grouped according to the criteria above, will
be marked according to that classification. QoS marks or values establish
priority levels or priority classes of service for network traffic as it is
processed by each switch. Once traffic is marked with a QoS value, then QoS
policies on switches and interfaces will handle traffic according to the QoS
values contained in individual frames and packets. As a result of
classification and marking, traffic will be prioritized accordingly at each
switch to ensure that delay sensitive traffic receives priority processing as
the switch manages congestion, delay and bandwidth allocation.

Layer 2 QoS Marking
QoS Layer 2 classification occurs by
examining information in the Ethernet or 802.1Q header such as destination MAC
address or VLAN ID. QoS Layer 2 marking occurs in the Priority field of
802.1Q header. LAN Layer 2 headers have no means of carrying a QoS value so
802.1Q encapsulation is required if Layer 2 QoS marking is to occur. The
Priority field is 3 bits in length and is also known as the 8021.p User
Priority or Class of Service (CoS) value.
This 3 bit field hosts CoS
values ranging from 1-7; 1 being associated with delay tolerant traffic such as
TCP/IP. Voice traffic, which by nature is not delay tolerant, receives higher
default CoS values such as 3 for Call Signaling. A CoS value of 5 is given to
Voice Bearer traffic which is the phone conversation itself where voice quality
is impaired if any packets are dropped or delayed.

As
a result of Layer 2 classification and marking, the following QoS operations
can occur:
-
Input queue scheduling – When a frame enters a port, it can be
assigned to one of a number of port-based queues prior to being scheduled for
switching to an egress port. Typically, multiple queues are used where traffic
requires different service levels.
-
Policing – Policing is the process of inspecting a frame to see if
it has exceeded a predefined rate of traffic within a certain time frame that
is typically a fixed number internal to the switch. If a frame is determined to
be in excess of the predefined rate limit, it can either be dropped or the CoS
value can be marked down.
-
Output queue scheduling – The switch will place the frame into an
appropriate outbound (egress) queue for switching. The switch will perform
buffer management on this queue by ensuring that the buffer does not
overflow.
Layer 3 QoS Marking
QoS Layer 3 classification results from
the examination of header values such as Destination IP address or Protocol.
QoS Layer 3 marking occurs in the Type of Service (ToS) byte in the IP Header.
The first 3 bits of the ToS byte are occupied by IP Precedence, which
correlates to the 3 CoS Bits carried in the Layer 2 header.
The ToS Byte
can also be used for Differentiated Services Code Point (DSCP) marking. DSCP
allows prioritization hop by hop as packets are processed on each switch and
interface. The ToS bits are used by DSCP values as shown below. The first 3
DSCP bits, correlating to Precedence and CoS, identify the DSCP Class of
Service for the packet.

The next three DS bits establish a drop precedence for the packet. Packets
with a high DSCP drop precedence value will be dropped before those with a low
value if a device or a queue becomes overloaded and must drop packets. Voice
traffic will be marked with a low DSCP drop precedence value to minimize voice
packet drop.
Each 6 bit DSCP value is also given a DSCP Codepoint name.
DSCP classes 1-4 are Assured Forwarding classes (AF). Therefore, if the DSCP
class value was 3 and the Drop Precedence was 1, the DSCP Codepoint would be
AF31.