Computer Networks · TEE · papers

Q3(b) · Classful net/host IDs and /26 host

2025-12-05 · 2022-23

Actual paper; 100 marks attempted. Current-syllabus alignment is stated per question.

Q3(b). (i) Find the netid and the hostid of the following classfull addresses: a. 114.34.2.8 b. 208.34.54.12 [5]. (ii) what is the last valid host on the subnetwork 165.21.80.128/26? [5] [10 marks]

Answer

An IPv4 address identifies an IP interface. The network prefix selects the destination network; remaining bits identify an address within it. Classful addressing is historical; modern routing uses explicit CIDR prefixes.

ClassFirst octetDefault maskNetwork / host splitPurpose
A1–126 (ordinary unicast)255.0.0.0 (/8)8 / 24 bitsLarge historical unicast networks; 0 and 127 reserved
B128–191255.255.0.0 (/16)16 / 16 bitsMedium historical unicast networks
C192–223255.255.255.0 (/24)24 / 8 bitsSmall historical unicast networks
D224–239No unicast default maskNot network/host class splitMulticast
E240–255No unicast default maskNot normal unicast allocationReserved/experimental; special addresses exist

Example: 114.34.2.8 is class A with network 114.0.0.0 and host portion 34.2.8. Class does not override an explicitly supplied CIDR prefix.

Classful split

AddressClass and maskNetwork IDHost ID
114.34.2.8A /8114.0.0.034.2.8 (24-bit host portion)
208.34.54.12C /24208.34.54.012 (8-bit host portion)

Last valid host of 165.21.80.128/26

Given

165.21.80.128/26

To find

First and last addresses and total block size.

Formula and why

N=2^{32-p}LaTeX: N=2^{32-p}

p is the prefix length. The remaining host bits vary through every combination. The network address is the first address; setting all host bits to one gives the last address.

Step 1. Find host bits

32 − 26 = 6. N = 64.

Step 2. Locate the aligned block

Mask = 255.255.255.192. The first varying octet is octet 4; its block width is 64. The supplied value 128 lies in the interval 128–191. Keep earlier octets fixed. Set any later octets to 0 for the first address and 255 for the last address.

Step 3. Write the result

First = 165.21.80.128; last = 165.21.80.191; total = 64 addresses. Usual usable host range: 165.21.80.129–165.21.80.190.

Asked host answer: 165.21.80.190; .191 is broadcast, not a usable host.