ipv6 various

  

IPv6 address resolution works:

Parsing IPv6 address comprises two processes: a parsing maintenance process corresponding to the destination IP address of the link layer, two neighbor reachability status.

Used in the ARP protocol is IPv4, IPv6 is used in ND (Neighbor discover) protocol NS and NA messages to achieve.

ND protocol using the advantage of increasing the independence of the ARP and the underlying link. For each link layer are used based eh same ARP, no need for each link layer protocol defines a new address resolution protocol.

Reach reduced packets. In IPv4, ARP using a broadcast address to each host must flood layer 2 network. Layer resolve IPv6 addresses using multicast addressing limits the propagation range of the address by the address resolution request to resolve a particular address belongs solicited-node multicast group (FF02 :: 1: FF00: 0 /104 + IPv6 the address of 24 bits) , reduced propagation range packets, saving network bandwidth.


In IPv6, the ND protocol interaction between the node NS and NA messages to complete the link-layer address to the IPv6 address is resolved, the information for analyzing the link layer address and IPv6 address to establish the corresponding resulting neighbor cache entry .

NS packet main functions include Target Address field and Option field.

TargetAddress containing an IPv6 address to be resolved.

NA Option field only packets using a link-layer address option (Link layer Address Option). Link-layer address option including the type, length and address of three parts.

When the type is 1, represents a source link layer address in NS, RS, Redirect message; when the type is 2, indicating that the link layer address of the target link-layer address in the NA message.


IPv6 address resolution process: If the network has hosts A and B. A link-layer address is MAC1, IPv6 address IPl; B link layer address is MAC2, IPv6 address IP2 (assuming 2001 :: 1). A query of the link-layer address of B is as follows:

1) Node A sends an NS message to the link destination IPv6 address corresponding to the node B is requested multicast address (FF02 :: 1: FF00: 1), destination address IP2, MACl carrying the option field;

2) When the node B receives the DS packet, the source address and source IPv6 link-layer address option in the NS message update their neighbor cache entry, and to send a reply message NA NS message, the message Option field in link layer address for its own link-layer address MAC2;

3) A node receives the NA message, the target Node B creates a neighbor cache entry according to the link layer packet carries the node B.

View the neighbor cache
ip -6 neighbor show

View route

ip -6 route show
route -A 'inet6'
route -6

添加IPV6地址
ip -6 addr add <ipv6address>/<prefixlength> dev <interface>
ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0

ifconfig <interface> inet6 add <ipv6address>/<prefixlength>
ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64

Add a default route
ip -6 route the Add <ipv6network> / <PrefixLength> Via <IPv6Address>
Via the Add default route ip -6 2001: 0db8: 0: 1 :: F101

route -A inet6 add <ipv6network>/<prefixlength> gw
route -A inet6 add default gw 2001:0db8:0:f101::1

 

NS message:

 Address ff02 :: 1 :: ff00: 1 :: 1 is a solicited-node multicast address. Link-layer containing its link-layer address.

NA message:

 Flags flag field three flags are set up, router field indicates the sender is a router, solicited field indicates the packet is a response to the NS, override this field represents the geocoding results covered by previous results. NA messages transmitted in unicast mode.

Guess you like

Origin www.cnblogs.com/liuhongru/p/11525824.html