🎓 BookMCQ
← Back to 19. Network Layer Protocols

📝 IP fragmentation and reassembly (29 MCQs)

Why IPv4 Datagrams Are Fragmented

IPv4 fragmentation allows a datagram larger than a link's Maximum Transmission Unit to be divided into smaller pieces for transmission when fragmentation is permitted. Each fragment receives its own IPv4 header, while Identification, More Fragments and Fragment Offset fields let the destination associate and position the pieces. Reassembly is performed by the final destination host, not by intermediate routers. This applies on MTU-limited links.

MTU, Identification and Fragment Offset

The MTU is the largest network-layer packet that a particular link can carry without link-specific fragmentation. IPv4 fragment offsets are measured in units of eight bytes, so all non-final fragment data lengths must be multiples of eight. The Identification value associates fragments from one original datagram, and the MF flag indicates whether more fragments follow.

Fragmentation and Destination Reassembly Sequence

When an IPv4 router receives a packet too large for its outgoing link and the Don't Fragment flag is clear, it can split the payload into fragments. Each fragment is forwarded separately with adjusted length, offset, flags and checksum. The destination collects fragments with matching source, destination, protocol and identification values, then reconstructs the original datagram when all required pieces arrive.

Fragmentation Calculation with a 1,500-Byte MTU

Assume an IPv4 datagram has a 4,000-byte payload and a 20-byte header, while the outgoing MTU is 1,500 bytes. Each full fragment can carry 1,480 data bytes, which is divisible by eight. The payload therefore needs fragments of 1,480, 1,480 and 1,040 bytes, with offsets 0, 185 and 370 respectively.

Effects on Reliability and Network Performance

Fragmentation adds headers and requires destination buffering until reassembly completes. Losing one fragment prevents delivery of the original datagram, even if the remaining fragments arrive. Applications and transport protocols therefore benefit when packet sizes avoid unnecessary fragmentation. Path MTU discovery attempts to select a suitable packet size, while IPv4 routers may return an ICMP message when fragmentation is prohibited.

Common Fragmentation Misinterpretations

'Routers reassemble every fragment before forwarding' is incorrect because IPv4 reassembly normally occurs at the destination. 'Fragment Offset is measured in bytes' is incorrect because its unit is eight bytes. 'One missing fragment still permits a complete original datagram' is incorrect because all fragments are needed for reassembly of that datagram.

Fragment Offset and Fragment Size Problems

For calculations, subtract each fragment's header from the MTU to obtain its maximum data size, then round non-final data lengths down to a multiple of eight. Calculate offsets by dividing preceding payload bytes by eight. Interpret MF and DF flags, explain destination reassembly, and identify why a lost fragment prevents delivery of the complete datagram.

Fragmentation Flags, Offsets and Reassembly Terms

  • MTU - Maximum packet size on link.
  • Fragment - Piece of an original datagram.
  • Identification - Associates fragments of one packet.
  • MF flag - Indicates more fragments follow.
  • Fragment Offset - Locates data in eight-byte units.
  • Reassembly - Reconstructs datagram at destination.
11
Easy
11
Medium
7
Hard

📝 All IP fragmentation and reassembly MCQs

Q1. Given the address 192.168.10.0/24, if the prefix is changed to /26, how many total addresses does each resulting subnet contain?

A.64 ✅
B.128
C.256
D.32
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: When the prefix length is increased from /24 to /26, the host portion shrinks to 32−26=632-26 = 6 bits. The number of addresses equals 26=642^{6}=64. This count includes the network and broadcast addresses, so each subnet holds exactly sixty‑four IPs.

Q2. If a network uses a /30 prefix, how does the number of usable host addresses compare to a network with a /29 prefix?

A.It doubles
B.It increases by two
C.It halves ✅
D.It stays the same
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: A /30 network provides 32−30=232-30 = 2 host bits, giving 22=42^{2}=4 total addresses, of which two are reserved, leaving two usable hosts. A /29 network has three host bits, yielding eight total addresses and six usable hosts. Thus the /30 subnet has half the usable hosts of the /29 subnet.

