Computer Networks Interview Questions · Question 01

Explain the responsibilities of all seven layers of the OSI model.

Interview preparation resource from Gate Smashers.

Interview-ready answer

The OSI model is a seven-layer reference model that separates network communication responsibilities. From Layer 7 to Layer 1: Application provides network services to application software; Presentation handles data representation, translation, compression, and encryption; Session establishes, manages, and terminates dialogs; Transport provides end-to-end communication between application processes, including segmentation, multiplexing with port numbers, and, where supported, reliability and flow control; Network provides logical addressing and routing between networks; Data Link provides node-to-node delivery over a local link using frames and link-layer addressing, with error detection; and Physical transmits bits as electrical, optical, or radio signals over the medium. Data is encapsulated as it moves down the sender's stack and decapsulated as it moves up the receiver's stack.

Computer Networks Interview Questions diagram explaining Explain the responsibilities of all seven layers of the OSI model
Understand it clearly

OSI model purpose

The Open Systems Interconnection (OSI) model organizes communication functions into seven conceptual layers. Each layer serves the layer above it and relies on the layer below it, which helps separate concerns for protocol design, interoperability, and troubleshooting.

Upper layers: application-facing functions

Layer 7, Application, provides network services used by application software. Common examples include services for web access, email, file transfer, and name resolution.

Layer 6, Presentation, is responsible for the representation of data so that communicating applications can interpret it consistently. Its functions include translation between data formats or character encodings, compression, and encryption or decryption.

Layer 5, Session, establishes, manages, and terminates dialogs between communicating applications. In the OSI model, it can also coordinate dialog control and synchronization points for longer exchanges.

  • Layer 7 — Application: Provides network services to application software; examples often associated with this layer include HTTP, DNS, SMTP, and FTP.
  • Layer 6 — Presentation: Handles data format, encoding, compression, and encryption-related representation functions.
  • Layer 5 — Session: Manages communication dialogs and synchronization between applications.

Transport and internetwork delivery

Layer 4, Transport, provides communication between application processes on end systems. It can segment and reassemble data, use port numbers to identify application endpoints, and provide reliability, ordered delivery, flow control, and retransmission when the transport protocol supports those functions.

Layer 3, Network, moves packets between networks. It uses logical addressing and routing to select paths toward a destination; IP is a common network-layer protocol.

  • Layer 4 — Transport: Provides process-to-process delivery and may provide reliability, ordering, flow control, and error recovery. TCP and UDP are commonly mapped to this layer.
  • Layer 3 — Network: Provides logical addressing and routing of packets across interconnected networks. Routers primarily operate at this layer.

Local-link transmission and data flow

Layer 2, Data Link, provides delivery over a single local link or network segment. It organizes data into frames, uses link-layer addressing such as MAC addresses where applicable, and commonly provides error detection. Ethernet switches primarily operate at this layer.

Layer 1, Physical, transmits bits over the medium as electrical, optical, or radio signals. It covers signaling, connectors, cabling or radio media, and other physical transmission characteristics.

On the sender, application data is encapsulated as it moves down the layers; lower-layer control information is added before transmission. On the receiver, the corresponding information is processed and removed as data moves up the stack. Real protocol suites do not always implement the seven OSI layers as separate components, but the model remains useful for describing responsibilities.

  • Layer 2 — Data Link: Provides local-link framing, link-layer addressing, and error detection.
  • Layer 1 — Physical: Carries bits over the physical medium using electrical, optical, or radio signaling.