MasterTech Technology, official logoGet a quote
English technical publication

Technical publication available in English and Spanish. Read Spanish version ↗

Advanced Networking

OSI Model Layers: Formal Protocol Specification, Services, and Transmission Mechanisms

Exhaustive technical treatise analysing application protocols, standard-nomenclature session token types, transport architecture (ports 0 to 65,535, flow control, Same Order Delivery), LLC/MAC sublayer separation, and physical-layer technologies such as SONET.

Diagram: seven OSI layers and encapsulation Enlarge diagram ↗

// FORMAL OBJECTIVES

  • Understand the OSI model.
  • Understand why it is used in computer networking.
  • Identify every layer and its boundary responsibilities.
OSI Model Layers

Layer 7 · Application

OSI Level 7

The layer with which users and applications interact directly, acting as the interface between end software and the network. It enables network services such as:

Core Protocols and How They Work:

Protocol Port(s) Formal Definition
HTTP 80, 8080 Enables client–server hypertext communication over ports 80 and 8080.
HTTPS 443 The secure version of HTTP, adding a TLS cryptographic and authentication layer over port 443.
FTP 20, 21 Provides bidirectional file transfer—sending and receiving files across ports 20 and 21.
DNS 53 Translates domain names into public IP addresses over port 53.
SMTP 25, 587, 465 Handles mail submission and relay transmission over ports 25, 587, and 465.
SSH 22, 2222 Provides encrypted remote server login, command execution, and file transfer over port 22 or 2222.
// Review Question:

What specific job does each of these protocols perform?

• HTTP/HTTPS: Govern web exchanges via request–response methods (GET, POST, PUT, DELETE). HTTPS wraps transport in TLS/SSL to thwart Man-in-the-Middle (MitM) interception.

• FTP: Uses two separate connections: port 21 for control commands and port 20 for the actual data stream.

• DNS: The Internet's directory, resolving human-readable names into 32-bit or 128-bit IP addresses needed by Layer-3 routers.

• SMTP: Store-and-forward mail relay protocol. Port 25 handles server-to-server transfers (MTA), while port 587 with STARTTLS serves mail clients (MUA).

• SSH: Secure replacement for Telnet. Authenticates via cryptographic key pairs and runs an encrypted interactive shell session.

OSI Model Layers

Layer 6 · Presentation

Ensures exchanged payloads can be understood by both endpoints and protects their confidentiality.

1
Translates text into binary encoding: maps between sender and receiver character representations (e.g., UTF-8 / ASCII text into standardised byte layouts).
2
Formats information syntax: ensures structural uniformity across platforms (object serialisation, abstract syntax notation ASN.1).
3
Encrypts and compresses (e.g., HTTPS): reduces bit volume through compression and applies cryptographic ciphers before passing payloads to the Session layer.
OSI Model Layers

Layer 5 · Session

Establishes, coordinates, and closes dialogue connections between communicating systems. Each connection is termed a session and is unique and unambiguous. Session control—such as temporary turn-taking governance—is also managed here.

For half-duplex or orderly exchanges, Layer 5 assigns tokens to coordinate turns and keep multi-step dialogues uninterrupted.

Formal Token Mechanisms:

Data Token:

Digital key indicating which data stream may be transmitted and when transmission is permitted.

Governs speaking turns over half-duplex links to avoid dialogue collisions.

Activity Major Token:

Partitions a session into distinct activities; if one activity is interrupted or deferred, it can resume cleanly later.

Isolates complex logical work units without restarting the entire session.

Synchronize Minor Token:

Synchronises client and server state using numbered temporal markers.

Inserts checkpoints during transfers to enable crash recovery without retransmission from scratch.

Release Token:

Terminates the session cleanly by negotiating closure of the communication channel.

Ensures orderly teardown and buffer deallocation on both peers.

OSI Model Layers

Layer 4 · Transport

