Home » QoS (Quality of Service): Classification, Marking และ Queuing
QoS (Quality of Service): Classification, Marking และ Queuing
QoS (Quality of Service): Classification, Marking และ Queuing
QoS (Quality of Service) เป็น set ของ mechanisms ที่จัดการ network traffic เพื่อให้ critical applications ได้รับ bandwidth, latency และ jitter ที่เหมาะสม QoS ประกอบด้วย 3 ขั้นตอนหลัก: Classification (ระบุ traffic), Marking (ติด label) และ Queuing/Scheduling (จัดลำดับส่ง)
โดยปกติ network ส่ง traffic แบบ best-effort — ทุก packet ได้รับการ treat เท่าเทียมกัน แต่เมื่อ link congested voice call จะ drop เหมือน file download QoS แก้ปัญหานี้โดย prioritize voice/video ให้ได้ low latency + low jitter ขณะที่ bulk traffic ใช้ bandwidth ที่เหลือ
QoS Models
| Model |
วิธีทำงาน |
ใช้เมื่อ |
| Best-Effort |
ไม่มี QoS — ทุก packet เท่ากัน (FIFO) |
Non-critical networks |
| IntServ (RSVP) |
Reserve bandwidth per-flow (guaranteed) |
ไม่ค่อยใช้ (ไม่ scale) |
| DiffServ |
Classify + mark packets → per-hop behavior (PHB) |
Standard ที่ใช้ทั่วไป (scalable) |
QoS Steps
| Step |
Action |
Where |
| 1. Classification |
ระบุ traffic type (voice, video, data, etc.) |
Access layer (closest to source) |
| 2. Marking |
ติด DSCP/CoS value ใน packet header |
Access layer (after classification) |
| 3. Policing |
จำกัด rate + drop/re-mark excess traffic |
Ingress (network edge) |
| 4. Shaping |
Buffer excess traffic + send at configured rate |
Egress (before WAN link) |
| 5. Queuing |
จัดลำดับ packets ใน queues ตาม priority |
Egress (congested interfaces) |
| 6. Scheduling |
ส่ง packets จาก queues ตาม algorithm |
Egress |
DSCP Values
| DSCP |
PHB |
Traffic Type |
Decimal |
| EF |
Expedited Forwarding |
Voice (low latency, low jitter) |
46 |
| AF41 |
Assured Forwarding 4-1 |
Interactive Video (Zoom, Teams) |
34 |
| AF31 |
Assured Forwarding 3-1 |
Streaming Video |
26 |
| CS3 |
Class Selector 3 |
Signaling (SIP, H.323) |
24 |
| AF21 |
Assured Forwarding 2-1 |
Transactional Data (SAP, database) |
18 |
| AF11 |
Assured Forwarding 1-1 |
Bulk Data (backup, FTP) |
10 |
| CS1 |
Class Selector 1 |
Scavenger (non-essential) |
8 |
| 0 (BE) |
Best Effort |
Default (web, email) |
0 |
| CS6 |
Class Selector 6 |
Network Control (routing protocols) |
48 |
Layer 2 vs Layer 3 Marking
| Feature |
CoS (Layer 2) |
DSCP (Layer 3) |
| Where |
802.1Q VLAN tag (3 bits) |
IP header ToS field (6 bits) |
| Values |
0-7 |
0-63 |
| Survives routing |
No (stripped ที่ L3 boundary) |
Yes (end-to-end) |
| Use Case |
Within L2 domain (switch-to-switch) |
End-to-end across routed network |
Queuing Mechanisms
| Mechanism |
วิธีทำงาน |
Use Case |
| FIFO |
First In, First Out (no priority) |
Default (no QoS) |
| PQ (Priority Queue) |
High-priority queue ส่งก่อนเสมอ |
Voice (strict priority) |
| WFQ (Weighted Fair Queue) |
แบ่ง bandwidth ตาม weight |
Fair sharing among flows |
| CBWFQ |
Class-Based WFQ — assign bandwidth per class |
Guarantee bandwidth per traffic class |
| LLQ (Low Latency Queue) |
CBWFQ + strict priority queue สำหรับ voice |
Standard สำหรับ enterprise QoS |
| WRED |
Random early drop ก่อน queue full (avoid tail drop) |
Prevent TCP synchronization |
Policing vs Shaping
| Feature |
Policing |
Shaping |
| Action เมื่อ exceed |
Drop หรือ re-mark excess packets |
Buffer excess packets → send later |
| Direction |
Ingress + Egress |
Egress only |
| Latency |
ไม่เพิ่ม latency (drop ทันที) |
เพิ่ม latency (buffering) |
| TCP-friendly |
ไม่ดี (drops cause retransmits) |
ดี (smooth traffic, no drops) |
| Use Case |
ISP rate limiting, ingress enforcement |
WAN egress, match sub-line rate |
QoS Design (4-Class Model)
| Class |
DSCP |
Queue |
Bandwidth |
| Voice |
EF |
LLQ (strict priority) |
10-20% |
| Video |
AF41 |
CBWFQ (guaranteed) |
20-30% |
| Critical Data |
AF21 |
CBWFQ (guaranteed) |
20-30% |
| Best Effort |
0 |
Default queue |
Remaining (25%+) |
Best Practices
| Practice |
รายละเอียด |
| Classify + mark at edge |
Mark DSCP ที่ access layer (closest to source) |
| Trust boundary |
Trust DSCP จาก IP phones, don’t trust จาก PCs |
| LLQ สำหรับ voice |
Strict priority + police ≤ 33% ของ link bandwidth |
| WRED สำหรับ TCP |
ใช้ WRED ใน data queues (prevent TCP sync) |
| End-to-end consistency |
ใช้ DSCP marking เดียวกัน end-to-end |
| Shape before WAN |
Shape ที่ egress ก่อนเข้า WAN link (match CIR) |
| Monitor + tune |
Monitor queue drops + latency + adjust allocations |
ทิ้งท้าย: QoS = Right Traffic, Right Priority
QoS = Classification → Marking (DSCP) → Queuing → Scheduling EF (46) = Voice, AF41 (34) = Video, AF21 (18) = Critical Data LLQ = strict priority (voice) + CBWFQ (guaranteed bandwidth per class) Policing = drop excess, Shaping = buffer excess Classify at edge + trust boundary + end-to-end DSCP consistency
อ่านเพิ่มเติมเกี่ยวกับ SD-WAN Architecture และ WAN Optimization ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com