πŸŽ“ BookMCQ
← Back to 19. Network Layer Protocols

πŸ“ Security of IPv4 datagrams (18 MCQs)

Security Risks in Connectionless IP Delivery

IPv4 provides addressing and packet forwarding but does not inherently encrypt datagram contents or authenticate the source address. Attackers may observe unprotected traffic, forge source addresses, modify packets or exploit fragmentation behavior. Network security therefore combines protective controls at hosts, routers and higher layers, with IPsec providing standardized security services at the IP layer. It requires configured security mechanisms when needed.

IPsec Authentication and Confidentiality Services

IPsec uses Authentication Header and Encapsulating Security Payload protocols. AH can provide data-origin authentication and integrity protection but does not encrypt payloads. ESP can provide confidentiality through encryption and may also provide integrity, authentication and anti-replay protection. Security associations define parameters such as algorithms and keys for protected communication today.

Protecting and Processing IP Datagrams

A sender applies the selected IPsec policy and security association before transmitting a protected packet. With ESP, payload data is encrypted and protection information is added; the receiver validates the packet and decrypts it when authorized. Firewalls and access-control lists can also filter traffic, while routers continue to forward packets using their network-layer headers.

Example of ESP Protecting an IP Communication

Two company gateways establish an IPsec security association for traffic between their private networks. A sending gateway applies ESP, encrypting the protected packet contents and adding integrity information when configured. The receiving gateway verifies the protection, decrypts the contents and forwards the original traffic internally, reducing exposure across the untrusted Internet.

Relationship Between IP Security and Network Controls

IPsec complements rather than replaces application security, authentication systems and firewall policies. HTTPS protects selected application sessions, while IPsec can protect IP traffic between hosts or security gateways. Source-address filtering reduces spoofing risks but is not cryptographic authentication. Secure deployment also requires key management, access rules and careful handling of fragmented or malformed packets.

Incorrect Assumptions About IPv4 Protection

'IPv4 automatically encrypts packets' is incorrect because ordinary IPv4 supplies no confidentiality. 'AH encrypts payload data' is incorrect because AH authenticates and protects integrity without encryption. 'A trusted source address proves sender identity' is incorrect because IP source addresses can be spoofed unless stronger authentication is used with cryptographic protection.

Comparing IP Security Mechanisms in Examinations

Be able to distinguish confidentiality, integrity, authentication and anti-replay protection. Compare AH with ESP, explain the role of a Security Association, and identify where encryption occurs. Do not confuse IPsec with ordinary IPv4 forwarding, and explain why firewalls, filtering, secure key management and application-layer protection remain relevant in enterprise networks.

IPsec Security Services and Protection Terms

  • IPsec - IP-layer security suite.
  • AH - Authenticates packets and protects integrity.
  • ESP - Encrypts and may authenticate traffic.
  • Confidentiality - Prevents unauthorized data reading.
  • Integrity - Detects unauthorized data changes.
  • Security Association - Defines one-way protection parameters.
5
Easy
8
Medium
5
Hard

πŸ“ All Security of IPv4 datagrams MCQs

Q1. Given the address 230.8.24.56 with a prefix length of /20, which of the following address blocks correctly represents its network?

A.230.8.0.0 to 230.8.255.255
B.230.8.16.0 to 230.8.31.255 βœ…
C.230.8.24.0 to 230.8.24.63
D.230.8.24.56 to 230.8.24.57
πŸ’‘ Difficulty: easy | βœ… Correct: B

πŸ“– Explanation: The /20 prefix means the first 20 bits are fixed, leaving 12 bits for hosts. This defines the block from 230.8.16.0 through 230.8.31.255. Only option B matches that range, making it the correct network block for the given address.

Q2. Comparing a /26 block and a /27 block that both contain the address 230.8.24.56, which prefix provides the smaller address range?

A./26
B./27 βœ…
C.Both are equal
D.Cannot determine
πŸ’‘ Difficulty: easy | βœ… Correct: B

πŸ“– Explanation: A /27 prefix uses 27 fixed bits, leaving only 5 bits for host addresses, which yields 2^5 = 32 addresses. A /26 prefix leaves 6 host bits, giving 64 addresses. Therefore the /27 block is smaller, so option B is correct.

Q3. Why must the first address of an allocated block be divisible by the number of addresses in that block?

