Ipv6:

IPv6 addresses are 128 bits in length and written as a string of hexadecimal values.

  • Every 4 bits is represented by a single hexadecimal digit;
  • For a total of 32 hexadecimal values been grouped into 8 octets;
  • IPv6 addresses are not case sensitive and can be written in either lowercase or uppercase.
  • IPsec is a mandatory component for IPv6, and therefore, the IPsec security model is required to be supported for all IPv6 implementations in near future.

Types of IPv6 addresses:

  • Unicast – An IPv6 unicast address uniquely identifies an interface on an IPv6-enabled device. A source IPv6 address must be a unicast address. But for load-balancing purpose, multiple interfaces on a device can share the same IPv6 unicast address.
  • Multicast – An IPv6 multicast address is used to send a single IPv6 packet to multiple destinations.
  • Anycast – An IPv6 anycast address is any IPv6 unicast address that can be assigned to multiple devices. A packet sent to an anycast address is routed to the nearest device having that address.
6 types of Unicast:

 

1. Unique Local address(site addresses) FD00:: /8:

A unique local address (ULA) is an IPv6 address in the block FC00::/7 to FDFF::/7, defined in RFC 4193. It is the approximate IPv6 counterpart of the IPv4 private address. Unique local addresses are available for use in private networks, e.g. inside a single site or organization or spanning a limited number of sites or organizations. They are not routable in the global IPv6 Internet.unique_local_format

  • Used within enterprise networks to identify the boundary of their networks
  • The first 7 bits are always 1111110, the 8th bits 0 is reserved for future use, currently the 8th bit is locally assigned as 1.  So, the site addresses begin with FD00::/8.

 

ipv6-unique-local-address
Original and current usage

 

2. Link-local address FE80:: /10

A link-local address is an IPv6 unicast address that can be automatically configured on any interface using the link-local prefix FE80::/10 (1111 1110 10) and the interface identifier in the modified EUI-64 format.  It is IPv6 counterpart of the IPv4 special block 169.254.0.0/16(For more,see here). Link-local addresses are not necessarily bound to the MAC address (configured in a EUI-64 format).   Link-local addresses can also be manually configured in the FE80::/10 format using the ipv6 address link-local command.

Link-local addresses are usually not guaranteed to be unique beyond a single network segment. Routers therefore do not forward packets with link-local addresses.

These addresses refer only to a particular physical link and are used for addressing on a single link for purposes such as automatic address configuration and neighbor discovery protocol. Link-local addresses can be used to reach the neighboring nodes attached to the same link. IPv6 routers must not forward packets that have link-local source or destination addresses to other links. All IPv6 enabled interfaces have a link-local unicast address.

3. Global unicast 2000::/3

A global unicast address is similar to a public IPv4 address. These are globally unique, Internet routable addresses. Global unicast addresses can be configured statically or assigned dynamically. There are some important differences in how a device receives its IPv6 address dynamically compared to DHCP for IPv4.

Currently, only global unicast addresses with the first three bits of 001 or 2000::/3 are being assigned. This is only 1/8th of the total available IPv6 address space, excluding only a very small portion for other types of unicast and multicast addresses.ipv6_prefix ipv6_unicast

Note: The 2001:0DB8::/32 address has been reserved for documentation purposes, including use in examples.

4. Loopback ::1

The loopback address is used by a host to send a packet to itself and cannot be assigned to a physical interface. Similar to an IPv4 loopback address, you can ping an IPv6 loopback address to test the configuration of TCP/IP on the local host. The IPv6 loopback address is all-0s except for the last bit, represented as ::1/128 or just ::1 in the compressed format.

5. Unspecified address

An unspecified address is an all-0s address represented in the compressed format as ::/128 or just :: in the compressed format. It cannot be assigned to an interface and is only used as a source address in an IPv6 packet. An unspecified address is used as a source address when the device does not yet have a permanent IPv6 address or when the source of the packet is irrelevant to the destination(such as DHCP).

