Protocol Hierarchies (ลำดับชั้นของโปรโตคอล)
โครงสร้างเครือข่ายคอมพิวเตอร์แบ่งเป็นชั้น (Layers) เพื่อลดความซับซ้อน แต่ละชั้นให้บริการแก่ชั้นบน และรับบริการจากชั้นล่าง
องค์ประกอบของโปรโตคอล
- Syntax: รูปแบบข้อมูล (Format, Encoding)
- Semantics: ความหมายของบิต/ฟิลด์ (Control, Error handling)
- Timing: เมื่อไหร่ ส่งเร็วแค่ไหน (Synchronization, Sequencing)
โมเดล 5 ชั้น (Five-Layer Model)
| Layer | ชื่อ | หน้าที่หลัก | Protocol Examples |
|---|---|---|---|
| 5 | Application | User Applications, Services | HTTP, HTTPS, DNS, SMTP, FTP, SSH |
| 4 | Transport | End-to-End Delivery, Reliability | TCP, UDP, SCTP, QUIC |
| 3 | Network | Routing, Logical Addressing | IP (v4/v6), ICMP, OSPF, BGP |
| 2 | Data Link | Framing, MAC, Error Detection | Ethernet, WiFi (802.11), PPP, MAC |
| 1 | Physical | Bit Transmission, Media | Cables, Fiber, Radio, Voltage, Pins |
หลักการทำงาน (Encapsulation)
- Application สร้าง Data (Message)
- Transport เพิ่ม Header (Port, Seq, Checksum) → Segment/Datagram
- Network เพิ่ม Header (IP Src/Dst, TTL) → Packet
- Data Link เพิ่ม Header (MAC Src/Dst) + Trailer (FCS) → Frame
- Physical ส่ง Bits ผ่านสื่อ (Copper, Fiber, Air)
ฝั่งรับ: ถอด Header/Tailer ทีละชั้น (Decapsulation) จนถึง Application
Peer-to-Peer Communication
- Layer N บนเครื่อง A ↔ Layer N บนเครื่อง B (Logical/Virtual)
- ข้อมูลจริงไหลลง-ขึ้นผ่านชั้น (Physical)
- Interface ระหว่างชั้น: กำหนด Service Primitives (Request, Indication, Response, Confirm)
Protocol Stack
รายการโปรโตคอลที่ใช้ ชั้นละ 1 ตัว (เช่น HTTP/TCP/IP/Ethernet)
TCP/IP Model (4 Layers) vs OSI (7 Layers)
- TCP/IP: Application, Transport, Internet, Network Access
- OSI: Application, Presentation, Session, Transport, Network, Data Link, Physical
- TCP/IP ใช้งานจริง, OSI เป็นกรอบอ้างอิง