March 12, 2009

Howto Subnet IPv6

I’ve been trying to get my head around IPv6 subnetting for some time now. Today was finally the day that forced the issue…

First some background:

All IP addresses (IPv4 and IPv6) are allocated in large blocks to a regional registry (ARIN, RIPE, etc…) these registries then in turn allocate addresses down to ISPs, ISPs to customers and so on. By default the registry will allocate a /32 to an ISP and the ISP is supposed to allocate a /48 to a customer. The IPv6 equivalent of a IPv4 /24 subnet is a /64 which is the space a customer should break their network segments into.

This is where my brain starts to hurt.

An IPv6 /32 is 2^16 (65536) /48 subnets, which in turn are each 2^16 /64 subnets. A /64 is 2^64 addresses, the square of the size of the entire IPv4 Internet. It took me a while to find a calculator that would actually give the expanded result – 18,446,744,073,709,552,000.

The numbers are just unbelievably large. Anyways back to the problem at hand, how does an ISP properly subnet their /32 space to customers (or better put what are the breakpoints in the subnets)?
The answer is incredibly simple, since IPv6 is going to be subnetted based on the existing “:” octet separator all you need to do is increase the number and volia. Phyber’s IPv6 allocation is 2637:f238/32 which means the subnets are:


2607:f238:0000/48
2607:f238:0001/48
2607:f238:0002/48

And so on and so on. Another trick, IPv6 isn’t just 0-9, the numbering is 0-9 + a-f or:


2607:f238:0008/48
2607:f238:0009/48
2607:f238:000a/48
2607:f238:000b/48

It is a ridiculous amount of IP space. I’ll post more when I figure out what we are doing for our cross connects and loopback interfaces.

Comments (7)

  1. April 22, 2009
    Neetee said...

    Keep up the good work.

  2. May 17, 2009
    Werner said...

    Thank you, that made IPv6 a little clearer to me. Unfortunately there is no ipv6 calculator on the net that can actually handle the subnetting of a /32 into 65536 /48 Networks :-(

    http://www.liquidalchemy.com/liquidalchemy/index.php

    e.g.
    2001:f238:/32 into 2^16 /48s doesn’t work :D

    Werner

    • May 17, 2009
      Max said...

      I’ve had the same problem trying to find an IPv6 calculator. The problem seems to be that the output is simply too big for any of them to handle.

      -Max

  3. May 20, 2009
    Chris said...

    Your statement ‘ An IPv6 /32 is 2^16 (65536) /48 subnets ‘ is assumed for one pop? Have you explored or researched anything longer than a /32 and shorter than a /48; Example, 32 /37s or 64 /38s if an ISP has several POPs and assigning several /37s or /38s to a single pop and so fourth? Thanks

    • May 20, 2009
      Max said...

      Chris,

      I have looked into different IPv6 subnet lengths but because ARIN wants to assign /32s to ISPs and wants the ISP to allocate out a /48 per customer it hasn’t been a pressing issue as of yet. Honestly our requirement is assigning a /128 for a router to customer connection and then the /48 for the customer. We’ve started looking at pushing IPv6 out to our Metro Fiber customers (Phyber ONTAP) but that is probably going to be a slow rollout.

      -Max

  4. May 21, 2009
    Chris said...

    Max,

    Thanks for the information. I feel that not all customers deserve a /48. I work for a Co-location facility and we also have several DSL and ATM customers. So I am looking into the implementation for our customers; If we follow the RFCs and guidelines, then I honestly feel that giving a Co-location customer /48 is a waste of address space if the customer only requires a handful of subnets, it would make more sense to give the customer a /56. We also implement HSRP for customers that have IPv4 connectivity, so when the time comes to implement IPv6 and HSRP (There is anycast), but for now, we are looking at all options and the best scalable method; So in the case with HSRP and IPv6, it does not make sense configuring a vlan interface with a /64. I see that maybe configuring the SVI with a /120 and then routing a /56 or a /48 to the customers router from the /120. I have reviewed many RFCs and the discussion for subnets that are longer than a /64 and what is breaks and so fourth, so I am just trying to get an idea what others have implemented.

    Thanks for your time.
    Chris

    • May 21, 2009
      Max said...

      Chris,

      Maybe this will help you (https://www.arin.net/policy/nrpm.html#six54):

      > /64 when it is known that one and only one subnet is needed
      > /56 for small sites, those expected to need only a few subnets over the next 5 years.
      > /48 for larger sites

      We will allocate a /48 to any downstream customer that requests one otherwise it is a /56. Anything connected to one of our routers is a /64 nothing larger. We use /126 on all of our connected interfaces with the customer. A /120 in your case for HSRP would fit the bill, we use a second interface via a different device and OSPF costing to facilitate link redundancy.

      -Max