# UDP length calculation · example 3

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/practice/transport/udp-size-3

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/practice/transport--udp-size-3/

Optional extension · no matching calculation in the two supplied papers

**Optional worked extension.** This calculation format was not found in the supplied December 2025 final or February 2026 re-exam. The numbers and practice marks are authored. Study the core concept and actual-paper questions first; this is extra explanation, not a TEE prediction.

### Practice question. A UDP datagram carries 1200 payload bytes. The IP header is 40 bytes with no additional extension headers. Find the UDP Length and complete IP packet size. [5 practice marks]

#### Answer

## Given

UDP payload=1200 B; UDP fixed header=8 B; IP header=40 B.

## To find

UDP Length field and total packet bytes.

## Formula and why



$$
L_{UDP}=8+P,\quad L_{IP}=H_{IP}+L_{UDP}
$$



UDP Length includes its own header, but does not include the IP header.

## Step-by-step solution

#### Step 1. Include the UDP header

1200+8=1208 bytes.

#### Step 2. Include the IP header

1208+40=1248 bytes.

#### Step 3. Check layer boundaries

40 IP + 8 UDP + 1200 data = 1248 bytes.

**Final answer:** UDP Length=1208 bytes; IP packet=1248 bytes.

#### What this result means

Do not write the whole IP packet size into the UDP Length field. Link-layer overhead is excluded.
