当前位置:网站首页>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 .
边栏推荐
- MATLAB小技巧(29)多项式拟合 plotfit
- How can flinksql calculate the difference between a field before and after update when docking with CDC?
- 请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?
- How can gyms improve their competitiveness?
- Bus message bus
- SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
- 服装门店如何盈利?
- oracle如何备份索引
- readonly 只读
- 非父子组件的通信
猜你喜欢
This article introduces you to the characteristics, purposes and basic function examples of static routing
Answer to the first stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第一阶段答案
Config distributed configuration center
Lvs+kept (DR mode) learning notes
Matlab tips (29) polynomial fitting plotfit
MySQL SQL的完整处理流程
一文带你了解静态路由的特点、目的及配置基本功能示例
Brand · consultation standardization
Master-slave replication principle of MySQL
随机推荐
from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
JWT的基础介绍
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
根据IP获取地市
How Oracle backs up indexes
【NOI模拟赛】区域划分(结论,构造)
Brand · consultation standardization
Anr principle and Practice
带你刷(牛客网)C语言百题(第一天)
Learning records on July 4, 2022
【mysqld】Can't create/write to file
Data of all class a scenic spots in China in 2022 (13604)
$refs:组件中获取元素对象或者子组件实例:
剑指offer-高质量的代码
2022/07/04学习记录
MATLAB小技巧(29)多项式拟合 plotfit
Installing redis and windows extension method under win system
MYSQL----导入导出&视图&索引&执行计划
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
华为机试题素数伴侣