Home » QoS Deep Dive: DiffServ, IntServ, DSCP, Queuing, Shaping และ Policing
QoS Deep Dive: DiffServ, IntServ, DSCP, Queuing, Shaping และ Policing
QoS Deep Dive: DiffServ, IntServ, DSCP, Queuing, Shaping และ Policing
QoS (Quality of Service) จัดการ network traffic เพื่อให้ critical applications ได้ bandwidth และ latency ที่ต้องการ DiffServ (Differentiated Services) จำแนก traffic เป็น classes ด้วย DSCP markings, IntServ (Integrated Services) ใช้ RSVP reserve bandwidth per-flow, Queuing algorithms จัดลำดับ packets, Shaping ควบคุม output rate ให้สม่ำเสมอ และ Policing drop/remark packets ที่เกิน rate limit
Network ที่ไม่มี QoS ใช้ best-effort delivery: ทุก packet ได้รับการปฏิบัติเหมือนกัน เมื่อเกิด congestion voice/video packets ถูก drop เหมือน file download → ทำให้ voice ขาดหาย, video กระตุก QoS ทำให้ voice/video ได้ priority สูงกว่า file download ระหว่าง congestion
DiffServ vs IntServ
| Feature |
DiffServ |
IntServ |
| Approach |
Per-class (aggregate traffic into classes) |
Per-flow (reserve bandwidth per flow) |
| Scalability |
Highly scalable (few classes) |
Not scalable (state per flow at every router) |
| Signaling |
No signaling (static classification) |
RSVP (Resource Reservation Protocol) |
| Guarantee |
Relative priority (no absolute guarantee) |
Absolute guarantee (reserved bandwidth) |
| Complexity |
Simple (classify + mark + queue) |
Complex (per-flow state at every hop) |
| Deployment |
Widely deployed (standard) |
Rare (scalability issues) |
DSCP (Differentiated Services Code Point)
| DSCP Value |
Name |
Per-Hop Behavior |
Use Case |
| 46 (101110) |
EF (Expedited Forwarding) |
Low latency, low loss, low jitter |
Voice (VoIP) |
| 34 (100010) |
AF41 |
Assured Forwarding Class 4, Low drop |
Video conferencing |
| 26 (011010) |
AF31 |
Assured Forwarding Class 3, Low drop |
Streaming video |
| 18 (010010) |
AF21 |
Assured Forwarding Class 2, Low drop |
Critical data (ERP, CRM) |
| 10 (001010) |
AF11 |
Assured Forwarding Class 1, Low drop |
Bulk data transfer |
| 0 (000000) |
BE (Best Effort) |
Default, no priority |
Web browsing, email |
| 8 (001000) |
CS1 (Scavenger) |
Lower than best effort |
Background traffic (backups, P2P) |
| 48 (110000) |
CS6 |
Network control |
Routing protocols (OSPF, BGP) |
QoS Processing Steps
| Step |
Action |
Where |
| 1. Classification |
Identify traffic type (ACL, NBAR, DSCP, CoS) |
Ingress |
| 2. Marking |
Set DSCP/CoS/IP Precedence value |
Ingress (trust boundary) |
| 3. Policing |
Rate limit — drop/remark excess traffic |
Ingress or Egress |
| 4. Queuing |
Place packets in appropriate queue |
Egress (during congestion) |
| 5. Scheduling |
Select which queue to service next |
Egress |
| 6. Shaping |
Smooth output rate (buffer excess) |
Egress |
Queuing Algorithms
| Algorithm |
How It Works |
Use Case |
| FIFO |
First In First Out (no priority) |
Default (no QoS) |
| PQ (Priority Queuing) |
High priority queue always served first |
Voice (but can starve other queues) |
| WFQ (Weighted Fair Queuing) |
Fair sharing based on weight/flow |
General purpose (fair distribution) |
| CBWFQ (Class-Based WFQ) |
WFQ + class-based bandwidth allocation |
Enterprise standard (per-class guarantees) |
| LLQ (Low Latency Queuing) |
CBWFQ + strict priority queue for voice/video |
Best practice (voice priority + class guarantees) |
| WRED (Weighted RED) |
Drop packets early (before queue full) based on DSCP |
Congestion avoidance (TCP-friendly) |
Shaping vs Policing
| Feature |
Shaping |
Policing |
| Action |
Buffer excess traffic → send later |
Drop or remark excess traffic immediately |
| Output |
Smooth rate (no bursts) |
Bursty (drop excess, pass conforming) |
| Direction |
Egress only |
Ingress or Egress |
| Latency |
Adds latency (buffering) |
No added latency (drop immediately) |
| TCP Impact |
TCP-friendly (no drops → no retransmits) |
TCP unfriendly (drops → retransmits → throughput loss) |
| Use Case |
Match ISP rate (shape to contracted rate) |
Enforce rate limit on ingress (customer traffic) |
QoS Design Best Practices
| Practice |
รายละเอียด |
| Mark close to source |
Trust boundary ที่ access layer → mark DSCP ที่ closest switch to user |
| 4-8 classes maximum |
ไม่ต้องมากกว่า 8 classes (complex = hard to manage) |
| LLQ for voice |
Strict priority queue สำหรับ voice (EF) — limit to ≤ 33% of link |
| CBWFQ for data |
Class-based bandwidth guarantees สำหรับ critical data applications |
| WRED for TCP |
Early random drop สำหรับ TCP traffic (avoid tail drop → TCP global sync) |
| Shape to contracted rate |
WAN interface: shape to ISP contracted rate (avoid ISP policing drops) |
| Monitor queues |
Monitor queue depths, drops, scheduling → tune policies |
Typical Enterprise QoS Model
| Class |
DSCP |
Bandwidth |
Queue |
| Voice |
EF (46) |
10% (strict priority) |
LLQ (priority) |
| Video |
AF41 (34) |
15% (strict priority) |
LLQ (priority) |
| Critical Data |
AF31 (26) |
25% |
CBWFQ |
| Transactional |
AF21 (18) |
15% |
CBWFQ |
| Best Effort |
BE (0) |
25% |
CBWFQ (default) |
| Scavenger |
CS1 (8) |
5% |
CBWFQ (minimum) |
| Network Control |
CS6 (48) |
5% |
CBWFQ |
ทิ้งท้าย: QoS = Right Traffic, Right Priority, Right Time
QoS Deep Dive DiffServ: per-class treatment (DSCP marking, scalable, standard) IntServ: per-flow reservation (RSVP, not scalable, rarely used) DSCP: EF=voice, AF4x=video, AF3x=critical, AF2x=transactional, BE=default, CS1=scavenger Steps: classify → mark → police → queue → schedule → shape Queuing: LLQ (voice priority) + CBWFQ (class guarantees) + WRED (TCP congestion avoidance) Shaping: buffer excess (smooth, TCP-friendly) | Policing: drop excess (bursty, ingress enforcement)
อ่านเพิ่มเติมเกี่ยวกับ SD-WAN Architecture Application-Aware Routing และ Network Load Balancing L4 L7 ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com