IPV4 address description

Imagine a scenario:
you have two computers A and B, and you need to transfer data from A to B. What should you do?
1 We can use a USB flash drive to copy, that is, copy the data of A to B.
2 We can connect AB with a network cable
. Obviously, two computers use one network cable. What if there are n computers? Use n-1 network cables. Obviously this is very troublesome. So we invented the switch. A batch of computers are plugged into the switch, allowing the switch to perform data transfer. There is a problem here. When we connect with a network cable, I know who to send the data to. But now that the data has reached the switch, how does the switch distinguish who to give the data to?
So we can use IPV4 addresses to distinguish. When sending a data packet, add an IP4 address to the header, such as 192.168.1.1. In fact, it is similar to the address we use to send express delivery.

IPV4: 2^32 ~=4.228 billion
192.168.1.1 (decimal)->

All addresses private address illustrate
Category A 1.0.0.1-126.255.255.254 10.0.0.0-10.255.255.255 large scale network
Category B 128.0.0.1-191.255.255.254 172.16.0.0-172.31.255.255 medium sized network
Category C 192.0.0.1-223.255.255.254 192.168.0.0-192.168.255.255 small scale network
Category D 224.0.0.1-239.255.255.254 multicast network
Category E 240.0.0.1-255.255.255.255 reserved address

Therefore, the number of truly usable IPv4 addresses is about 3.647 billion. There are now more than 7 billion people in the world, which is obviously not enough.
So with NAT-Network Address Translation technology, for example, if you are alone and have a tablet, a mobile phone, and a computer, the IP addresses are 192.168.0.1 192.168.0.2 192.168.0.3 respectively; if you forward through the WAN 5.5.5.5, the switch will do A mapping table that changes the packet header to 5.5.5.5 for forwarding. That is to say, the local IP set only takes effect locally. But after getting the data through the gateway, I don’t know how to give it to the device. Port mapping is used here.

To understand IP, just send it by express delivery. Easy to understand

IPV6 probably means the same thing
Insert image description here

Guess you like

Origin blog.csdn.net/wangbiao9292/article/details/132622375