Encapsulation and decapsulation through the layers

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Encapsulation and decapsulation through the layers

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. As data moves down the layers on the sender's device, what does each layer do to it?
A Removes the header added by the layer above
B Adds its own header (encapsulation)
2. Which describes decapsulation?
A The receiver strips off each layer's header in reverse order
B The sender adds headers from the bottom layer to the top
3. In the TCP/IP model, what is the data unit called after the Transport layer (TCP) adds its header?
A Frame
B Segment
4. What does the Internet layer produce when it adds an IP header to a segment?
A A packet
B A frame
5. Which layer adds a header and a trailer to create a frame?
A Network Access (data link)
B Transport

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Application data -> Segment -> Packet -> Frame ASegment = TCP header + Data
2Frame -> Packet -> Segment -> Application data BThe order data is encapsulated as it moves down the layers on the sender
3The transport layer adds a TCP header containing port numbers to the data, creating a segment CFrame = Frame header + Packet + Frame trailer
4The network interface layer adds a header and a trailer around the packet, creating a frame DDecapsulation happens in reverse order, so the frame header is removed first, not last.
5Receiver removes the frame header last, after the TCP header EThe order data is decapsulated as it moves up the layers on the receiver
6Sender: Frame -> Packet -> Segment -> Data FThis shows the wrong direction. Encapsulation starts with the data and adds headers on the way down, so the frame is made last.

Definitions

encapsulation

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
Transport layer: data + header = _______
2.
Network layer: segment + header = ______
3.
frame = header + packet + _______
4.
Receiver removes headers in _______ order
5.
Receiver: frame -> packet -> _______ -> data

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A data = 'Hello'
B segment = IP_header + data
C packet = IP_header + segment
D frame = MAC_header + packet
Question 2
A segment = TCP_header + data
B packet = IP_header + segment
C frame = MAC_header + segment
D send(frame)
Question 3
A frame = receive()
B packet = frame.payload
C segment = frame.payload
D data = segment.payload
Question 4
A 1 Application: add MAC header
B 2 Transport: add TCP header
C 3 Internet: add IP header
D 4 Link: add header + trailer
Question 5
A 1 Link: remove header+trailer
B 2 Internet: remove IP header
C 3 Transport: remove TCP header
D 4 Application: add TCP header

Answer Key

Encapsulation and decapsulation through the layers
Section A: Quick Questions
Q1
B — Adds its own header (encapsulation)
Q2
A — The receiver strips off each layer's header in reverse order
Q3
B — Segment
Q4
A — A packet
Q5
A — Network Access (data link)
Section B: Match the Pairs
Q1
Application data -> Segment -> Packet -> Frame → The order data is encapsulated as it moves down the layers on the sender
Q2
Frame -> Packet -> Segment -> Application data → The order data is decapsulated as it moves up the layers on the receiver
Q3
The transport layer adds a TCP header containing port numbers to the data, creating a segment → Segment = TCP header + Data
Q4
The network interface layer adds a header and a trailer around the packet, creating a frame → Frame = Frame header + Packet + Frame trailer
Q5
Receiver removes the frame header last, after the TCP header → Decapsulation happens in reverse order, so the frame header is removed first, not last.
Q6
Sender: Frame -> Packet -> Segment -> Data → This shows the wrong direction. Encapsulation starts with the data and adds headers on the way down, so the frame is made last.
Section C: Definitions
Q1
encapsulation — Each layer on the sender adds its own header (and sometimes a trailer) as data moves down the layers. The receiver removes them in reverse order, which is called decapsulation.
Section D: Fill in the Blanks
Q1
Transport layer: data + header = segment
Q2
Network layer: segment + header = packet
Q3
frame = header + packet + trailer
Q4
Receiver removes headers in reverse order
Q5
Receiver: frame -> packet -> segment -> data
Section E: Spot the Error
Q1
B — The Transport layer builds the segment, so it adds the TCP header, not the IP header. It should be segment = TCP_header + data. The IP header is added at the next layer down.
Q2
C — Each layer wraps the unit from the layer above. The frame must wrap the packet, so it should be frame = MAC_header + packet. Skipping the packet would lose the IP header.
Q3
C — The segment is inside the packet, not directly inside the frame. Decapsulation works in reverse order, so it should be segment = packet.payload.
Q4
A — The Application layer is where the data is created, before any headers are added. The MAC header is only added at the Link layer, so line 1 should be 1 Application: create data.
Q5
D — The receiver only removes headers as data moves up the layers. By the Application layer all headers are gone and the data is read, so it should be 4 Application: read the data.