当前位置:网站首页>What is the IP address

What is the IP address

2022-06-25 06:17:00 Programmer community

In use TCP/IP When communication , use IP Address identification hosts and routers . In order to ensure normal communication , It's necessary to configure each device with the right IP Address , Otherwise, normal communication cannot be realized at all

IPv4

IPv4 Address by 32 Bit composition , common 4 Bytes , People are more used to decimal system , So we convert every byte to decimal , The middle is separated by dots , such as 192.168.1.1

IP What is the address illustration

IPv4 How many addresses can be assigned ?2^32 = 4 294 967 296, almost 43 One hundred million , That is to say, at most 43 Hundreds of millions of devices are connected to the network at the same time , And in the 2019 year IPv4 The address is officially exhausted

IP What is the address illustration 1

IP The address is not configured according to the host , In other words, a host can not only have one IP Address , But according to the network card settings IP Address , however , The network card can also set multiple IP, You can also not configure IP Address . It's like a router , There are usually two network cards

Then your computer's IP How is the address assigned ? Is it distributed at will ? There are so many devices in the global network ,IP The address is the unique identification of the device , It's impossible to configure it at will , What should I do if I repeat

IP The address is identified by the network ( network address ) And host identification ( The host address ) form

The network identifier is the unique identifier for each segment of the data link , let me put it another way , The network ID is the only network address of a LAN , Every LAN has its own network segment

The host ID is the unique ID of the host in the same LAN , A host in the same LAN cannot have the same host address

thus :

A mainframe's IP The address is made up of a unique network address + A unique host address makes up a unique IP Address , To ensure the IP The uniqueness of address in global network

How to divide network address and host address ? There are two ways

  • 192.168.1.1/24, The network address has 24 A bit

IP What is the address illustration 2

192.168.1 It's the Internet address ,1 It's the host address

  • 192.168.1.1,Netmask 255.255.255.0, Use subnet mask netmask Express

IP What is the address illustration 3

The subnet mask is IP All the network address bits of the address are set to 1, The host address bits are all set to 0, Then each 8 A group of bits , In decimal

IPv4 There are four types of addresses :

IP What is the address illustration 4

  • A Class address

The first is 0, front 8 Bit is the network address , The network address range is 0000 0000 - 0111 1111, Distributable A Class segment is 0.0.0.0 - 127.0.0.0

  • B Class address

The first two are 0, front 16 Bit is the network address , Distributable B Class segment is 128.0.0.1 - 191.255.0.0

  • C Class address

The first three are 110, front 24 Bit is the network address , Distributable C Class segment is 192.168.0.0 - 239.255.255.0

  • D Class address

The top four are 1110, All 32 Bits are all network addresses , Distributable D Class segment is 224.0.0.0 - 239.255.255.255,D Class address has no host address , Suitable for multicast address ( Why? ?)

If you want to configure your host network card IPv4 Address , The host address can't be repeated , It can't be all 0 Or all of them 1, Because it's all 0 Only in IP Use when the address is unknown , And the whole 1 Indicates the broadcast address

although IPv4 The addresses are classified , But it can't be so rigid in practice , It needs to be set flexibly according to the number of hosts in the LAN

such as C The number of hosts with class addresses is 255, And I want to build a LAN within the host only 50 individual , Then I use C Class addresses waste resources , What shall I do? ? Network address and host address can be flexibly divided , To meet the actual use . By what ? Subnet mask

For example, there are at most 50 Console host , use C Class address waste , The host address bit can be shortened appropriately , from C Class 8 individual bit Shorten to 6 individual ,2^6 = 63, At most configurable 63 Host computer , The corresponding network address bit is 26 position

IP What is the address illustration 5

The subnet mask is 255.255.255.192

IPv6

In order to solve IPv4 The problem of address exhaustion ,IPv6 emerge as the times require

IPv6 yes IPv4 Of 4 times , from 128 It's made up of two bits , common 16 Bytes , and IPv4 use 10 Hexadecimal means different ,IPv6 per 16 Bit is a group. , use 16 Hexadecimal said , The middle is separated by a colon , such as :DEAF:2780:3A4E:0189:C3D5:F728:6B23:1011

that IPv6 How many addresses can be assigned ?2^128, It's said that one can be assigned to every grain of sand on the earth IPv6 The address of

IPv6 No, ABCD Class address , There is no subnet mask , Its addressing method is not ARP Addressing , Those who are interested can understand by themselves , I don't know much


原网站

版权声明
本文为[Programmer community]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201245251409.html