补充一点子网划分的知识(Supplement the knowledge of sub network division)

子网划分

IP地址:

IPv4由32位二进制数组成,一般用点分十进制来表示

IPv4由32位二进制数组成,分成四组,每组八位。例如:11000000,10101000,00000000,00000010

为了便于配置通常表示成点分十进制形式例如:192.168.0.2  255.255.255.0

Pv6由128位组成,一般用冒号分隔,十六进制表示

IPv4地址由两部分组成:

网络部分( NETWORK)  主机部分(HOST) 192.168.1.132

网络部分(192.168.1) 主机部分(132)  192.168.1.0(网络地址) 192.168.1.255(广播)

IPv4私有网络地址和公有网络地址

公有网络地址(以下简称公网地址)是指在互联网上全球唯一的地址。2019年11月26日,是类互联时代值得纪念的一天,全球近43亿个Pv4地址已正式耗尽。

IP地址分为A、B、C、D、E五类

A类地址范围:1.0.0.1~126.255.255.254

A类地址=网络部分+主机部分+主机部分+主机部分

(有类边界)默认子掩码为/8,即255.0.0.0

B类地址范围:128.0.01~~191.255.255.254

B类地址=网络部分+网络部分+主机部分+主机部分

(有类边界)默认子网掩码为/16,即255.255.0.0

C类地址范围:192.0.0.1~~223.255.255.254

C类地址=网络部分+网络部分+网络部分+主机部分

(有类边界)默认子网掩码为/24,即255.255.255.0

D类地址范围:224.0.0.1~239.255.255.254

用于组播通信的地址

组播:一对列

单播:一对

广播:一对多

E类地址范围:240.0.0.1~255.255.255.254

用于科学研究的保留地止

以127开头的IP地址都代表本机(广播地址127.255.255.255除外),

127.0.0.1为本机回环地址

169.254.0.0~169.254.255.255  DHCP服务失效时配的地址

私有网络地址(以下简称私网地址)是指内部网络或主机的IP地址,IANA(互联网数字分配机构)规定将下列的P地址保留用作私网地址,不在 Internet上被分配,可在一个单位或公司内部使用。RFC1918中规定私有地址如下:

A类私有地址:10.0.0.0~10.255.255.255      10.0.0.0/8

B类私有地址:172.16.0.0~172.31.255.255    172.16.0.0/12

c类私有地址:192.168.0.0~192.168.255.255  192.168.0.0/16

网段组成:网络地址,可用IP,广播地址

列:192.168.1.189/24

网络号:192.168.1.0

可用IP:192.168.1.1~192.168.1.254

广播地址:192.168.1.255

子网拖码有32个二进制位

对应IP地址的网络部分用1表示

对应IP地址的主机部分用0表示

子网数=2^n,其中n为子网部分位数,例:/26,n=26-24

主机数(可用IP)=2^N-2,其中N为主机部分位数:N=32-26

192.168.1.0  /24   /25   /26   /27   /28   /29   /30   /31   /32

子网掩码    0    128   192   224   240  248   252   254   255

子网个数    1     2     4     8    16    32   64    128   256

IP数量     256   128   64    32    16    8    4      2     1         

可用IP     254   126   62    30    14    6    2            1

192.168.1.100/24表示为一个固定IP       255.255.255.0

根据P地址的类型来判断n的值:

A类地址:子网掩码-8

B类地址:子网掩码-16

C类地址:子网掩码-24

N=32-子网掩码

————————

Subnet Division

IP address:

IPv4 consists of 32-bit binary numbers, which are generally expressed in dotted decimal system

IPv4 consists of 32-bit binary numbers, which are divided into four groups with eight bits in each group. For example: 11000000100100000000000000000 10

For ease of configuration, it is usually expressed in dotted decimal form, such as 192.168.0.2    255.255.255.0

Pv6 consists of 128 bits, generally separated by colons and expressed in hexadecimal

The IPv4 address consists of two parts:

Network part (Network)    Host part   192.168.1.132

Network part (192.168.1)   Host part (132)    192.168.1.0 (network address)   192.168.1.255 (broadcast)

IPv4 private network address and public network address

Public network address (hereinafter referred to as public network address) refers to the only address in the world on the Internet. November 26, 2019 is a memorable day in the era of class interconnection. Nearly 4.3 billion pv4 addresses in the world have been officially exhausted.

IP addresses are divided into five categories: A, B, C, D and E

Class a address range: 1.0.0.1 ~ 126.255.255.254

Class a address = network part + host part + host part + host part

(with class boundary) the default submask is / 8, that is 255.0.0.0

Class B address range: 128.0.01 ~ 191.255.255.254

Class B address = network part + network part + host part + host part

(with class boundary) the default subnet mask is / 16, i.e. 255.255.0.0

Class C address range: 192.0.0.1 ~ 223.255.255.254

Class C address = network part + network part + network part + host part

(with class boundary) the default subnet mask is / 24, that is, 255.255.255.0

Class D address range: 224.0.0.1 ~ 239.255.255.254

Address for multicast communication

Multicast: a pair of columns

Unicast: one pair

Broadcast: one to many

Class E address range: 240.0.0.1 ~ 255.255.255.254

Reserved land for scientific research

All IP addresses starting with 127 represent the local machine (except the broadcast address 127.255.255.255),

127.0.0.1 is the local loopback address

169.254.0.0~169.254.255.255    Address configured when DHCP service fails

Private network address (hereinafter referred to as private network address) refers to the IP address of the internal network or host. IANA (Internet digital distribution organization) stipulates that the following p address shall be reserved as private network address, not allocated on the Internet, and can be used within a unit or company. The private addresses specified in rfc1918 are as follows:

Class a private address: 10.0.0.0 ~ 10.255.255.255        10.0.0.0/8

Class B private address: 172.16.0.0 ~ 172.31.255.255      172.16.0.0/12

Class C private address: 192.168.0.0 ~ 192.168.255.255    192.168.0.0/16

Network segment composition: network address, available IP and broadcast address

Column: 192.168.1.189/24

Network number: 192.168.1.0

Available IP: 192.168.1.1 ~ 192.168.1.254

Broadcast address: 192.168.1.255

The subnet drag code has 32 binary bits

The network part corresponding to the IP address is represented by 1

The host part of the corresponding IP address is represented by 0

Number of subnets = 2 ^ n, where n is the number of subnets, for example: / 26, n = 26-24

Number of hosts (available IP) = 2 ^ n-2, where n is the number of hosts: n = 32-26

192.168.1.0   / twenty-four    / twenty-five   / twenty-six    / twenty-seven    / twenty-eight    / twenty-nine    / thirty    / thirty-one    / thirty-two

Subnet mask      0     one hundred and twenty-eight     one hundred and ninety-two    two hundred and twenty-four     two hundred and forty    two hundred and forty-eight     two hundred and fifty-two     two hundred and fifty-four     two hundred and fifty-five

Number of subnets      one      two       four       eight      sixteen      thirty-two    sixty-four     one hundred and twenty-eight     two hundred and fifty-six

Number of IP       two hundred and fifty-six     one hundred and twenty-eight     sixty-four      thirty-two      sixteen      eight     four       two      one

Available IP       two hundred and fifty-four     one hundred and twenty-six     sixty-two     thirty     fourteen     six     two             one

192.168.1.100/24 represents a fixed IP address         255.255.255.0

Judge the value of n according to the type of p address:

Class a address: subnet mask – 8

Class B address: subnet mask – 16

Class C address: subnet mask – 24

N = 32 subnet mask