当前位置:网站首页>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 .
边栏推荐
- STM32F103 series controlled OLED IIC 4-pin
- 强烈推荐十几款IDEA开发必备的插件
- 雲服務器部署 Web 項目
- Strlen and sizeof, array length and string length, don't be silly
- [openstack]-01- basic introduction
- AI大模型落地大考,浪潮交出了怎样的答卷?
- MySQL数据库用户管理
- 如何制作CSR(Certificate Signing Request)文件?
- Transfer the token on the matic-erc20 network to the matic polygon
- Configure the user to log in to the device through telnet -- AAA local authentication
猜你喜欢

Inno setup the simplest user-defined interface effect

动态规划--怪盗基德的滑翔翼

What do you think of the deleted chat records? How to restore the deleted chat records on wechat?

SparseArray
![[Alibaba cloud] student growth plan answers](/img/34/cba975c0960d5595433adcb23f6e64.jpg)
[Alibaba cloud] student growth plan answers

8 ways to earn passive income

Mysql database learning notes - foreign keys, table connections, subqueries, and indexes for MySQL multi table queries

Summation of basic exercise sequence of test questions

ECS deployment web project

token 过期后,如何自动续期?
随机推荐
Xi'an Jiaotong 21st autumn "computerized accounting" online homework answer sheet (I) [standard answer]
You don't know how to deduce the location where HashSet stores elements?
STM32F103系列控制的OLED IIC 4针
Using lazy < t > in C # to realize singleton mode in WPF
[Alibaba cloud] student growth plan answers
How to print pthread_ t - How to print pthread_ t
数据读写:Unity中基于C#脚本实现数据读写功能
MySQL高级SQL语句
[GPU] basic operation
Sword finger offer 22 The penultimate node in the linked list
10-【istio】istio Sidecar
24、 I / O device model (serial port / keyboard / disk / printer / bus / interrupt controller /dma and GPU)
重构之美:当多线程批处理任务挑起大梁 - 万能脚手架
[untitled] user defined function
Leetcode search insert location
接口中方法详解
Solidity - 安全 - 重入攻击(Reentrancy)
CompletableFuture从了解到精通,你想知道的这里都有
Who is promoting the new inflection point of audio and video industry in 2022?
ECS deployment web project