Delivers reliable end-to-end host communication across a network. It receives payloads from the Session layer (Layer 5) and passes segmented units to the Network layer (Layer 3), splitting or sizing segments into smaller or larger units as transport limits require.

Two transport protocols dominate production networks:

TCP

Transmits data sequentially, numbering segments and confirming ordered delivery.

UDP

Lower-latency transmission without ordering checks or delivery acknowledgements.

Services Provided by the Transport Layer:

• Connection-oriented transmissions:

Supported by protocols like TCP (Transmission Control Protocol), which assigns port numbers in the range 0 to 65,535 and enforces acknowledgement handshakes.

• Connectionless protocols:

Skip delivery acknowledgements and session setup. Despite omitting retry overhead, they excel for real-time streams like voice and videoconferencing. UDP (User Datagram Protocol) likewise uses ports between 0 and 65,535.

• Same Order Delivery:

Guarantees segments are reassembled in exact send sequence by assigning monotonically tracked sequence numbers.

• Data integrity:

Detects corrupted, dropped, or out-of-order segments via checksums and issues acknowledgements (ACKs) back to the sender to verify payload integrity.

• Flow control:

Throttles or expands transmission windows dynamically (sliding window advertisement) to avoid overwhelming a slower receiver's buffers.

• Congestion avoidance:

When intermediate routers or links bottleneck, the transport layer scales back send rates (cwnd back-off) to prevent sustained network collapse.

• Multiplexing:

Interleaves packets from many concurrent applications over one network link using unique source/destination port tuples.

OSI Model Layers

Layer 3 · Network

Determines the logical path data travels across interconnected networks, handling logical addressing, routing computation, and packet forwarding.

Devices such as routers operate here using routing algorithms and forwarding tables to guide packets across complex internetworks via protocols such as:

Protocol Formal Definition
IP Internet Protocol—unique numerical logical identifier for an interface across networks, operating via IPv4 or IPv6.
ICMP Internet Control Message Protocol—transmits error notifications and diagnostic telemetry (ping / traceroute).
IPSec IP Security—provides network-layer authentication and encryption for IP packets.
OSI Model Layers

Layer 2 · Data Link

Provides reliable node-to-node transfer across a single local link. Organises raw bits into frames, handles local error detection, and arbitrates orderly media access through two sublayers:

Logical Link Control (LLC):

Bridges upper Network-layer protocols with the hardware-facing MAC sublayer.

Media Access Control (MAC):

Interfaces directly with NIC hardware and manages frame encapsulation and physical addressing.

OSI Model Layers

Layer 1 · Physical

Forms the foundation of the OSI stack, transmitting raw binary streams (1s and 0s) over copper cabling, optical fibre, or wireless radio spectrum. Defines electrical, mechanical, and procedural specifications to activate and maintain physical links.

Key standards and technologies: physical Ethernet specifications, RS-232, DSL, SONET, and Bluetooth.

Hardware components: hubs, cables, repeaters, connectors, and transceivers operate here, governing line rate, signal attenuation, and medium integrity.

// INITIAL QUESTION

Returning to the WhatsApp Example: What Happens When You Send a Message?

Layer-by-layer traceability:

OSI Layer Technical Action in WhatsApp
Application The user types "Hello" in WhatsApp; the client app parses the event and prepares Internet delivery.
Presentation The message is encoded into binary bytes and encrypted (end-to-end encryption in WhatsApp).
Session An active authenticated session between peers is verified and kept coherent throughout delivery.
Transport Payloads are split into segments and assigned TCP (reliable text/control) or UDP (low-latency voice/video) depending on data type.
Network Source and destination IP addresses are attached, routing paths are selected, and each segment becomes an IP packet.
Data Link Next-hop MAC addresses are prepended, payloads are wrapped into frames, and local link errors are detected.
Physical Bits are modulated into electrical voltages, optical pulses, or radio waves (Wi-Fi / cellular).