
QoS Configuration: จัดลำดับ Traffic สำหรับ VoIP และ Video
Quality of Service (QoS) คือกลไกในการจัดลำดับความสำคัญของ traffic ในเครือข่าย ให้ traffic ที่สำคัญ (เช่น VoIP, Video Conferencing) ได้รับ bandwidth และ low latency ก่อน traffic ที่สำคัญน้อยกว่า (เช่น web browsing, file download) ถ้าไม่มี QoS เมื่อ network congestion เกิดขึ้น ทุก traffic ถูกปฏิบัติเท่ากัน ทำให้เสียงโทรศัพท์ VoIP กระตุก video conference ภาพแตก
ในองค์กรที่ใช้ VoIP, Microsoft Teams, Zoom และ video surveillance QoS เป็น must-have ไม่ใช่ nice-to-have บทความนี้จะอธิบายแนวคิด QoS, classification methods, queuing mechanisms และวิธีตั้งค่าบน Cisco switches/routers
ทำไม VoIP และ Video ต้องการ QoS
| คุณสมบัติ | VoIP | Video | Data (Web/Email) |
|---|---|---|---|
| Latency ที่ยอมรับได้ | < 150ms | < 200ms | ไม่จำกัด |
| Jitter ที่ยอมรับได้ | < 30ms | < 50ms | ไม่จำกัด |
| Packet Loss ที่ยอมรับได้ | < 1% | < 1% | < 5% |
| Bandwidth ต้องการ | 80-100 Kbps/call | 1-5 Mbps/stream | Variable |
| ผลกระทบเมื่อ QoS ไม่ดี | เสียงกระตุก ขาดหาย | ภาพแตก freeze | โหลดช้า |
QoS Model: DiffServ
DSCP Values ที่สำคัญ
DiffServ (Differentiated Services) เป็น QoS model ที่นิยมที่สุด ใช้ DSCP (Differentiated Services Code Point) 6-bit ใน IP header เพื่อ mark traffic แต่ละ class
| Traffic Type | DSCP Value | Per-Hop Behavior | Priority |
|---|---|---|---|
| Voice (RTP) | EF (46) | Expedited Forwarding | สูงสุด |
| Voice Signaling (SIP) | CS3 (24) | Class Selector 3 | สูง |
| Video Conferencing | AF41 (34) | Assured Forwarding 41 | สูง |
| Video Streaming | AF31 (26) | Assured Forwarding 31 | ปานกลาง-สูง |
| Critical Data (ERP, DB) | AF21 (18) | Assured Forwarding 21 | ปานกลาง |
| Bulk Data (Backup) | AF11 (10) | Assured Forwarding 11 | ต่ำ |
| Best Effort (Web, Email) | 0 | Default | ต่ำสุด |
| Scavenger (P2P, YouTube) | CS1 (8) | Class Selector 1 | ต่ำกว่า Best Effort |
3 ขั้นตอนของ QoS
1. Classification (จำแนก)
จำแนก traffic ว่าเป็นประเภทไหน จำแนกตาม DSCP marking ที่ติดมา (trust) จำแนกตาม source/destination IP, port number จำแนกตาม protocol (RTP = voice, SIP = signaling) จำแนกตาม VLAN (voice VLAN = voice traffic) จำแนกตาม NBAR (Network-Based Application Recognition) สำหรับ application-level
2. Marking (ทำเครื่องหมาย)
ทำเครื่องหมาย traffic ด้วย DSCP value mark ที่ edge ของ network (access switch) แล้ว trust DSCP ไปทั้ง network ไม่ต้อง re-classify ทุก hop ประหยัด processing power บน core/distribution switches
3. Queuing (จัดคิว)
จัดคิว traffic ตาม DSCP marking ที่ egress interface Voice (EF) ใส่ priority queue (strict priority) ส่งก่อนเสมอ Video, Critical Data ใส่ bandwidth queue (guaranteed bandwidth) Best Effort ใส่ default queue ได้ bandwidth ที่เหลือ
ตั้งค่า QoS บน Cisco Switch
Trust DSCP บน Uplink
บน uplink interfaces (ไปยัง distribution/core) trust DSCP ที่ mark มาจาก access switch ใช้ mls qos trust dscp บน interface
Trust CoS บน IP Phone Port
บน access port ที่ต่อ IP Phone trust CoS จาก phone (phone mark voice traffic เป็น CoS 5) ใช้ mls qos trust cos บน interface ที่ต่อ phone switch จะ map CoS 5 → DSCP EF (46)
Policy Map สำหรับ Queuing
สร้าง class-map จำแนก traffic ตาม DSCP สร้าง policy-map กำหนด bandwidth สำหรับแต่ละ class Voice (EF): priority queue 10% of bandwidth Video (AF41): bandwidth 20% Critical Data (AF21): bandwidth 15% Best Effort: bandwidth remaining apply policy-map บน interface ด้วย service-policy output
QoS Design Recommendations
| Traffic Class | DSCP | Bandwidth Allocation | Queue Type |
|---|---|---|---|
| Voice | EF | 10% (strict priority) | Priority Queue (LLQ) |
| Video Interactive | AF41 | 20% | CBWFQ |
| Voice Signaling | CS3 | 2% | CBWFQ |
| Critical Data | AF21 | 15% | CBWFQ |
| Bulk Data | AF11 | 10% | CBWFQ |
| Scavenger | CS1 | 1% | CBWFQ |
| Best Effort | 0 | Remaining (~42%) | Default Queue |
QoS สำหรับ Microsoft Teams / Zoom
Port Ranges
Microsoft Teams ใช้ UDP ports: Audio 50000-50019, Video 50020-50039, Screen Sharing 50040-50059 Zoom ใช้ UDP ports: 8801-8810 สร้าง ACL จำแนก traffic ตาม port ranges แล้ว mark DSCP: Audio = EF, Video = AF41, Screen Sharing = AF31
ทดสอบ QoS
ตรวจสอบ
ใช้ show mls qos interface ดูว่า QoS trust ถูกต้อง ใช้ show policy-map interface ดูว่า traffic ถูก classify และ queue ถูกต้อง ใช้ show mls qos maps dscp-cos ดู DSCP-CoS mapping ทดสอบโทร VoIP ระหว่าง flood bandwidth ดูว่าเสียงยังดีอยู่
ทิ้งท้าย: QoS คือ Insurance สำหรับ Real-time Traffic
QoS เป็น insurance ที่ทำให้ VoIP และ Video ทำงานได้ดีแม้ network จะ congested ตั้งค่าครั้งเดียว ใช้ได้ตลอด classify ที่ edge, trust ตลอด network, queue ที่ egress ให้ voice ได้ priority queue เสมอ ทดสอบว่า QoS ทำงานจริงภายใต้ load
อ่านเพิ่มเติมเกี่ยวกับ EtherChannel และ Network Design ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com