# Masks and address blocks

Subject: Computer Networks

Exam: TEE

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

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

Core units, ALOHA, address and routing rules; illustrative values are practice



$$
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/tee/read/subnets--block-1/)
