Protocols: Service Boundary

      1 Comment on Protocols: Service Boundary

The previous post highlights the role of PDUs in exchanging state information between peer protocols in remote systems. This post discusses the exchange between adjacent protocols in the same system.

The concept of a service boundary is fundamental in communication protocols. It represents the dividing line between different protocol layers, specifically between a protocol machine (PM) and the PM or application it serves, the (N+1)-PM. This boundary is where data is exchanged, and it involves the following key points:

  1. Service Data Unit (SDU): This is the data provided by the (N+1)-PM to the (N)-PM at the service boundary. The SDU consists entirely of user-data, and its size is determined by the (N+1)-PM’s requirements. The (N)-PM may need to process the SDU, such as segmenting it into smaller pieces or aggregating multiple SDUs before transmitting them as Protocol Data Units (PDUs).
  2. Port-ID: is used within the system to identify the flow or connection associated with the SDU. This identifier is local and only known within the system, serving as a reference for related communications between the (N)-PM and (N+1)-PM.
Service Data Unit

Data handling modes

After it has been processed by the (N)-PM, an SDU is handled in either one of these modes:

Stream Mode: treats data as a continuous flow of bytes, without fixed boundaries between SDUs. This mode is more flexible as it allows data to be delivered in various forms (whole SDUs, pieces of SDUs, or even multiple SDUs together). The (N+1)-PM must be able to recognize and reassemble the SDUs from this stream, as the (N)-PM doesn’t preserve the identity of individual SDUs.

Record (Block) Mode: operates on fixed-length or variable length data units or records, maintaining clear boundaries between each SDU. The identity of each SDU is maintained between sender and receiver. In this mode, the (N)-PM is responsible for ensuring that the SDU is delivered to the (N+1)-PM in the same form it was received, even if fragmentation or aggregation occurred during transmission.

The Stream Mode is more efficient for protocols with octet-level sequence granularity, where boundaries between SDUs are not maintained, and partial SDUs may be delivered. The Record Mode maintains the identity of SDUs, requiring the (N)-PM to reassemble fragmented data before delivery, ensuring that the (N+1)-PM receives the data exactly as it was sent. The advantage of this mode is that it aligns with good programming practices, emphasizing the need to maintain the integrity and identity of the data units throughout the communication process.

Example

FTP (RFC959) defines three different transmission modes that specify how data is sent from one device to another: stream mode, block mode, and compressed mode.

  • In stream mode, data is sent as a continuous stream of bytes with no specific header structure is used. If a file is sent, the end of the file is indicated by the sending device closing the data connection when it is done.
  • In block mode, the data is broken into blocks and encapsulated into individual blocks, or records. Each record has a three-byte header that indicates its length (two bytes) and information about the data blocks being sent (1 byte).
  • The compressed mode uses a simple technique for compressing data before sending it in a way similar to the block mode.

References

  1. J. Day, Patterns in network architecture: A return to fundamentals. 2008.

One thought on “Protocols: Service Boundary

  1. Pingback: Protocols: Mechanism and Policy – Ad Hoc Node

Comments are closed.