6. IPv4 embedded

The last type of unicast address type is the IPv4 embedded address. These addresses are used to help transition from IPv4 to IPv6.

Multicast address(ff00::/8)

 

Multicast addresses in IPv6 have the prefix ff00::/8. IPv6 multicast addresses are generally formed from four bit groups, illustrated as follows:

General multicast address format
Bits 8 4 4 112
Field prefix flags scope group ID

The prefix holds the binary value 11111111 for any multicast address. Currently, 3 of the 4 flag bits in the flags field are defined;the most-significant flag bit is reserved for future use. The other three flags are known as R, P and T.

Multicast address flags
Bit Flag 0 1
0 (MSB) (Reserved) (Reserved) (Reserved)
1 R (Rendezvous) Rendezvous point not embedded Rendezvous point embedded
2 P (Prefix) Without prefix information Address based on network prefix
3 (LSB) T (Transient) Well-known multicast address Dynamically assigned multicast address

Similar to unicast addresses, the prefix of IPv6 multicast addresses specifies their scope, however, the set of possible scopes is different. The 4-bit sc (or scope) field (bits 12 to 15) is used to indicate where the address is valid and unique.

Multicast address scope
IPv6 address                                                                                                                        IPv4 equivalent                                                                                            Scope                                                                                                                                   Purpose
ff00::/16 - ff0f::/16 Reserved
ffx1::/16 127.0.0.0/8 Interface-local Packets with this destination address may not be sent over any network link, but must remain within the current node; this is the multicast equivalent of the unicast loopback address.
ffx2::/16 224.0.0.0/24 Link-local Packets with this destination address may not be routed anywhere.
ffx3::/16 239.255.0.0/16 IPv4 local scope
ffx4::/16 Admin-local The smallest scope that must be administratively configured.
ffx5::/16 Site-local Restricted to the local physical network.
ffx8::/16 239.192.0.0/14 Organization-local Restricted to networks used by the organization administering the local network. (For example, these addresses might be used over VPNs; when packets for this group are routed over the public internet (where these addresses are not valid), they would have to be encapsulated in some other protocol.)
ffxe::/16 224.0.1.0-238.255.255.255 Global scope Eligible to be routed over the public internet.

The service is identified in the 112-bit Group ID field. For example, if ff02::101 refers to all Network Time Protocol (NTP) servers on the local network segment, then ff08::101 refers to all NTP servers in an organization’s networks. The Group ID field may be further divided for special multicast address types.

Well-known IPv6 multicast addresses

Well-known multicast addresses have the prefix ff00::/12. This means that the third hexadecimal digit, the Flag field, is always set to 0. Well-known multicast addresses are predefined or reserved multicast addresses for assigned groups of devices. These addresses are equivalent to IPv4 well-known multicast addresses in the range 224.0.0.0 to 239.255.255.255. Some examples of IPv6 well-known multicast addresses include the following:

Well-known IPv6 multicast addresses
Address                                                                 Description
ff02::1 All nodes on the local network segment
ff02::2 All routers on the local network segment
ff02::5 OSPFv3 All SPF routers
ff02::6 OSPFv3 All DR routers
ff02::8 IS-IS for IPv6 routers
ff02::9 RIP routers
ff02::a EIGRP routers
ff02::d PIM routers
ff02::16 MLDv2 reports (defined in RFC 3810)
ff02::1:2 All DHCP servers and relay agents on the local network segment (defined in RFC 3315)
ff02::1:3 All LLMNR hosts on the local network segment (defined in RFC 4795)
ff05::1:3 All DHCP servers on the local network site (defined in RFC 3315)
ff0x::c Simple Service Discovery Protocol
ff0x::fb Multicast DNS
ff0x::101 Network Time Protocol
ff0x::108 Network Information Service
ff0x::181 Precision Time Protocol (PTP) version 2 messages (Sync, Announce, etc.) except peer delay measurement
ff02::6b Precision Time Protocol (PTP) version 2 peer delay measurement messages
ff0x::114 Used for experiments

 

