# Masks and address blocks

Subject: Computer Networks

Exam: M2

Reader: https://deep-learning-study-room.vercel.app/cn/#m2/formulas/formulas/ipv4

Canonical: https://deep-learning-study-room.vercel.app/read/cn/m2/formulas/formulas--ipv4/

M2 · symbols explained; worked examples linked below



$$
h=32-p,\quad N=2^h
$$



p=prefix bits, h=host bits, N=total addresses.



$$
U=2^h-2
$$



Ordinary usable-host count. /31 point-to-point and /32 are exceptions.



$$
\text{step}=256-M
$$



M is the first mask octet not equal to 255.



$$
\text{network}=\text{address AND mask}
$$



Bitwise AND keeps network bits and clears host bits.



$$
\text{broadcast}=\text{network}+(N-1)
$$



Use full address arithmetic, not an overflowing final octet.

## Learn it with complete solutions

[Nine complete address-block examples](https://deep-learning-study-room.vercel.app/read/cn/m2/read/subnets--block-1/)
