当前位置: 首页 > news >正文

[network] IPv4 vs. IPv6 address pool

 

===============

let’s expand on that precisely.


1. IPv4 address space size

Each IPv4 address is 32 bits long.
Therefore, the total number of possible combinations is:

[
2^{32} = 4,294,967,296
]

That’s roughly 4.29 billion unique addresses.


2. Why we don’t actually have 4.29 billion usable public addresses

A large portion of that space is reserved for special uses.
Examples:

RangePurposeNotes
0.0.0.0/8 “This network” Used in routing contexts.
10.0.0.0/8 Private networks (RFC 1918) Not publicly routable.
127.0.0.0/8 Loopback 127.0.0.1 = localhost.
169.254.0.0/16 Link-local (APIPA) Used when no DHCP server.
172.16.0.0/12 Private networks Not routable.
192.168.0.0/16 Private networks Not routable.
224.0.0.0/4 Multicast Not unicast.
240.0.0.0/4 Reserved for future use Historically unused.
255.255.255.255 Broadcast Special all-hosts address.

After subtracting all of those, the number of publicly routable IPv4 addresses is closer to ~3.7 billion.


3. The consequence: IPv4 exhaustion

Because of this limited pool, IPv4 addresses began running out.
Regional Internet Registries (RIRs) officially exhausted their free pools between 2011 and 2019.
The world has since relied on:

  • NAT (Network Address Translation) — allowing thousands of devices to share a single public address.

  • CIDR (Classless Inter-Domain Routing) — to allocate space more efficiently.

  • IPv6 — the successor protocol, with 2¹²⁸ addresses, effectively inexhaustible for the foreseeable future.


4. Quick comparison

ProtocolAddress bitsTotal addressesExample
IPv4 32 4,294,967,296 192.168.1.100
IPv6 128 340,282,366,920,938,463,463,374,607,431,768,211,456 2001:0db8::1

IPv6 has about 7.9×10²⁸ times as many addresses as IPv4.


So yes — (2^{32}) defines the theoretical IPv4 address space, but in practice, only a fraction of that is globally usable.

 

 

==================================

 

let’s write out 2001:0db8::1 in binary form step by step.


1. IPv6 address structure

An IPv6 address has 128 bits, written as 8 groups of 16-bit hexadecimal blocks, separated by colons:

2001:0db8::1

The :: means a run of zero blocks has been compressed.
Let’s first expand it fully.


2. Expand the compressed form

2001:0db8::1 expands to:

2001:0db8:0000:0000:0000:0000:0000:0001

Now we have 8 groups (each 16 bits = 4 hex digits).


3. Convert each group to binary

Each hexadecimal digit → 4 binary bits.

GroupHexBinary
1 2001 0010 0000 0000 0001
2 0db8 0000 1101 1011 1000
3 0000 0000 0000 0000 0000
4 0000 0000 0000 0000 0000
5 0000 0000 0000 0000 0000
6 0000 0000 0000 0000 0000
7 0000 0000 0000 0000 0000
8 0001 0000 0000 0000 0001

4. Concatenate them all

The full 128-bit binary form is:

0010000000000001 0000110110111000 0000000000000000 0000000000000000
0000000000000000 0000000000000000 0000000000000000 0000000000000001

Or, without spaces:

00100000000000010000110110111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

5. Verification

  • 8 × 16 bits = 128 bits

  • Each group corresponds exactly to its hex block ✅

So in binary,
2001:0db8::1 = 0010 0000 0000 0001 0000 1101 1011 1000 … (rest all zero) … 0000 0000 0000 0001.

 

http://www.jsqmd.com/news/38731/

相关文章:

  • [Network] subnet mask
  • flask: 用flask-cors解决跨域问题
  • Linux小课堂: 用户管理与权限控制机制详解 - 实践
  • 分享一个MySQL万能备份脚本
  • 实用指南:构建AI智能体:六十五、模型智能训练控制:早停机制在深度学习中的应用解析
  • 解码LVGL 布局与多界面编程
  • 【为美好CTF献上祝福】浅学花指令
  • FreeSql自动分表
  • 20251112
  • 能耗在线监测体系:革新能源管理模式,助推企业节能减排
  • SAP SQL 加法不生效问题
  • 2025/11/14
  • 一份用pyhon生成word/wps蓝墨云班题库的代码
  • 公开仓库中的哈希值暴露安全风险分析
  • Kibana基本命令操作
  • linux版本微信打开关闭快捷键
  • Linux shell映射表(变量的变量)
  • 详细介绍:显卡算力过高导致PyTorch不兼容的救赎指南
  • 2025/11/13
  • Linux《网络基础》 - 教程
  • 《程序员修炼之道》阅读笔记4
  • 记一次 .NET 某医联体管理系统 崩溃分析
  • 如何构建可信智能 Data Agent?推荐 Aloudata Agent 分析决策智能体
  • #题解#牛客:牛牛的构造#DP#构造#
  • Machine Learning - SVM Part 2: The Radial Kernel
  • 2025-11-12 ZYZ28-NOIP-aoao round 2 hetao1733837的record
  • 2025/11/12
  • redis stream介绍
  • Java 线性表、栈、队列和优先队列
  • 2025/11/11