子网划分(Subnet Division)

子网划分IP地址:

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

IPv4是由32位二进制数组成,分成四组,每组八位。例如:11000000.10101000.00000000.00000010

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

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

IPv4地址由两部分组成:

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

网络部分(192.168.1)主机部分(132)

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

公有网络地址是指在互联网上全球唯一的IP地址。

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

A类地址A类地址范围:1.0.0.1——126.255.255.254

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

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

B类地址B类地址范围:128.0.0.1——-191.255.255.254

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

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

C类地址C类地址范围:192.0.0.1——–223.255.255.254

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

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

D类地址D类地址范围:224.0.0.1——-239.255.255.254

用于组播通信的地址

组播:一对列

单播:一对一

广播:有对多

E类地址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(互联网数字分配机构)规定将下列的IP地址保留用作私网地址,不在Internte被分配,可在一个单位或公司内部使用。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/16

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表示

IP地址和子网掩码“与”运算得到的网络地址

0和任何数相与都是0

1和任何数相与都是1

子网数=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

根据IP地址的类型判断n的值

A类地址:子网掩码-8

B类地址:子网掩码-16

C类地址:子网掩码-24

————————

Subnet partition IP address:

IPv4 is composed of 2-bit binary numbers, generally expressed in dotted decimal system

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

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

IPv6 consists of 128 bits, generally separated by colons and represented in hexadecimal

The IPv4 address consists of two parts:

Network host 192.168.1.132

Network part (192.168.1) host part (132)

IPv4 private network address and public network address

Public network address refers to the only IP address in the world on the Internet.

Classification of IP addresses IP addresses are divided into five categories: a B C D E

Class a address class a address range: 1.0.0.1 —— 126.255.255.254

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

(bounded) the default subnet mask is / 8, i.e. 255.0.0.0

Class B address class B address range: 128.0.0.1 ——- 191.255.255.254

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

(bounded) the default subnet mask is / 16, i.e. 255.255.0.0

Class C address class C address range: 192.0.0.1 ——– 223.255.255.254

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

(bounded) the default subnet mask is / 24, i.e. 255.255.255.0

Class D address class D address range: 224.0.0.1 ——- 239.255.255.254

Address for multicast communication

Multicast: a pair of columns

Unicast: one to one

Broadcast: have to many

Class E address class E address range: 240.0.0.1 —— 255.255.255.254

Reserved address for scientific research

All IP addresses starting with 127 represent the local machine (except the broadcast address 127.255.255.255), and 127.0.0.1 is the local loopback address 169.254.0.0 ——– 169.254.255.255   Address assigned when DHCP service fails

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

Class a address: 10.0.0.0 ——– 10.255.255.255      10.0.0.0/8

Class B address: 172.16.0.0 —— 172.31.255.255       172.16.0.0/16

Class C address: 192.168.0.0 ——- 192.168.255.255       192.168.0.0/16

Subnet Division

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 mask has 32 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

The network address obtained by the and operation of IP address and subnet mask

The sum of 0 and any number is 0

The sum of 1 and any number is 1

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

Judge the value of n according to the type of IP address

Class a address: subnet mask – 8

Class B address: subnet mask – 16

Class C address: subnet mask – 24