Thursday, December 16, 2010

IPv6 Subnetting

An ISP is normally allocated a /32 block.
In Singapore, One of the block issued to Singtel is 2001:0C20::/32

|                  n bits           |       m bits   |            128-n-m bits      |
+-----------------------------+---------------+-------------------------------+
|    global routing prefix | subnet ID   |          interface ID          |
+-----------------------------+---------------+-------------------------------+
An organization is often allocated a /48 block of IPv6 address space.
Let's use 2001:0C20:A::/48 10th group in the subnet assigned to ISP

The remaining 16 bits of the first half 64 bits will give 65536 /64s

Let's use 0000 for loopback address

2001:0C20:A:0000:0000:0000:0000:0000/64

Router Loopback Addresses
Router loopback addresses are /128 bit host routes
2001:0C20:A:0000:0000:0000:0000:0000/64

Each router loopback address is indicated by its Router # (y):
2001:0C20:A:0000:0000:0000:0000:0001/128
2001:0C20:A:0000:0000:0000:0000:0002/128
2001:0C20:A:0000:0000:0000:0000:FFFE/128
2001:0C20:A:0000:0000:0000:0000:FFFF/128

Point-to-Point Addresses 
Point-to-Point are links between only two nodes. 
For such networks, we could use one specific set of networks allocated 
from the prefix 2001:0C20:A:F000:0000:0000:0000:0000/52

Examples of possible Point to Point subnets:
Point-to-Point Link 1
2001:0C20:A:F001:0000:0000:0000:0001/64 
2001:0C20:A:F001:0000:0000:0000:0002/64 
...
Point-to-Point Link 10 
2001:0C20:A:F00A:0000:0000:0000:0001/64 
2001:0C20:A:F00A:0000:0000:0000:0002/64 

Server, Printers Subnet Assignment (Static IP)
For such networks, we could use one specific set of networks allocated from the prefix 2001:0C20:A:E000:0000:0000:0000:0000/52 

These are examples of possible server subnets: 
2001:0C20:A:E001:0000:0000:0000:0000/64  
2001:0C20:A:E002:0000:0000:0000:0000/64 
... 
2001:0C20:A:EFFE:0000:0000:0000:0000/64 
2001:0C20:A:EFFF:0000:0000:0000:0000/64 

General End-Node Subnets 
There are a a few ways you could subnet your end node subnets:  
|          n bits (48)           | b(8) | s(8)  |    128-b-s bits (64)    | 
+-----------------------------+--------------+----------------------------+ 
| global routing prefix    | bldg | Lvl   |         interface ID        | 
+-----------------------------+--------------+----------------------------+ 
OR  
|          n bits (48)           |      v(16)       |      128-v bits (64)     | 
+-----------------------------+----------------+----------------------------+ 
|  global routing prefix   |   VLAN ID   |        interface ID         | 
+-----------------------------+----------------+----------------------------+ 

Building addresses are summarized as: 2001:0C20:A:bb00:0000:0000:0000:0000/56 
Level addresses are: 2001:0C20:A:bbll:0000:0000:0000:0000/64 

Therefore, Building 45, Level 7 would be: 2001:0C20:A:4507::/64