当前位置:网站首页>IP address
IP address
2022-07-07 07:06:00 【Aegean child】
Point to point communication between computers
Under normal circumstances , You and I both have a computer , But what a computer can do is limited , We may be between two computers in order to do more things , We need data interaction , We can go through U Disk as medium , Data exchange , But this efficiency is too slow , therefore , In order to improve efficiency , Someone came up with a good idea , We plug a data cable between the two computers , Data interaction through data lines

With this data cable , Or network cable , The two computers can interact with each other , however , What if there are more than two computers ? With multiple computers , It's time to pull the cable again ?

You found out , If every machine wants to communicate with other machines , Then you have to establish a connection with that machine , With more and more machines , How complicated the number of network cables will be , This is definitely unacceptable .
Switch
In order to solve the complexity of point-to-point communication between computers , The concept of switch we introduced

With the switch , The switch distributes the data from each machine . At this time, there are new problems , On point-to-point data connections , If two computers want to interact with each other , Just find the data line of the corresponding host from many data lines , But now it's all sent to the switch . How should the switch distribute data ? It's like a package that should not have a clear address , Switches are like express companies , You gave it to the express company , No address , Then the express company doesn't know who to send the package to . As long as the express company has the express address, it knows where to send the package , The same goes for switches , We can assign one to each machine IP Address .

With IP After the address , Just add the corresponding host to the sent packet IP Address , Then the switch can be based on the IP The address sends the data to the corresponding machine .
LAN to WAN
Through the switch , We can let the computer connected to the switch exchange data , If these machines are your school computers , Your school wants to cooperate with the school next door , We need each other's computers to exchange data , It happens that the computer next door also uses the switch for data exchange , So we just connect the switches of the two schools , Then the computers on both sides can access each other .

By connecting two switches , So that computers on both sides can exchange data , If you want to add more LAN later , That's connecting each other's switches

With more and more switches in LAN , Switches are also as complex as point-to-point connections between computers before , So a new switch is put between the switches .

this is it , More and more switches , Know that it covers the whole world , You just need to enter any of these nodes , You can access any design in the world that is also connected to the network , This constitutes the wan .
You can understand it as : Wan is the combination of countless LANs . Obviously , Building these networks must require a lot of money , The companies that build these networks are called ISP Internet service provider , The familiar mobile , Telecom and China Unicom are ISP supplier .
IPV4
Every machine on the Internet needs one IP Address to access each other , Then first we have to talk IP The composition of the address .IP The address is generally IPV4 Of IP Address , It is from 32 A composition , that IP The combination of addresses that can be used is 2 Of 32 Power , Greater than or equal to 42.28 Billion .

To facilitate memory and input , Will each 8 A binary is divided into a group , common 4 Group , In the transformation of 10 Base number
![]()
meanwhile , Will also be right IP Address classification , Some addresses for special purposes

The last really available address may not yet 42 One hundred million . It is known that there are 70 More than 100 million people , Even if not everyone will access the Internet , But many people don't have more than one device , One person may have multiple mobile phones , Computer, etc. , If you want to assign one to each device IP, What about this 36 Billions of IP Is the address enough ? It's not enough .
NAT Network address translation
In order to solve IP We used a new technology ,NAT Network address translation . Suppose there are five computers , their IP The address is 192.168.0.1----192.168.0.5, They connected to the same switch , Or router , The wide area network of the switch they are connected to IP yes 6.6.6.6

If these five machines are going to one 8.8.8.8 Send data to your server , that NAT Will take the original of these computers IP convert to 6.6.6.6 Of ip towards 8.8.8.8 send data , Realization 5 One for each device IP The effect of . If 8.8.8.8 Many devices are also mounted under the switch , The five servers are based on 8.8.8.8 Sent by this machine , How do you send it to 8.8.8.8 What about the specific equipment attached below ?

Port mapping
To solve the above problems , We introduced a new concept , Port mapping . We can do it in IP Add a port after the address , Pictured

such as 192.168.0.1 and 6.6.6.6 Of 1000 Port binding , The other side 192.168.0.1 and 8.8.8.8 Of 500 Port binding , such , If 6.6.6.6 The next mounted machine wants to access 8.8.8.8 Remove the mounted machine , Just add the corresponding port .
Public network IP And private IP
If you open cmd, Input ipconfig see IP Address

You'll see ip The address is 192.168 At the beginning , Why? , Just mentioned ,ip The address is not enough , But in order for most machines to access the Internet , We usually share a public network with multiple machines ip, You go to Baidu search ip Inquire about .

You can see the public network attached to your current device ip 了 . Now I know why many ip All are 192.168 It's the beginning ? Because it is attached to a small transfer device C Class private ip, This private class IP The public network that depends on the converter IP surf the internet .
Give me an example , Public network IP Is the name of your community , The private network IP It's the floor unit where you live , Assuming that the names of communities across the country are not repeated , According to the name of the community , You can find your approximate location , This is equivalent to according to the public network IP Locate your specific lan , But to know where you are , You also need to know the number of the unit in the community , The number of several units in the community is equivalent to the private network IP, So the private network of many machines IP It's all repetitive .
边栏推荐
- mysql查看bin log 并恢复数据
- ViewModelProvider.of 过时方法解决
- Stack and queue-p79-9
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
- leetcode 509. Fibonacci Number(斐波那契数字)
- How to install swoole under window
- Take you to brush (niuke.com) C language hundred questions (the first day)
- How DHCP router works
- Kotlin之 Databinding 异常
- Maze games based on JS
猜你喜欢

CompletableFuture使用详解

Lvs+kept (DR mode) learning notes

How can brand e-commerce grow against the trend? See the future here!

Composition API 前提

Complete process of MySQL SQL

JDBC database connection pool usage problem

大咖云集|NextArch基金会云开发Meetup来啦

Jetpack Compose 远不止是一个UI框架这么简单~

2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书

The latest trends of data asset management and data security at home and abroad
随机推荐
$parent(获取父组件) 和 $root(获取根组件)
mysql查看bin log 并恢复数据
Unity3d learning notes
多学科融合
品牌·咨询标准化
[Luogu p1971] rabbit and egg game (bipartite game)
Initial experience of addresssanitizer Technology
How can clothing stores make profits?
Config分布式配置中心
Prime partner of Huawei machine test questions
CompletableFuture使用详解
【mysqld】Can't create/write to file
leetcode 509. Fibonacci Number(斐波那契数字)
【JDBC以及内部类的讲解】
Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park
Installing redis and windows extension method under win system
.net core 访问不常见的静态文件类型(MIME 类型)
MySQL的主从复制原理
Test of transform parameters of impdp
.net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context