Computer Networks · TEE · mocks

Q1D · IPv4 address block

TEE mock C · full paper

TEE · 100 attempted marks · solutions for every choice · current syllabus 702AI0C023

TEE practice mock · Q1D. One address in a block is 172.18.7.33/23. Find its subnet mask, first/last address, total address count and ordinary usable-host range. [5 mock marks]

Answer

Given

IP/prefix = 172.18.7.33/23.

To find

The complete containing address block and its usable host range.

Formula and why

h=32-p,\qquad N=2^hLaTeX: h=32-p,\qquad N=2^h
\text{step}=256-\text{changing mask octet}LaTeX: \text{step}=256-\text{changing mask octet}

Use the explicit prefix. We show both the interval method and bitwise AND so the boundary can be understood.

Step-by-step solution

Step 1. Count host bits and addresses

h=32−23=9; N=29=512.

Step 2. Construct the mask

Mask=255.255.254.0; binary=11111111.11111111.11111110.00000000.

Step 3. Find the changing-octet interval

The changing octet is number 3. Its mask value is 254, so step=256−254=2. The IP value 7 lies in 6…7.

Step 4. Form the first/network address

Keep earlier octets; place 6 in octet 3; set any later octets to zero. Network=172.18.6.0.

Step 5. Show the AND operation

OctetIP bitsMask bitsAND resultDecimal
1101011001111111110101100172
200010010111111110001001018
30000011111111110000001106
40010000100000000000000000

Step 6. Form the last/broadcast address

Use 7 in the changing octet and 255 in any later octets. Broadcast=172.18.7.255.

Step 7. State usable hosts

First usable=172.18.6.1; last usable=172.18.7.254; count=512−2=510.

Final answer: Network 172.18.6.0; broadcast 172.18.7.255; 512 total, 510 ordinary usable; range 172.18.6.1–172.18.7.254.