NivaarExam PrepOfficial exam papers ↗

22-Elec-B4 Information Technology Networks · May 2013

Question 1 of 6: The Internet Protocol, versions 4 and 6

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Paper format. Professional Engineers of Ontario annual examination, 07-Elec-B4 Information Technology Networks, May 2013. Three hours, closed book, one PEO-approved non-programmable calculator. Marks are shown in the left margin of the original paper; the cover page states that four questions constitute a complete paper worth 100 marks. Every question and every sub-part is answered below, because the set is intended as a study resource rather than as a sat examination.

Check: question count. The cover page of the paper says “There are 5 questions on this exam. Any 4 questions constitute a complete paper”, yet six numbered questions are printed (Questions 1 to 5 at 25 marks each on pages 2 to 4, and Question 6 at 20 marks on page 5), for 145 marks in total. Four 25-mark questions do give exactly the stated 100 marks, so the cover note is consistent with the five 25-mark questions and Question 6 appears to be a carry-over that the cover page was never updated for. All six are solved here.

Reference texts. A. Leon-Garcia and I. Widjaja, Communication Networks: Fundamental Concepts and Key Architectures, 2nd ed. — the reference listed by the EGBC/Engineers Canada syllabus for this examination code; J. F. Kurose and K. W. Ross, Computer Networking: A Top-Down Approach, 8th ed.; A. S. Tanenbaum and D. J. Wetherall, Computer Networks, 5th ed.; W. Stallings, Data and Computer Communications, 10th ed. Normative documents cited: RFC 791 and RFC 8200 (IPv4 and IPv6), RFC 1918 and RFC 4193 (private address space), RFC 5681 (TCP congestion control), IEEE 802.3 (CSMA/CD) and IEEE 802.11 (RTS/CTS).