Prefix terminology
Term Assignment Example                                   
Registry prefix By IANA to an RIR 2340::/12
ISP prefix By an RIR to an ISP 2340:1111/32
SIte prefix or global routing prefix By an ISP or registry to a customer(site) 2340:1111:AAAA/48
Subnet prefix By an enterprise engineer for each individual link 2340:1111:AAAA:1/64

 

Key requirements outlined in RFC 5952:
  • leading zeros must be suppressed.
  • The use of the symbol”::”must be used to its maximum capability.
  • The characters “a”, “b”, “c”, “d”,”e” and “f” must be represented in lowercase.
  • The symbol “::” must not be used to shorten just one “16-bit” field:

So 2001:db8:0000:1:1:1:1:1       Incorrect

2001:db8::1:1:1:1:1                Incorrect

2001:db8:0:1:1:1:1:1              correct

  • When an alternative choice exists in the placement of a “::”, the longest run of consecutive 16-bit 0 fields must be shortened.  If the length are equal, the first sequence of zero bits must be shortened.

eg: 664a:0000:0000:fc02:0000:0000:0000:4b74         incorrect

664a:0:0:fc02::4b74                                                          correct

664a:0000:0000:fc02:00b2:0000:0000:4b74          incorrect

664a::fc02:00b2:0:0:4b74                                               incorrect(there are two 0 block)

ipv6 header

IPv6_header

IPv6 header has markedly fewer fields than an IPv4 header. This makes the IPv6 header easier and quicker for the router to process.One of the major design improvements of IPv6 over IPv4 is the simplified IPv6 header. The IPv4 header consists of 20 octets (up to 60 bytes if the Options field is used) and 12 basic header fields, not including the Options field and Padding field.

The IPv6 header consists of 40 octets (largely due to the length of the source and destination IPv6 addresses) and 8 header fields (3 IPv4 basic header fields and 5 additional header fields).

The fields in the IPv6 packet header include:

  • Version – This field contains a 4-bit binary value identifying the IP packet version. For IPv6 packets, this field is always set to 0110.
  • Traffic Class – This 8-bit field is equivalent to the IPv4 Differentiated Services (DS) field. It also contains a 6-bit Differentiated Services Code Point (DSCP) value used to classify packets and a 2-bit Explicit Congestion Notification (ECN) used for traffic congestion control.
  • Flow Label(New in IPV6)This 20-bit field provides a special service for real-time applications. It can be used to inform routers and switches to maintain the same path for the packet flow so that packets are not reordered.
  • Payload Length – This 16-bit field is equivalent to the Total Length field in the IPv4 header. It defines the entire packet (fragment) size, including header and optional extensions.
  • Next Header – This 8-bit field is equivalent to the IPv4 Protocol field. It indicates the data payload type that the packet is carrying, enabling the network layer to pass the data to the appropriate upper-layer protocol. This field is also used if there are optional extension headers added to the IPv6 packet.
  • Hop Limit: – This 8-bit field replaces the IPv4 TTL field. This value is decremented by one by each router that forwards the packet. When the counter reaches 0 the packet is discarded and an ICMPv6 message is forwarded to the sending host, indicating that the packet did not reach its destination.
  • Source Address – This 128-bit field identifies the IPv6 address of the sending host.
  • Destination Address – This 128-bit field identifies the IPv6 address of the receiving host.

An IPv6 packet may also contain Extension headers (EH), which provide optional network layer information. Extension headers are optional and are placed between the IPv6 header and the payload. EHs are used for fragmentation, security, to support mobility, and more.

The IPv6 simplified header offers several advantages over IPv4:

  • Better routing efficiency for performance and forwarding-rate scalability
  • No requirement for processing checksums
  • Simplified and more efficient extension header mechanisms (as opposed to the IPv4 Options field)
  • A Flow Label field for per-flow processing with no need to open the transport inner packet to identify the various traffic flows

 

