What is the OSI model?

The Open Systems Interconnection model is a reference model that describes how applications interact with each other over a computer network. The OSI model has seven layers seen below.

Physical Layer

This is the lowest layer of the OSI model. This layer provides mechanical, and electrical functions by transmitting bits over physical connections. This may be electrical signals, optical signals (optical  , laser), electromagnetic waves (wireless networks) or sound. So essentially anything allows data to be transferred physically from one machine to another.

Data Link Layer

This is the second layer of the OSI model,  which is in charge of the local delivery of frames between devices on the same LAN. Data-link frames, as these protocol data units are called, do not cross the boundaries of a local network. This is where the MAC address of each network device is used.

Network Layer

This is the third layer of the OSI model. The network layer is responsible for packet forwarding including routing through layer 3 devices like routers using logical addressing which includes IPv4 and IPv6 IP addresses.

Transport Layer

This is the fourth layer of the OSI model. This layer is responsible for end-to-end connections between machines using transport protocols. The best-known transport protocol of TCP/IP is the Transmission Control Protocol (TCP) which lent its name to the title of the entire suite. It is used for reliable connection-oriented transmissions, whereas the connectionless User Datagram Protocol (UDP) is used for simpler messaging transmissions.

Session Layer

This is the fifth layer of the OSI model. The session layer provides the mechanism for opening, closing and managing a session between end-user application processes , working closely with the Transport layer.

Presentation Layer

This is the sixth layer of the OSI model. The presentation layer ensures the information that the application layer of one system sends out is readable by the application layer of another system. Encryption is typically performed at this level For example when logging on to an online bank account site the presentation layer will decrypt the data as it is received and present it to the above application layer.

Application Layer

This is the seventh layer of the OSI model. The application layer is the user interface responsible for displaying received information to the user on the screen, maybe a web browser, email client or Word document.

Scenario

A user wants to view a secure website page using a web browser from their machine.

  • Application Layer - A user opens an HTTPS URL in a web browser.
  • Presentation Layer - The formatting/Encryption is completed
  • Session/Transport Layer - TCP three-way handshake is established with the web server
  • Network Layer - IP addressing and routing will be used to route the packets to the destination IP address (The web server)
  • Data Link Layer - MAC addresses are used on the local LAN for communication purposes.
  • Physical layer - bits of data are transmitted across the physical connection

This process is then reversed back to the application (web browser), which is displayed on the user's screen allowing them to view the contents of the web page,