A.Because the network address must be odd
B.Because the block size must be a power of two
C.Because the first address must have all host bits set to zero βœ…
D.Because DNS requires it
πŸ’‘ Difficulty: medium | βœ… Correct: C

πŸ“– Explanation: The first address of a CIDR block has the host portion filled with zeros. This requirement forces the decimal value of the first address to be a multiple of the block size, ensuring that the block aligns on a boundary where the host bits are all zero.

Q4. What does the acronym ICANN stand for?

A.Internet Corporation for Assigned Names and Numbers βœ…
B.International Computer Association for Network Naming
C.Institute of Cybersecurity and Network Administration
D.International Council for Addressing and Naming
πŸ’‘ Difficulty: easy | βœ… Correct: A

πŸ“– Explanation: ICANN is the global authority that coordinates the allocation of IP address blocks and manages the DNS root zone. Its full name is Internet Corporation for Assigned Names and Numbers, which is captured by option A.

Q5. A router’s forwarding table maps the network 230.8.24.0/26 to interface 3. To which interface will a packet destined for 230.8.24.56 be sent?

A.Interface 1
B.Interface 2
C.Interface 3 βœ…
D.Interface 4
πŸ’‘ Difficulty: easy | βœ… Correct: C

πŸ“– Explanation: The address 230.8.24.56 falls within the /26 block 230.8.24.0‑230.8.24.63. Because the forwarding entry for that block points to interface 3, the router will forward the packet out interface 3, making option C correct.

Q6. An ISP wants to allocate a block of 2^{10} addresses. Which of the following starting addresses satisfies the divisibility requirement?

A.230.8.0.0 βœ…
B.230.8.1.0
C.230.8.2.0
D.230.8.3.0
πŸ’‘ Difficulty: medium | βœ… Correct: A

πŸ“– Explanation: A block of 2^{10}=1024 addresses requires the first address to be a multiple of 1024. The address 230.8.0.0 is exactly such a multiple, while the others are not aligned to a 1024‑address boundary. Therefore option A is the only valid starting point.

Q7. How does CIDR (classless inter‑domain routing) help reduce the size of global routing tables compared with classful addressing?

A.By discarding class boundaries
B.By increasing address length
C.By using NAT
D.By allowing aggregation of contiguous prefixes βœ…
πŸ’‘ Difficulty: medium | βœ… Correct: D

πŸ“– Explanation: CIDR permits aggregation of multiple contiguous prefixes into a single, shorter entry. This route summarization dramatically reduces the number of entries a router must store, unlike classful addressing where each class‑A, B, or C network appears as a separate entry. Option D captures this benefit.

Q8. With a prefix length of /29 for the address 230.8.24.56, what is the full range of host addresses in that block?

A.230.8.24.48–230.8.24.55
B.230.8.24.56–230.8.24.63 βœ…
C.230.8.24.0–230.8.24.7
D.230.8.24.64–230.8.24.71
πŸ’‘ Difficulty: medium | βœ… Correct: B

πŸ“– Explanation: A /29 prefix leaves 3 host bits, yielding 2^3 = 8 addresses. Starting at the network address 230.8.24.56, the block runs through 230.8.24.63. Thus option B accurately describes the host range.

Q9. In a /31 block, which of the following statements correctly distinguishes the network and broadcast addresses?

A.Network is first, broadcast is second
B.Both addresses are usable hosts βœ…
C.There is no broadcast address
D.Network address is undefined
πŸ’‘ Difficulty: medium | βœ… Correct: B

πŸ“– Explanation: RFCβ€―3021 defines a /31 as having only two addresses, both of which are usable for point‑to‑point links; the traditional network and broadcast roles are omitted. Consequently both addresses can be assigned to hosts, making option B correct.

Q10. An ISP receives a request for 3000 IPv4 addresses. According to CIDR rules, which allocation strategy is compliant?

A.Allocate exactly 3000 addresses
B.Allocate a block of 4096 addresses (2^{12}) βœ…
C.Allocate a block of 2048 addresses and a separate block of 1024
D.Allocate a /24 block
πŸ’‘ Difficulty: medium | βœ… Correct: B

πŸ“– Explanation: CIDR requires the allocated size to be a power of two. The smallest power of two β‰₯β€―3000 is 2^{12}=4096, so the ISP must allocate a /20 block containing 4096 addresses. Option B follows this rule.

