0

This is something I'm confused about...if person A and B have networks with different subnet masks, then what prevents them from assigning an end IP that is identical?

It makes me think I'm understanding something incorrectly, since otherwise it seems like this would be a common problem

3

Hosts on a LAN will never have different netmasks. If I see it as /24 and you see it as /25, we have different networks. Such overlapping networks present numerous problems, not the least of which is the hosts in the smaller block will not know hosts in the larger block are actually "on the wire" with them; they'll send traffic to their gateway (if they have one) instead of directly to the other host.

As for address collisions, X is X no matter the netmask. So when the two hosts check for duplicates (as most modern systems do), they'll see each other. This is done with ARP at layer-2, so netmasks have no role. (e.g. the host coming online sends an ARP -- "who has (my ip)" -- if anyone answers, there's a collision.)

2

This should never happen. If it happens, the behavior is undefined, i.e., network may not work in a number of ways.

IP addresses are hierarchical and must be assigned hierarchically. All IP addresses are divided between 5 regional organizations (e.g., RIPE in Europe). These organizations give subblocks of their addresses to large-scale internet providers. They in turn can give subblocks to smaller providers, and so on. At each step is must be ensured that the subblocks don't overlap.

If B has a network 123.123/16 than it is B's responsibility to ensure that addresses within its network do not overlap. For A to get the network 123.123.123/24 it has to get it through B (does not have to be directly). Then B knows that it can't assign addresses in 123.123.123/24 to anybody, because this block is now owned by A.

As was said in different answers, private IP addresses (i.e., specific blocks marked for private addresses) can be reused. It is a responsibility of each organization to ensure that these addresses are not routed outside this organization.

1

123.123.123.0/24 is a subnet of 123.123.0.0/8

If company B was allocated network 123.123.0.0/16 (by a LIR) then only they can use this network and nobody else can use any subnet of this network (unless granted by company B). So company A cannot possibly be assigned 123.123.123.0/24

it other works it is impossible for 2 companies to use the same public IP network / address.

There are special network defined in RFC1918, called "private" IP networks that can be used by anybody within their internal networks. Those addresses cannot be used on the Internet and as such cannot conflict.

2
  • this is not true, B is free to sell sub-blocks of these addresses. It does have to make sure that these blocks do not overlap and it can't use sold block itself.
    – Effie
    Sep 15 at 14:17
  • True; I wanted to keep it simple. We could wrote a very lengthy answer with many specific case but this may confuse more than help.
    – JFL
    Sep 15 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.