Quality of Service (QoS) & Voice Technologies
IP Phones and Voice VLANs
- Concept: IP phones use VoIP (Voice over IP) to encapsulate audio data in IP packets. They feature an internal 3-port switch:
- Uplink: Connects to the external network switch.
- Downlink: Connects to a PC.
- Internal: Connects to the phone’s internal components.
- Details: This design allows a PC and an IP phone to share a single switch port, saving hardware costs.
- Voice VLANs: It is highly recommended to separate voice and data traffic into different VLANs to apply QoS effectively.
- Data VLAN: PC traffic is sent untagged.
- Voice VLAN: IP phone traffic is sent tagged with a specific VLAN ID.
- The switch uses CDP (Cisco Discovery Protocol) to inform the IP phone which Voice VLAN ID to tag its traffic with.
- Things to note: Even though the port carries traffic for two VLANs, it is configured as an access port (static access), NOT a trunk port.
! Configure Voice VLAN on a switch port
Switch(config)# interface g0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# switchport voice vlan 11
! Verify Voice VLAN configuration
Switch# show interfaces g0/0 switchport
Switch# show interfaces trunk
Common Misconception: show interfaces trunk will NOT display the port because it is administratively and operationally an access port, despite carrying tagged voice traffic.
Power over Ethernet (PoE)
- Concept: PoE allows PSE (Power Sourcing Equipment, typically a switch) to provide DC electrical power to PDs (Powered Devices, like IP phones, cameras, APs) over the exact same Ethernet cable used for data.
- Details: The PSE sends low-power signals to detect if the PD needs power and negotiates the required amount to prevent electrical damage.
- Power Policing: A feature that prevents a PD from drawing too much power.
! Configure Power Policing (Default action is err-disable)
Switch(config-if)# power inline police
Switch(config-if)# power inline police action err-disable
! Configure Power Policing to only log and restart the interface
Switch(config-if)# power inline police action log
! Verify PoE status
Switch# show power inline police g0/0
PoE Standards Comparison
| Standard |
Name |
Max Power |
Wires Used (Historical context) |
| Cisco ILP |
Inline Power |
7W |
4, 5, 7, 8 (Spare pairs) |
| 802.3af |
PoE (Type 1) |
15.4W |
All 4 pairs |
| 802.3at |
PoE+ (Type 2) |
30W |
All 4 pairs |
| 802.3bt |
UPoE (Type 3) |
60W |
All 4 pairs |
| 802.3bt |
UPoE (Type 4) |
100W |
All 4 pairs |
QoS Fundamentals
- Concept: QoS (Quality of Service) is a set of tools used to prioritize specific traffic (like voice/video) in converged networks to manage bandwidth, delay, jitter, and loss.
- Details:
- Bandwidth: Overall link capacity (measured in bps). QoS can reserve bandwidth for specific traffic classes.
- Delay: Time taken for a packet to travel from source to destination.
- One-way delay: Source to destination.
- Two-way delay: Round trip time.
- Jitter: Variation in one-way delay between packets of the same flow. IP phones use a jitter buffer to smooth this out.
- Loss: Percentage of packets that fail to reach the destination (caused by congestion/tail drop or faulty cables).
Recommended Standards for Interactive Audio
| Characteristic |
Recommended Maximum |
| One-way Delay |
150 ms |
| Jitter |
30 ms |
| Packet Loss |
1% |
Queuing and Congestion Management
- Concept: When a device receives traffic faster than it can transmit it, packets are placed in a queue.
- FIFO (First In First Out): The default queuing method. Packets are transmitted in the exact order they arrive. No priority is given.
- Tail Drop: When a queue is completely full, all newly arriving packets are dropped.
- Negative Effect: Causes TCP Global Synchronization. All TCP senders detect packet loss, reduce their sliding window sizes simultaneously (causing network underutilization), and then increase them simultaneously (causing congestion waves).
- RED (Random Early Detection): Monitors queue depth and randomly drops packets from select TCP flows before the queue is completely full to prevent tail drop and global synchronization.
- WRED (Weighted RED): An enhanced version of RED that drops packets based on traffic classes. Lower-priority traffic is dropped sooner than higher-priority traffic.
Classification and Marking
- Concept:
- Classification: Identifying and categorizing traffic into classes (using ACLs, NBAR (Network Based Application Recognition - deep packet inspection up to Layer 7), or header fields).
- Marking: Setting specific values in Layer 2 or Layer 3 headers to indicate the packet’s priority to downstream devices.
Layer 2 Marking: PCP / CoS
- Concept: Found in the 3-bit PCP (Priority Code Point) field of the 802.1Q VLAN tag. Also known as CoS (Class of Service).
- Details: Values range from 0 to 7.
- 0: Best Effort (Default)
- 3: Critical Applications / Voice Signaling
- 4: Video
- 5: Voice (Audio)
- Limitation: PCP/CoS can ONLY be used on tagged links (Trunk links or Access ports with a Voice VLAN). It cannot be used over standard routed links where the 802.1Q tag is removed.
Layer 3 Marking: ToS Byte & DSCP
- Concept: The IPv4 ToS (Type of Service) byte is used for Layer 3 QoS. It is divided into:
- DSCP (Differentiated Services Code Point): 6 bits (Values 0-63).
- ECN (Explicit Congestion Notification): 2 bits.
- Historical Context: Previously, the first 3 bits were used for IPP (IP Precedence), which only allowed 8 values (0-7). DSCP was created for more flexibility and backward compatibility.
Standard DSCP Markings
| Marking |
Name |
DSCP Value |
Binary (6-bit) |
Usage |
| DF |
Default Forwarding |
0 |
000000 |
Best Effort (Standard data) |
| EF |
Expedited Forwarding |
46 |
101110 |
Voice (Low loss, delay, jitter) |
| AF |
Assured Forwarding |
Varies |
Varies |
Data with guaranteed delivery |
| CS |
Class Selector |
Varies |
Varies |
Backward compatibility with IPP |
Assured Forwarding (AF) Deep Dive
- Concept: AF defines 4 classes (x) and 3 drop precedences (y).
- Format: Written as AFxy (e.g., AF41).
- Class (x): 1 to 4. Higher class = higher priority.
- Drop Precedence (y): 1 to 3. Higher drop precedence = higher likelihood of being dropped by WRED during congestion.
- Binary Structure:
xxx yy 0 (3 bits for class, 2 bits for drop precedence, 1 bit always 0).
- Formula to calculate DSCP decimal value:
DSCP = 8x + 2y
- Example: AF43 -> Class 4, Drop Precedence 3.
8(4) + 2(3) = 32 + 6 = 38.
- Example: AF11 -> Class 1, Drop Precedence 1.
8(1) + 2(1) = 10.
- Best/Worst Service: AF41 provides the best service (highest class, lowest drop precedence). AF13 provides the worst.
Class Selector (CS) Deep Dive
- Concept: Provides backward compatibility with the old 3-bit IPP.
- Format: Written as CSx (where x is 0-7).
- Binary Structure: The original 3 IPP bits are used, and the 3 new DSCP bits are set to
000.
- Formula:
DSCP = 8 * x
- Example: CS3 ->
8 * 3 = 24. Binary: 011000.
- Example: CS6 ->
8 * 6 = 48. (Often used for Network Control / Routing protocols).
Trust Boundaries
- Concept: Defines the point in the network where a device decides whether to trust or re-mark the QoS markings of incoming packets.
- Details:
- If trusted, the device forwards the packet without changing its PCP/DSCP values.
- If untrusted, the device changes the markings according to its configured policy (usually downgrading to Best Effort).
- Best Practice: Move the trust boundary to the IP Phone.
- Trust markings from IP phones (they correctly mark voice as EF/CoS 5).
- Do NOT trust markings from PCs connected behind the IP phone (prevents users from maliciously marking data traffic as high priority). The switch will re-mark PC traffic to DF/CoS 0.
graph LR
PC[PC Data Traffic] -->|Untagged / Untrusted| Phone[IP Phone]
Phone -->|Tagged Voice VLAN / Trusted| SW1[Switch]
SW1 -->|Trusted Markings| Network[Core Network]
subgraph Trust Boundary
Phone
end
Advanced Queuing and Scheduling
- Concept: Instead of a single FIFO queue, QoS uses multiple queues based on traffic classification. A scheduler decides which queue to service.
- Weighted Round-Robin: The scheduler cycles through queues, taking a larger “weight” (more packets/bytes) from higher-priority queues each time.
- CBWFQ (Class-Based Weighted Fair Queuing): Uses a weighted round-robin scheduler and guarantees each queue a minimum percentage of the interface’s bandwidth during congestion.
- LLQ (Low Latency Queuing): Adds a Strict Priority Queue to CBWFQ.
- Details: If there is ANY traffic in the strict priority queue, the scheduler will service it immediately before looking at other queues.
- Usage: Essential for voice and video to eliminate delay and jitter.
- Downside: Can starve other queues if not limited. Policing is applied to the strict priority queue to prevent it from consuming 100% of the link bandwidth.
graph TD
A[Ingress Traffic] --> B[Classification & Marking]
B --> C{Scheduler}
C -->|Strict Priority| D[LLQ Queue - Voice/Video]
C -->|Weighted Round Robin| E[CBWFQ Queue 1]
C -->|Weighted Round Robin| F[CBWFQ Queue 2]
C -->|Weighted Round Robin| G[Default Queue]
D --> H[Egress Interface]
E --> H
F --> H
G --> H
Traffic Shaping and Policing
- Concept: Tools used to control the rate of traffic, limiting it to below the physical maximum capacity of the link (e.g., limiting traffic to match an ISP contract).
- Traffic Shaping:
- Mechanism: Buffers (queues) packets that exceed the configured rate, smoothing out the traffic flow.
- Behavior: Polite. Delays packets but does not drop them (unless the shaping queue itself fills up and causes tail drop).
- Traffic Policing:
- Mechanism: Drops packets that exceed the configured rate.
- Behavior: Not polite. However, it allows for configurable burst sizes to accommodate bursty data applications.
- Common Scenario: A customer connects to an ISP. The ISP polices inbound traffic to the contracted rate (e.g., 300 Mbps). To prevent the ISP from dropping their packets, the customer configures shaping on their outbound interface to match the 300 Mbps rate.
Summary of Commands
! --- Voice VLAN Configuration ---
Switch(config)# interface g0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10 ! Data VLAN (Untagged)
Switch(config-if)# switchport voice vlan 11 ! Voice VLAN (Tagged via CDP)
! --- PoE Power Policing ---
Switch(config-if)# power inline police ! Default action: err-disable
Switch(config-if)# power inline police action err-disable
Switch(config-if)# power inline police action log ! Action: Log and restart interface
! --- Verification Commands ---
Switch# show interfaces g0/0 switchport
Switch# show interfaces trunk
Switch# show power inline police g0/0
! --- QoS Classification (Conceptual) ---
Switch(config)# class-map TEST
Switch(config-cmap)# match dscp ef ! Match Expedited Forwarding
Switch(config-cmap)# match dscp af41 ! Match Assured Forwarding 41