Concept and mechanism
An IP address and prefix length distinguish the network portion from the remaining bits. Do not compare octets only by appearance: for 192.0.2.130/26, the block starts at 128 and ends at 191. Two addresses sharing the first three octets can belong to different /25 networks.
Operational decisions also depend on effective routes, including explicit on-link routes. Ports identify transport endpoints and do not change the mask. To correlate a connection, retain protocol, source, destination, and ports in the correct network context.
A service bind address defines where that socket accepts traffic; listening only on loopback does not mean listening on remote interfaces.
Guided application
In a fictional case, a host retains /24 after the network was split into two /25 networks. It starts directly looking for a destination it should reach through the router. Compare the approved plan, address, prefix, and route before changing timeouts.
In IPv6, a link-local address can recur on different links: zone or interface disambiguates the destination when needed. Do not turn a scoped address into a global one by omitting context. This course IPv4 examples use documentation-reserved blocks such as 192.0.2.0/24 and 198.51.100.0/24; they are not instructions to advertise those blocks in a real network.
Validation should respect the design and authorization of the environment where you work.
192.0.2.20/25 and 192.0.2.150/25 belong to different prefixes despite matching first three octets.
Common pitfalls
Comparing only octets; confusing port with prefix; forgetting binding and IPv6 zone.
Related topics: Routes and next-hop resolution · Transport, acknowledgement, and messages · States, queues, and flow control
Define address, prefix, port, and context before interpreting the test.
References
- CIDR and longest-prefix routing: RFC4632 · RFC 4632
- TCP base specification: RFC 9293 · RFC 9293
- Linux IPv4 sockets and addresses · Online Linux manual/kernel documentation reviewed 2026-09-30; behavior must match deployed kernel and tools
- IPv6 scoped addresses: RFC4007 · RFC 4007
- Documentation IPv4 address blocks: RFC5737 · RFC 5737