# IP地址

IP地址是分配给使用互联网协议的设备网络接口的数字标签，它出现在每个数据包的报头中，以便路由器将数据包转发至目的地，并让接收方识别发送方。所使用的[互联网协议](https://www.edgepedia.org/zh/internet-protocol)版本决定了地址格式：IPv4地址长32位，可提供约43亿个可能的地址；而IPv6地址长128位，可提供\( 2^{128} \)种可能性。<sup>[1](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)</sup><sup> • </sup><sup>[2](https://www.rfc-editor.org/info/rfc8200/)</sup>

| 关键事实 | 详情 |
|---|---|
| IPv4长度 | 32位，约43亿个地址；1983年1月1日部署<sup>[1](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)</sup><sup> • </sup><sup>[3](https://www.itu.int/en/wtpf-13/Documents/backgrounder-wtpf-13-ipv4-ipv6-en.pdf)</sup> |
| IPv6长度 | 128位，\( 2^{128} \)个地址，设计为IPv4的继任者<sup>[2](https://www.rfc-editor.org/info/rfc8200/)</sup> |
| 表示法 | CIDR：一个4字节地址后跟斜杠和0–32的十进制数，表示有效网络位数，例如192.168.99.0/24<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup> |
| 私用地址块 | 10.0.0.0/8、172.16.0.0/12和192.168.0.0/16，由RFC 1918于1996年2月保留，从不在公共互联网上路由<sup>[5](https://www.iana.org/assignments/iana-ipv4-special-registry)</sup><sup> • </sup><sup>[6](https://www.iana.org/help/private-addresses)</sup> |
| 分配层级 | IANA向区域互联网注册管理机构分配/8块，后者再向本地互联网注册管理机构和ISP分配更小的块<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup> |
| IPv4耗尽 | IANA的可用池于2011年1月耗尽，APNIC的于2011年4月耗尽，ARIN的可用池于2015年9月24日耗尽<sup>[7](https://www.internetsociety.org/wp-content/uploads/2017/06/IPv6_report_2017-0606-1.pdf)</sup><sup> • </sup><sup>[8](https://www.arin.net/resources/guide/ipv4/)</sup> |
| IPv6采用率 | 谷歌测量到2026年3月首次有50%的用户通过IPv6访问其服务；APNIC测量约为43%<sup>[9](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> |

## 结构与表示法

IPv4地址是固定长度的32位值，以四个字节的十进制形式书写，由网络部分和本地（主机）部分组成。<sup>[10](https://www.rfc-editor.org/rfc/rfc791.html)</sup>在最初的有类方案中，地址的前导位从三种格式中选择一种：A类为7位网络和24位主机，B类为14位网络和16位主机，C类为21位网络和8位主机。<sup>[10](https://www.rfc-editor.org/rfc/rfc791.html)</sup>这种僵硬的划分并不合适：一个C类网络最多提供254个主机地址，对许多组织来说太小；而一个B类网络提供65,534个，对大多数组织来说太大。<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup>

无类别域间路由（CIDR）记录于RFC 4632，以任意位长的前缀取代了类别划分。在CIDR表示法中，前缀写为一个4字节地址、一个斜杠，以及一个0到32之间的十进制数，表示有效位数；传统的B类网络172.16.0.0变为172.16.0.0/16，C类号码192.168.99.0变为192.168.99.0/24。<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup>一个/32表示单个地址（主机路由），一个/31表示两个，前缀每缩短一位，地址块就翻倍。<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup>前缀应当遵循底层互联网拓扑，以便路由可以聚合，从而保持全球路由表的可扩展性。<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup>

IPv6地址是接口的128位标识符，以IPv6寻址架构定义的冒号分隔十六进制形式书写。IPv6定义了三种地址类型：单播、任播和组播；没有广播地址，其功能已被组播取代。<sup>[11](https://www.rfc-editor.org/info/rfc4291/)</sup>所有IPv6地址都分配给接口而非节点，每个接口必须至少有一个链路本地单播地址。<sup>[11](https://www.rfc-editor.org/info/rfc4291/)</sup>

## 分配与注册系统

未分配的IPv4池由[互联网号码分配局](https://www.edgepedia.org/zh/internet-assigned-numbers-authority)（IANA）管理，它向五个区域互联网注册管理机构（RIR）分配连续的、按位对齐的地址块，每块包含\( 2^{24} \)个地址，即/8前缀。RIR再向本地互联网注册管理机构和互联网服务提供商分配或指派更小的块，后者可以直接使用或再分配给客户；大型ISP可能获得一个/15（\( 2^{17} \)个地址），而较小的ISP获得一个/21（\( 2^{11} \)个地址）。<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup>在该系统中，“分配”意味着将地址块委托给预计会进一步再委托的组织，而“指派”用于其他授予。<sup>[4](https://www.rfc-editor.org/info/rfc4632/)</sup>该层级根植于IANA地址分配职能，这一角色目前由ICANN履行，服务于RIR，RIR再服务于LIR和其他客户。<sup>[12](https://www.rfc-editor.org/info/rfc7020/)</sup>

## 私有、专用和文档地址

三个IPv4块保留给私有网络：10.0.0.0/8、172.16.0.0/12和192.168.0.0/16，均于1996年2月在RFC 1918下分配。<sup>[5](https://www.iana.org/assignments/iana-ipv4-special-registry)</sup>任何组织都可以使用这些地址，无需与IANA或注册管理机构协调，因此许多不连通的网络重复使用相同的地址；这些块绝不应出现在公共互联网上，私有网络之外的路由器，尤其是ISP的路由器，应当过滤关于它们的路由信息。<sup>[6](https://www.iana.org/help/private-addresses)</sup><sup> • </sup><sup>[13](https://www.rfc-editor.org/info/rfc1918/)</sup>网络地址转换（NAT）通过将私有地址和TCP/UDP端口映射到全球唯一的注册地址，将私有领域连接到公共互联网，这使得许多独立的组织可以同时使用相同的私有空间。<sup>[14](https://www.rfc-editor.org/info/rfc3022/)</sup>

IANA维护着一个专用地址注册表，记录每个保留块是否可用作源或目的地、是否可在外部接口之间转发、是否可全球访问。其他条目包括用于环回的127.0.0.0/8、用于链路本地寻址的169.254.0.0/16、用于共享地址空间的100.64.0.0/10、保留用于文档的TEST-NET块192.0.2.0/24、198.51.100.0/24和203.0.113.0/24，以及用于基准测试的198.18.0.0/15。<sup>[5](https://www.iana.org/assignments/iana-ipv4-special-registry)</sup>6to4中继任播块192.88.99.0/24于2001年6月分配，于2015年3月因弃用而终止。<sup>[5](https://www.iana.org/assignments/iana-ipv4-special-registry)</sup>

## 耗尽与向IPv6的过渡

IPv4的32位长度很早就被认识到是一种限制：到1990年，互联网规模每12个月翻一番，如果没有纠正措施，B类池将在1994年耗尽。<sup>[15](https://blog.apnic.net/2025/11/14/how-we-measure-ipv6/)</sup>CIDR和NAT延长了IPv4的使用寿命，但根本性的短缺依然存在。IANA于2011年1月耗尽IPv4地址空间，亚太注册管理机构APNIC在三个月后，即2011年4月耗尽。<sup>[7](https://www.internetsociety.org/wp-content/uploads/2017/06/IPv6_report_2017-0606-1.pdf)</sup>ARIN的可用池于2015年9月24日耗尽；此后ARIN仅按适用范围有限的政策满足请求，例如为向IPv6过渡的组织提供一个/24，并为未满足的请求维护等待列表。<sup>[8](https://www.arin.net/resources/guide/ipv4/)</sup>稀缺性创造了一个市场：公司现在接受IPv4地址作为贷款抵押品。<sup>[1](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)</sup>

IPv6由RFC 8200定义，将地址长度从32位扩大到128位，允许更深的寻址层级、多得多的可寻址节点，以及更简单的自动配置。<sup>[2](https://www.rfc-editor.org/info/rfc8200/)</sup>采用多年来一直缓慢，但已跨过一个象征性门槛：谷歌的测量记录到2026年3月28日首次有50%的用户通过IPv6访问其服务，而APNIC的测量显示全球使用率约为43%。<sup>[9](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>APNIC的区域测量记录到2025年4月所有56个APNIC经济体的IPv6能力均超过50%，APNIC经济体占全球IPv6用户的64%。<sup>[16](https://blog.apnic.net/2025/04/23/ipv6-capability-reaches-50-in-the-asia-pacific-region/)</sup>由于IPv6与IPv4不直接兼容，大多数网络在过渡期间以双栈配置并行运行两者。<sup>[17](https://www.ripe.net/manage-ips-and-asns/ipv6/)</sup><sup> • </sup><sup>[15](https://blog.apnic.net/2025/11/14/how-we-measure-ipv6/)</sup>

## 地理定位与归属

由于注册管理机构记录每个块的持有者，IP地址可以映射到一个组织，并大致映射到一个位置。MaxMind、DB-IP和IP2Location等商业和免费地理定位数据库估计每个地址的位置，但其准确性因城市规模、ISP分配实践和覆盖范围而异。<sup>[18](https://www.itc.ktu.lt/index.php/ITC/article/view/14451)</sup>一项纵向研究发现，2019年同一数据库的连续实例之间，47%的终端用户IP地址移动了超过40公里，这是在比较数据库版本时容易忽视的错误来源。<sup>[19](https://arxiv.org/abs/2107.03988)</sup>私用地址以另一种方式使归属复杂化：看似源自RFC 1918地址的流量来自本地环境、ISP或伪造的源，因为这些地址没有全球意义。<sup>[6](https://www.iana.org/help/private-addresses)</sup>

## 历史

最初的互联网地址由32位组成，前8位标识网络，其余24位标识主机；该方案只能命名256个网络，这一限制早在1978年就被指出。<sup>[20](https://www.apnic.net/about-apnic/organization/history-of-apnic/history-of-the-internet/)</sup>有类A/B/C结构于1981年全面规范，IPv4于1983年1月1日部署。<sup>[10](https://www.rfc-editor.org/rfc/rfc791.html)</sup><sup> • </sup><sup>[3](https://www.itu.int/en/wtpf-13/Documents/backgrounder-wtpf-13-ipv4-ipv6-en.pdf)</sup>地址分配最初由[乔恩·波斯特尔](https://www.edgepedia.org/zh/jon-postel)（Jon Postel）维护，据称记录在一个纸质笔记本中，之后在NSF合同下移交给[SRI International](https://www.edgepedia.org/zh/sri-international)，然后进入基于IANA的注册系统。<sup>[20](https://www.apnic.net/about-apnic/organization/history-of-apnic/history-of-the-internet/)</sup>版本编号跳过了5：[互联网流协议](https://www.edgepedia.org/zh/internet-stream-protocol)，有时称为IPv5，是一种用于实时流传输的实验性32位协议，从未被批准为通用互联网协议，因此业界从IPv4直接转向IPv6。<sup>[1](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)</sup>

## References

1. [IPv5 and the Internet Stream Protocol, Tom's Hardware](https://www.tomshardware.com/networking/ipv5-and-the-internet-stream-protocol-a-data-streaming-experiment-rendered-unnecessary-by-broadband)
2. [RFC 8200: Internet Protocol, Version 6 (IPv6) Specification, RFC Editor](https://www.rfc-editor.org/info/rfc8200/)
3. [World Telecommunication/ICT Policy Forum backgrounder on IPv4/IPv6, ITU](https://www.itu.int/en/wtpf-13/Documents/backgrounder-wtpf-13-ipv4-ipv6-en.pdf)
4. [RFC 4632: Classless Inter-domain Routing (CIDR), RFC Editor](https://www.rfc-editor.org/info/rfc4632/)
5. [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry)
6. [Private-use IP addresses, IANA](https://www.iana.org/help/private-addresses)
7. [Introduction, Internet Society IPv6 Report 2017](https://www.internetsociety.org/wp-content/uploads/2017/06/IPv6_report_2017-0606-1.pdf)
8. [IPv4 Addressing Options, ARIN](https://www.arin.net/resources/guide/ipv4/)
9. [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)
10. [RFC 791: Internet Protocol, RFC Editor](https://www.rfc-editor.org/rfc/rfc791.html)
11. [RFC 4291: IP Version 6 Addressing Architecture, RFC Editor](https://www.rfc-editor.org/info/rfc4291/)
12. [RFC 7020: The Internet Numbers Registry System, RFC Editor](https://www.rfc-editor.org/info/rfc7020/)
13. [RFC 1918: Address Allocation for Private Internets, RFC Editor](https://www.rfc-editor.org/info/rfc1918/)
14. [RFC 3022: Traditional IP Network Address Translator (Traditional NAT), RFC Editor](https://www.rfc-editor.org/info/rfc3022/)
15. [How we measure: IPv6, APNIC Blog (Geoff Huston, 2025)](https://blog.apnic.net/2025/11/14/how-we-measure-ipv6/)
16. [IPv6 capability reaches 50% in the Asia Pacific region, APNIC Blog](https://blog.apnic.net/2025/04/23/ipv6-capability-reaches-50-in-the-asia-pacific-region/)
17. [IPv6, RIPE Network Coordination Centre](https://www.ripe.net/manage-ips-and-asns/ipv6/)
18. [Location Accuracy of Commercial IP Address Geolocation Databases, Information Technology and Control](https://www.itc.ktu.lt/index.php/ITC/article/view/14451)
19. [Longitudinal Study of an IP Geolocation Database, arXiv](https://arxiv.org/abs/2107.03988)
20. [History of the Internet, APNIC](https://www.apnic.net/about-apnic/organization/history-of-apnic/history-of-the-internet/)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/ip-address

English original: https://www.edgepedia.org/ip-address