Dynamic configure Ipv6

A device may receive all or some of its IPv6 addressing information from a DHCPv6 server depending upon whether option 2 (SLAAC and DHCPv6) or option 3 (DHCPv6 only) is specified in the ICMPv6 RA message.

If option 1 (SLAAC only) or option 2 (SLAAC with DHCPv6) is used, the client does not obtain the actual Interface ID portion of the address from this processes. The client device must determine its own 64-bit Interface ID, either by using the EUI-64 process or by generating a random 64-bit number.

EUI-64 process:

Ethernet MAC addresses are usually represented in hexadecimal and are made up of two parts:

  • Organizationally Unique Identifier (OUI) – The OUI is a 24-bit (6 hexadecimal digits) vendor code assigned by IEEE.
  • Device Identifier – The device identifier is a unique 24-bit (6 hexadecimal digits) value within a common OUI.

An EUI-64 Interface ID is represented in binary and is made up of three parts:

  • 24-bit OUI from the client MAC address, but the 7th bit (the Universally/Locally (U/L) bit) is reversed. This means that if the 7th bit is a 0 it becomes a 1, and vice versa.
  • The inserted 16-bit value FFFE (in hexadecimal)
  • 24-bit Device Identifier from the client MAC address

eg. R1’s GigabitEthernet MAC address of FC99:4775:CEE0.

Step 1: Divide the MAC address between the OUI and device identifier.FC 99 47 and 75 CE E0, reverse the 7th bit, So, FC become FE.

Step 2: Insert the hexadecimal value FFFE, which in binary is: 1111 1111 1111 1110.
EUI64Process

Step 3: Convert the first 2 hexadecimal values of the OUI to binary and flip the U/L bit (bit 7). In this example the 0 in bit 7 is changed to a 1. The result is an EUI-64 generated Interface ID of FE99:47FF:FE75:CEE0.

EUI for Serial Interface

whenever Cisco IOS needs a MAC address for an interface, and that interface does not have a built-in MAC address (such as serial interface), the router uses the MAC address of the lowest-numbered LAN interface on the router.

e.g. 

R2(config) # interface F0/0
R2(config-if)# ipv6 address 2000:0:0:1::/64  eui-64
R2(config-if)#exit
R2(config) # interface Serial0/0/1
R2(config-if)# ipv6 address 2000:0:0:1::/64  eui-64
R2# show interfaces fa0/0
FastEthernet0/0 is up, line protocol is up
Hardware is Gt96k FE, address is 0013.197b.5004 (bia 0013.197b.5004)
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
R2# show ipv6 interface brief
FastEthernet0/0 [up/up]
FE80::213:19FF:FE7B:5004
2000::4:213:19FF:FE7B:5004
Serial0/0/1 [up/up]
FE80::213:19FF:FE7B:5004
2000::1:213:19FF:FE7B:5004

The following list shows the derivation of the last 64 bits (16 hexadecimal digits) of R2’s IPv6 interface IDs for its global unicast IPv6 addresses on Fa0/0 and S0/0/1:

Step 1. Use Fa0/0’s MAC address: 0013.197B.5004.
Step 2. Split and insert FFFE: 0013:19FF:FE7B:5004.
Step 3. Invert bit 7: Hex 00 = 00000000 binary, flip for 00000010, and convert back to hex 02, resulting in 0213:19FF:FE7B:5004.

IPv6 has same address format for global unicast and for anycast.
• Uses a global routing prefix—a structure that enables aggregation upward,eventually to the ISP.
• A single interface may be assigned multiple addresses of any type (unicast,anycast, multicast).
• Every IPv6-enabled interface must contain at least one loopback (::1/128)and onelink-local address.
• Optionally, every interface can have multiple unique local and global addresses.
• Anycast address is a global unicast address assigned to a set of interfaces (typically on different nodes).
• IPv6 anycast is used for a network multihomed to several ISPs that have multipleconnections to each other
 Transition technologies to work with IPv4:

