「CCNA小黑屋」IPv4地址

IPv4

IP(Internet Protocol),因特网协议(网络协议,网协),口头上说的IP通常指的是IP地址。

IP地址是啥?就是字面意义,地址,听不懂我想你还是去中关村找个师傅学装机修电脑吧。

IPv4,IP协议第4版本。

下面内容均为IPv4版本。

地址格式

IPv4地址共32位比特(bit),通常8个bit为一组(8bit=1byte),4个byte。一般采用十进制表示。

450px-ipv4_address-svg

wikipedia 的图片清晰明了。

地址分类

Wikipedia:

Class(类)Leading
bits(首部比特)
Size of network
number
bit field(网络号位长度(掩码))
Size of rest
bit field(主机号位长度)
Number
of networks(子网个数)
Addresses
per network(每个子网的IP地址个数)
Total addresses
in class(总共IP地址个数)
Start address(起始地址)End address(结束地址)
Class A    0    8    24    128 (27)    16,777,216 (224)    2,147,483,648 (231)0.0.0.0127.255.255.255
Class B    10    16    16    16,384 (214)    65,536 (216)    1,073,741,824 (230)128.0.0.0191.255.255.255
Class C    110    24    8    2,097,152 (221)    256 (28)    536,870,912 (229)192.0.0.0223.255.255.255
Class D (multicast多播)    1110    not defined    not defined    not defined    not defined    268,435,456 (228)224.0.0.0239.255.255.255
Class E (reserved保留)    1111    not defined    not defined    not defined    not defined    268,435,456 (228)240.0.0.0255.255.255.255

 

需要记住每类地址的范围,默认网络号位长度(子网掩码)。其他的东西是可变可计算的。

关于掩码之后再另外开一篇文章。

别死记硬背

Wikipedia:

  • n indicates a bit used for the network ID.(网络位)
  • H indicates a bit used for the host ID.(主机位)
  • X indicates a bit without a specified purpose.(未定义)
Class A
  0.  0.  0.  0 = 00000000.00000000.00000000.00000000
127.255.255.255 = 01111111.11111111.11111111.11111111
                  0nnnnnnn.HHHHHHHH.HHHHHHHH.HHHHHHHH

Class B
128.  0.  0.  0 = 10000000.00000000.00000000.00000000
191.255.255.255 = 10111111.11111111.11111111.11111111
                  10nnnnnn.nnnnnnnn.HHHHHHHH.HHHHHHHH

Class C
192.  0.  0.  0 = 11000000.00000000.00000000.00000000
223.255.255.255 = 11011111.11111111.11111111.11111111
                  110nnnnn.nnnnnnnn.nnnnnnnn.HHHHHHHH

Class D
224.  0.  0.  0 = 11100000.00000000.00000000.00000000
239.255.255.255 = 11101111.11111111.11111111.11111111
                  1110XXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX

Class E
240.  0.  0.  0 = 11110000.00000000.00000000.00000000
255.255.255.255 = 11111111.11111111.11111111.11111111
                  1111XXXX.XXXXXXXX.XXXXXXXX.XXXXXXXX

保留地址

Wikipedia:

Reserved address blocks
RangeDescriptionReference
0.0.0.0/8Current network (only valid as source address)RFC 6890
10.0.0.0/8Private network (A类私有)RFC 1918
100.64.0.0/10Shared Address SpaceRFC 6598
127.0.0.0/8Loopback (本地回环)RFC 6890
169.254.0.0/16Link-localRFC 3927
172.16.0.0/12Private network (B类私有)RFC 1918
192.0.0.0/24IETF Protocol AssignmentsRFC 6890
192.0.2.0/24TEST-NET-1, documentation and examplesRFC 5737
192.88.99.0/24IPv6 to IPv4 relay (includes 2002::/16)RFC 3068
192.168.0.0/16Private network (C类私有)RFC 1918
198.18.0.0/15Network benchmark testsRFC 2544
198.51.100.0/24TEST-NET-2, documentation and examplesRFC 5737
203.0.113.0/24TEST-NET-3, documentation and examplesRFC 5737
224.0.0.0/4IP multicast (former Class D network)RFC 5771
240.0.0.0/4Reserved (former Class E network)RFC 1700
255.255.255.255Broadcast (广播)RFC 919

私有地址

mdzz,上面不是写了么。

Ref

IPv4 https://en.wikipedia.org/wiki/IPv4

Classful network https://en.wikipedia.org/wiki/Classful_network

0 条评论
    发表一条评论