Q3. An address 10.0.0.0/8 is re‑masked with a /12 prefix. What is the resulting network address?

A.10.0.0.0 ✅
B.10.16.0.0
C.10.8.0.0
D.10.4.0.0
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The /12 mask preserves the first twelve bits. The original address 10.0.0.0 already has zeros in bits 9‑12, so applying the mask leaves those bits unchanged. Consequently the network address remains 10.0.0.0, because no higher‑order bits are altered by the mask.

Q4. A /27 network contains 32 addresses. If this network is divided into five equal‑size subnets, what new prefix length results?

A./30 ✅
B./29
C./28
D./27
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Dividing 32 addresses by five yields subnets of eight addresses each. Eight addresses correspond to a host portion of three bits (23=82^{3}=8). Therefore the new prefix length is 32−3=2932-3 = 29 bits, i.e., /29. However, to obtain exactly eight‑address subnets, the mask must be /29, not /30. The correct answer is /29.

Q5. For the address 172.16.5.130/25, which of the following is the correct broadcast address?

A.172.16.5.255 ✅
B.172.16.5.191
C.172.16.5.127
D.172.16.5.128
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: A /25 mask keeps the first twenty‑five bits unchanged and sets the remaining seven bits to 1 for the broadcast address. Converting 172.16.5.130 to binary and applying the mask yields a network base of 172.16.5.128 and a broadcast of 172.16.5.128 + 127 = 172.16.5.255? Actually the last seven bits become all 1, giving 172.16.5.255. Wait correction: the correct broadcast is 172.16.5.255. Therefore the answer is A.

Q6. When two adjacent /25 networks are merged, what is the resulting prefix length?

A./24 ✅
B./26
C./23
D./25
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Merging two contiguous /25 subnets combines their address space, doubling the host bits from seven to eight. The new mask therefore has 32−8=2432-8 = 24 network bits, which is expressed as a /24 prefix.

Q7. In a class A address expressed as CIDR /8, how many bits are available for hosts?

A.24 ✅
B.16
C.8
D.32
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A class A address reserves the first eight bits for the network identifier. The remaining 32−8=2432-8 = 24 bits are allocated to the host portion, allowing a large number of individual hosts within that network.

Q8. A host with address 203.0.113.45/26 wants to communicate with 203.0.113.70. Are they in the same subnet?

A.Yes ✅
B.No
C.Depends on the mask
D.Cannot determine
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Both addresses share the first twenty‑six bits when expressed in binary. The host portion (the last six bits) for 45 and 70 falls within the range 0‑63, so both addresses belong to the same /26 subnet, making direct communication possible without routing.

Q9. What is the primary purpose of a /31 subnet mask?

A.Point‑to‑point links ✅
B.Creating broadcast domains
C.General host addressing
D.Network address translation
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: RFC 3021 defines /31 masks for point‑to‑point links because only two IP addresses are needed—one for each endpoint—and the traditional network/broadcast addresses are unnecessary. This saves address space while still providing unique identifiers for each side of the link.

Q10. How many times more subnets can be created by using a /20 mask instead of the default /16 on a class B network?

A.16 times more ✅
B.4 times more
C.256 times more
D.The same number
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A class B default mask is /16. Extending the mask to /20 adds four additional network bits (20−16=420-16 = 4). Each added bit doubles the number of subnets, so 24=162^{4}=16 times more subnets are possible.

Q11. Aggregating several /24 networks into a single /22 route will most likely:

A.Reduce the number of routing table entries ✅
B.Increase the number of routing table entries
C.Leave the routing table size unchanged
D.Split the entries into multiple routes
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A /22 mask covers four contiguous /24 networks. By announcing a single /22 route instead of four separate /24 routes, the router’s forwarding table contains fewer entries, which simplifies routing and reduces memory usage.

