1

In IPv4, we had to find the Network Address using the IP address and the subnet mask. With IPv6 there's already the Network Prefix in the IP address.

Suppose I have an IP address A: 2001:db8:a0b:12f0::1/48 and B: 2001:2AC:CAD:0000::/64, the network prefix with mask for A is:2001:0db8:0a0b:0000:0000:0000:0000:0000 and B is: 2001:02AC:0CAD:0000:0000:0000:0000:0000. How can I determine whether these two devices will be able to communicate?
Any help will be greatly appreciated. Thanks.

  • I cannot see how this would be different in IPv4 and IPv6. Given 192.168.10.20/24 and 10.20.30.40/24, how would you determine if these devices will be able to communicate over IPv4? – Dubu Jan 20 '16 at 11:46
  • Like I said, for IPv4, using the subnet mask and the IP address we could find the NA then if the NA would match, it meant that they would be able to communicate. – Manisha Singh Sanoo Jan 20 '16 at 11:55
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 13 '17 at 03:09

1 Answers1

3

Given your additional comments, you're not asking if machines with specific addresses can communicate, you're asking if two addresses are in the same subnet. In the first case, things like routing and firewalling are relevant, the second is just math.

There's no real difference between subnet calculations in IPv4 and IPv6, it's just more bits. You can use normal techniques as explained in detail in this question, or you can use a tool like sipcalc to calculate this:

% sipcalc 2001:db8:a0b:12f0::1/48
-[ipv6 : 2001:db8:a0b:12f0::1/48] - 0

[IPV6 INFO]
Expanded Address    - 2001:0db8:0a0b:12f0:0000:0000:0000:0001
Compressed address  - 2001:db8:a0b:12f0::1
Subnet prefix (masked)  - 2001:db8:a0b:0:0:0:0:0/48
Address ID (masked) - 0:0:0:12f0:0:0:0:1/48
Prefix address      - ffff:ffff:ffff:0:0:0:0:0
Prefix length       - 48
Address type        - Aggregatable Global Unicast Addresses
Network range       - 2001:0db8:0a0b:0000:0000:0000:0000:0000 -
              2001:0db8:0a0b:ffff:ffff:ffff:ffff:ffff

% sipcalc 2001:2AC:CAD:0000::/64
-[ipv6 : 2001:2AC:CAD:0000::/64] - 0

[IPV6 INFO]
Expanded Address    - 2001:02ac:0cad:0000:0000:0000:0000:0000
Compressed address  - 2001:2ac:cad::
Subnet prefix (masked)  - 2001:2ac:cad:0:0:0:0:0/64
Address ID (masked) - 0:0:0:0:0:0:0:0/64
Prefix address      - ffff:ffff:ffff:ffff:0:0:0:0
Prefix length       - 64
Address type        - Aggregatable Global Unicast Addresses
Network range       - 2001:02ac:0cad:0000:0000:0000:0000:0000 -
              2001:02ac:0cad:0000:ffff:ffff:ffff:ffff

As you can see form the ranges, there's no overlap in these two networks.

Teun Vink
  • 17,233
  • 6
  • 44
  • 70
  • So judging by what you wrote, if there's no overlap in the ranges it means that they can communicate? – Manisha Singh Sanoo Jan 20 '16 at 12:14
  • 1
    Can you please be more specific in what you mean by 'communicate'. Any IP can communicate with another IP as long as there are routers available to help them reach each other. In the comments of your question you were talking about networks having the same network address. If that's what you mean, 'able to communicate' means that the two should have an overlap. – Teun Vink Jan 20 '16 at 12:47