当前位置:网站首页>Network basics
Network basics
2022-06-30 06:00:00 【shldy1999】
1.MAC Address :
MAC The address is used to identify the network card in the network , Each network card has a unique mac Address ( All network cards in the world mac The address doesn't repeat ).MAC Address by 48 position 2 Base numbers make up , Usually, the 12 position 16 Hexadecimal display , Such as :08:58:56:9e:f4:d9. front 6 position 16 Hexadecimal numbers are generally composed of IEEE Uniformly distributed by the management organization , after 6 position 16 The hexadecimal number shall be allocated by the manufacturer , These two are used to ensure that each mac The address is unique in the world . adopt mac The address can go directly to its corresponding physical address .
2.ip:
What we often say ip Address generally refers to ipv4 Address , It's just like 192.168.1.1 such . This address is provided by 32 position 2 Base numbers make up . For the convenience of display, we divide it into four groups of decimal numbers '.' separate .
ip Addresses can theoretically be assigned 2 Of 32 Secondary address , about 43 Billion . stay ip In the year when the address was proposed, computers were still a rare device , therefore 43 From the point of view of that time, there are already many . However, the development of computer is too crazy , Now it seems 43 Billion is not enough . actually ipv4 The address has been on 2019 Years run out . And this is still using some means to make ip Address can be reused . and 1998 Proposed ipv6 This problem can be solved temporarily .
ipv6 from 128 position 2 Base numbers make up , Theoretically, it can be expressed as much as possible 2 Of 128 This time, that is 43 Billions of 4 Next ip, Now let's look at these ip It's enough , However, with the development of the Internet and the Internet of things, a huge amount of ip Address , But at least it can be used for a while .
ipv6 One of the main reasons why it hasn't been widely used is ipv4 and ipv6 Communication is currently unavailable , And most websites still use ipv4 Address , So we can't give up completely now ipv4. The question mentioned later ip Unless otherwise specified, it means ipv4.
3.ip and mac The difference in address :
mac The address is at OSI Data link layer , and ip On the network layer .ip It's a logical address , It takes effect because of the allocation rules , and mac The address is the physical address , It can take effect directly .ip and mac The mapping of addresses is by arp By agreement .
4.ip Address structure and subnet mask :
As mentioned earlier ip yes 32 position 2 Hexadecimal number , By network ID And host ID form . The Internet ID It can be understood as a network segment , host ID It can be understood as the of a host in the network segment id. commonly ip The first few bits of are network ID, The last few bits are the host ID.
The subnet mask is used to indicate how many of the first bits are hosts ID, Subnet masks are generally expressed in two ways :
Before assumption 24 Bitwise is 192.168.3 It's the Internet ID, after 8 Bitwise is 1 Host computer ID
192.168.3.1
Method 1 :
Set additional subnet mask
255.255.255.0
front 24 Is it 1 It means above ip Before 24 Bit network ID, Last 8 Is it 0 It means above IP After 8 Bit is host ID
Method 2 :
Set up ip The following format shall be adopted for :
192.168.3.1/24
Before presentation 24 Bit is the Internet IDIn this way, the subnet mask can distinguish ip Network of ID And host ID.
5. gateway :
If there are two ip:192.168.1.1/24 and 192.168.3.1/24, So these two ip Not in the same network segment , Unable to communicate with each other , Then a medium is needed for them to communicate . The gateway can handle this function . Join in A towards B Send data but find B Not in your own network segment , Then it will send it to its own gateway , Then send your own gateway to B Gateway for ,B The gateway to B. The gateway ip The address should be set to have routing function ip, In this way, data can be sent to each other .
Generally, the default gateway is used , In a few cases, you need to set the gateway manually .
6. Domain name and DNS The server :
Domain names are such as www.xxx.com Such websites , Most of the time, we can't remember the target website ip, But the domain name can be used to resolve ip Address . Therefore, the request to the domain name will eventually be sent to the resolved ip Address .
DNS The server is used to resolve domain names . Because the machine cannot identify the domain name , Can only identify ip, Therefore, the target cannot be directly accessed through the domain name .DNS The server can resolve the domain name and send the information to the corresponding target .
7. port :
A server can provide many types of services , Such as http,https,ftp etc. . When the client sends a request, if only ip The address cannot distinguish between functions , Therefore, different services can use different ports without distinguishing types .
In general 0-1023 Is a public port , Reserved for some common services . Such as tcp Of 22,http Of 80,https Of 443. Other ports can be left to the user for customization . But ports can also be dynamically allocated , This method is not subject to the above rules .
边栏推荐
- 声网,站在物联网的“土壤”里
- 2022年,谁在推动音视频产业的新拐点?
- Solidy - fallback function - 2 trigger execution modes
- Xi'an Jiaotong 21st autumn "computerized accounting" online homework answer sheet (I) [standard answer]
- Answer sheet for online assignment of "motor and drive" of Xijiao 21 autumn (IV) [standard answer]
- Leetcode56. consolidation interval
- Leetcode search insert location
- 10-【istio】istio Sidecar
- Leader: who can use redis expired monitoring to close orders and get out of here!
- 接口中方法详解
猜你喜欢

Using lazy < t > in C # to realize singleton mode in WPF

Leetcode search insert location

MySQL log management, data backup and recovery

Sword finger offer 22 The penultimate node in the linked list

【板栗糖GIS】global mapper—如何把栅格的高程值赋予给点

We strongly recommend more than a dozen necessary plug-ins for idea development

Lantern Festival | maoqiu technology and everyone "guess riddles and have a good night"

Balanced binary tree judgment of Li Kou 110 -- classic problems

I have been working as a software testing engineer for 5 years, but I was replaced by an intern. How can I improve myself?

Master slave synchronization of MySQL database to realize read-write separation
随机推荐
数据读写:Unity中基于C#脚本实现数据读写功能
Today, Ali came out with 35K. It's really sandpaper that wiped my ass. it showed me my hand
【LeetCode】236. Nearest common ancestor of binary tree
1380. lucky numbers in matrices
What kind of answer has Inspur given in the big AI model landing test?
Leetcode56. consolidation interval
How to print pthread_ t - How to print pthread_ t
Idea of capturing mobile terminal variant combination
Zibll子比主题V6.4.1wordpress 开心版源码下载_破解原版/直接使用/无需教程
At the age of 32, I fell into a middle-aged crisis and finally quit naked...
Solidy - fallback function - 2 trigger execution modes
Solidity - Security - reentrancy attack
[ansible series] fundamentals 02 module debug
MySQL index
Finally someone can make the server so straightforward
Huxiaochun came to fengshu electronics to sign a strategic cooperation agreement with Zoomlion
SparseArray
二十四、输入输出设备模型(串口/键盘/磁盘/打印机/总线/中断控制器/DMA和GPU)
Xijiao 21 autumn "motor and drive" online homework answer sheet (I) [standard answer]
旋转标注工具roLabelImg