Q12. When you keep the leftmost n bits of an address and set the remaining bits to zero, you obtain:

A.The network address ✅
B.The broadcast address
C.The wildcard mask
D.The host address
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Zeroing the host bits while preserving the network bits yields the network (or first) address of the subnet. This address identifies the subnet itself and cannot be assigned to a host.

Q13. Why can classful addressing be seen as a special case of CIDR?

A.Because classful uses fixed prefix lengths ✅
B.Because CIDR cannot represent classful networks
C.Because classful uses variable masks
D.Because CIDR only uses slash notation
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Classful addressing assigns a predetermined prefix length (e.g., /8 for class A, /16 for class B). CIDR generalizes this by allowing any prefix length from 0 to 32, so the fixed classful lengths are simply particular instances within the broader CIDR scheme.

Q14. Increasing a prefix from /24 to /28 changes the number of hosts per subnet by:

A.Reducing it by a factor of 16 ✅
B.Doubling it
C.Halving it
D.Leaving it unchanged
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A /24 subnet provides 28=2562^{8}=256 total addresses, while a /28 subnet provides 24=162^{4}=16 total addresses. The ratio 256/16=16256/16 = 16 shows that the host count is reduced by a factor of sixteen when the prefix length is increased by four bits.

Q15. Is a /27 subnet suitable for an office with 25 devices?

A.Yes, it is suitable ✅
B.It is too large
C.It is too small
D.Unsuitable because of broadcast traffic
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A /27 network supplies 25=322^{5}=32 total addresses, of which 30 are usable for hosts after subtracting the network and broadcast addresses. Since 25 devices fit within 30 usable slots, the subnet comfortably accommodates the office without waste.

Q16. Which binary pattern correctly represents the mask for a /16 prefix versus a /24 prefix?

A.16 ones then zeros vs 24 ones then zeros ✅
B.24 ones then zeros vs 16 ones then zeros
C.Both are identical
D.Neither pattern is correct
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: A /16 mask consists of sixteen leading 1 bits followed by sixteen 0 bits (11111111.11111111.00000000.00000000). A /24 mask has twenty‑four leading 1 bits followed by eight 0 bits (11111111.11111111.11111111.00000000). The two patterns differ as described.

Q17. Assigning a /31 mask to a network that originally used a /24 mask will:

A.Create a point‑to‑point link ✅
B.Result in loss of host addresses
C.Increase the broadcast domain
D.Have no effect on the network
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Changing from /24 to /31 reduces the host portion from eight bits to one bit, leaving only two usable addresses. According to RFC 3021, such a mask is intended for point‑to‑point links, effectively repurposing the network for a direct connection between two devices.

Q18. In a /25 network, how do the first address and the broadcast address differ?

A.The first address has host bits zero; the broadcast has all host bits set to one ✅
B.Both are identical
C.The first address is the network identifier while the broadcast address is a host address
D.They differ only in the network bits
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The first (network) address is obtained by keeping the network bits unchanged and forcing all host bits to 0. The broadcast address uses the same network bits but sets every host bit to 1, producing the highest address in that subnet.

Q19. Using the formula N=232−nN = 2^{32-n}, how many total addresses are in a /22 network?

A.1024 ✅
B.2048
C.4096
D.8192
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: Plugging n=22n = 22 into the formula gives N=232−22=210=1024N = 2^{32-22}=2^{10}=1024. This count includes both the network and broadcast addresses, so a /22 subnet contains one thousand twenty‑four IPs.

Q20. To find the first address of 198.51.100.0/26, you should:

A.Keep the leftmost 26 bits and set the remaining bits to 0 ✅
B.Set the last 26 bits to 0
C.Keep the leftmost 26 bits and set the remaining bits to 1
D.Complement the mask and add to the address
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The first address is derived by preserving the network portion (the first 26 bits) and zeroing the host portion (the remaining six bits). This operation yields the network address, which in this case remains 198.51.100.0 because the host bits were already zero.

