Layers in a network stack need a well-defined point where they exchange data and control information. Without a clear interface, layer implementations would be tightly coupled and hard to modify independently.
The interface point between two adjacent protocol layers where the upper layer requests services from the lower layer.
- Each layer exposes a SAP for the layer above
- Upper layer invokes service primitives at the SAP
- Data and parameters are passed through the SAP
- Lower layer delivers indications and confirmations through the SAP
- The SAP abstracts the lower layer’s implementation from the upper layer
- Layer boundary interface
- Implemented as API calls in practice (e.g., Berkeley sockets)
- Identified by a SAP address (e.g., port number for transport layer)
- Enables layer independence and modularity
- Built from: Service — the service provided through the SAP
- Built from: Service Primitives — operations at the SAP
- Related: Socket API — common SAP implementation
- Related: Layered Model — SAPs exist between layers
- SAP exhaustion (e.g., running out of ports) prevents new connections
- SAP addressing must be unique within a system (e.g., IP+port combination)
- Some SAPs are connection-oriented, others connectionless