The OSI Model

Cmill

OSI

618 Words

2025-05-06 03:56


DATA in Layers

Layer PDU/Datagram Use Case
Application Data Bridge between applications and the network
Presentation Data Translates data if needed, encryption
Session Data Manages session state
Transport Segment Protocols, segmenting, ordering of packets
Network Packet IP Addressing, Routing, Switches(L3)
Data-Link Frame MAC, Switches(L2), Organizes bits to Frames
Physical Bit TX/RX bits, cabling, standards.

Layer 1: The Physical Layer is the lowest layer of the OSI/TCP model, representing the literal physical means of data transmission via bits. Every bit transmitted and received by a NIC, data cable, and antenna pass through this layer. Layer 1 defines these devices and mediums along with the standards in which they physically communicate. It focuses on pure data transmission at it’s rawest form, like a radio wave or fiber pulse, not the logical elements like addressing.


Layer 2: The Data-Link layer focuses on creating Ethernet frames from bits and their transmission via a MAC Address. On a local level, this helps us define where a frame will be sent or received. Data-Link frames stay within their LAN.


The Ethernet Frame

The data-link layer utilizes Ethernet frames to transmit layer 1 data into logical form to direct said data to a switch or other device locally. It’s a post card, an encapsulating unit of data(PDU) for addressing who(MAC) our data is going to. MAC addresses will be stripped and added depending on whether the data needs to be routed or retained on the local network.

  1. Preamble - Aids receiving device synchronization to read the frame.
  2. Start frame Delimiter - indicates the end of the preamble/beginning of the frame
  3. Destination MAC Address - MAC address of where frame is being sent
  4. Source MAC Address - MAC address identifying device sending frame
  5. Type - Specifies type of protocol in the payload or length of payload (IPV4/6, ARP)
  6. Payload - The data being transmitted. Between 46-1500 bytes
  7. Frame Check Sequence(FCS) - Error checking. Aids identifying errors during transmission

EthernetFrame

If VLAN’s are present, a VLAN tag will be applied to the frame between Source MAC and type

Or


Where’s my data?

In Layer 1, a client’s NIC converted outgoing data into binary and sends it across a physical medium. At layer 2, our interface(NIC) translated the binary data into a logical form for local addressing. An Ethernet frame is created with a destination and source address to either send to a device locally or to prepare the transmission for routing outside the LAN via Layer 3.


Layer 3: The Network layer is responsible for routing between different networks by utilizing logical addressing(IP). With these IP address’, we can identify devices and route packets on a global scale dynamically. When thinking of layer 3, think routers, hardware firewalls, and layer 3 switches.

Packets

Due to packets being delivered globally, the number of fields within layer 3’s PDU are larger.

  1. Version - provides IP version (4/6)
  2. Header Length - a 4 bit field describing IP header length in 32 bit incremenents
  3. Type of Service - used for prioritizaion (QOS)
  4. Total Length - indicaties size of entire packet (header and data)
  5. Identification - Value for fragmented packets to ID as a set
  6. IP Flags - Used for fragmentation process
  7. Fragment Offset - describes fragment position in the original fragmented packet
  8. Time to Live - used to prvent endless loops by reducing value over time. If value drops to 0, packet is dropped
  9. Protocol - ID’s which protocol is being utilized in the packet (TCP =6, UDP = 17)
  10. Header Checksum - error correction
  11. Source Address - sender IP
  12. Destination Address - reciever IP
  13. IP Option - used for various options(not common)

Layer 4: The transport layer