Monday 15 October 2012

IPV6 How it works

IPV6 Connection happening on the local machine, but not connecting from the LAN. What may be the cause?
1. Check does assigned IPV6 has route to reach LAN
2. Check the status firewall (ip6tables in case of IPV6 network)
3. If Firewall running on local machine , stop firewall or modify accordingly to reach out LAN from local machine
How to stop firewall for IPV6 network, following
service ip6tables stop
4. how to check route for ipv6
ip -6 route


Information about IPV6


1. Enables Innovation , for application without NAT
2. IPV6 Address represented by hexa decimal numbers
3. There is no netmask in IPV6, it has only prefix length
4. IPV6 headers are 40bytes long, header doesn't include checksum, so if designing software, UDP checksum is mandatory
5. There is no broadcast in IPV6, it has only Multicasting
6. In IPV6 there is no ARP or IGMP, ICMP6 takes those jobs
7 .There are different types of IPV6 Addresses, they are Unicast, Multicast, Anycast, Reserved
8. There are also different scopes for IPV6, they are Local, Link, Global

IPV6 continuation
Lets go in detail, about the difference in IPV4/6 ..

how IPV6 really differs from IPV4 ..

IPV4 has several class of IP Addressing

IPV6 addressing follows,

As we know IPV6 has 128 bits wide,

starting from MSB, first 64 bits for network id, next 64 bits for host id

Here in host identifier can also be called as interface identifier.

In case of IPV4, a single interface can hold only a single IP Address ..

For example:
eth0 - can hold single unique IP Address
say 172.19.12.51

In IPV6 there are different scope defined for the interfaces.

Means a single interface can hold multiple IP's too, which overcomes IPV4 drawback ..

lets go interface wise ..

yes IPV6 has loop back address namely. ::1/128

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:933651 errors:0 dropped:0 overruns:0 frame:0
TX packets:933651 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:204721069 (195.2 MiB) TX bytes:204721069 (195.2 MiB)


Here we could see the scope of the loopback interface (lo), which is Scope: Host

Here the convension differs from IPV4, i.e successive leading zero's can be combined, not trailing zero's

A IPV6 address can hold only single combined successive leading zeros

For Example:

IPV6 Address : 2001:0DB8:130F:0000:0000:7000:0000:140B can be called by following,

2001:DB8:130F:0:0:7000:0:140B(Leading zeroes)

2001:DB8:130F:0:0:7000:0:140B(Trailing zeroes)

2001:DB8:130F::7000:0:140B(Successive field of zeroes)

Hene we can combine successive leading zeros, not trailing zeros.

Also there is only one time successive leading zeros can be combined in a given IPV6 Address.


Following are IPV6 addressing types.

1. Unicast
2. Multicast
3. Anycast

Note that IPV6 doesn't have broadcasting in nature.

There are different other scopes are available those are used for different purposes,
they are,

1. Link Local -- peer-to-peer communication (starts with FE80::) -- not intended to route
2. Unique Local -- starts with FD00:: -- within domain
3. Site Local -- intended to use within the site ( similar to unique local )
4. Global Unique -- global unique IPV6 address, can be routable ( similar to public IP Address in case of IPV4)



Is there a default DHCP address segment in IPv6 (similar to 169.254.x.x series in IPv4) ?
yes, it has fe80::/64 prefix .

In general IP Address can be assigned by following ways,

1. Configure Manually
2. Assign Dynamically with help of DHCP configured, IP Address can be assigned by DHCP for lease, will expire after certain time interval , otherwise DHCP can assign permanently . Again it depends on DHCP Server configuration
3. Assigning IP Address (local link) using default address block 169.254.0.0/16 for ipv4, In IPv6, they are assigned with the fe80::/64 prefix.

In IPV6 most often local link address will be assigned using stateless address autoconfiguration.



How many bits are present in an IPv6 address ?

There are 128 bits (16 bytes/octets) in an IPv6 address.  Please note that the "6" in IPv6 refers to IP specification version/release 6 and not the number of bytes in the address.  It so happens that in IPv4, the number of bytes in the address is 4.




How is loopback address represented in IPv6 ?
Its represented as ::1/128

In IPv6 the loopback address is a single IP address and hence the netmask bit of 128 above.

In the long form its
0000:0000:0000:0000:0000:0000:0000:0001/128

A slightly shorter from is
0:0:0:0:0:0:0:1/128

The shortest and usual form is
::1/128

Considering the IP alone its
::1

Note: In IPv4 the loopback address is 127.0.0.1/8



How many bits are present in an IPv6 address ?
128 bits.


How many bits are present in an IPv6 address ?
128 bits.
128/8=16 bytes

Neighbor Discovery Protocol (stateless auto configuration -- replacement of DHCP, ARP)
===========================================================
Here assume that N number of hosts are connected with Router
H1---
H2----
H3----ROUTER
.
.
.
Hn----

how link local unique address assigned

Steps are following,

As per understanding of IPV6 Address, first 64bit are meant for Network ID rest 64bit meant for HostID/Interface ID

To Generate unique link local IPV6 Address,
1. First 10 bits always will be 1111 1110 10 --> meant for link local address  rest 54 bits will be zero
   In terms it will be fe80:: (leading zeros are combined, not trailing zeros)
   The next 64bit interface id will be generated based on MAC address of the client system
  
   Assume that interface ID being generated by MAC address,
   And the IPV6 link address is fe80::219:d1ff:fe97:768c/64
  
 2. Now the second step, how the client has to make sure that there is no one in this network using this link local address
    This can be achieved by Neighbor Discovery Protocol underline with help of newly designed ICMP6
   
    How to test assigned link local address is unique
   
    a. Send Neighbor Solicitation and listen for Neighbor advertisement --> it means that IP Address is in use -> if not then goahead with router contact
    b.The node next attempts to contact a local router for more information on continuing the configuration.
      This is done either by listening for Router Advertisement messages sent periodically by routers,
      or by sending a specific Router Solicitation to ask a router for information on what to do next
      The router provides direction to the node on how to proceed with the autoconfiguration.
      It may tell the node that on this network “stateful” autoconfiguration is in use,
      and tell it the address of a DHCP server to use. Alternately, it will tell the host how to determine its global Internet address.
    c. Global Address Configuration: Assuming that stateless autoconfiguration is in use on the network,
      the host will configure itself with its globally-unique Internet address.
      This address is generally formed from a network prefix provided to the host by the router,
      combined with the device's identifier as generated in the first step
     
     

How MAC Table updated in IPV6:
=====================

Following is the command to get mac table entry in linux

 ip -6 neigh list

Following are the steps which will help kernel to update MAC entry for IPV6

1. Assume that there is no entry for say ip1 host , and ip1 is belonging to your network ( means it is reachable from your client)
2. Consider you have been assigned with some link local address and you want to reach/ping some one who is sitting in your network ex: ip1
 3.  Ideally the client should know the MAC address of other peer to establish communication,

 in this case when you do ping6 ip1 , client sends multicast request to ff02::1:ff:(24 least bits of your ip1 ) -- neighbor solicitation follows under icmpv6

therefore ip1 will reply back  with ip1 MAC address follows neighbor solicitation under icmpv6

 This is the stage client will do neighbor advertisement,  means client updated MAC table entry

then actual ping request will be sending to ip1, and vise versa.





 



2 comments: