Hurricane Electric's IPv6 Tunnel Broker Forums

General IPv6 Topics => IPv6 Basics & Questions & General Chatter => Topic started by: smoochict on January 24, 2011, 02:45:48 AM

Title: Determining Prefixes?
Post by: smoochict on January 24, 2011, 02:45:48 AM
Hello,

I've read up a lot on IPV6 but i still cannot figure out how for example i'd find the next /prefix. E.G.

lets say i have: 2e24:9022:1000:302a:0000:0000:0000:0000
And i want to split that up into a /112 prefix...

2e24:9022:1000:302a:0000:0000:0000:0000/112

How could i determine what to change to get another /112 after the above

Title: Re: Determining Prefixes?
Post by: sput on January 24, 2011, 05:52:05 AM
Hi there


128 - 112 = 16
So the first address in the next net is 2¹⁶ = 64k bigger;
2e24:9022:1000:302a:0000:0000:0000:0000 - 2e24:9022:1000:302a:0000:0000:0000:00ff
2e24:9022:1000:302a:0000:0000:0000:0100 - 2e24:9022:1000:302a:0000:0000:0000:01ff
2e24:9022:1000:302a:0000:0000:0000:0200 - 2e24:9022:1000:302a:0000:0000:0000:02ff
Etc.

An interface expects a /64 though.
You can however, apply different firewall, ACL, whatever rules to each range within a /64.


Regards,
Rob
Title: Re: Determining Prefixes?
Post by: snarked on January 24, 2011, 10:44:50 AM
QuoteSo the first address in the next net is 2¹⁶ = 64k bigger;
2e24:9022:1000:302a:0000:0000:0000:0000 - 2e24:9022:1000:302a:0000:0000:0000:00ff
2e24:9022:1000:302a:0000:0000:0000:0100 - 2e24:9022:1000:302a:0000:0000:0000:01ff
2e24:9022:1000:302a:0000:0000:0000:0200 - 2e24:9022:1000:302a:0000:0000:0000:02ff
WRONG - The above only skips by 8 bits, not 16.

Correct:
2E24:9022:1000:302A:0000:0000:0000:0000 - 2E24:9022:1000:302A:0000:0000:0000:FFFF
2E24:9022:1000:302A:0000:0000:0001:0000 - 2E24:9022:1000:302A:0000:0000:0001:FFFF
2E24:9022:1000:302A:0000:0000:0002:0000 - 2E24:9022:1000:302A:0000:0000:0002:FFFF

Canonical Form:
2E24:9022:1000:302A::0    - 2E24:9022:1000:302A::FFFF
2E24:9022:1000:302A::1:0 - 2E24:9022:1000:302A::1:FFFF
2E24:9022:1000:302A::2:0 - 2E24:9022:1000:302A::2:FFFF
Title: Re: Determining Prefixes?
Post by: sput on January 24, 2011, 03:35:20 PM
Hi there


You are absolutely right.
I'm sorry about any confusion I may have caused.


Regards,
Rob
Title: Re: Determining Prefixes?
Post by: smoochict on January 24, 2011, 09:39:10 PM
Could you please explain it in more detail. i can't understand it
Title: Re: Determining Prefixes?
Post by: antillie on January 24, 2011, 10:24:34 PM
In the above example we are using a /112 so the first 112 bits of the 128 bit address are the network address. This means that there are 16 bits left over to use for host addresses inside that network. Now remember that in IPv6 each "octet" represents 16 bits. (8 octets x 16 bits per octet = 128 bits of address space)

If you were to write /112 out in an IPv4 style subnet mask it would look like this:

FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000

So any change the first 7 octets of the address (is octets the right word since they don't represent 8 bits?) would indicate a different network with that subnet mask. Changes in the last octet would indicate a different host within a network.

So in Snarked's example the following would be the first address in a network:

2E24:9022:1000:302A:0000:0000:0000:0000

And the second address would be:

2E24:9022:1000:302A:0000:0000:0000:0001

And so on all the way up to:

2E24:9022:1000:302A:0000:0000:0000:FFFF

Which means you can have 65,536 hosts in this /112 network. (2^16) Now the moment you change something in one of the first 7 octets you are in another network. So the first address in the next network would be:

2E24:9022:1000:302A:0000:0000:0001:0000

And so on. It's really not that different from IPv4 subnetting once you get past the fact that its written in hex. Now since nobody wants to type out a long subnet mask like "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000" IPv6 just uses /112 instead. Much like 255.255.255.240 would translate to /28 in IPv4. It means the same thing and is way easier to read, write, and type.

So as Snarked said, your first few networks would be:

2E24:9022:1000:302A:0000:0000:0000:0000/112
2E24:9022:1000:302A:0000:0000:0001:0000/112
2E24:9022:1000:302A:0000:0000:0002:0000/112

With each network containing 65,536 host IPs. While things like auto config and such only work right in a /64 environment you can use a /112 or whatever oddball network size you want for a network as long as you configure the addresses on all of the devices in said network manually. The IPv6 RFCs also recommend a /64 subnet for host networks so certain IPv6 implementations might get cranky if you try and make them run on a network that is using a subnet size other than /64.
Title: Re: Determining Prefixes?
Post by: jimb on January 24, 2011, 10:58:56 PM
If you are familiar with subnetting under IPv4 it works almost exactly the same way.  The main differences are that the addresses are 128 bits long instead of 32 bits, you are allowed to use the all-ones host number since there's no broadcast, and the addresses are in hex instead of decimal, which actually makes it easier to convert to binary in your head.
Title: Re: Determining Prefixes?
Post by: smoochict on January 25, 2011, 12:10:25 AM
Thanks for all the help!
Much appreciated.

I understand it now.