Computer Networks · TEE · practice

UDP length calculation · example 1

Unit 5 · Process delivery, UDP, TCP and SCTP · optional practice

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 100 payload bytes. The IP header is 20 bytes with no additional extension headers. Find the UDP Length and complete IP packet size. [5 practice marks]

Answer

Given

UDP payload=100 B; UDP fixed header=8 B; IP header=20 B.

To find

UDP Length field and total packet bytes.

Formula and why

L_{UDP}=8+P,\quad L_{IP}=H_{IP}+L_{UDP}LaTeX: 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

100+8=108 bytes.

Step 2. Include the IP header

108+20=128 bytes.

Step 3. Check layer boundaries

20 IP + 8 UDP + 100 data = 128 bytes.

Final answer: UDP Length=108 bytes; IP packet=128 bytes.