当前位置:网站首页>Network protocol details: IP

Network protocol details: IP

2022-07-27 04:58:00 Gold content of Xiaobai

Catalog

Two kinds of IP Address

Take apart IP Address

1. Static mode

2. Dynamic mode

Network mask (mask)

Find the host number and network number

special IP Address

1. network number

2. Radio number

3. Loopback address

4. Intranet address / Public address

Relationship

Concept map

  Address specially used for intranet

Of the same network IP Address cannot be repeated  

IP The core function of address


You have to ask me what is the most important thing about the network layer , I'll tell you , yes IP.

IP What is the most important thing in ?IP Address

Two kinds of IP Address

IP Address is divided into IPV4 and IPV6, Now the former is used most , So we only talk about the former .

IPV4 It's a 32 Bit unsigned integer , Expressed in decimal dot distribution , such as 192.184.145.56

Take apart IP Address

IP Address is divided into Network number and host number .

We can imagine the network number as the first few digits of our ID card , The network number in the same network is the same

The host number is behind the ID card , Each host is unique

Let's talk about the disassembly method .

1. Static mode

Is not commonly used , Just know there is .

2. Dynamic mode

Dynamic mode will first lead to a concept : Network mask

Network mask (mask)

32 An integer , The front is full of 1, Behind all 0

for example 11111111 11111110 00000000 00000000

It can also be directly expressed in numbers , for example :/21 Express 21 individual 1 , The rest is 0

Find the host number and network number

use IP Address & mask = network number

use IP Address & (~mask) = Host number

for example IP Address :192.168.13.255/24

We can calculate the network number is :

192.168.13.0

The host number is :

0.0.0.255

special IP Address

1. network number

All host numbers are 0 Of IP Will not be assigned to the host , This is called network number

for example IP The address is :192.168.13.193/24 , Its network number is :192.168.13.0

2. Radio number

All host numbers are 1 Of IP Will not be assigned to the host , This is called the broadcast number

for example IP The address is :192.168.13.193/24 , Its network number is :192.168.13.255

3. Loopback address

127 start Of IP Are loopback addresses

The most common ones are :127.0.0.1

4. Intranet address / Public address

Relationship

The intranet address can be accessed internally , You can also visit the public address .

You can't access the intranet address from the external address . You can't just take my money from Alipay with a big Taobao .

Concept map

That's probably what it means

  Because of this , The intranet address cannot be used as a server , Because you can't access outside the network

  Address specially used for intranet

Look at the picture

  

Of the same network IP Address cannot be repeated  

To put it bluntly , Different Intranet ,IP The address can be repeated , It is not allowed in the same intranet .

IP The core function of address

This has already been said in the chapter of understanding the network , We send UDP/TCP When the agreement , Put the machine IP( Carry in advance ) And the target IP(Socket Write well ) send out , these two items. IP Direct connection is a long-term goal , Then we began to look for short-term goals ( Through the routing table maintained inside the host )

ps: Devices working above the network layer have routing tables , The switch did not

 

原网站

版权声明
本文为[Gold content of Xiaobai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207270436469404.html