03. Protocol Layering

Layering

The internet and POTS are complex and require vast amounts of software. Hence, structuring principals are used to achieve:

Networking software is layered - layer NN offers an interface to layer N+1N + 1, offering it using only the service offered by layer N1N - 1 (through its interface).

General layout of Layer NN-PDU (Protocol Data Unit)

| N-protocol header | N + 1 data (N-SDU) | N trailer |

Thus, going down the stack, each layer sandwiches the N+1N + 1 payload between its own header and trailer:

| N-2 hdr | N-1 hdr | N hdr | N+1 data | N trl | N-1 trl | N-2 trl|

The receiver does the opposite, with each layer removing its header/trailer before handing the payload to the upper layer.

OSI Seven Layer Model

OSI: Open Systems Interconnection. A commercial failure, but the terminology and layering architecture/concepts are foundational to networking.

If there are two end hosts, A and B, and a router in between:

Physical (PHY)

Transmission of digital data over a physical medium using modulated waveforms/signals.

Often requires the specification of:

Responsible for reliable transfer of messages over a physical link. Messages at this layer are called frames.

Often requires the specification of:

Network layer

Provides link technology-independent abstraction of the entire network to other layers. Handles addressing and routing and end-to-end delivery of messages.

Messages at this layer and above are called packets.

Often requires the specification of:

Transport Layer

Provides reliable, in-sequence and transparent end-to-end transfer; gives programming abstractions to higher layers.

Often requires the specification of:

Session & Presentation Layers

No one really knows what these are.

Session layer:

Presentation layer:

Application Layer

Application support functions (high-level APIs) used in many applications. Applications sit on top of this layer.

Examples include file transfer services, directory services, transaction processing support (e.g. two-phase commit)

TCP/IP Reference Model

Broadly equivalent to OSI model, but with the session and representation layers removed.

Once again, routers only implement the lowest three layers, which are kept simple. This allows many things to be implemented in hardware, allowing routers to keep up with the deluge of packets.

Application Layer

Protocols such as SMTP, HTTP, FTP.

Transport Layer

Internet Layer

IP:

Physical and Network Interface Layer

Network interface layer:

Service Providers and Service Users

An NN-protocol implements an NN-service; it is an NN-service provider which will be used by an N+1N+1 protocol; the NN-service user.

The service user and provider:

There are standard service primitives for a service.

Confirmed Service

Unconfirmed Service

The first three steps: S.request, PDU sent to B, then S.indication. Service user A does not know if their request has reached B’s service user.

Confirmed Delivery Service

Host B’s service provider simultaneously sends a S.indication to its service user and an acknowledgement packet to A’s service, which will generate a S.confirm packet to the service user.

Thus, A’s service user knows that B’s service provider received the request, but not if the service user successfully processed it.

Multiplexing

Allows several NN SAPs to transmit data over a single N1N-1 SAP.

To do this, the NN protocol entity needs to make scheduling decisions to decide which NN SAP to serve next.

The sending NN protocol entity must include an SAP identifier into the NN PDUs so it can be delivered to the right SAP (e.g. UDP has port numbers).

Splitting

Fragmentation and Reassembly

Blocking and Deblocking

Sequence Numbers