The OSI model broken down for dummies

·

6 min read

This article are for dumb dumbs like me to understand the OSI model since I didn't remember it from college well enough

What does the Internet mean?

The Internet is a network of machines that allows access to the web.

What does the web mean?

The web is a collection of pages that may contain images or text. It is a subset of the Internet."

Application Layer

The Application Layer is used by network applications that operate over the Internet

Protocols used in the Application Layer include HTTP, HTTPS, SNMP, FMTP, DHCP, FTP, POP3, NNTP, and NFS.

Examples of applications in the Application Layer include:

  • Browsers: Chrome, Firefox (uses HTTP)

  • Emails: Gmail, Outlook (uses SMTP)

  • Messaging: Skype"

File Transfer: FTP
Web Surfing: HTTP/S
Emails: SMTP
virtual terminals: Telnet

Presentation Layer

This layer receives data from the Application Layer. The data is in the form of characters and numbers and is converted to machine-understandable binary. Before the data is transmitted to the next layer, it is compressed using either lossy or lossless methods. Then it is encrypted to keep the integrity of the data via the SSL protocol to encrypt and decrypt

Presentation layer performs these 3 tasks:

Session Layer

Functionalities:

  • Authentication

  • Authorization

  • Session Management

Setting up, managing and termination connections. Enables sending and receiving data. APIs and NETBIOS (Network basic input-output systems) operate at this level.

Before a session/connection is established with the server, the server will perform Authentication to verify the user. Then Authorization is next to check if the user has permissions to access the resource.
The session layer also keeps track of files being downloaded. Since text and images are stored as separate files on the web server, when you request a website in a web browser, the browser opens separate connections to the webserver to download the text and images in the form of data packets and tracks where the data goes.

Transport Layer

Controls the reliability of communications via

  • Segmentation

  • Flow Control

  • Error Control

Segmentation:

Data received from the session layer is divided into segments
Each segment is a data unit which contains port and sequence number

Flow Control:

The transport layer controls the amount of data being transmitted

In this example, the phone can only download at 10 Mbps but server can send at 100 Mbps. The server is trying to send at 50 Mbps but since the phone can only handle 10 Mbps, the phone through the transport layer can tell the server to slow down to 10 Mbps. Vice versa if the server Mbps to the client is too slow, then you can the phone can tell the server to speed up.

Error Control

If some data is lost, the transport layer uses Automatic Repeat Request to retransmit the data units lost

A group of bits called Checksum is added to each segment to verify the integrity of data during transmission or storage

Protocols: TCP (Transmission Control Protocol) UDP (User datagram protocol)

Network Layer

The network layer handles 3 main things.

  • Packet forwarding

  • Routing/ Logical Addressing

  • Path determination

Packet Forwarding

Data units in the network layer are packets. It is constructed using the segments from the transport layer (binary data that was segmented), headers, and the IP addresses of the source and destination.

The following is how it looks like

     Packet 1                Packet 2             Packet 3             Packet 4
+------------------+  +------------------+  +------------------+  +------------------+
| TCP Header       |  | TCP Header       |  | TCP Header       |  | TCP Header       |
| Sequence Number 1 |  | Sequence Number 2 |  | Sequence Number 3 |  | Sequence Number 4 |
+------------------+  +------------------+  +------------------+  +------------------+
| Data (Segment 1) |  | Data (Segment 2) |  | Data (Segment 3) |  | Data (Segment 4) |
+------------------+  +------------------+  +------------------+  +------------------+

Logical Addressing/Routing

This is the assignment of IP addresses on a network to identify them. It so we can route a packet to a client that requests it and not to the wrong client.

For example, in the picture below, the client B requests Facebook.com. So Facebook has an IP address for client b which is 192.168.2.1. We have a mask 225.225.225.0 which says the first 3 segments are the network "id" and the latter is the client that requested. 192.168.2 is the network we are looking for and .1 is the client we are looking for.

Path Determination

This is the layer where we determine what is the best way to get from sender to receiver. Many algorithms are used to help determine how we can send the data through the internet as efficiently as we can.

Some include:

  • OSPF (Open Shortest Path First)

    • Purpose: OSPF is a link-state routing protocol used within an Autonomous System (AS). It is designed for fast convergence and scalability, commonly used in enterprise and ISP networks.
  • BGP

    • Purpose: BGP is a path-vector protocol used for routing between Autonomous Systems, making it the core protocol of the internet. It is responsible for inter-domain routing
  • IS-IS

    • Purpose: IS-IS is a link-state routing protocol used within an Autonomous System, similar to OSPF. It is widely used in large service provider networks.

The Data Link Layer handles physical addressing

  • Accessing media (Physical addressing)

    • Mac addresses of the sender and receiver are added to the data packet to create a data unit in this layer called a Frame. Frames travel through "local media" such as copper wire, optical, or air. Basically from media to

    • The picture above is a computer connected to Router1 via ethernet, the routers communicate with each via IP and Router2 communicates with the laptop via wireless.

      Steps of the process of communicating between computer and laptop

      • Computer encapsulates IP packet into a frame (ethernet frame)

      • R1 receives it and decapsulates the frame to just IP packet

      • R1 then encapsulates into an IP frame to travel to R2

      • R2 decapsulate it to just IP packet

      • R2 then encapsulates it into a wireless datalink frame

      • Laptop receives the wireless frame

      • Laptop decapsulates it and forwards the IP packet to the network layer which then goes to the application layer

    • Control how data is placed and received from the media

      • The technique used to get the frame on and off the media is

        Media Access Control.

      • CSMA ( Carrier Sense Multiple Access)

        • used to avoid collision of frame sent when multiple devices are on the same media ( like if many ppl connected to the router via wireless or wire)

        • Tail of each frame contains bits to detect errors in the received frame

Physical Layer

This layer is where Frames of binaries are converted into signals

  • electrical signal - copper

  • light signal - optic

  • radio signal - air