19. IPv6 Basics
19. IPv6 Basics
IPv6 Basics
Unicast, multicast,
Address types Unicast, multicast, anycast
broadcast
Address
Static, DHCP Static, DHCP, SLAAC
configuration
IPv6 significantly expands the address space, enabling unique addresses for
every device globally and simplifying network configurations.
2. iPv6 Advantages
Nearly Infinite Address Space:
IPv6 uses a 128-bit address space, which is much larger than IPv4's
32-bit space.
It enables the Internet of Things (IoT) and ensures that every terminal
can be online simultaneously without running out of addresses.
Plug-and-Play:
Enhanced Security:
Although not yet widely used, IPv6 has built-in security features that
can be leveraged to encrypt traffic end-to-end.
2. Traffic Class (8 bits): Indicates the priority of the packet, similar to the
TOS field in IPv4, primarily used for QoS control.
3. Flow Label (20 bits): Used to identify and differentiate real-time traffic
flows. A source IP address and a flow label together uniquely identify a
data flow.
5. Next Header (8 bits): Indicates the type of the next extension header or
the protocol type of the upper-layer PDU (similar to IPv4’s protocol
field).
6. Hop Limit (8 bits): This is equivalent to the TTL (Time to Live) field in
IPv4. It specifies how many hops (or routers) the packet can traverse. It
decreases by one with each hop and is discarded when it reaches zero.
IPv4 had an Options field that could extend the IPv4 header, but it was
limited and required processing by all intermediate devices, which was
inefficient.
The extension headers form a chained list where each header indicates the
type of the next one. This way, an IPv6 packet can include zero, one, or
multiple extension headers.
5. IPv6 Addressing
IPv6 addresses are 128 bits long and are usually written as eight groups of four
hexadecimal digits separated by colons ( : ). Here’s an example:
makefile
Copy code
The /64 at the end represents the subnet prefix length, indicating that the
first 64 bits of the address are used for the network portion.
1. Unicast Address:
2. Multicast Address:
IPv6 does not define broadcast addresses as IPv4 does; instead, all
broadcast-like functions are handled by multicast.
3. Anycast Address:
2. Interface ID: The remaining 128 - n bits, similar to the host ID in IPv4.
Most common unicast addresses, such as GUAs and LLAs, have a 64-bit
network prefix and a 64-bit interface ID.
3. EUI-64 Format: This method uses the MAC address of the device to
form a 64-bit interface ID. However, this method has a potential security
risk because attackers could deduce the MAC address from the IPv6
address.
GUAs usually have a 64-bit network prefix and a 64-bit interface ID.
ULAs use the prefix FC00::/7 , with only FD00::/8 being currently in use,
while FC00::/8 is reserved.
These addresses are valid only on the local link (network segment) and
have the prefix FE80::/10 .
LLAs are used for local communication, such as neighbor discovery and
SLAAC. They cannot be routed outside the local link.
Every IPv6 interface must have an LLA, and these can be generated
automatically or manually configured.
Scope: Defines the range of the multicast group (e.g., link-local, site-
local, organization-local, or global).
1. Service Redundancy:
Multiple servers can use the same anycast address. If one server fails,
the client can connect to another server using the same address,
maintaining service availability.
With SLAAC, the host generates its IPv6 address by combining the prefix
provided by the router with a locally generated interface ID (e.g., using the EUI-
64 method). The process ensures that hosts can configure themselves
automatically in IPv6 networks.
1. Stateful DHCPv6:
The host obtains a full 128-bit IPv6 address from the DHCPv6 server.
The server keeps track of which addresses have been assigned (this is
the "stateful" aspect).
2. Stateless DHCPv6:
Hosts use SLAAC to get their IPv6 address but rely on DHCPv6 for
additional information like DNS servers.
1. When a host (e.g., PC) needs to determine the MAC address corresponding
to an IPv6 address (e.g., 2001::2 on Router R1), it sends an NS message to
the solicited-node multicast address for 2001::2 .
2. R1 receives the NS message, records the source IPv6 and MAC addresses
of the PC, and replies with a unicast NA message containing its IPv6 and
MAC addresses.
3. After receiving the NA message, the PC records R1’s IPv6 and MAC
addresses, completing the neighbor discovery process and establishing a
neighbor entry.