networking cyberpunk pixel style

Discovering OSI model and TCP/IP

Let’s dive into each of the Layers to understad what is it about:

  1. Physical Layer: it deals with electrical, radio or optical signals used to move bits. For example: cables, repeaters, hubs, NICs.
  2. Data Link Layer: it’s responsible to connect one device to another to transfer data using frames. It has two sub-layers:
    LLC (Logical Link Control): Identifies network protocols and provides flow control.
    – MAC (Media Access Control): Uses MAC Addresses to decide who has permission to transmit data on the wire.
    Devices: Switches and Bridges.
  3. Network Layer: It’s where routing is possible through different networks, like the internet, for example. It uses IP addresses to find the best path to transmit data via packets.
    Key Protocols: IPv4, IPv6, ICMP (ping), and IGMP.
    Devices: Routers and Layer 3 Switches.
  4. Transport Layer: It ensures that the data arrives in order without losing its message. It can use two different protocols:
    – TCP (Transmission Control Protocol): Reliable and “connection-oriented.” It checks if the segment of data arrived; if not, it sends it again.
    – UDP (User Datagram Protocol): Fast and “connectionless.” It shoots the data out via datagrams and doesn’t care if it’s received (great for gaming or livestreams).
  5. Session Layer: It’s responsible for coordinating and terminating sessions between applications. Also creating check-points in case of the connection is lost or interrupted, so it can start from where it was for the last time. Examples: NetBIOS, SAP, and RPC.
  6. Presentation Layer: That’s where Encryption and Compression usually happen to guarantee confidentiality of the message. Examples: SSL/TLS (encryption), JPEG, GIF, MPEG, and ASCII/EBCDIC.
  7. Application Layer: This is where protocols are used depending on the network services that the user needs from that application. Examples: HTTP/HTTPS (web), SMTP (email), FTP (files), and DNS (mapping names to IPs).

All this process of sending data through the network is related to a concept of Encapsulation. It means that for each layer, as from Layer 7 to Layer 1, it’s like the data (an envelope) is inside a package (capsule) that changes in each layer adding its own “header”.

Encapsulation process

Layers 7-6-5: They get the raw data like a text message an user types. Header: Encryption (TLS), character encoding (ASCII, UTF-8).

Layer 4: it converts the message into small pieces that are segments. Header: TCP or UDP header, including the Port Number like, port 443 for HTTPS or 80 for HTTP.

Layer 3: This is where your message becomes a packet. Header: IP address of the source and destination

Layer 2: Get the packet from the previous Layer and moves it to the Network Interface Card (NIC) as a frame. Header & Trailer: MAC (physical address) header and FCS (Frame Check Sequence) that validates if the data got corrupted during the transit, if so, it send the whole packet away.

Layer 1: The frame turns into bits that are sent via electrical, radio or optical signals wired or through the air.

///After all that encapsulation, we have the decapsulation, which is the reverse process checking layer by layer for the message to get to its right destination.

Alright, that’s it for now. On the next post I’m gonna cover about Wireshark and we are gonna analyse some TCP Layers and data sending. Thank you for the reading.

Leave a Comment

Your email address will not be published. Required fields are marked *