π 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.
π 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?
π 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?
π 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?
π 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?
π 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?
π 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?
π 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?
π 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?
π 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?
π 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?
π 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?
π 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 addresses (/27), which of the following addresses can serve as the first address of the block?
π 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?
π 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?
π 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?
π 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?
π 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?
π Explanation: IPv4 uses a 32βbit address space, yielding 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?
π 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.