User Tools

Site Tools


icnd1:encapsulation

Encapsulation / Decapsulation

Data goes through preparations to traverse the network when being sent or received. It moves through the OSI model layer by layer adding headers and trailers at each layer.

Encapsulation


The data starts at layer 7, the Application layer where it's raw data. As it goes down the stack information is added onto the data.

LAYER : PDU

  • 4 = Segment – Adds Source and Destination PORT #'s
  • 3 = Packet – Adds Source and Destination IP Addresses (Logical)
  • 2 = Frame – Adds Source and Destination MAC Addresses (Physical)
  • 1 = bits / waves / light pulses / etc

The process generally looks like this:

  • DATA
  • [ L4 S D Ports ] DATA [ L4 Trailer ]
  • [ L3 S D IP Addr ] [L4] DATA [L4] [ L3 Trailer ]
  • [ L2 S D MAC Addr ] [L3] [L4] DATA [L4] [L3] [ L2 FCS Trailer ]
  • Layer 1 the data is converted to the transmission medium. Bits / Waves / etc

Decapsulation


Basic travel logic:

Frame:

  • Does destination MAC match my MAC?
  • Yes?
    • Accept the frame.
  • No?
    • Drop the frame.

Packet:

  • Router: Is the destination IP in my routing table?
    • Yes?
      • Forward the packet on.
    • No?
      • Drop the packet.
  • Host: Does the destination IP match mine?
    • Yes?
      • Strip packet headers/trailers and process the rest of the data.
    • No?
      • Drop the packet.

Once the packet gets to it's final destination the encapsulation process is reversed by the basic travel logic stated above. So long as the addresses match the receiving device will strip each layer's travel data until it can send the data to it's ultimate destination, perhaps port 80 HTTP traffic destined for a web server.

icnd1/encapsulation.txt · Last modified: 2015/12/13 00:23 (external edit)