Constitute ip address

ip network device provides logical address
ipv4 32 bits = 4 bytes
32 are all become the last one that is 0 1 every two possibilities are a total of two possibilities is to multiply the 32-bit 2 probably about 32 ^ th 4300000000
2 ^ 32
IPv6 are 128 bits = 16 bytes
2 ^ 128 ^

Characteristics of IP addresses
globally unique or globally unique call

Indicates the IP address of
192.168.1.250
dotted decimal

IP addresses are divided into two parts: the network and host bits
Network Identification: identify the specific network is the same as the same network segment, may ping the
host ID: identify the specific one of the nodes in a network is specific computer number

Mask:
1) to distinguish between network and host bits, the network is represented by 1 bit, indicates the host with 0.
2) a large ip address into a plurality of smaller sub-networks, in order to reduce wasted address ip

2.0.0.0/8 255.0.0.0
192.168.1.250 / 24

192.168.2.236 192.168.2. 236

The IP mask and performing an AND operation, the result is the network bit
AND operation there is a full 1 0

IP address classification five categories A, B, C, D, E
A Class Address: network number is 8 bits, bit 0 must be 1, the host bits 24 bits, the number of hosts 2 ^ 24
addresses range: 0.0.0.0 ~ 127.255.255.255
number network: 2 ^ 7
Subnet Mask: 255.0.0.0

Class B addresses: the network number is a 16-bit, 2-bit from the left must be 10, the other bits freely changed, the host is 16 bits, the number 2 ^ 16 host
address range: 128.0.0.0 ~ 191.255.255.255
Network Number 2 ^ 14
Subnet Mask: 255.255.0.0

Class C addresses: the network number is 24, 2, 3 from the left bit must be 110, other bits freely changed, the host is eight bits, the number of hosts 2 ^ 8
address range: 192.0.0.0 ~ 223.255.255.255
network number 2 ^ 24
Subnet Mask: 255.255.255.0

Class D addresses: left 1,2,3,4 bit must be 1110, the other bits freely changed
multicast address
Address range: 224.0.0.0 ~ 239.255.255.255

Class E Address: 1,2,3,4,5 bit from the left must be 11110, other random bits change
research use
address ranges: 240 to 247
Here Insert Picture Description
Here Insert Picture Description
network addresses are the same, then it proved to be the same network segment, they want between to communicate, through the "switch"
network address different things, belong to different network segments, you want to communicate between them, need to "router"

Network address (segment number)
used to identify the entire network segment (if NPC)
Host bits are all 0
the broadcast address
for the particular network address for transmitting data to all hosts
whole host 1 bit
host address (available address)
can be assigned to network equipment

192.168.1.3/24 网络地址: 192.168.1.0 广播地址:192.168.1.255
192.168.1.0/24网段中可用地址:192.168.1.1~192.168.1.254

1.最大为255
2.每个网段中第一个地址为网络号 192.168.1.0/24 (主机位全为0)
3.每个网段中最后一个地址为广播地址 192.168.1.255/24 (主机位全为1)

特殊地址:
1、127.0.0.1~127.255.255.255 回环地址 测试地址:检验网卡TCP/IP协议是否正常
2、255.255.255.255 全网广播
3、x.x.x.255 C类地址主机位全为1,代表该网段的广播地址
4、0.0.0.0 任何网络

私有地址:不能直接连接到公共的internet上
A:10.0.0.0~10.255.255.255
B:172.16.0.0~172.31.255.255
C:192.168.0.0~192.168.255.255

网段地址:ip与掩码做于运算

判断两个ip是否为同网段? 不是
192.168.1.3/24 网络地址: 192.168.1.0 广播地址:192.168.1.255

128 64 32 16 8 4 2 1
168-128=40
40-32=8
8-8=0
11000000.10101000.00000001.00000011 ==>192.168.1.3
11111111.11111111.11111111.00000000 ==>255.255.255.0 ==>24

11000000.10101000.00000001.00000000 ==>192.168.1.0
192.168.1.0

11000000.10101000.00000001.11111111 ==>192.168.1.255

192.168.3.2/24 网络地址:192.168.3.0 广播地址:192.168.3.255

两者之间想通信通过什么? 路由器

相同网段
172.16.200.100/16==>172.16.0.0
172.16.100.200/16==>172.16.0.0

172.16.200.100/17
10101100.00010000.11001000.01100100 ==>172.16.200.100
11111111.11111111.10000000.00000000 ==>255.255.128.0

10101100.00010000.10000000.00000000 ==>172.16.128.0

172.16.100.200/17
10101100.00010000.01100100.11001000 ==>172.16.100.200
11111111.11111111.10000000.00000000 ==>255.255.128.0

10101100.00010000.00000000.00000000 ==>172.16.0.0

Analyzing valid host (IP) address:
192.168.10.240/24 legitimate
192.168.10.0/24 illegal, the host bits are all 0, the network address
192.168.10.255/24 not legal, the broadcast address, bits are all host. 1
255.255.255.255 no legal, network and host bits are all 1, the whole network broadcast address
127.xxx/8 illegal, local loopback address
172.16.3.5/24 legitimate 172.16.3.255 172.16.3.0
192.168.5.240/32 legitimate
224.10.10.1 illegal, group multicast address
300.2.4.200/24 illegal

Guess you like

Origin blog.csdn.net/weixin_45177186/article/details/91415410