当前位置:网站首页>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 .
边栏推荐
- MySQL 索引
- 超简单 STM32 RTC闹钟 时钟配置
- MySQL log management, data backup and recovery
- 声网,站在物联网的“土壤”里
- MySQL advanced SQL statement
- Sword finger offer 18 Delete the node of the linked list
- Strlen and sizeof, array length and string length, don't be silly
- Summation of basic exercise sequence of test questions
- 09- [istio] istio service entry
- Master slave synchronization of MySQL database to realize read-write separation
猜你喜欢

1380. lucky numbers in matrices

Do you know how to show the health code in only 2 steps

Leetcode56. consolidation interval

云服务器部署 Web 项目

Dao -- a beautiful new world?

从零开发 stylelint规则(插件)

强烈推荐十几款IDEA开发必备的插件

飞升:基于中文分词器IK-2种自定义热词分词器构建方式showcase & 排坑showtime

MySQL log management, data backup and recovery

8 ways to earn passive income
随机推荐
English语法_形容词/副词3级-最高级
Stack overflow caused by C # using protobuf stack overflow
UML tools
电脑查看WiFi使用密码
OSPF - authentication and load balancing summary (including configuration commands)
Create priority queue
Lantern Festival | maoqiu technology and everyone "guess riddles and have a good night"
Huxiaochun came to fengshu electronics to sign a strategic cooperation agreement with Zoomlion
CompletionService使用及原理(源码分析)
Mysql database user management
Leetcode search insert location
Xi'an Jiaotong automation control theory test simulation question [standard answer]
I have been working as a software testing engineer for 5 years, but I was replaced by an intern. How can I improve myself?
luoguP2756 飞行员配对方案问题(最大流)
After getting these performance test decomposition operations, your test path will be more smooth
How to automatically renew a token after it expires?
旋转标注工具roLabelImg
SHELL
二十四、输入输出设备模型(串口/键盘/磁盘/打印机/总线/中断控制器/DMA和GPU)
接口中方法详解