This article is not an exhaustive description of IPv6. It originated as my notes when I was preparing for the Cisco test 642-901 BSCI, so it looks like notes. If anyone wants to add any substantial information, they are welcome in the comments.
IPv6 Features
- addresses are
128 bits = 16 byteslong - this means
3.2*10^38addresses (IPv4 about 4 billion) - integrated IPsec
- support for mobile connections (mobile IP - MIPv6)
- subnets are written using CIDR address/prefix notation
Security in IPv6 - IPsec
IPv4 originally contained no security mechanisms, and security was addressed at higher layers (application level). Over time, a security mechanism was added that works directly on the 3rd layer of the OSI model, i.e., on IP, called IPsec - Internet Protocol Security. IPsec provides encryption and authentication. In IPv6, its implementation is mandatory, but it is not used very often.
Mobility Support in IPv6
Another integral part of IPv6 is mobility. Today, there are many mobile devices that connect to the network from various locations. Mobility support is designed to ensure that a mobile device has an address from its home network and that it doesn't change even when connected elsewhere. Mobile IPv6 bypasses problems with triangular routing (communication from the source goes to my home network and from there to my mobile device connected elsewhere, but secure optimization is performed here to communicate directly) and is therefore as efficient as normal IPv6. However, MIPv6 has not yet become widespread.
Cisco IOS Commands for IPv6
ROUTER(config)#ipv6 unicast-routing // enables IPv6 support ROUTER(config)#ipv6 cef // enables Cisco Express Forwarding (CEF) for IPv6 ROUTER(config-if)#ipv6 address 2002:C0A8:2101::1/128 // defines an IPv6 address ROUTER(config-if)#ipv6 enable // enables IPv6 only for the interface
Stateless Address Autoconfiguration (SLAAC)
When a client is connected to a routed IPv6 network, it can automatically configure itself using ICMPv6 router discovery message. When a client first connects to the network (e.g., during booting), it sends a router solicitation (RS) message (link-local multicast) as a request for configuration parameters, and the router responds with a router advertisement (RA) message. The RA contains a 64-bit prefix for the link and a lifetime. The address is created from the sent prefix and completed with the client's MAC address (in the case of Ethernet). For initial communication, the client creates a local address with the prefix FE80::.
Note: In IPv6, there is also stateful autoconfiguration, similar to IPv4, using DHCPv6.
Addresses in IPv6
IPv6 Address Format and Shortening
- addresses consist of 8 groups of 4 hexadecimal numbers (16 bits) separated by colons
0123:BB99:3210:FE00:58A0:4565:98AE:1245- addresses can be written in shortened form, as it is expected that there will be addresses with many zeros, leading 0s in a group can be omitted (except for one), groups of zero 16-bit blocks can be written as
::(two colons), but this can only be used once 1080:0000:0000:0000:0008:0800:0000:417A = 1080:0:0:0:8:800:0000:417A = 1080::8:800:0:417A
Types of IP Addresses
- unicast - identifier of one interface on one node
- anycast - new in IPv6, the same address assigned to a group of interfaces that typically belong to different nodes, a packet is delivered only to one - the nearest interface (according to the given routing protocol) that is identified by this address, an anycast address is a normal unicast address, so it's difficult to identify
- multicast - identifier of a group of interfaces that typically belong to different nodes, a packet is delivered to all interfaces
Note: There is no broadcast in IPv6, it is replaced by the link-local all hosts multicast group
Basic Addresses
- ::/0 is the default route.
- ::1/128 loopback address
- ::/128 is an unspecified address
- FF00::/8 are multicast addresses
- FC00::/7 are unique local addresses
Multicast Addresses
Multicast addresses starting with FF (first 8 bits are 1) FF::/8
- FF01::1 local node - all hosts
- FF01::2 local node - all routers
- FF02::1 local link - all hosts
- FF02::2 local link - all routers
- FF05::2 local site - all routers
- FF02::5 all OSPF routers
- FF02::6 all designated routers
IPv6 Packet
In IPv6, there's an effort to make the header as small as possible. Some less used parts were moved to extension headers. The header size is fixed and equals 40B, of which 32B are addresses. So it doesn't contain information about the header size, and the checksum was also removed.
An IPv6 packet contains version, traffic class (priority - QoS), flow label (QoS, not used yet), payload length (data size, max 64kB, or set to 0 and then it's jumbo up to 4GB), next header (equivalent to protocol in IPv4), hop limit (instead of TTL), source and destination address.
| bits | 0-3 | 4-11 | 12-15 | 16-23 | 24-31 |
| 0 | version = 6 | traffic class | flow label | ||
| 32 | payload length | next header | hop limit | ||
| 64 | source address | ||||
| 96 | |||||
| 128 | |||||
| 160 | |||||
| 192 | destination address | ||||
| 224 | |||||
| 256 | |||||
| 288 | |||||
Next Header can also indicate one of 6 extension headers. In that case, one or more headers with special data follow the normal header. This could be, for example, routing (list of nodes through which the packet should pass) and fragmentation (the link layer, depending on the technology, can transport frames of a certain maximum size, Ethernet MTU = 1500B, fragmentation divides larger data, in IPv6 it can only be performed by the sender).
Techniques that can be used when transitioning from IPv4 to IPv6
Dual Stack
IPv4 and IPv6 are used simultaneously, routers have two separate stacks, NAT or dual-stack servers are needed to complement, so that communication between IPv4 and IPv6 can occur.
6to4 tunneling
For communication of isolated IPv6 networks through an IPv4 backbone, where packets are encapsulated in IPv4 (IP type 41), tunnels can be used on routers - manual, GRE tunnels, semi or fully automatic tunnels, the IPv6 address is created from the prefix 2002::/16 and IPv4 converted to hex, e.g.: 172.31.100.1 -> 2002:AC1F:6401::/48, the border router must have an IPv6 address with 2002::/16 in the prefix.
IPv6 on dedicated links
The same L2 infrastructure, but separate Frame Relay or ATM PVCs.
IPv6 on MPLS backbone
Separate IPv6 networks communicate through an MPLS IPv4 backbone.
Ahoj,
Link-local adresa je FE80::/10, nejspíš se jedná pouze o překlep ;-).