Computer Networks · TEE · papers

Q1(a) · Subnetting and masks

2023-11-22 · AI-only Sem V variant; incomplete recovered scan

Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.

Q1(a). What is subnetting? Explain subnetting and default subnet masks. [5 marks]

Answer

Definition. Subnetting divides an address block into smaller prefix-defined blocks. In an ordinary subnet, the network and directed-broadcast addresses bound its usable host range.

Simple meaning. Pehle block nikalo; phir first aur last. Uske baad hosts.

Swipe across the diagram to read its labels ↔
A /24 split into four /26 blocks
Diagram: A /24 split into four /26 blocks. Labels: A /24 split into four /26 blocks | A /24 split into four /26 blocks | 1. /26 | First: .0 Last: .63 | Usable: .1 to .62 | 2. /26 | First: .64 Last: .127 | Usable: .65 to .126 | 3. /26 | First: .128 Last: .191 | Usable: .129 to .190 | 4. /26 | First: .192 Last: .255 | Usable: .193 to .254 | Each block: 64 total addresses; 62 ordinary usable hosts. | An address ending in .77 belongs to the .64–.127 block.
One method for every ordinary IPv4 block question

Understand it step by step

  1. Read /p. Host bits h=32−p. Total addresses N=2ʰ, not N−2.
  2. Build the mask. Find the first octet that is not 255; block step there is 256−that mask octet.
  3. Round that address octet down to a multiple of the step. Preserve preceding octets and set later octets to 0 for the network address.
  4. For the broadcast address, use the end of the same interval in the changing octet and set later octets to 255. Equivalently, broadcast is network+(N−1) in 32-bit address arithmetic.
  5. For an ordinary broadcast subnet with at least two host bits: first usable=network+1, last usable=broadcast−1, usable count=N−2. /31 point-to-point and /32 routes are exceptions explained separately.
N=2^{32-p}LaTeX: N=2^{32-p}
\text{block step}=256-\text{changing mask octet}LaTeX: \text{block step}=256-\text{changing mask octet}
\text{ordinary usable hosts}=2^h-2LaTeX: \text{ordinary usable hosts}=2^h-2

A /26 has 32−26=6 host bits, so it contains 2⁶=64 total addresses. Under ordinary IPv4 subnet rules, one is the network address and one is directed broadcast, leaving 64−2=62 usable host addresses.

Yaad rakho: Total mein sab count; usable mein boundary ke 2 minus.

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.

Example: 192.168.1.70 AND255.255.255.192 gives network192.168.1.64. The mask distinguishes the network prefix from the host portion. CIDR masks need not equal historical default class masks.