25-Comp-B5 Computer Communications · December 2016
Question 6 of 7: IP Address Class, Network ID, Subnet ID, and Host ID
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
98-Comp-B5, Computer Communications — National Exams, December 2016. Closed-book, 3 hours; seven questions of equal value (20% each); ANY FIVE constitute a complete exam (all seven answered below as a complete study resource).
Reference texts: Stallings, Data and Computer Communications, 10th ed. — sampling and aliasing (Ch.5, Q1), Shannon–Hartley channel capacity (Ch.3, Q2), LAN/network topologies (Ch.16, Q3), decibels and signal-to-noise ratio (Ch.3, Q4), IP addressing and subnetting (Ch.18, Q6), and physical/link/network-layer terminology (Ch.3, 9, 11, 17, Q7); Kurose & Ross, Computer Networking: A Top-Down Approach, 8th ed. — error detection via CRC (Ch.5, Q5), IP addressing (Ch.4, Q6), and TCP/IP terminology (Ch.1, Q7).
Question 6: IP Address Class, Network ID, Subnet ID, and Host ID (20 marks)
Find. The address class, the (classful) network ID, the subnet ID, and the host ID, with the reasoning behind each.
Approach. Classify the address from its leading octet against the classful ranges; find the classful network ID by zeroing the host portion of that class's default mask; then find the subnet ID by bit-wise ANDing the full address with the GIVEN subnet mask, and the host ID as the bits left over once the subnet mask's 1-bits are removed.
Classify the address. The first octet is $198$, which falls in the Class C range $192\text{-}223$:
$$\boxed{\text{Class C}}$$
Classful network ID. A default Class C mask is $255.255.255.0$ (/24): the first 3 octets are the network, the last is host. Zeroing the host octet of the given address:
$$\text{Network ID} = \boxed{198.53.147.0}$$
Interpret the given subnet mask. $255.255.255.224$ borrows bits from the classful host octet: $224 = 11100000_2$, i.e. the top 3 bits of the last octet are now subnet bits (/27 overall $= 24+3$), leaving 5 host bits. This carves the class C's 256 host addresses into $2^{3}=8$ subnets of $2^{5}=32$ addresses each (30 usable per subnet, after excluding the subnet's own network and broadcast addresses).
Subnet ID. AND the full address with the subnet mask, octet by octet (only the last octet changes): $45 = 00101101_2$, $224=11100000_2$, so $45\ \&\ 224 = 00100000_2 = 32$.
$$\text{Subnet ID} = \boxed{198.53.147.32}\ \ (\text{i.e. } 198.53.147.32/27)$$
This is the third of the 8 subnets ($0,32,64,96,128,160,192,224,\ldots$), covering host addresses $32$–$63$.
Host ID. The bits NOT covered by the mask (the low 5 bits of the last octet) identify the host within its subnet: $45\ \&\ (\sim 224\ \&\ 255) = 45\ \&\ 31 = 00001101_2 = 13$.
$$\text{Host ID} = \boxed{13}\ \ (\text{host } 13\ \text{within subnet } 198.53.147.32/27)$$