Dual-layer IP stack

dual_stack
•IPv6 over IPv4 : adding an IPv4 header to the IPv6 packet. This works similar to virtual private network (VPN)

•Intra-Site Automatic Tunnel Addressing Protocol (ISATAP) : allows IPv6 routers and hosts to communicate across IPv4 networks. ISATAP is designed for private intranets.

The interface ID is separated intotwo parts as follows:
•The first 32 bits are either 0:5efe for a private address or 200:5efe for a public address.
•The last 32 bits are the IPv4 address.

•6to4:  uses tunneling of IPv6 packets over an IPv4 network. The technologies differ in how they store the IPv4 address in the IPv6 packet. Where ISATAP stores the IPv4 address as a decimal in the last 32 bits of the address, 6to4 stores the IPv4 address of the ISATAP router in bits 17 to 48.

6to4 is designed for communicating across the public IPv4 Internet.

•Teredo:  Teredo allows IPv6 hosts to communicate over IPv4 networks that use NAT, which is a mechanism used in IPv4 networks for hiding a private IP network behind a public IP address.

Teredo’s address is based on the 2001::/32 prefix. It is structured as follows:
→The first 32 bits of the address are 2001.
→The next 32 bits are the IPv4 address in hexadecimal to complete the network ID.
→The host ID begins with 16 bits used for Teredo flags.
→The next 16 bits represent the external IPV4 UDP port number being used by the NAT.
→The remaining 32 bits are the IPv4 address of the NAT in hexadecimal.

Inverse Neighbor Discovery

The ND protocol discussed in this section starts with a known neighbor’s IPv6 address and seeks to discover the link-layer address used by that IPv6 address. On Frame Relay networks, and with some other WAN data-link protocols, the order of discovery is reversed. A router begins with knowledge of the neighbor’s data link layer address and instead needs to dynamically learn the IPv6 address used by that neighbor.

IPv4 solves this discovery problem on LANs using ARP and the reverse problem over Frame Relay using Inverse ARP (InARP). IPv6 solves the problem on LANs using ND, and now for Frame Relay, IPv6 solves this problem using Inverse Neighbor Discovery (IND). IND, also part of the ICMPv6 protocol suite, defines an Inverse NS (INS) and Inverse NA (INA) message. The INS message lists the known neighbor link-layer address (Data-Link Connection Identifier [DLCI] for Frame Relay), and the INS asks for that neighboring device’s IPv6 addresses. The details inside the INS message include the following:

Source IPv6: IPv6 unicast of sender
Destination IPv6: FF02::1 (all IPv6 hosts multicast)
Link-layer addresses
Request: Please reply with your IPv6 address(es)

IPv6 configuration (Cisco IOS)

 

Command                                                                                                                                                     Description
ipv6 unicast-routing A global configuration mode command that enables the routing of unicast IPv6 traffic
ipv6 cef A global configuration mode command that enables Cisco Express Forwarding (CEF) for IPv6.
ipv6 flowset  A global configuration mode command that configures flow-label marking in 1280-byte or larger packets sent from the router.
ipv6 address address/length  Static configuration of the entire IPv6 unicast address.
ipv6 address prefix/length eui64  Static configuration of the first 64 address bits; the router derives the last 64 bits with EUI-64.
ipv6 address autoconfig  Router uses stateless autoconfig to find an address.
ipv6 address dhcp  Router uses stateful DHCP to find an address.
ipv6 unnumbered interface-type number Uses the same IPv6 unicast address as a referenced interface.
ipv6 enable  Enables IPv6 on the interface, but results in only a link-local address.
ipv6 address address link-local  Overrides the automatically created link-local address. The configured value must conform to the FE80::/10 prefix.
ipv6 address address/length anycast  Designates that the unicast address is an anycast address.

 

 

Reference

http://www.ciscopress.com/articles/article.asp?p=2803866&seqNum=5