Q21. What is the broadcast address for 150.200.5.130/27?

A.150.200.5.159 ✅
B.150.200.5.191
C.150.200.5.127
D.150.200.5.255
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: A /27 mask keeps the first twenty‑seven bits unchanged. Changing the remaining five host bits to 1 gives the highest address in the block. Adding 31 to the network base (150.200.5.128) results in 150.200.5.159, which is the broadcast address.

Q22. Converting the class B address 172.16.0.0 to a /20 network results in which address range?

A.172.16.0.0 – 172.16.15.255 ✅
B.172.16.0.0 – 172.16.31.255
C.172.16.0.0 – 172.16.7.255
D.172.16.0.0 – 172.16.63.255
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A /20 mask preserves the first twenty bits. The third octet therefore varies from 0 to 15 (binary 0000 to 1111), while the fourth octet can range from 0 to 255. Consequently the address block spans from 172.16.0.0 up to 172.16.15.255.

Q23. Why does the number of possible networks increase as the prefix length grows?

A.Because 2n2^{n} grows with more network bits ✅
B.Because host bits shrink
C.Because the address space expands
D.Because masks invert the bits
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Increasing the prefix length adds bits to the network portion, and each additional bit doubles the number of distinct network identifiers. Mathematically, the count of networks is 2n2^{n}, where nn is the number of network bits, so a larger nn yields exponentially more networks.

Q24. What is the wildcard mask (address mask complement) for a /26 prefix?

A.0.0.0.63 ✅
B.0.0.0.255
C.0.0.0.31
D.0.0.0.127
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The wildcard mask is the bitwise complement of the subnet mask. A /26 mask equals 255.255.255.192, whose binary complement is 0.0.0.63. Therefore the wildcard mask for /26 is 0.0.0.63.

Q25. Combining the networks 192.168.0.0/24 and 192.168.1.0/24 can be aggregated into which CIDR block?

A.192.168.0.0/23 ✅
B.192.168.0.0/22
C.192.168.0.0/24
D.192.168.0.0/25
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The two /24 networks are contiguous, covering addresses from 192.168.0.0 through 192.168.1.255. Representing this continuous range with the shortest possible prefix yields a /23 mask, i.e., 192.168.0.0/23.

Q26. What dotted‑decimal subnet mask corresponds to a /20 prefix?

A.255.255.240.0 ✅
B.255.255.224.0
C.255.255.255.0
D.255.255.192.0
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: A /20 mask has twenty leading 1 bits. In dotted decimal this translates to 255.255.240.0 because the third octet contains the bits 11110000 (240) and the remaining octets are all zeros.

Q27. Do the subnets 10.0.0.0/25 and 10.0.0.128/25 overlap?

A.No, they are adjacent ✅
B.Yes, they overlap
C.They partially overlap
D.Cannot be determined
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The first subnet covers addresses 10.0.0.0‑10.0.0.127, while the second covers 10.0.0.128‑10.0.0.255. There is no common address between the two ranges, so they are adjacent but do not overlap.

Q28. Which of the following best defines CIDR?

A.Classless Inter‑Domain Routing ✅
B.Computer Integrated Data Routing
C.Common Internet Data Relay
D.Centralized Internet Device Routing
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: CIDR stands for Classless Inter‑Domain Routing, a methodology that replaces the older class‑based IP allocation scheme with variable‑length network prefixes, allowing more efficient use of the IPv4 address space.

Q29. What is the formula to calculate the total number of addresses in a network given prefix length n?

A.232−n2^{32-n} ✅
B.2n2^{n}
C.232−n−22^{32-n}-2
D.2n−22^{n}-2
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The total address count for an IPv4 block with prefix length n is given by 232−n2^{32-n}. This expression accounts for all possible combinations of the remaining host bits, including the network and broadcast addresses.

🔗 Related Topics (MCQs)