Multicast Routing: PIM-SM และ IGMP สำหรับ Video Streaming

Multicast Routing: PIM-SM และ IGMP สำหรับ Video Streaming

Multicast Routing คือวิธีส่งข้อมูลจาก source เดียวไปยัง receivers หลายตัวพร้อมกัน โดยไม่ต้องส่งซ้ำหลายครั้ง (ต่างจาก unicast) ใช้ bandwidth อย่างมีประสิทธิภาพ เหมาะสำหรับ video streaming, IPTV, video conferencing, software updates และ real-time data distribution ที่มี receivers จำนวนมาก

ถ้าใช้ unicast ส่ง video ไปยัง 100 users → ต้องส่ง 100 copies ใช้ bandwidth 100 เท่า แต่ถ้าใช้ multicast → ส่งแค่ 1 copy network replicate ให้ที่จุดที่จำเป็น ใช้ bandwidth น้อยกว่ามาก แต่ multicast ซับซ้อนกว่า unicast ต้องมี multicast routing protocol (PIM) และ group membership protocol (IGMP) บทความนี้จะอธิบายพื้นฐานที่จำเป็น

Unicast vs Multicast vs Broadcast

Type วิธีส่ง Bandwidth เหมาะกับ
Unicast 1 source → 1 destination (ส่งแยกทีละคน) N × bandwidth (N = receivers) Web, email, file download
Broadcast 1 source → ทุก device ใน subnet ทุก device ได้รับ (แม้ไม่ต้องการ) ARP, DHCP discover
Multicast 1 source → เฉพาะ receivers ที่สนใจ 1 × bandwidth (replicate เมื่อจำเป็น) Video streaming, IPTV

Multicast Addresses

Range ใช้สำหรับ ตัวอย่าง
224.0.0.0/24 Local network control (ไม่ forward ข้าม router) 224.0.0.1 (all hosts), 224.0.0.5 (OSPF)
224.0.1.0 – 224.0.1.255 Internetwork control 224.0.1.1 (NTP)
239.0.0.0/8 Administratively scoped (private multicast) 239.1.1.1 (internal video)
232.0.0.0/8 Source-Specific Multicast (SSM) 232.1.1.1 (SSM stream)

IGMP (Internet Group Management Protocol)

Receivers บอก Router ว่าสนใจ Group ไหน

IGMP Version Features ใช้เมื่อไหร่
IGMPv1 Basic join (no leave message) Legacy ไม่แนะนำ
IGMPv2 Join + Leave message (faster leave) ทั่วไป (default ส่วนใหญ่)
IGMPv3 Source-specific join (SSM support) SSM, large-scale IPTV

IGMP Messages

Message ส่งโดย ทำอะไร
Membership Query Router (querier) ถาม hosts ว่ายังสนใจ group ไหนอยู่
Membership Report Host ตอบว่าสนใจ group นี้ (join)
Leave Group Host บอกว่าไม่สนใจ group นี้แล้ว (IGMPv2+)

IGMP Snooping

Switch-level Multicast Optimization

IGMP Snooping ทำงานบน L2 switches: Switch ดักฟัง IGMP messages ระหว่าง hosts กับ router สร้าง multicast forwarding table ส่ง multicast traffic เฉพาะ ports ที่มี receivers (ไม่ flood ทุก port) ลด unnecessary multicast traffic บน LAN enabled by default บน switches ส่วนใหญ่

PIM (Protocol Independent Multicast)

Multicast Routing Protocol หลัก

PIM Mode วิธีทำงาน เหมาะกับ
PIM-SM (Sparse Mode) ใช้ RP (Rendezvous Point) เป็นจุดนัดพบ sources register กับ RP receivers join ผ่าน RP Enterprise ทั่วไป (recommended)
PIM-DM (Dense Mode) Flood multicast ทุกที่ก่อน แล้ว prune ที่ไม่ต้องการ Small networks, lab (ไม่แนะนำ production)
PIM-SSM (Source-Specific) Receivers ระบุ source + group (S,G) ไม่ต้องมี RP IPTV, large-scale streaming
BiDir-PIM Bidirectional shared tree ผ่าน RP Many-to-many multicast

PIM-SM Components

Component บทบาท
RP (Rendezvous Point) จุดนัดพบ: sources register streams, receivers join ผ่าน RP
Shared Tree (*,G) Tree จาก RP ไปยัง receivers (initial path)
Shortest Path Tree (S,G) Tree ตรงจาก source ไปยัง receivers (optimal path)
SPT Switchover เมื่อ traffic ถึง threshold → switch จาก shared tree เป็น SPT
DR (Designated Router) Router ที่ส่ง PIM join/prune บน shared segment

RP Configuration Methods

Method วิธีการ ข้อดี
Static RP Configure RP address บนทุก router manually ง่าย เหมาะกับ network เล็ก
Auto-RP (Cisco) RP ประกาศตัวเอง routers เรียนรู้อัตโนมัติ Automatic RP discovery (Cisco only)
BSR (Bootstrap Router) BSR กระจายข้อมูล RP ให้ทุก router (RFC 5059) Standard-based multi-vendor
Anycast RP หลาย routers ใช้ RP address เดียวกัน (MSDP) RP redundancy + load sharing

Multicast Use Cases

Use Case Protocol Multicast Group
IPTV / Video Streaming PIM-SSM + IGMPv3 232.x.x.x (SSM range)
Video Conferencing PIM-SM 239.x.x.x (private)
Software Distribution PIM-SM 239.x.x.x (private)
Financial Market Data PIM-SM / SSM 239.x.x.x / 232.x.x.x
OSPF Routing Updates Built-in 224.0.0.5, 224.0.0.6
Discovery Protocols Built-in 224.0.0.x (link-local)

Troubleshooting

ปัญหา ตรวจสอบ Commands
Receivers ไม่ได้รับ stream IGMP snooping, PIM neighbor, RP reachability show ip igmp groups, show ip pim neighbor
Stream ช้า/กระตุก Bandwidth, QoS, TTL show ip mroute, show interfaces
Multicast flood ทุก port IGMP snooping disabled show ip igmp snooping
RP ไม่ทำงาน RP configuration, PIM enabled ทุก interface show ip pim rp mapping
Source ไม่ register กับ RP PIM enabled บน source interface show ip pim interface

ทิ้งท้าย: Multicast = ประหยัด Bandwidth สำหรับ One-to-Many

Multicast ลด bandwidth จาก N× เหลือ 1× สำหรับ one-to-many ใช้ PIM-SM เป็นมาตรฐาน (enterprise) ใช้ PIM-SSM สำหรับ IPTV/large-scale IGMP Snooping ต้อง enable บน switches (default ส่วนใหญ่) วางแผน RP placement + redundancy ก่อน deploy

อ่านเพิ่มเติมเกี่ยวกับ EtherChannel LACP และ Network Performance Monitoring ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com

จัดส่งรวดเร็วส่งด่วนทั่วประเทศ
รับประกันสินค้าเคลมง่าย มีใบรับประกัน
ผ่อนชำระได้บัตรเครดิต 0% สูงสุด 10 เดือน
สะสมแต้ม รับส่วนลดส่วนลดและคะแนนสะสม

© 2026 SiamLancard — จำหน่ายการ์ดแลน อุปกรณ์ Server และเครื่องพิมพ์ใบเสร็จ

SiamLancard
Logo
Free Forex EA Download — XM Signal · EA Forex ฟรี
iCafeForex.com - สอนเทรด Forex | SiamCafe.net
Shopping cart