IPv4和IPv6的地址格式区别?

IPv4和IPv6格式对比

IPv4的个数  4,294,967,296 (也就是 2^32).

IPv4和IPv6的地址格式区别?
IPv4地址格式

IPv6的个数 2^128 ,很多

IPv4和IPv6的地址格式区别?
IPv6地址格式

下面来个表格对比

Point of comparisonIPv4IPv6
Size of IP address32-bit (4 bytes)128-bit (16 bytes)
Number of available IP addresses4.3 billion (must reuse and mask addresses)340 undecillion (every device can have a unique address)
IP address notationDecimal address, 4 fields (octets) separated by dots (.)Alphanumeric address, 8 fields (hextets or quartets) separated by colons (:)
Main selling pointWidely supported and easy to useVirtually unlimited number of IP addresses
IP address lifetimeNot an applicable conceptTwo lifetimes: preferred and valid (preferred lifetime is always smaller or equal to valid)
Address prefixSometimes 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)
ConfigurationDHCP or manual configurationStateless address auto-configuration (via Internet Control Message Protocol version 6 (ICMPv6) or DHCPv6)
Number of header fields12 (length of 20-60 bytes)8 (fixed length of 40 bytes)
Checksum in headerYesNo
Types of addressesUnicast, broadcast, and multicastUnicast, multicast, and anycast
Number of classesClass A to ENo classes
Address maskingUsedNot used
VLSM (Variable Length Subnet Mask) supportYesNo
How to pingping [insert IP address]ping6 [insert IP address]
Starting and stoppingUse the STRTCP or ENDTCP command to start or end IPv4Specify YES on the STRIP6 parameter of the STRTCP command to start (the ENDTCP command ends IPv6)
Packet sizeThe minimum packet size is 576 bytesThe minimum packet size is 1208 bytes
Packet fragmentationPerformed by routers and sending nodesPerformed by the sending node only
Routing Information Protocol (RIP)Supported by the routed daemonRIP does not support IPv6 (uses static routes for network functions)
Simple Network Management Protocol (SNMP)YesNo
IPSec (Internet Protocol Security)OptionalIntegrated and mandatory
Built-in end-to-end encryptionNoYes
Quality of Service (QoS)The packet header does not identify packet flow for QoS handlingThe packet header contains Flow Label field that specifies packet flow for QoS handling
DNS recordsPointer (PTR) records, IN-ADDR.ARPA DNS domainPointer (PTR) records, IP6.ARPA DNS domain
IP to MAC resolutionBroadcast ARPMulticast neighbor solicitation
Local subnet group managementInternet Group Management Protocol (IGMP)Multicast Listener Discovery (MLD)
Optional fieldsYesNo (but there are Extension Headers)
Header includes optionsRequiredMoved to IPv6 extension headers
Mobility protocolUses 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
IPv4和IPv6表格对比

为什么 IPv6 优于 IPv4?
在可预见的未来有足够的IP地址。
简化路由器任务(主要是由于使用类似于CIDR的层次结构的 IPv6 地址编码)。
自动配置IP地址分配和设备编号等任务。
更好地与移动网络兼容。
减少路由表的大小,从而提高路由效率。
速度提升高达15%,主要是由于更大的有效负载和允许每个设备都有一个公共IP地址(而不是隐藏在NAT路由器后面)。
内置 IPSec、端到端加密、身份验证和数据完整性功能。