IPv6

Packet Spec - RFC2460

表示法 1. IPv6使用128bit空間,因此最多可以有2的128次方個位址 2. IPv4分為四段,以"點"當區隔;IPv6分為8段,以"冒號"當區隔 3. IPv4是以10進位表示,但IPv6是以16進位來表示,ex: 2000:0000:0000:0000:123f:0000:0000:0001 4. 可以不用冒號,直接寫出全部位址,但容易出錯,ex: 2000000000000000123f000000000001 5. 如果你覺得寫一堆0很煩,IPv6也可以把重複的0縮減掉 ex:2000::123f:0:0:1 6. 縮寫規則:

  • 每段(16bit)的開頭如果是0就可以省略

  • 每段(16bit)如果都是0,可以縮寫成0

  • 如果有連續好幾個段都為0,則可以用::代替,但只能1次

    1. IPv6可與IPv4合用,將IPv4當做IPv6的末32bit,如:

  • 2000::192.168.1.1(IPv6頭 + IPv4尾)

  • 2000::C0A8:101 (192.168.1.1變C0A8:0101)

Address type

  • Global Scope - Internet上互連的位址,稱為Global Unicast Address

  • Link Local Scope - 所有同一個Layer2網路下的位址,稱為Link-Local Address

  • Unique_Local Scope - 所以在同一個網路管理機制下的私用網路位址,稱為Unique-Local Address

If you are using IPv6 address, then you can not access IPv4 address server or service

IPv6 packet priority - RFC2474

For deployment.

IPv6 has to transparent to IPv4

  1. IPv4/IPv6 Dual stack(雙協定)

    • Upgrade IPv4 element and make it support IPv4 and IPv6

  2. IPv6 Tunneling (隧道技術)

isatap、6to4 Tunnel、6RD、及auto-tunnel

  • Add IPv4 Header to IPv6 packets.

  1. IPv6 Translation(NAT-PT)

RFC2663 RFC2765

Use ND(Network Discovery) (RFC 4861)的訊息及處理程序,取代了IPv4中使用的 ARP (Address Resolution Protocol) ICMP(Internet Control Message Protocol) Router Discovery (RFC 2461)

Field Compare with IPv4 (32bits to 128bits)

IPv4

ToS

Protocol Type

Time-to-Live

Header-size:20 bytes

protocol type

::1 (loopback ip)

IPv6

Traffic Class

Next Header

Hop Limit

Header-size:40 bytes

next header

127.0.0.1

New field in IPv6

  • Flow Label

Version

  • IPv6 or IPv4

Traffic Class // RFC 2474「Definition of the Differentiated Services Field(DS Field)

  • For priority

Flow label

  • For sppeed up (有加label 且同source/destination ip的人不須多餘處理)

Payload length

  • Header 後的data length

Next header

  • For specify packet combine type

0

IPv4 標頭:保留未使用, IPv6 標頭:Hop-by-Hop Option 標頭之後

1

Internet Control Message Protocol ( ICMPv4 )— IPv4 支援

2

Internet Group Management Protocol ( IGMPv4 )— IPv4 支援

4

IPv4

5

Stream Protocol ( RFC 1819 )

6

TCP

8

Exterior Gateway Protocol ( EGP )

9

IGP ── 任一私有內部閘道器(用於 Cisco IGRP )

17

UDP

41

IPv6

43

路由標頭

44

分段標頭

45

域間路由通訊協定( Interdomain Routing Protocol ; IDRP )

46

資源預留通訊協定( Resource Reservation Protocol ; RSVP )

47

一般路由封裝( General Routing Encapsulation ; GRE )

50

Encapsulating Security Payload 標頭

51

身份認證標頭

58

ICMPv6

59

IPv6 的 No Next Header

60

Destination Options 標頭

88

EIGRP

89

OSPF

103

PIM

108

IP 負載壓縮通訊協定( IP Payload Compression Protocol )

115

Layer 2 Tunneling Protocol ( L2TP )

132

Stream Control Transmission Protocol ( SCTP )

135

Mobility Header ( Mobile IPv6 )

140

Shim6 ( RFC 5533 )

143–252

未指派

253, 254

用於實驗與測試性質( RFC 3692 )

255

保留

Hop limit

  • How many hop packet remain in network

    • 0: drop and sender get "Hop Limit exceeded in transit" icmpv6 message.

Source address

  • Sender ip

Destination address

  • Receiver ip or next router ip

RS (Router Solicitation)

  • When Host try to get address, send RS.

checksum

  • 用以檢查表頭內容是否錯誤,由於IPv4有1個TTL(time to live)限制封包最大經過網路節點數,由於每經過1個網路節點,這個值會減1,所以檢查碼必須重新計算,消耗網路節點效能

RA (Router Advertisement) packet

  • IPv6 router 會定期對IPv6 node send RA packet

  • Content

    • Prefix(es)

    • Prefix Length

    • Prefer Lifetime

    • Valid Lifetime

    • MTU

    • Autoconfiguration Flag

SLAAC(Stateless Address Autoconfiguration)

  • If there are no DHCPv6 server in network, host will calculate its IPv6 address by a algo.

  • And set default gateway to the Link-local Address (get by RA source IPv6 address)of router

    • Interface ID Algorithm

Extension Header (RFC 6564) All IPv6 node should compatible with

  • Hop-by-Hop Option (RFC 2460)

  • Routing (RFC 2460)

  • Fragment (RFC 2460)

  • Destination Options (RFC 2460)

  • Authentication (RFC 4302)

  • Encapsulating Security Payload (RFC 4303)

IPv6 PMD (Path MTU Discovery)

  • For host

    • IP packet size

  • For router

    • Ethernet frame size

In IPv6, router will not take responsibility for packet fragmentation (the host will take it),so if router got packets over MTU size, then drop packet and send "Packet Too Big" with MTU size to host, and then do packet fragment by host.

So, If in the network environment, some network device can not recognize ICMPv6 or PMD, IPv6 will be failed.

ICMPv6

  • Message

    • Error message

      • 用於報告目的節點或中間router傳送封包時遇到的錯誤。ICMPv6錯誤訊息包括Destination Unreachable, Packet Too Big, Time Exceed和Parameter Problem

    • Informational messages

      • 用於提供診斷功能以及其它功能 (如MLD、MLDv2及Neighbor Discovery) 診斷功能包括Echo Request和Echo Reply

IPv4 Netmask and IPv6 Prefix

Last updated

Was this helpful?