Saturday, March 28, 2015

IPv6 notes. IPv6 packet structure.

IPv6 packet format notes.

 IPv6 vs IPv4 differences

- address became 128 bit long
- no more fragmentation ( no fragment ID, flag, fragment ofset) fragmentation is done by the traffic source using the Path MTU discovery
- no more header checksum ( remains link-layer and transport layer checksum)
- new role for multicast addressing ("scop" field )
- anycast addresses
- autoconfiguraton of address
- header format simplification
- flexibility in using header options
- a new capability to label packets belonging to different flows with "flow label" field
- extension to support authentication and data integrity

Header structure.


IPv6 header fields

IPv6 packet header has a fixed 40-byte length. The data payload following the IPv6 header represents either the upper layer protocol or extension header chain (IPv6 options).

Version

This 8 bit length field shows us what IP protocol version is used. 

Traffic Class

This field is used to carry QOS information (the same way as IPv4)


Flow Label

Is defined in RFC 6437. Allows to separate different flows from single source to particular destination. I haven't seen any real examples of using this field nowadays, always set to zero.

Payload length

Shows us the length of the payload with all extension headers. 16-bit long field.


Next header

This 8-bit field is the pointer that shows us what upper layer protocol or extension header is following the IPv6 header.


Hop limit

This 8-bit field have replaced TTL field and plays the same role.


SA/DA

Source and destination IPv6 addresses. 128-bit long fields.


IPv6 Extensions


As described above there can be inserted an extension header chain between the IPv6 header and upper layer protocol header. The number of extension headers and it's size is limited only by MTU. All extension headers are align in 8-byte boundaries. All IPv6 extensions have TLV format (Type Length Value, where "Type" - is a pointer to the next extension header type).
There are several extension headers and here are some of them:

 Hop-by-hop extension

Identified by the ipv6  "Next header" value 0 . The order of chaining of extension header can be various but there is the rule that says that Hop-By-hop extension should be the first extension header because this header should be decoded by every node on the way of a packet containing this EH  (Extension Header). This extension can be used to provide information that should be processed by all routers (for example some forwarding instructions, using Jumbogramms)

Routing header

Identified by the ipv6  "Next header" value 43. This extension carries information similar to IPv4 Loose Source and Record Route options. Field contains the ordered list of router addresses that must be visited by the packet on the way to the destination.

Destination options

Identified by the ipv6  "Next header" value 60 . This header is used to  carry option information to the packet's destination only.

Fragment header

Identified by the ipv6  "Next header" value 44. This extension  is used to send a packet larger then Path MTU. Here you can find such fields as a "Fragment offset", "Identification" and "More flag" that usually you can find in IPv4 packet. Note, that fragmentation can be done only by the source of a packet.

 Authentication header

Identified by the ipv6  "Next header" value 51. The same as authentication data as in IPsec provides data protection.


IPv6 packet fully described in RFC2640.

No comments:

Post a Comment