September 22, 2023
We know that an IP address consists of "network number + subnet number + host number". Judging whether two IP addresses are on same network segment mainly depends on "network number". If network number is same, then they are in same network segment Network segment, otherwise not in network segment.
There are three addresses below, let's set PC address and subnet mask first, and then check:
(1): 192.168.1.1/24
(2): 192.168.1.11/24
Two addresses can communicate with each other, indicating that they are on same network segment;
(3): 192.3.2.10/27
(4): 192.3.2.30/27
These two addresses can also interact with each other, indicating that these two addresses are also on same network segment;
(5): 192.3.2.31/27
(6): 192.3.2.32/27
The two addresses cannot communicate with each other, which means they are not on same network segment.
Why, let's count together and see what their network numbers are?
You can see there is only a third group, their network numbers are different so they are not in same address segment.
The network number of an IP address is calculated by ANDing the IP address and mask.
Welcome and if you need a topology map, follow me + private message me, let's explore smart technologies together!