---
title: "Headers and trailers"
subject: "Computer Networks and Security"
chapter: 1
key: "semester_7/computer_networks_and_security:headers-trailers-added-removed"
source: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/headers-trailers-added-removed
site: BCT Engineering
---

# Headers and trailers

Computer Networks and Security · Chapter 1: Introduction to Computer Network

- Asked in: 2073 Chaitra, 5 marks; 2070 Chaitra, 4 marks (asked 2 times)
- Video: [Datacom2 -10 Headers and Trailers](https://www.youtube.com/watch?v=3MwqwehclDk) — Roger Zimmerman
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/headers-trailers-added-removed
- Whole chapter: https://www.bctengineer.com/md/semester_7/computer_networks_and_security/chapter-1

## Question

What are headers and trailers and how do they get added and removed?

## Short answer

A header is control information placed before data, and a trailer is control information appended after data, usually for error detection. The sender adds transport, network, and data link headers plus a data link trailer during encapsulation; the receiver removes each header and checks the trailer during decapsulation.

## Answer

A **header** is control information (addresses, sequence numbers, checksums, etc.) placed in front of the data by a protocol layer. A **trailer** is control information appended after the data, usually for error detection (for example the CRC in a data link frame). Together they let the peer layer at the receiver process the data correctly.

#### Adding (encapsulation) at the sender
1. Application data goes to the transport layer, which adds a transport header (ports, sequence number) forming a segment.
2. The network layer adds an IP header (source and destination IP) forming a packet.
3. The data link layer adds a header (source and destination MAC) and a trailer (CRC) forming a frame.
4. The physical layer sends the frame as bits.

```text
 App data :            [      DATA      ]
 Transport:        [TH | DATA ]
 Network  :     [NH | TH | DATA ]
 Data link: [DH | NH | TH | DATA | DT]
```

#### Removing (decapsulation) at the receiver
The frame travels up. The data link layer checks the CRC trailer, reads and removes the frame header and trailer. The network layer reads and strips the IP header, the transport layer strips its header, and the pure data reaches the application.

Each layer reads only the header added by its own peer. Trailers are added at layer 2 (and some other layers) mainly for error checking.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is a trailer, and a typical example?
   A. Control info placed before data, e.g. IP header
   B. Control info appended after data, usually for error detection, e.g. CRC in a data link frame
   C. Encrypted payload at the application layer
   D. The port number in a segment
   Answer: B. A trailer follows the data; the CRC at layer 2 is the standard example. (Key point: Trailer purpose)

2. In which order are headers added at the sender?
   A. Data link, network, transport
   B. Network, transport, data link
   C. Transport, network, then data link (header and trailer)
   D. All at once at the physical layer
   Answer: C. Transport adds a segment header, network adds the IP header, and data link adds a header and trailer to form a frame. (Key point: Encapsulation order)

3. What are the PDUs formed at transport, network and data link layers, respectively?
   A. Packet, segment, frame
   B. Segment, packet, frame
   C. Frame, packet, segment
   D. Segment, frame, packet
   Answer: B. Transport forms segments, network forms packets, and data link forms frames. (Key point: Unit names)

4. What does the data link layer do at the receiver?
   A. Checks the CRC trailer, then removes the frame header and trailer
   B. Removes only the IP header
   C. Adds a new trailer
   D. Reads the transport header
   Answer: A. The receiver's data link layer verifies the CRC, strips its header and trailer, and passes the packet up. (Key point: Decapsulation)

## Related in Computer Networks and Security

- [Layered protocols, headers and trailers](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Alayered-protocols-headers) — Computer Networks and Security, chapter 1, asked 2×
