Home » QoS (Quality of Service): Classification, Marking, Queuing, Policing, Shaping และ QoS Design
QoS (Quality of Service): Classification, Marking, Queuing, Policing, Shaping และ QoS Design
QoS (Quality of Service): Classification, Marking, Queuing, Policing, Shaping และ QoS Design
QoS (Quality of Service) จัดลำดับความสำคัญของ traffic เพื่อให้ applications ที่สำคัญทำงานได้ดี Classification แยกประเภท traffic, Marking ติด label เพื่อ identify ตลอดเส้นทาง, Queuing จัดลำดับการส่ง packets, Policing จำกัด bandwidth แบบ drop excess, Shaping จำกัด bandwidth แบบ buffer excess และ QoS Design วางแผนทั้งระบบ
QoS จำเป็นเพราะ bandwidth ไม่เคยพอ: แม้ link จะใหญ่แค่ไหน → applications ก็ใช้จนเต็มเสมอ (Parkinson’s Law of bandwidth) VoIP ต้องการ latency < 150ms, jitter < 30ms, packet loss < 1% — ถ้าไม่มี QoS → ไฟล์ download ขนาดใหญ่จะกิน bandwidth จน voice call หลุด Video conferencing, real-time applications, business-critical apps ทั้งหมดต้องการ QoS
QoS Processing Order
| Step |
Action |
Where |
| 1. Classification |
Identify traffic type: voice, video, data, best-effort |
Ingress (closest to source) |
| 2. Marking |
Tag packet with priority value (DSCP, CoS, IP Precedence) |
Ingress (trust boundary) |
| 3. Policing |
Rate-limit traffic — drop or re-mark excess |
Ingress or egress |
| 4. Queuing |
Place packets in priority queues based on marking |
Egress (when congestion occurs) |
| 5. Scheduling |
Service queues: strict priority, weighted fair, round-robin |
Egress |
| 6. Shaping |
Buffer excess traffic — smooth bursts to match line rate |
Egress (WAN interfaces) |
Classification & Marking
| Method |
Layer |
Values |
Use |
| CoS (802.1p) |
L2 (VLAN tag) |
0-7 (3 bits) |
Within LAN — lost when VLAN tag removed |
| IP Precedence |
L3 (ToS field) |
0-7 (3 bits) |
Legacy — replaced by DSCP |
| DSCP |
L3 (DS field) |
0-63 (6 bits) |
Standard: end-to-end marking across network |
| NBAR |
L4-L7 (deep inspection) |
Application-aware |
Classify by application (Zoom, Teams, YouTube) |
| ACL-Based |
L3/L4 |
Match IP, port, protocol |
Simple classification when NBAR not available |
Common DSCP Values
| DSCP |
Per-Hop Behavior |
Traffic Type |
Decimal |
| EF |
Expedited Forwarding |
Voice (VoIP RTP) |
46 |
| AF41 |
Assured Forwarding 41 |
Video conferencing |
34 |
| AF31 |
Assured Forwarding 31 |
Streaming video |
26 |
| CS3 |
Class Selector 3 |
Signaling (SIP, H.323) |
24 |
| AF21 |
Assured Forwarding 21 |
Transactional data (ERP, CRM) |
18 |
| CS2 |
Class Selector 2 |
Network management (SNMP, SSH) |
16 |
| AF11 |
Assured Forwarding 11 |
Bulk data (FTP, backup) |
10 |
| CS1 |
Class Selector 1 |
Scavenger (P2P, non-business) |
8 |
| BE (0) |
Best Effort |
Default — no priority |
0 |
Queuing Mechanisms
| Mechanism |
How |
Best For |
| Strict Priority (LLQ) |
Always service priority queue first — preempts all other queues |
Voice, real-time — guarantee no delay (limit to < 33% of link) |
| CBWFQ |
Class-Based Weighted Fair Queuing — allocate bandwidth % per class |
Data classes — guaranteed minimum bandwidth |
| WRR |
Weighted Round Robin — service queues in rotation with weights |
Hardware-based switches — simple, fast |
| WRED |
Weighted Random Early Detection — drop lower priority before congestion |
TCP traffic — prevent tail-drop (TCP global sync) |
| FIFO |
First In First Out — no priority, no fairness |
Default on high-speed interfaces — no QoS |
Policing vs Shaping
| Feature |
Policing |
Shaping |
| Action on Excess |
Drop or re-mark immediately |
Buffer (delay) excess — send when allowed |
| Direction |
Ingress or egress |
Egress only |
| Burst Handling |
Strict — excess immediately handled |
Smooth — buffers bursts, sends evenly |
| Latency Impact |
None (drops immediately) |
Adds latency (buffering) |
| Use Case |
ISP rate-limiting customer traffic, ingress policing |
WAN interface matching contracted rate, Frame Relay CIR |
| TCP Behavior |
TCP retransmits dropped packets → reduced throughput |
TCP adjusts smoothly → better throughput |
QoS Design Model (RFC 4594)
| Class |
DSCP |
Bandwidth |
Queue |
| VoIP (Voice) |
EF |
< 10% (strict priority) |
LLQ — priority queue |
| Video Conferencing |
AF41 |
< 23% (strict priority or CBWFQ) |
Priority or guaranteed bandwidth |
| Signaling |
CS3 |
< 2% |
CBWFQ — guaranteed |
| Transactional Data |
AF21 |
10-15% |
CBWFQ — guaranteed |
| Bulk Data |
AF11 |
5-10% |
CBWFQ — guaranteed |
| Network Management |
CS2 |
3-5% |
CBWFQ — guaranteed |
| Scavenger |
CS1 |
< 1% |
CBWFQ — minimal |
| Best Effort |
0 |
25% (remainder) |
Default queue |
ทิ้งท้าย: QoS = Guarantee Performance for Critical Applications
QoS Order: classify → mark (DSCP) → police → queue → schedule → shape Classification: CoS (L2), DSCP (L3, standard), NBAR (application-aware), ACL-based DSCP: EF (voice 46), AF41 (video 34), AF21 (transactional 18), CS1 (scavenger 8), 0 (best effort) Queuing: LLQ (voice, strict priority < 33%), CBWFQ (bandwidth guarantee per class), WRED (avoid TCP sync) Policing vs Shaping: police = drop excess (ingress/egress) | shape = buffer excess (egress, smoother for TCP) Design: voice < 10% priority, video < 23%, signaling 2%, data classes with guaranteed bandwidth Key: QoS doesn't create bandwidth — it prioritizes what you have → critical for voice/video when congestion occurs
อ่านเพิ่มเติมเกี่ยวกับ Network Performance Latency Jitter Throughput QoE และ WAN Technologies MPLS SD-WAN DMVPN ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com