# IPv4

**IPv4**（[互联网协议](https://www.edgepedia.org/zh/internet-protocol)第四版，Internet Protocol version 4）是互联网协议的第四个版本。该协议属于网络层，用32位地址为数据报寻址，使其得以在分组交换网络中传输。1981年9月，[南加州大学](https://www.edgepedia.org/zh/university-of-southern-california)信息科学研究所（Information Sciences Institute of the University of Southern California）为受ARPA资助的研究群体制定了RFC 791；1983年，它成为ARPANET的工作协议，至今仍是承载[互联网流量](https://www.edgepedia.org/zh/internet-traffic)的主导协议。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup><sup> • </sup><sup>[2](https://www.tomshardware.com/networking/arpanet-standardized-tcp-ip-on-this-day-in-1983-43-year-old-standard-set-the-foundations-for-todays-internet)</sup>

| 关键事实 | 详情 |
|---|---|
| 规范 | RFC 791，1981年9月；将寻址与分片定义为该协议的两项基本功能<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup> |
| 地址长度 | 每个地址32位，以点分记法写作四个八位组；理论上约43亿个地址，实际约37亿个<sup>[3](https://www.tomshardware.com/networking/ipv6-usage-reaches-historic-50-percent-across-google-services-matching-ipv4-increased-usage-eases-pressure-on-the-ipv4-address-market-as-new-protocol-designed-in-1998-finally-hits-its-stride)</sup> |
| 服务模型 | 无连接数据报服务，无确认、无数据差错控制、无重传、无流量控制；仅有首部校验和<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup> |
| 首部字段 | 生存时间（8位）、协议（8位）、首部校验和（16位）、源地址与目的地址（各32位）<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup> |
| 部署里程碑 | ARPANET于1983年1月1日从NCP切换至TCP/IP；转换于1983年6月完成<sup>[2](https://www.tomshardware.com/networking/arpanet-standardized-tcp-ip-on-this-day-in-1983-43-year-old-standard-set-the-foundations-for-todays-internet)</sup> |
| 地址耗尽 | IANA的未分配地址池于2011年初耗尽；RIPE NCC的地址池于2019年11月25日耗尽<sup>[4](https://blog.apnic.net/2026/01/20/ip-addresses-through-2025/)</sup><sup> • </sup><sup>[5](https://www.ripe.net/manage-ips-and-asns/ipv4/ipv4-run-out/)</sup> |
| 后继协议 | 1998年设计的IPv6提供 \( 2^{128} \) 个地址；2026年3月28日，谷歌首次测得50%的用户通过IPv6访问其服务<sup>[3](https://www.tomshardware.com/networking/ipv6-usage-reaches-historic-50-percent-across-google-services-matching-ipv4-increased-usage-eases-pressure-on-the-ipv4-address-market-as-new-protocol-designed-in-1998-finally-hits-its-stride)</sup> |

## 起源与设计

该协议源自ARPA委托开展的工作——ARPA即美国国防高级研究计划局（Defense Advanced Research Projects Agency）的旧称。罗伯特·卡恩（Robert Kahn）于1972年以项目经理身份加入ARPA的信息处理技术办公室（Information Processing Techniques Office），他邀请斯坦福大学（Stanford University）的温顿·瑟夫（Vinton Cerf）合作，为在ARPANET上传输数据分组设计新的通信协议；成果便是[传输控制协议](https://www.edgepedia.org/zh/transmission-control-protocol)（Transmission Control Protocol）与互联网协议，二者通常合称TCP/IP。<sup>[6](https://www.darpa.mil/about/innovation-timeline/tcp-ip)</sup>第一个完全成熟、可用的标准于1981年以IPv4的形式问世；1983年1月1日，ARPANET的系统架构师将所有主机从网络控制程序（Network Control Program）切换到TCP/IP。到1984年，美国和欧洲已有100多所大学与研究机构使用它联网。<sup>[2](https://www.tomshardware.com/networking/arpanet-standardized-tcp-ip-on-this-day-in-1983-43-year-old-standard-set-the-foundations-for-todays-internet)</sup>

RFC 791描述了该协议的运行模型：每个主机和每个网关中各驻留一个互联网模块，它把每个数据报视为与其他任何数据报都无关的独立实体，并利用首部中携带的地址把数据报发往目的地，这一选择路径的过程称为路由。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup>该协议实现两项基本功能：寻址与分片。对于“小分组”网络而言过大的数据报，可由分片机制加以拆分，每个分片都携带一些首部字段，使数据报能在目的端重组；分片按8个八位组的边界拆分，分片偏移以8个八位组为单位计量。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup>

首部承载四项关键的服务机制。服务类型（Type of Service）字段表示所期望的服务质量；它后来由RFC 1349重新定义，又由RFC 2474改作区分服务（Differentiated Services）字段。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup><sup> • </sup><sup>[7](https://www.rfc-editor.org/info/rfc791/)</sup>生存时间（Time to Live）是数据报寿命的8位上界：每个处理数据报的模块都必须将其至少减一，TTL归零的数据报即被销毁，无法投递的数据报便由此被丢弃。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup>协议（Protocol）字段标明数据部分中的下一层协议；首部校验和（Header Checksum）是将首部中所有16位字作反码加法求和后，再取反码所得的16位值，由于TTL等字段在传输途中会变化，每处理一次首部都要重新计算。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup>

该服务是有意设计成不可靠的。RFC 791明确指出，本协议不提供可靠的通信设施：无论端到端还是逐跳都没有确认，没有数据差错控制，没有重传，也没有流量控制。检测到的错误可通过[互联网控制消息协议](https://www.edgepedia.org/zh/internet-control-message-protocol)（Internet Control Message Protocol，ICMP）报告，该协议在互联网协议模块中实现。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup>可靠性改由TCP等高层协议提供，在协议层次中TCP与UDP同处IP之上。<sup>[1](https://www.rfc-editor.org/rfc/rfc791.html)</sup>

## 寻址与CIDR

每个IPv4地址为32位，即4个八位组。在最初的有类方案中，地址被划分为A、B、C三类网络，由中央的网络信息中心（Network Information Center）基本上按任意顺序分配，并不考虑如何安排号码以便路由聚合。<sup>[8](https://datatracker.ietf.org/doc/html/rfc4632)</sup>到20世纪90年代初，这一设计已难以为继。1991年11月，[互联网工程任务组](https://www.edgepedia.org/zh/internet-engineering-task-force)（Internet Engineering Task Force）成立了ROAD（路由与寻址，Routing and Addressing）小组，该小组于1992年1月开会，指出了三个问题：B类网络地址空间即将耗尽，因为最多容纳254个主机地址的C类对中等规模机构而言太小，而最多可容纳65 534个主机地址的B类又太大；路由表的增长超出了软件、硬件和人员所能管理的程度；以及32位地址空间本身的最终耗尽。<sup>[8](https://datatracker.ietf.org/doc/html/rfc4632)</sup>

应对之策是[无类别域间路由](https://www.edgepedia.org/zh/classless-inter-domain-routing)（Classless Inter-Domain Routing，CIDR），1993年9月以RFC 1519发布，2006年由RFC 4632更新。CIDR废弃了分类体系，改用斜线记法书写的无类层次化前缀，如172.16.0.0/16，斜线后的数字表示有效网络位的位数。前缀可以描述从1个到 \( 2^{32} \) 个地址之间任何2的幂大小的地址块，分配则遵循提供商与用户的关系，以便路由能够聚合。<sup>[8](https://datatracker.ietf.org/doc/html/rfc4632)</sup>CIDR原本只打算作为权宜之计，有效期约三到五年；它远远超出了这一期限，减缓了地址空间的消耗，尽管它并未试图解决耗尽问题本身。<sup>[8](https://datatracker.ietf.org/doc/html/rfc4632)</sup>

## 私有地址与NAT

另有两项机制延长了地址供给。1996年2月，思科系统公司（Cisco Systems）的雅科夫·雷克特（Yakov Rekhter）及其同事发布了当前最佳实践（Best Current Practice）RFC 1918，保留三个IPv4地址块供私有网络内部使用，这些地址从不在公共互联网上路由；主机要在私有用途与公共用途之间转换，须更改其IP地址和DNS记录。<sup>[9](https://www.rfc-editor.org/info/rfc1918/)</sup><sup> • </sup><sup>[10](https://www.iana.org/numbers/documents)</sup>网络地址转换（Network Address Translation）由RFC 1631引入，并由Jasmine Networks的P. Srisuresh和英特尔公司（Intel Corporation）的K. Egevang在RFC 3022（2001年1月）中详加规定；它把众多内部地址及其TCP/UDP端口转换为单一外部地址，使拥有多个节点的家庭或办公室共用同一个公共IPv4地址。<sup>[11](https://www.rfc-editor.org/info/rfc3022/)</sup>NAT公认的缺点在于，它取消了[IP地址](https://www.edgepedia.org/zh/ip-address)的端到端意义，代之以网络中更多的状态。<sup>[11](https://www.rfc-editor.org/info/rfc3022/)</sup>

## 耗尽与地址市场

这些节约措施只是推迟、而未能阻止耗尽。IANA的中央未分配地址池于2011年初耗尽，此后各区域互联网注册管理机构（Regional Internet Registries，RIR）也相继耗尽了自己的地址池。<sup>[4](https://blog.apnic.net/2026/01/20/ip-addresses-through-2025/)</sup>由于供给已经枯竭，IANA的分配统计中不再列出IPv4；回收的地址空间按2012年5月6日批准的全球政策处理，该政策设立“回收IPv4地址池”，当某个RIR持有的地址不足一个/9时启动，按地址池的五分之一作为分配单位发放，向下取整至2的幂边界，最小单位为/24。<sup>[12](https://www.iana.org/numbers/allocations/)</sup><sup> • </sup><sup>[13](https://www.icann.org/resources/pages/allocation-ipv4-post-exhaustion-2012-05-08-en)</sup>

负责欧洲、中东和部分中亚地区的注册管理机构RIPE NCC于2012年用到了最后一个/8区块，即1600万个地址，此后每个本地互联网注册管理机构（Local Internet Registry，LIR）只能申请一个/22的分配，即1024个地址。它在2019年11月25日15:35（UTC+1）完成了最后一次/22分配，如今运行一份等候名单，LIR可从中申请一个/24，取自今后回收的地址。<sup>[5](https://www.ripe.net/manage-ips-and-asns/ipv4/ipv4-run-out/)</sup>

稀缺催生了转让市场。自2012年以来，转让记录显示约有3.42亿个地址易手，相当于20.4个/8，占已分配IPv4地址空间总量（37亿个地址）的9.3%；由于有些地址块被多次转让，这一数字很可能偏高。转让地址的数量在2022年达到峰值，2023年有所下降。<sup>[4](https://blog.apnic.net/2026/01/20/ip-addresses-through-2025/)</sup>人们原本期望转让能把未被通告的地址重新投入使用，但数据并不能给出定论：未通告的已分配地址从2000年的6亿个增至2010年的9亿个，此后十一年间降至约8亿个，2021年初又急剧下降，原因是原分配给美国国防部（US Department of Defense）的地址空间中有七个/8在路由系统中被通告。2024年12月12日，亚马逊（Amazon）运营的各自治系统通告了81 224 704个地址，约合4.8个/8。<sup>[4](https://blog.apnic.net/2026/01/20/ip-addresses-through-2025/)</sup>

## 分片的实践

1981年设计的分片机制已明显老化。2020年9月的当前最佳实践RFC 8900指出，运行经验表明IP分片给互联网通信带来脆弱性，并列举了虚拟重组、基于策略的路由、NAT、无状态防火墙和负载均衡器等方面的问题。在高速率下，16位IP标识字段不足以避免标识符重复，导致经常出现组装错误的分片，而TCP和UDP的校验和无法发现这类损坏。<sup>[14](https://www.rfc-editor.org/rfc/rfc8900.pdf)</sup>该文件并不建议废弃分片，而是建议上层协议在自己的层次上处理分片，尽可能减少对IP分片的依赖。<sup>[14](https://www.rfc-editor.org/rfc/rfc8900.pdf)</sup>

## 今日的IPv4与IPv6

IPv6于1998年设计，作为提供 \( 2^{128} \) 个地址的替代方案，长期被认为难以实施而遭轻视，但其采用率一直在稳步增长。谷歌（Google）的监测显示，2026年3月28日曾有短暂一刻，全球50%的用户通过IPv6访问其服务，这是首次；APNIC的测量显示全球43%的用户在使用该协议，[Cloudflare](https://www.edgepedia.org/zh/cloudflare)测得40%的流量经由IPv6。<sup>[3](https://www.tomshardware.com/networking/ipv6-usage-reaches-historic-50-percent-across-google-services-matching-ipv4-increased-usage-eases-pressure-on-the-ipv4-address-market-as-new-protocol-designed-in-1998-finally-hits-its-stride)</sup>Cloudflare的2025年度回顾统计，双栈请求中有29%经由IPv6，比2024年的28%上升一个百分点；并发现2025年间，被有效RPKI路由覆盖的IPv4地址空间升至48.5%。<sup>[15](https://blog.cloudflare.com/radar-2025-year-in-review/)</sup>版本号5被跳过了：它已被分配给[互联网流协议](https://www.edgepedia.org/zh/internet-stream-protocol)（Internet Stream Protocol），那是一项数据流实验，因宽带的普及而变得没有必要，于是IPv4的后继者取了6号。<sup>[16](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)</sup>

## References

1. [RFC 791: Internet Protocol Specification, USC/Information Sciences Institute, September 1981](https://www.rfc-editor.org/rfc/rfc791.html)
2. [ARPANET standardized TCP/IP on this day in 1983, Tom's Hardware](https://www.tomshardware.com/networking/arpanet-standardized-tcp-ip-on-this-day-in-1983-43-year-old-standard-set-the-foundations-for-todays-internet)
3. [IPv6 usage reaches historic 50% across Google services, Tom's Hardware](https://www.tomshardware.com/networking/ipv6-usage-reaches-historic-50-percent-across-google-services-matching-ipv4-increased-usage-eases-pressure-on-the-ipv4-address-market-as-new-protocol-designed-in-1998-finally-hits-its-stride)
4. [IP addresses through 2025, APNIC Blog](https://blog.apnic.net/2026/01/20/ip-addresses-through-2025/)
5. [What is IPv4 Run Out?, RIPE Network Coordination Centre](https://www.ripe.net/manage-ips-and-asns/ipv4/ipv4-run-out/)
6. [TCP/IP, DARPA Innovation Timeline](https://www.darpa.mil/about/innovation-timeline/tcp-ip)
7. [RFC 791: Internet Protocol, RFC Editor info page](https://www.rfc-editor.org/info/rfc791/)
8. [RFC 4632: Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan, August 2006](https://datatracker.ietf.org/doc/html/rfc4632)
9. [RFC 1918: Address Allocation for Private Internets, February 1996](https://www.rfc-editor.org/info/rfc1918/)
10. [Number-related Documents, IANA](https://www.iana.org/numbers/documents)
11. [RFC 3022: Traditional IP Network Address Translator (Traditional NAT), January 2001](https://www.rfc-editor.org/info/rfc3022/)
12. [RIR Allocation Data, IANA](https://www.iana.org/numbers/allocations/)
13. [Global Policy for Post Exhaustion IPv4 Allocation Mechanisms by the IANA, ICANN, ratified 6 May 2012](https://www.icann.org/resources/pages/allocation-ipv4-post-exhaustion-2012-05-08-en)
14. [RFC 8900: IP Fragmentation Considered Fragile, September 2020](https://www.rfc-editor.org/rfc/rfc8900.pdf)
15. [The 2025 Cloudflare Radar Year in Review, Cloudflare Blog](https://blog.cloudflare.com/radar-2025-year-in-review/)
16. [The industry skipped from IPv4 to IPv6, leaving IPv5 and the Internet Stream Protocol to the annals of history, Tom's Hardware](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › Networking fundamentals and architecture › Routing and addressing › IP protocol versions, variants, and options

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/ipv4

English original: https://www.edgepedia.org/ipv4
