Service Primitives (บริการพื้นฐาน)
Operation ที่ Layer ให้ Layer บนเรียกใช้ เพื่อแลกเปลี่ยนข้อมูลกับ Peer Entity
4 ประเภทหลัก
| Primitive | ความหมาย | ตัวอย่าง |
|---|---|---|
| Request | Layer บนขอให้ Layer ล่างทำงาน (ส่งข้อมูล) | CONNECT.request, DATA.request |
| Indication | Layer ล่างแจ้ง Layer บนว่า Peer ทำ Request มา | CONNECT.indication, DATA.indication |
| Response | Layer บนตอบกลับ Indication (ยอม/ปฏิเสธ) | CONNECT.response (Accept/Reject) |
| Confirm | Layer ล่างแจ้ง Layer บนผลของ Request เดิม | CONNECT.confirm (Success/Failed) |
Connection-Oriented Service (เช่น TCP, Telephone)
- CONNECT.request → CONNECT.indication → CONNECT.response → CONNECT.confirm
- DATA.request → DATA.indication
- DISCONNECT.request → DISCONNECT.indication
Connectionless Service (เช่น UDP, Postal Mail)
- DATA.request (ส่งทันที, ไม่ต้อง Connect)
- DATA.indication (รับทันที)
- อาจมี REPORT.confirm (Registered Mail - ยืนยันส่งถึง)
Confirmed vs Unconfirmed Services
- Confirmed: มี Response/Confirm (Connection-Oriented)
- Unconfirmed: ไม่มี Confirmation (Connectionless, Best Effort)
Parameters ของ Primitives
- CONNECT: Address, QoS, Options
- DATA: Buffer, Length, Flags
- DISCONNECT: Reason Code
ความสัมพันธ์กับ Protocol
Service Primitives = Service Interface (API) ระหว่าง Layer
Protocol = Rules ระหว่าง Peer Entities (Wire Format, State Machine)
Service Definition: "What it does"
Protocol Specification: "How it does it"