IPv4的个数 4,294,967,296 (也就是 2^32).
IPv6的个数 2^128 ,很多
下面来个表格对比
Point of comparison | IPv4 | IPv6 |
---|---|---|
Size of IP address | 32-bit (4 bytes) | 128-bit (16 bytes) |
Number of available IP addresses | 4.3 billion (must reuse and mask addresses) | 340 undecillion (every device can have a unique address) |
IP address notation | Decimal address, 4 fields (octets) separated by dots (.) | Alphanumeric address, 8 fields (hextets or quartets) separated by colons (:) |
Main selling point | Widely supported and easy to use | Virtually unlimited number of IP addresses |
IP address lifetime | Not an applicable concept | Two lifetimes: preferred and valid (preferred lifetime is always smaller or equal to valid) |
Address prefix | Sometimes used to designate network from host portion (written as /nn suffix on the presentation form of address) | Used to designate the subnet prefix of an address (written as /nnn) |
Configuration | DHCP or manual configuration | Stateless address auto-configuration (via Internet Control Message Protocol version 6 (ICMPv6) or DHCPv6) |
Number of header fields | 12 (length of 20-60 bytes) | 8 (fixed length of 40 bytes) |
Checksum in header | Yes | No |
Types of addresses | Unicast, broadcast, and multicast | Unicast, multicast, and anycast |
Number of classes | Class A to E | No classes |
Address masking | Used | Not used |
VLSM (Variable Length Subnet Mask) support | Yes | No |
How to ping | ping [insert IP address] | ping6 [insert IP address] |
Starting and stopping | Use the STRTCP or ENDTCP command to start or end IPv4 | Specify YES on the STRIP6 parameter of the STRTCP command to start (the ENDTCP command ends IPv6) |
Packet size | The minimum packet size is 576 bytes | The minimum packet size is 1208 bytes |
Packet fragmentation | Performed by routers and sending nodes | Performed by the sending node only |
Routing Information Protocol (RIP) | Supported by the routed daemon | RIP does not support IPv6 (uses static routes for network functions) |
Simple Network Management Protocol (SNMP) | Yes | No |
IPSec (Internet Protocol Security) | Optional | Integrated and mandatory |
Built-in end-to-end encryption | No | Yes |
Quality of Service (QoS) | The packet header does not identify packet flow for QoS handling | The packet header contains Flow Label field that specifies packet flow for QoS handling |
DNS records | Pointer (PTR) records, IN-ADDR.ARPA DNS domain | Pointer (PTR) records, IP6.ARPA DNS domain |
IP to MAC resolution | Broadcast ARP | Multicast neighbor solicitation |
Local subnet group management | Internet Group Management Protocol (IGMP) | Multicast Listener Discovery (MLD) |
Optional fields | Yes | No (but there are Extension Headers) |
Header includes options | Required | Moved to IPv6 extension headers |
Mobility protocol | Uses Mobile IPv4 (MIPv4) | Uses Mobile IPv6 (faster handover, routing, and hierarchical mobility) |
Address allocation | Initially allocated by network class, now relies on smaller allocations of Classless Inter-Domain Routing (CIDR) | Allocation is still in early stages, but the address space is large enough to give everyone a /48 subnet prefix length |
为什么 IPv6 优于 IPv4?
在可预见的未来有足够的IP地址。
简化路由器任务(主要是由于使用类似于CIDR的层次结构的 IPv6 地址编码)。
自动配置IP地址分配和设备编号等任务。
更好地与移动网络兼容。
减少路由表的大小,从而提高路由效率。
速度提升高达15%,主要是由于更大的有效负载和允许每个设备都有一个公共IP地址(而不是隐藏在NAT路由器后面)。
内置 IPSec、端到端加密、身份验证和数据完整性功能。