Network Working Group M. Blanchet Internet-Draft Viagenie inc. Expires: August 31, 2001 March 2, 2001 A flexible method for managing the assignment of bits of an IPv6 address block draft-ietf-ipngwg-ipaddressassign-02 Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." To view the entire list of Internet-Draft Shadow Directories, see http://www.ietf.org/shadow.html. This Internet-Draft will expire on August 31, 2001. Copyright Notice Copyright (C) The Internet Society (2001). All Rights Reserved. Abstract This document presents a method to manage the assignment of bits of an IPv6 address block or range. When an organisation needs to make an address plan for its subnets or when an ISP needs to make an address plan for allocating address ranges to its customers, this method enables the organisation to postpone the final decision on the number of bits to partition in the address space they have. It does it by keeping the bits around the borders of the partition to be free as long as possible. This scheme is applicable to any bits addressing scheme using bits with partitions in the space, but its first intended use is for IPv6. It is a generalization of RFC1219 and can be used for IPv6 assignments based on RFC2373 and RFC2374. Blanchet Expires August 31, 2001 [Page 1] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 Table of Contents 1. Rationale . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Address plan . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1 leftmost . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.2 rightmost . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.3 centermost . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5. Implementation . . . . . . . . . . . . . . . . . . . . . . . . 8 6. Security Considerations . . . . . . . . . . . . . . . . . . . 10 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 11 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 12 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 12 Full Copyright Statement . . . . . . . . . . . . . . . . . . . 13 Blanchet Expires August 31, 2001 [Page 2] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 1. Rationale IPv6 addresses have a more flexible structure for address assignments than IPv4 where no pre-defined prefixes (called subnetmasks in IPv4) are used (except a few special cases). It enables registries, internet service providers, network designers and others to assign addresses ranges to organisations and networks based on different criterias, like size of networks, estimated growth rate, etc. Often, the initial assignation doesn't scale well because a small network becomes larger than expected, needing more addresses. But then, the assignment autority cannot allocate contiguous addresses because they were already assigned to another network. RFC1219 describes an allocation scheme for IPv4 where address space is kept unallocated between the leftmost bits of the subnet part and the rightmost bits of the host part of the address. This enables the network designer to change the subnetmask without renumbering, for the central bits that were not allocated. This work generalizes the previous scheme by extending the algorithm so it can be applied on any part of an IP address, which are assigned by any assignment autority level (TLA, registries, ISPs, organisations, ...). It can be used for both IPv4 and IPv6, with IPv6 assignments conforming to RFC2373 and RFC2374. This document is not an IPv6 address allocation plan, but can be used as a method for allocation plans, and is independent of any specific internet address registry ipv6 allocation plan. Blanchet Expires August 31, 2001 [Page 3] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 2. Scheme We define parts of the IP address as p1, p2 , p3, ... pN in order, so that an IP address is composed of these parts contiguously. Boundaries between each part are based on the prefix assigned by the next level assignment autority. Part p1 is the leftmost part probably assigned to a TLA, Part p2 can be assigned by the TLA to a large internet service provider or to a national registry. Part p3 can be allocated to a large customer or a smaller provider, etc. Each part can be of different length. We define l(pX) the length of part X. +------+------+------+------+------+------+ | p1 | p2 | p3 | p4 | ... | pN | +------+------+------+------+------+------+ <------- ipv6 or ipv4 address ------------> The algorithm for allocating addresses is as follows : a) for the leftmost part (p1), assign addresses using the leftmost bits first b) for the rightmost part (pN), assign addresses using the rightmost bits first c) for all other parts (center parts), predefine an arbitrary boundary (prefix) and then assign addresses using the center bits first of the part being assigned. This algorithm grow assigned bits in such way that it keeps unassigned bits near the boundary of the parts. This means that the prefix between any two parts can be changed forward or backward, later on, up to the assigned bits. Any assignment must conform to RFC2373 and RFC2374, which have precedence over this method in case of conflicts. Blanchet Expires August 31, 2001 [Page 4] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 3. Address plan 3.1 leftmost p1 will be assigned in order as follows : Order Assignment 1 10000000 2 01000000 3 11000000 4 00100000 5 10100000 6 01100000 7 11100000 8 00010000 9 ... This is actually a mirror of binary counting. 3.2 rightmost pN (the last part) will be assigned in order as follows : Order Assignment 1 00000001 2 00000010 3 00000011 4 00000100 5 00000101 6 00000110 7 00000111 8 00001000 9 ... 3.3 centermost pX (where 1 < X < N) will be assigned in order as follows : (for example, with a 8 bit predefined length l(pX)=8)) Blanchet Expires August 31, 2001 [Page 5] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 Order Assignment 1 00001000 2 00010000 3 00011000 4 00000100 5 00001100 6 00010100 7 00011100 8 00100000 9 ... Blanchet Expires August 31, 2001 [Page 6] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 4. Example A TLA has been assigned the 3ffe:0b00/24 prefix and wants to assign prefixes to its connected networks. It anticipates in the forseable future a maximum of 256 NLAs consuming 8 bits. One of these NLA, named NLA2, anticipates a maximum of 1024 subNLA assignments under it, consuming 10 other bits. The assignment will be as follows, not showing the first 24 leftmost bits (3ffe:0b00/24: 00111111 11111110 00001011): TLA assigning to NLAs using lefmost bits: 10000000 : assigned to NLA1 01000000 : assigned to NLA2 11000000 : assigned to NLA3 00100000 : assigned to NLA4 ... NLA2 assigning to its subNLAs using centermost bits: 0000010000 : assigned to subNLA1 0000100000 : assigned to subNLA2 0000110000 : assigned to subNLA3 ... subNLAs can use centermost bits for maximum flexibility and then the last aggregators (should be a network in a site) will be assigned using rightmost bits. Putting all bits together for subNLA3: TLA |NLA2 |subNLA3 00111111 11111110 00001011 01000000 00001100 00 <-------> <------> growing bits By using this method, the TLA will be able to expand the number of NLAs and the NLAs will be able to modify their first assumptions about the size of their subNLAs, until "reserved" bits are assigned. Blanchet Expires August 31, 2001 [Page 7] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 5. Implementation The following perl code was written by Jocelyn Picard (Jocelyn.Picard@viagenie.qc.ca) and implements this draft. #!/usr/bin/perl -w use strict; #=============================================================================== # allocation(Last Prefix,Number of bits,Method) # # Last Prefix = last prefix allocated, ex: 3ffe:b00::/48 # Number of bits = range we want to allocate # Method = method to use: l,c or r (left,center,right) # # Returns next prefix using selected method # # Note: no validation is made # #--------------------------------------------------------------------- sub allocation { my ($ip,$pl)=split('/',shift); my ($nbits,$method) = @_ ; my ($w,@Abits,$abits); my $i = $ip =~ s/:/:/g; my $repl= ':0' x (9 - $i); $ip =~ s/::/$repl/; $ip =~ s/^:/0:/; foreach $i (split(':',$ip)) { push @Abits, split('',unpack("B16", pack("n", hex($i)))); } my $sp = int($nbits/2); for($i=0;$i<$nbits;$i++) { if ($method eq "c") { $w = ($i % 2) ? $sp - ($i+1)/2: $sp + $i/2; } elsif ($method eq "r") { $w = $nbits -1 - $i; } else { $w = $i ; } $w += $pl - $nbits; if ($Abits[$w] == 0) { Blanchet Expires August 31, 2001 [Page 8] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 $Abits[$w] = 1; last; } else { return 0 if ($i == $nbits-1); $Abits[$w] = 0; } } $abits = join("",@Abits); $ip = ""; for($i=0;$i<8;$i++) { $ip .= sprintf("%lx", unpack("n", pack("B16", substr($abits, $i * 16,16)))) . ":"; } chop $ip; $ip =~ s/(:0){2,}$/::/; return($ip . "/$pl"); } #=============================================================================== # #Usage example: allocation of 100 /48 using "centermost" method # my $Prefix = '3ffe:b00::/48'; for(my $i=0;$i<100;$i++) { print $Prefix = allocation($Prefix,16,'c'),"\n"; } Blanchet Expires August 31, 2001 [Page 9] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 6. Security Considerations Address assignment doesn't seem to have any specific security consideration. Blanchet Expires August 31, 2001 [Page 10] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 7. References [1] RFC2373 IP Version 6 Addressing Architecture. R. Hinden, S. Deering. July 1998. (Format: TXT=52526 bytes) (Obsoletes RFC1884) (Status: PROPOSED STANDARD) [2] RFC2374 An IPv6 Aggregatable Global Unicast Address Format. R. Hinden, M. O'Dell, S. Deering. July 1998. (Format: TXT=25068 bytes) (Obsoletes RFC2073) (Status: PROPOSED STANDARD) [3] RFC1219 On the assignment of subnet numbers. P.F. Tsuchiya. Apr-01-1991. (Format: TXT=30609 bytes) (Status: INFORMATIONAL) Blanchet Expires August 31, 2001 [Page 11] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 8. Acknowledgements Thanks to Steve Deering, Bob Hinden, Erik Nordmark, Florent Parent and Jocelyn Picard for their very useful comments on this work. Author's Address Marc Blanchet Viagenie inc. 2875 boul. Laurier, bureau 300 Sainte-Foy, QC G1V 2M2 Canada Phone: +1 418 656 9254 EMail: Marc.Blanchet@viagenie.qc.ca URI: http://www.viagenie.qc.ca/ Blanchet Expires August 31, 2001 [Page 12] Internet-Draft A flexible method for managing the assignment of bits of an IPv6 address block March 2001 Full Copyright Statement Copyright (C) The Internet Society (2001). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implmentation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Acknowledgement Funding for the RFC editor function is currently provided by the Internet Society. Blanchet Expires August 31, 2001 [Page 13]