# Multimedia Network Protocols ### โปรโตคอลเครือข่ายมัลติมีเดีย **ผู้จัดทำ:** อรรถพล คงหวาน --- ## Outline 1. บทนำ: โปรโตคอลมัลติมีเดียในเครือข่าย 2. RTP — Real-time Transport Protocol 3. SRTP — Secure Real-time Transport Protocol 4. SIP — Session Initiation Protocol 5. H.323 — Multimedia Communication Protocol 6. ช่องโหว่และการป้องกัน VoIP 7. สรุปโดยรวม --- # 1. บทนำ ## โปรโตคอลมัลติมีเดียในเครือข่าย --- ## Multimedia Network Protocols คืออะไร **Multimedia Network Protocols** คือกลุ่มโปรโตคอลที่ออกแบบสำหรับการส่งข้อมูลเสียงและวิดีโอแบบ real-time ผ่านเครือข่าย IP ลักษณะพิเศษของ Real-time Traffic: - **Latency Sensitive** — ความล่าช้าเกิน 150ms ทำให้คุณภาพการสนทนาแย่ลง - **Jitter Intolerant** — ความไม่สม่ำเสมอของ delay ส่งผลต่อคุณภาพเสียง/วิดีโอ - **Loss Tolerant** — การสูญหายของแพ็กเก็ตบางส่วนยอมรับได้ แต่ต้องน้อยกว่า 1-5% - **Bandwidth Predictable** — ต้องการ bandwidth คงที่ตลอดเวลา --- ## ภาพรวม Protocol Stack มัลติมีเดีย ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'secondaryColor': '#3c3836', 'tertiaryColor': '#504945', 'background': '#282828', 'mainBkg': '#282828', 'nodeBorder': '#928374', 'clusterBkg': '#3c3836', 'titleColor': '#ebdbb2', 'edgeLabelBackground': '#3c3836'}}}%% flowchart TD subgraph APP["Application Layer (ชั้นแอปพลิเคชัน)"] A1["🎤 Voice/Video Application - Softphone, Video Conferencing"] end subgraph SIG["Signaling Protocols (โปรโตคอลส่งสัญญาณ)"] S1["SIP - Session Initiation Protocol"] S2["H.323 - ITU-T Standard"] end subgraph MEDIA["Media Transport (การส่งข้อมูลสื่อ)"] M1["RTP / SRTP / RTCP"] end subgraph TRANS["Transport Layer"] T1["UDP - User Datagram Protocol"] end subgraph NET["Network Layer"] N1["IP - Internet Protocol"] end APP --> SIG --> MEDIA --> TRANS --> NET style APP fill:#458588,color:#ebdbb2,stroke:#83a598 style SIG fill:#d79921,color:#282828,stroke:#fabd2f style MEDIA fill:#98971a,color:#ebdbb2,stroke:#b8bb26 style TRANS fill:#cc241d,color:#ebdbb2,stroke:#fb4934 style NET fill:#689d6a,color:#ebdbb2,stroke:#8ec07c ``` --- ## ประวัติความเป็นมาของ Multimedia Protocols ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% flowchart LR subgraph ERA1["ยุคที่ 1: ต้นกำเนิด (1990s)"] E1["1996 - H.323 v1\n1996 - RTP RFC 1889"] end subgraph ERA2["ยุคที่ 2: SIP (Late 1990s-2000s)"] E2["1999 - SIP RFC 2543\n2002 - SIP RFC 3261\n2004 - SRTP RFC 3711"] end subgraph ERA3["ยุคที่ 3: WebRTC & Modern (2010s+)"] E3["2012 - WebRTC\n2018 - SIP over WebSocket\n2020+ - Zoom, Teams, Meet"] end ERA1 --> ERA2 --> ERA3 style ERA1 fill:#504945,color:#ebdbb2,stroke:#665c54 style ERA2 fill:#3c3836,color:#ebdbb2,stroke:#504945 style ERA3 fill:#282828,color:#ebdbb2,stroke:#3c3836 ``` --- # 2. RTP ## Real-time Transport Protocol --- ## RTP คืออะไร **RTP (Real-time Transport Protocol)** คือโปรโตคอลมาตรฐานสำหรับการส่งข้อมูลเสียงและวิดีโอแบบ real-time กำหนดใน **RFC 3550** โดย IETF RTP ทำงานบน **UDP** เป็นหลัก เนื่องจาก: - ไม่มี connection overhead ของ TCP - ไม่มีการ retransmit ที่ทำให้เกิด jitter - ยอมรับการสูญหายของข้อมูลบางส่วนได้ - มี latency ต่ำกว่า TCP อย่างเห็นได้ชัด --- ## โครงสร้าง RTP Packet Header ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836', 'nodeBorder': '#d79921'}}}%% packet-beta 0-1: "V=2" 2: "P" 3: "X" 4-7: "CC" 8: "M" 9-15: "PT (Payload Type)" 16-31: "Sequence Number" 32-63: "Timestamp" 64-95: "SSRC (Synchronization Source)" 96-127: "CSRC [optional]" 128-159: "Extension Header [optional]" 160-191: "Payload Data (เสียง/วิดีโอ)" ``` --- ## RTP Header Fields | Field | ขนาด | ความหมาย | |-------|------|-----------| | **V** | 2 bits | รุ่น RTP (ปัจจุบัน = 2) | | **PT** | 7 bits | ระบุชนิด codec เช่น PCMU=0, G.729=18 | | **Seq No.** | 16 bits | ลำดับแพ็กเก็ต (0–65535) สำหรับตรวจ loss | | **Timestamp** | 32 bits | เวลาของ sample แรก สำหรับ sync | | **SSRC** | 32 bits | รหัสเฉพาะของแหล่งส่งข้อมูล | | **M** | 1 bit | Marker — กำหนดจุดสำคัญ เช่น ต้น frame | | **CC** | 4 bits | จำนวน CSRC identifiers (0–15) | --- ## RTCP — RTP Control Protocol **RTCP** ทำงานคู่กับ RTP เพื่อตรวจสอบคุณภาพ ส่งบน Port = RTP Port + 1 | ประเภท | ชื่อเต็ม | หน้าที่ | |--------|---------|---------| | **SR (200)** | Sender Report | สถิติจากผู้ส่ง: packets sent, bytes sent | | **RR (201)** | Receiver Report | สถิติจากผู้รับ: packet loss, jitter | | **SDES (202)** | Source Description | ข้อมูลผู้ส่ง: CNAME, NAME | | **BYE (203)** | Goodbye | แจ้งการสิ้นสุด session | | **APP (204)** | Application-Defined | ข้อมูล custom ของแอปพลิเคชัน | --- ## การคำนวณ RTP Timestamp **สูตรคำนวณ Timestamp:**
T
RTP
=
T
start
+
t
×
f
s
**ตัวอย่าง:** G.711 (PCMU) sampling rate 8,000 Hz, ส่งทุก 20ms
Timestamp increment
=
0.02
×
8000
=
160
samples/packet
- Packet 1: TS = `12345` (random start) - Packet 2: TS = `12505` - Packet 3: TS = `12665` --- ## การคำนวณ Jitter
J
=
J
+
|
D
(
i
-
1
,
i
)
|
-
J
16
**D(i-1, i)** = ความต่างของ relative transit time ระหว่างแพ็กเก็ตสองชุด --- ## Codec ที่นิยมใช้กับ RTP | Codec | PT | Sampling Rate | Bitrate | ใช้สำหรับ | |-------|----|--------------|---------|----------| | **G.711 PCMU** | 0 | 8 kHz | 64 kbps | VoIP telephony | | **G.711 PCMA** | 8 | 8 kHz | 64 kbps | VoIP (A-law) | | **G.722** | 9 | 16 kHz | 64 kbps | HD Voice | | **G.729** | 18 | 8 kHz | 8 kbps | ประหยัด bandwidth | | **G.723.1** | 4 | 8 kHz | 5.3/6.3 kbps | Low bandwidth | | **Opus** | Dynamic | 8–48 kHz | 6–510 kbps | WebRTC | | **H.264** | Dynamic | — | Variable | Video conferencing | --- # 3. SRTP ## Secure Real-time Transport Protocol --- ## ทำไมต้องใช้ SRTP RTP ดั้งเดิม **ไม่มีการเข้ารหัสข้อมูล** ทำให้เสี่ยงต่อ: - **Eavesdropping** — การดักฟังเสียงและวิดีโอ - **Replay Attack** — การส่งแพ็กเก็ตซ้ำ - **Tampering** — การแก้ไขข้อมูลระหว่างทาง **SRTP (RFC 3711, 2004)** แก้ไขโดยเพิ่ม: - **Confidentiality** — เข้ารหัสด้วย AES - **Integrity** — ตรวจสอบด้วย HMAC-SHA1 - **Replay Protection** — ป้องกัน replay attack ด้วย sequence number window --- ## สถาปัตยกรรม SRTP ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% flowchart LR subgraph SENDER["ฝั่งผู้ส่ง"] P1["🎤 Audio/Video"] --> P2["RTP Packet"] P2 --> P3["AES-CTR Encrypt"] P3 --> P4["HMAC-SHA1 Auth"] P4 --> P5["📤 SRTP Packet"] end subgraph KEYS["Key Management"] K1["Master Key"] --> K2["KDF"] K2 --> K3["Session Keys\n(Cipher/Salt/Auth)"] end subgraph RECEIVER["ฝั่งผู้รับ"] R1["📥 SRTP"] --> R2["Replay Check"] R2 --> R3["HMAC Verify"] R3 --> R4["AES Decrypt"] R4 --> R5["🔊 Output"] end K3 --> P3 K3 --> P4 P5 -.->|Network| R1 style SENDER fill:#98971a,color:#ebdbb2,stroke:#b8bb26 style KEYS fill:#d79921,color:#282828,stroke:#fabd2f style RECEIVER fill:#458588,color:#ebdbb2,stroke:#83a598 ``` --- ## กระบวนการเข้ารหัส SRTP (AES-CTR) **การสร้าง Initialization Vector:**
IV
=
salt
⊕
(
SSRC
∥
index
)
**การเข้ารหัส:**
Ciphertext
=
Plaintext
⊕
AES
k
(
IV
∥
counter
)
**Authentication Tag (HMAC-SHA1):**
Auth Tag
=
HMAC-SHA1
(
k
a
,
SRTP packet
∥
index
)
[
0
:
80
]
--- ## วิธีการแลกเปลี่ยน Key ใน SRTP | วิธีการ | มาตรฐาน | ความปลอดภัย | ใช้ในระบบ | |--------|---------|------------|----------| | **SDES** | RFC 4568 | ปานกลาง | Legacy SIP | | **DTLS-SRTP** | RFC 5764 | สูง (PFS) | WebRTC (บังคับ) | | **MIKEY** | RFC 3830 | สูง | IMS, Enterprise | | **ZRTP** | RFC 6189 | สูงมาก (ไม่ต้อง PKI) | Zfone, Signal | --- # 4. SIP ## Session Initiation Protocol --- ## SIP คืออะไร **SIP (Session Initiation Protocol)** คือโปรโตคอลมาตรฐานสำหรับ **Signaling** กำหนดใน **RFC 3261** — เป็น text-based protocol คล้าย HTTP **SIP ทำหน้าที่เฉพาะ Signaling เท่านั้น:** - สร้าง (Create), ปรับเปลี่ยน (Modify), ยุติ (Terminate) multimedia session - ไม่ส่งข้อมูลเสียงหรือวิดีโอ — ข้อมูลจริงส่งผ่าน RTP/SRTP - Port 5060 (ปกติ) / Port 5061 (SIP/TLS) --- ## SIP Architecture ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% flowchart TB subgraph CLIENTS["SIP Clients (User Agents)"] UA1["📱 Alice sip:alice@example.com"] UA2["💻 Bob sip:bob@example.com"] end subgraph SERVERS["SIP Servers"] PROXY["🔄 Proxy Server"] REG["📋 Registrar"] REDIR["↩️ Redirect Server"] B2B["🔀 B2BUA"] end UA1 <-->|SIP Signaling| PROXY UA2 <-->|SIP Signaling| PROXY PROXY <--> REG PROXY <--> REDIR PROXY <--> B2B UA1 <-.->|"RTP Media"| UA2 style CLIENTS fill:#689d6a,color:#ebdbb2,stroke:#8ec07c style SERVERS fill:#458588,color:#ebdbb2,stroke:#83a598 ``` --- ## SIP Request Methods | Method | หน้าที่ | |--------|---------| | **INVITE** | ชวน/เริ่ม session | | **ACK** | ยืนยันการรับ final response | | **BYE** | ยุติ session | | **CANCEL** | ยกเลิก pending request | | **REGISTER** | ลงทะเบียน location กับ Registrar | | **OPTIONS** | ถาม capabilities | | **SUBSCRIBE/NOTIFY** | subscribe/แจ้ง event | | **REFER** | Call transfer | | **MESSAGE** | Instant message | --- ## SIP Response Codes | Code | ความหมาย | ตัวอย่าง | |------|---------|---------| | **1xx** | Provisional (กำลังดำเนินการ) | 100 Trying, 180 Ringing | | **2xx** | Success (สำเร็จ) | 200 OK | | **3xx** | Redirection (เปลี่ยนทาง) | 302 Moved Temporarily | | **4xx** | Client Error | 403 Forbidden, 404 Not Found | | **5xx** | Server Error | 500 Internal Server Error | | **6xx** | Global Failure | 603 Decline | --- ## SIP Call Flow ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% sequenceDiagram participant A as "📱 Alice" participant P as "🔄 SIP Proxy" participant B as "💻 Bob" Note over A,B: Registration A->>P: REGISTER P-->>A: 200 OK Note over A,B: Call Setup A->>P: INVITE P->>B: INVITE B-->>P: 100 Trying B-->>P: 180 Ringing 🔔 P-->>A: 180 Ringing 🔔 B-->>P: 200 OK P-->>A: 200 OK A->>P: ACK P->>B: ACK Note over A,B: Media Exchange A-->>B: 🔊 RTP/SRTP Note over A,B: Teardown B->>P: BYE P->>A: BYE A-->>P: 200 OK ``` --- ## SDP — Session Description Protocol SIP ใช้ **SDP (RFC 4566)** บอกรายละเอียด session ``` v=0 o=alice 2890844526 2890844527 IN IP4 192.168.1.10 s=Phone Call c=IN IP4 192.168.1.10 t=0 0 m=audio 49170 RTP/AVP 0 8 18 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:18 G729/8000 a=ptime:20 a=sendrecv ``` --- ## SIP Digest Authentication
HA1
=
MD5
(
username:realm:password
)
HA2
=
MD5
(
method:URI
)
Response
=
MD5
(
HA1:nonce:HA2
)
> ⚠️ **ปัญหา:** ใช้ MD5 ซึ่ง**ไม่ปลอดภัย** — ควรใช้ **SIP over TLS (Port 5061)** แทน --- # 5. H.323 ## Multimedia Communication Protocol --- ## H.323 คืออะไร **H.323** คือมาตรฐานของ **ITU-T** สำหรับระบบการสื่อสารมัลติมีเดียบนเครือข่าย packet-based เริ่มใช้ตั้งแต่ปี **1996** — ก่อน SIP H.323 เป็น suite ของโปรโตคอลที่ประกอบด้วย: - **Terminal** — อุปกรณ์ปลายทาง - **Gatekeeper** — ควบคุมการเข้าถึง - **Gateway** — เชื่อม PSTN - **MCU** — Multipoint Control Unit --- ## H.323 Architecture ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% flowchart TD H323["H.323 Suite"] --> TERM["📱 Terminal"] H323 --> GK["🔑 Gatekeeper"] H323 --> GW["🌉 Gateway (PSTN)"] H323 --> MCU["🎛️ MCU"] H323 --> PROTOCOLS["โปรโตคอลภายใน"] PROTOCOLS --> H225["H.225.0 - Call Signaling (TCP 1720)"] PROTOCOLS --> H245["H.245 - Media Control"] PROTOCOLS --> H235["H.235 - Security"] PROTOCOLS --> H239["H.239 - Dual Video Stream"] style H323 fill:#d79921,color:#282828,stroke:#fabd2f style PROTOCOLS fill:#458588,color:#ebdbb2,stroke:#83a598 ``` --- ## เปรียบเทียบ H.323 กับ SIP | คุณสมบัติ | H.323 | SIP | |----------|-------|-----| | **ผู้กำหนดมาตรฐาน** | ITU-T | IETF | | **รูปแบบข้อความ** | Binary (ASN.1) | Text (คล้าย HTTP) | | **ความซับซ้อน** | สูงมาก | ปานกลาง | | **NAT Traversal** | ยากมาก | ยาก แต่มีทางออกมากกว่า | | **Scalability** | จำกัด | ดีกว่า | | **การใช้งานปัจจุบัน** | Legacy, ลดลง | ครองตลาด | | **ตัวอย่าง** | Video Conference เก่า | PBX, Softphone, WebRTC | --- ## ขั้นตอนการสร้าง H.323 Call 1. **Registration** — Terminal ลงทะเบียนกับ Gatekeeper ด้วย RRQ/RCF (H.225 RAS) 2. **Admission** — ขอ admission จาก Gatekeeper ด้วย ARQ/ACF 3. **Call Signaling** — สร้าง TCP connection ไปยัง port 1720, ส่ง SETUP message (H.225) 4. **Capability Exchange** — แลกเปลี่ยน codec capabilities ด้วย H.245 5. **Logical Channel Opening** — เปิด channel สำหรับส่ง media (H.245 OpenLogicalChannel) 6. **Media Transfer** — ส่งข้อมูลเสียง/วิดีโอผ่าน RTP 7. **Call Disconnect** — ปิด logical channels, ส่ง ReleaseComplete --- # 6. ช่องโหว่และการป้องกัน VoIP --- ## ภัยคุกคามที่พบบ่อยใน VoIP ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% mindmap root((VoIP Threats)) Eavesdropping RTP Stream Capture SIP Message Interception Credential Theft Denial of Service SIP Flood RTP Flood Resource Exhaustion Fraud & Abuse Toll Fraud Caller ID Spoofing Vishing Man-in-the-Middle SIP Hijacking RTP Injection Registration Hijacking Quality Attacks Jitter Injection Packet Dropping ``` --- ## RTP Eavesdropping เนื่องจาก RTP ปกติไม่เข้ารหัส ผู้โจมตีสามารถ: 1. ใช้ Wireshark capture แพ็กเก็ต UDP 2. Filter ด้วย `rtp` หรือ `udp.port >= 10000 && udp.port <= 20000` 3. ใช้ฟีเจอร์ **Telephony > RTP > Stream Analysis** 4. บันทึกเป็นไฟล์เสียง WAV ได้โดยตรง **Wireshark capture filter:** ``` udp && (udp.port >= 10000 && udp.port <= 65535) ``` --- ## SIP Registration Hijacking ผู้โจมตีส่ง REGISTER message ปลอมเพื่อ overwrite location ของเหยื่อ: ``` REGISTER sip:example.com SIP/2.0 Via: SIP/2.0/UDP attacker.evil.com:5060;branch=z9hG4bKnasty From: "Bob"
;tag=hijack123 To:
Contact:
← แทนที่ด้วย IP ผู้โจมตี Expires: 3600 ``` > ⚠️ ผลลัพธ์: สายโทรที่มาหา Bob จะถูกส่งไปยังผู้โจมตีแทน --- ## Toll Fraud ผู้โจมตี brute-force SIP credentials เพื่อโทรระหว่างประเทศโดยไม่ต้องจ่ายเงิน
ความเสี่ยง (บาท/ชั่วโมง)
=
R
call
×
simultaneous calls
×
cost per min
×
60
มาตรการป้องกัน: - ใช้รหัสผ่านที่ซับซ้อนสำหรับ SIP accounts - เปิดใช้ Rate Limiting สำหรับ REGISTER/INVITE - ใช้ **Fail2Ban** สำหรับ SIP --- ## Session Border Controller (SBC) ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% flowchart LR subgraph EXTERNAL["Internet (Untrusted)"] EXT1["📱 Remote Phone"] EXT3["👿 Attacker"] end subgraph SBC_ZONE["SBC"] SBC["🛡️ Session Border Controller\n• NAT Traversal\n• DoS Protection\n• Encryption Enforcement\n• Rate Limiting\n• Topology Hiding"] end subgraph INTERNAL["Internal (Trusted)"] INT1["🖥️ SIP PBX"] INT2["💻 IP Phones"] end EXT1 <-->|"SIP/TLS + SRTP"| SBC EXT3 -->|"Attack (blocked)"| SBC SBC <-->|"SIP + RTP"| INT1 INT1 <--> INT2 style EXTERNAL fill:#cc241d,color:#ebdbb2,stroke:#fb4934 style SBC_ZONE fill:#d79921,color:#282828,stroke:#fabd2f style INTERNAL fill:#98971a,color:#ebdbb2,stroke:#b8bb26 ``` --- ## Best Practices สำหรับ VoIP Security | มาตรการ | รายละเอียด | ความสำคัญ | |--------|-----------|----------| | **ใช้ SRTP** | เข้ารหัส media stream ทั้งหมด | 🔴 สูงมาก | | **ใช้ SIP/TLS** | เข้ารหัส signaling | 🔴 สูงมาก | | **VLAN Separation** | แยก Voice VLAN ออกจาก Data | 🔴 สูงมาก | | **Strong Passwords** | รหัสผ่านซับซ้อนสำหรับ SIP | 🔴 สูงมาก | | **Rate Limiting** | จำกัดจำนวน REGISTER/INVITE/วินาที | 🟠 สูง | | **Fail2Ban** | block IP ที่ login ผิดหลายครั้ง | 🟠 สูง | | **QoS & DSCP** | รับประกันคุณภาพเสียง | 🟡 ปานกลาง | | **STUN/TURN** | แก้ปัญหา NAT one-way audio | 🟢 พื้นฐาน | --- ## การวิเคราะห์ VoIP ด้วย Wireshark **Display Filters สำหรับ VoIP:** ``` sip # ดู SIP calls ทั้งหมด sip.Method == "INVITE" # ดูเฉพาะ INVITE sip.Status-Code >= 400 # ดู SIP errors rtp # ดู RTP stream rtcp # ดู RTCP statistics sip || rtp # ดู SIP + RTP รวม ``` **เมนู Telephony → RTP → RTP Streams** ข้อมูลที่ได้: - **Max Delta** — ควรน้อยกว่า 50ms - **Max Jitter** — ควรน้อยกว่า 30ms - **Lost Packets** — ควรน้อยกว่า 1% --- # 7. สรุปโดยรวม --- ## สรุป: โปรโตคอลหลัก - **RTP** — ขนส่งข้อมูลเสียง/วิดีโอแบบ real-time บน UDP มี sequence number และ timestamp สำหรับ sync - **SRTP** — ส่วนขยายของ RTP เพิ่มการเข้ารหัส AES-CTR และ authentication HMAC-SHA1 ควรใช้ทดแทน RTP ทุกกรณี - **RTCP** — ทำงานคู่ RTP รายงานสถิติคุณภาพ: jitter, packet loss, delay - **SIP** — โปรโตคอล signaling text-based ครองตลาด VoIP ใช้ร่วมกับ SDP เพื่อ negotiate media - **H.323** — มาตรฐานเก่าจาก ITU-T ยังพบในระบบ legacy กำลังถูกแทนที่ด้วย SIP --- ## สรุป: ความสัมพันธ์ระหว่าง Protocol ```mermaid %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#282828', 'primaryTextColor': '#ebdbb2', 'primaryBorderColor': '#928374', 'lineColor': '#d5c4a1', 'background': '#282828', 'mainBkg': '#3c3836'}}}%% flowchart TD APP["Application (Softphone)"] APP -->|"Signaling\n(negotiate codec, exchange IPs)"| SIG["SIP / H.323"] APP -->|"Media Transport\n(ข้อมูลเสียง/วิดีโอจริงๆ)"| MEDIA["RTP / SRTP"] APP -->|"Quality Monitoring"| CTRL["RTCP"] SIG --> UDP["UDP / IP"] MEDIA --> UDP CTRL --> UDP style APP fill:#d79921,color:#282828,stroke:#fabd2f style SIG fill:#458588,color:#ebdbb2,stroke:#83a598 style MEDIA fill:#98971a,color:#ebdbb2,stroke:#b8bb26 style CTRL fill:#689d6a,color:#ebdbb2,stroke:#8ec07c style UDP fill:#504945,color:#ebdbb2,stroke:#665c54 ``` --- ## สรุป: ด้านความปลอดภัย - VoIP ที่ไม่ได้รับการป้องกันมีความเสี่ยงสูงต่อการดักฟัง, toll fraud, และ DoS - การใช้ **SIP/TLS + SRTP** คือพื้นฐานที่ต้องมีในระบบ production ทุกระบบ - **VLAN Separation** และ **SBC** ช่วยป้องกันการโจมตีจากภายนอก - **Wireshark** เป็นเครื่องมือสำคัญสำหรับวิเคราะห์และ troubleshoot VoIP --- ## เอกสารอ้างอิง 1. RFC 3550 — RTP: A Transport Protocol for Real-Time Applications (IETF, 2003) 2. RFC 3711 — The Secure Real-time Transport Protocol (IETF, 2004) 3. RFC 3261 — SIP: Session Initiation Protocol (IETF, 2002) 4. RFC 4566 — SDP: Session Description Protocol (IETF, 2006) 5. RFC 3551 — RTP Profile for Audio and Video Conferences (IETF, 2003) 6. ITU-T H.323 — Packet-based Multimedia Communications Systems (2009) 7. RFC 5764 — DTLS Extension to Establish Keys for SRTP (IETF, 2010) 8. RFC 6189 — ZRTP: Media Path Key Agreement for Secure RTP (IETF, 2011) 9. Stallings, W. (2017). *Network Security Essentials* (6th ed.). Pearson. 10. Collier & Endler (2006). *Hacking Exposed VoIP*. McGraw-Hill. --- # คำถาม - ข้อสงสัย