Q11. A router has two overlapping entries: 230.8.24.0/24 β†’ iface1 and 230.8.24.0/26 β†’ iface2. For a packet to 230.8.24.45, which interface is selected?

A.iface1
B.iface2 βœ…
C.Both interfaces
D.The packet is dropped
πŸ’‘ Difficulty: hard | βœ… Correct: B

πŸ“– Explanation: Longest‑prefix matching selects the most specific route. The /26 entry is more specific than the /24 entry, so the packet matches iface2. Therefore option B correctly describes the forwarding decision.

Q12. Given a block size of 25=322^{5}=32 addresses (/27), which of the following addresses can serve as the first address of the block?

A.230.8.24.32 βœ…
B.230.8.24.33
C.230.8.24.34
D.230.8.24.35
πŸ’‘ Difficulty: medium | βœ… Correct: A

πŸ“– Explanation: A /27 block contains 32 addresses, so its first address must be a multiple of 32. The address 230.8.24.32 satisfies this condition, whereas the others do not align on the required boundary. Hence option A is correct.

Q13. What happens to an IPv4 datagram when its TTL field reaches zero during routing?

A.It is forwarded anyway
B.Router discards it and sends ICMP Time Exceeded βœ…
C.TTL is reset to default
D.Packet is broadcast to all hosts
πŸ’‘ Difficulty: hard | βœ… Correct: B

πŸ“– Explanation: When the TTL counter decrements to zero, the router must drop the packet to prevent endless looping and generate an ICMP Time‑Exceeded message back to the source. This behavior matches option B.

Q14. Can 230.8.24.64 be the first address of a /26 block?

A.Yes βœ…
B.No
C.Only if subnet mask is /27
D.Only with NAT
πŸ’‘ Difficulty: hard | βœ… Correct: A

πŸ“– Explanation: A /26 block contains 64 addresses, so its first address must be a multiple of 64. The address 230.8.24.64 meets this criterion, making it a valid starting point for a /26 block. Therefore option A is correct.

Q15. Compared to classful addressing, how does classless addressing affect the risk of subnet‑mask manipulation attacks?

A.Increases risk because masks are variable
B.Reduces risk by enabling precise filtering βœ…
C.No effect
D.Eliminates need for masks
πŸ’‘ Difficulty: hard | βœ… Correct: B

πŸ“– Explanation: Classless addressing allows administrators to define exact prefix lengths, enabling tighter access‑control lists and more precise filtering of traffic. This granularity reduces opportunities for attackers to exploit ambiguous or overly broad masks, thereby lowering the risk of mask‑manipulation attacks. Option B reflects this advantage.

Q16. When an ISP reclaims a previously assigned block, what change must a router make to its forwarding table to maintain correct delivery?

A.Add a new entry without removing old
B.Delete the old entry and add a new one with updated interface βœ…
C.Only update metric
D.No change needed
πŸ’‘ Difficulty: hard | βœ… Correct: B

πŸ“– Explanation: Reclaimed address space must no longer be advertised on the old interface. The router therefore removes the stale entry and inserts a new entry that points to the correct interface or next‑hop for the reclaimed block. This ensures packets are routed appropriately, making option B correct.

Q17. How many unique IPv4 addresses exist in total?

A.2^{16}
B.2^{24}
C.2^{32} βœ…
D.2^{48}
πŸ’‘ Difficulty: medium | βœ… Correct: C

πŸ“– Explanation: IPv4 uses a 32‑bit address space, yielding 2322^{32} distinct addresses. This is the total pool of possible IPv4 addresses, so option C is the accurate count.

Q18. If a packet's destination address is 230.8.24.56 and the router’s forwarding table contains an entry for 230.8.24.56/31 on interface 5, which interface will forward the packet?

A.Interface 1
B.Interface 2
C.Interface 5 βœ…
D.Interface 7
πŸ’‘ Difficulty: easy | βœ… Correct: C

πŸ“– Explanation: A /31 prefix covers the two addresses 230.8.24.56 and 230.8.24.57. Since the destination matches this entry, the router forwards the packet out the associated interface, which is interfaceβ€―5. Hence option C is correct.

πŸ”— Related Topics (MCQs)