created | modified | tags | type | status | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2025-01-05 14:55 |
|
|
|
An IP network is a pool of devices connected by a network, where each device is identified in the network using it's IP address. e.g. the internet is an IP network. Internet Protocol (IP) is a set of rules and procedures that govern how devices identify themselves and exchange data with other devices on a network.
An IP network can be partitioned into smaller (non-overlapping) subnetworks (i.e. subnets), each subnet with it's own IP address range.
An IPv4 address is a 32-bit number, meaning a number which is represented by 32 binary digits. e.g. 10011000011001100101010111001100 is a 32-bit number.
An IP address is divided into four 8-bit numbers (called octets).
For example, the IP address
192.168.1.20
in binary is
11000000.10101000.00000001.00010100
A subnet mask is a 32-bit number which is used to subdivide the IP network (pool of IP addresses) into a network portion and a host portion.
Example:
The netmask 255.255.252.0
in binary is 11111111.11111111.11111100.00000000
Applying this netmask to the IP address 192.168.1.20
(11000000.10101000.00000001.00010100
)
divides the IP address into a network portion and a host portion:
IP Addr: 1 1 0 0 0 0 0 0 . 1 0 1 0 1 0 0 0 . 0 0 0 0 0 0 0 1 . 0 0 0 1 0 1 0 0
NETMASK: 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 0 0 . 0 0 0 0 0 0 0 0
Network: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Host: _ _ _ _ _ _ _ _ _ _
All devices within the subnet have the same network values, but each connected device has a unique host value. The are 2 reserved IP addresses in the subnet - the network and broadcast IP addresses.
Network: 11000000.10101000.00000000.00000000
(192.168.0.0)
Broadcast: 11000000.10101000.00000011.11111111
(192.168.3.255)
Host range (min): 11000000.10101000.00000000.00000001
(192.168.0.1)
Host range (max): 11000000.10101000.00000011.11111110
(192.168.3.254)
In CIDR notation, the subnet of the IP address 192.168.1.20 would usually be notated 192.168.0.0/22 (i.e. just showing the network portion of the IP address). The /22 is the number of bits in the network portion.
Therefore, the number of available IP addresses in a /22 subnet is
There is something called a "wildcard", which is just the inverse of the subnet mask.
- https://www.freecodecamp.org/news/subnet-cheat-sheet-24-subnet-mask-30-26-27-29-and-other-ip-address-cidr-network-references.
- https://www.cbtnuggets.com/blog/technology/networking/networking-basics-what-is-ipv4-subnetting
- Online Subnet Calculator
- Links to other notes which are directly related go here