Helloo Heping
Glad to hear that you are finding the content helpful so far!
Networks by design are segmented into smaller network segments. Each network segment (or broadcast domain) is assigned a single subnet. So as far as subnetting IP addresses goes, each segment or broadcast domain is assigned IP addresses within the same IP subnet. So there is a one to one correspondence between IP address subnets and network segments.
In order or hosts within different subnets to communicate, you must employ routing. Where communication between hosts in the same subnet takes place directly, communication between hosts in differet subnets takes place via a default gateway. In other words, routing is involved.
Well not quite. If you have subnets of different sizes, this formula wouldn’t work. Also, you have to take into account that every subnet also reserves two IP addresses for the network and broadcast addresses. These are the first and last addresses within a subnet. This is more fully explained in the Subnetting in Binary lesson.
I hope this has been helpful!
Laz