Question 1: The Internet Protocol, versions 4 and 6 (25 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. The forwarding table printed in the question, reproduced below with each dotted-decimal mask converted to its prefix length, and five destination addresses to be looked up.

Given data — the router’s IPv4 forwarding table
DestinationMaskPrefixNext hop
127.0.0.1255.255.255.255/32127.0.0.1
129.96.0.0255.255.255.0/24129.96.54.1
129.97.152.0255.255.255.128/25129.97.152.1
129.97.152.128255.255.255.128/25129.97.152.183
default0.0.0.0/0129.97.0.1

Find. The next hop selected for each of the five destinations under longest-prefix-match forwarding, two reserved private address ranges, a plausible system behind this table, and three advantages of IPv6 over IPv4.

Router Rforwarding table129.97.152.0/25hosts .1 to .126 (126 usable)next hop 129.97.152.1129.97.152.128/25hosts .129 to .254 (126 usable)next hop 129.97.152.183129.96.0.0/24neighbouring department LANnext hop 129.96.54.1default 0.0.0.0/0campus border routernext hop 129.97.0.1127.0.0.1/32 loopback (never leaves R)
Figure 1.1 — a system consistent with the given table: a departmental router serving two /25 subnets, with one lateral link to a neighbouring /24 and everything else sent to the campus border router.

Approach. Convert every mask to a prefix length, apply the bitwise test $D \land M = N$ to each table entry in turn, and among the entries that match keep the one with the longest prefix, falling back to the default route only when nothing else matches.

  1. Part (a) — read the masks as prefix lengths. A dotted-decimal mask is a run of ones followed by a run of zeros, so counting the ones gives the prefix length: $255.255.255.255 \rightarrow /32$ (a host route), $255.255.255.0 \rightarrow /24$, $255.255.255.128 \rightarrow /25$ and $0.0.0.0 \rightarrow /0$. The two /25 entries split the third octet range 152 into its lower half (.0 to .127) and upper half (.128 to .255), each carrying $2^{32-25}-2 = 126$ usable host addresses.
  2. State the forwarding rule. For destination $D$, entry $(N, M)$ matches when $$D \land M = N \land M$$ where $\land$ is the bitwise AND. Of all matching entries the router forwards on the one with the longest prefix, which is why the /32 loopback route is consulted before the /25 subnet routes and the /0 default route is consulted last.
  3. Destination (i), 129.96.56.254. Masking with /24 gives $129.96.56.254 \land 255.255.255.0 = 129.96.56.0$, which is not the table entry 129.96.0.0. No /25 or /32 entry matches either, so only the default route is left: $$\boxed{\text{next hop } = 129.97.0.1}$$
  4. Destination (ii), 129.97.152.129. Masking with /25 gives $129.97.152.129 \land 255.255.255.128 = 129.97.152.128$, which is the fourth entry, so the packet leaves towards $\boxed{129.97.152.183}$.
  5. Destination (iii), 129.128.0.1. The second octet 128 matches neither 96 nor 97, so no specific entry matches and the packet again takes the default route, $\boxed{129.97.0.1}$.
  6. Destination (iv), 129.97.152.1. Masking with /25 gives $129.97.152.0$, the third entry, whose next hop is $\boxed{129.97.152.1}$ — the same address as the destination. That is the signature of a directly attached subnet: the next hop field simply names the router’s own interface on that link, and the packet is delivered over the local medium after an ARP resolution rather than being handed to another router.
  7. Destination (v), 129.96.0.178. Masking with /24 gives $129.96.0.0$, the second entry, so the next hop is $\boxed{129.96.54.1}$.

Check: the mask on the 129.96.0.0 entry. The second row is printed with the mask 255.255.255.0, i.e. a /24, and the answers above follow the paper exactly as printed. Because a /24 covers only 129.96.0.0–129.96.0.255, destination (i) 129.96.56.254 falls outside it and takes the default route. Had the intended mask been 255.255.0.0 (a /16 covering the whole 129.96 network) the answer to (i) would instead have been 129.96.54.1. The distinction is exactly what part (a) is testing, so the printed mask is taken at face value here and the alternative is noted rather than assumed.

Part (b) — reserved private ranges. RFC 1918 sets aside three IPv4 blocks that will never be advertised in the global routing system: 10.0.0.0/8 (16 777 216 addresses, a single Class-A-sized block), 172.16.0.0/12 (1 048 576 addresses, sixteen contiguous /16 networks) and 192.168.0.0/16 (65 536 addresses, 256 contiguous /24 networks). Any two of these satisfy the question. Two further IPv4 blocks are worth knowing: 169.254.0.0/16 for link-local autoconfiguration when no DHCP server answers, and 100.64.0.0/10 reserved by RFC 6598 for carrier-grade NAT. In IPv6 the equivalent construct is the unique local address block fc00::/7, of which fd00::/8 is used in practice with a randomly generated 40-bit global identifier, together with the link-local block fe80::/10 that every IPv6 interface configures automatically. Hosts numbered from these ranges reach the public Internet only through a network address translator or an application proxy, which is why they can be reused independently inside every enterprise.

Part (c) — a system that would carry this table. Figure 1.1 shows the arrangement. The table belongs to a departmental router on a large campus network — the 129.97 address space is a university block, and the router sits one level below the campus core. Two of its interfaces are on the same physical building wiring, which has been split into two equal /25 subnets, 129.97.152.0/25 and 129.97.152.128/25, so that broadcast traffic from one laboratory does not disturb the other; each subnet supports 126 hosts, and the router is the default gateway for both. A third interface provides a lateral link to a neighbouring department’s 129.96.0.0/24 network, reached through the router 129.96.54.1, so that traffic between the two departments does not have to climb to the campus core and back. Everything with no more specific match — the whole of the public Internet and the rest of the campus — is handed to the campus border router at 129.97.0.1. The 127.0.0.1/32 host route is the loopback interface that every IP stack maintains for its own management traffic and never appears on a wire. The fact that the upper /25 has a next hop of 129.97.152.183 rather than a .1 style interface address suggests that this half is reached through a second device (for example a firewall or a wireless controller) rather than being directly attached, which is a common arrangement when a subnet is dedicated to guest or laboratory equipment.

Part (d) — three advantages of IPv6 over IPv4. First and most important is address space: IPv6 uses 128-bit addresses against IPv4’s 32 bits, a factor of $2^{96}$ more addresses, which removes the exhaustion that forced the deployment of network address translation and restores the end-to-end addressing model that many peer-to-peer and real-time applications depend on. Second, the IPv6 header is a fixed 40 bytes with no options field, no header checksum and no router-performed fragmentation; optional information is carried in a chain of extension headers that intermediate routers skip, so forwarding reduces to a table lookup on a fixed-offset field and can be done in hardware at line rate. Third, IPv6 hosts configure themselves: stateless address autoconfiguration combines a router-advertised /64 prefix with a locally generated interface identifier, and neighbour discovery replaces ARP with an authenticated, multicast mechanism, so a network can be renumbered by changing the prefix a router advertises. Other defensible answers include mandatory support for IPsec, the 20-bit flow label for quality-of-service classification, the replacement of broadcast by scoped multicast, and the strictly hierarchical allocation policy that keeps the global routing table smaller than IPv4’s.

Final results — Question 1(a), next hop by longest prefix match
DestinationLongest matching entryNext hop
i. 129.96.56.254none; default 0.0.0.0/0129.97.0.1
ii. 129.97.152.129129.97.152.128/25129.97.152.183
iii. 129.128.0.1none; default 0.0.0.0/0129.97.0.1
iv. 129.97.152.1129.97.152.0/25 (directly attached)129.97.152.1
v. 129.96.0.178129.96.0.0/24129.96.54.1
← Paper overview