当前位置:网站首页>[network protocol] why learn network protocol
[network protocol] why learn network protocol
2022-04-22 05:19:00 【Pistachio 2021】
The three elements of the agreement : grammar 、 semantics 、 The order
Why learn network protocols :
Only through network protocol , To make a large number of machines cooperate with each other 、 Accomplish one thing together .
【 Take online ordering as an example 】
Enter an e-commerce website in the browser , The browser will go through DNS Or more precisely HTTPDNS Find specific IP.
After finding the target address , The browser starts to package its requests . For ordinary browsing requests , Often use HTTP agreement , But for shopping requests , Encrypted transmission is often required , So I will use HTTPS agreement .
DNS、HTTP、HTTPS The layer we are on becomes the application layer , After application layer encapsulation , The browser will give the package of the application layer to the next layer to complete , adopt socket Programming to achieve . The next layer is the transport layer . The transport layer has two protocols , One is connectionless protocol UDP, One is connection oriented TCP( Connection oriented is ,TCP It will ensure that the package can reach the destination , If not , Send it all the time , Until you can ). For payment , Often use TCP agreement .
TCP There are two ports in the protocol , One is the port on which the browser listens , One is the server monitoring port of e-commerce . Operating systems often judge by ports , Which process should it get the package for .
After the completion of transport layer encapsulation , The browser will deliver the package to the network layer of the operating system . The protocol of the network layer is IP agreement . stay IP There will be something in the agreement IP Address , That is, the browser's machine IP Address and destination IP Address .
When the operating system starts , Will be DHCP Protocol configuration IP Address , And the default gateway IP Address 192.168.1.1, Get the goal IP After the address , The operating system passes through ARP The protocol found the default gateway MAC Address , therefore , take IP Give the bag to the next floor , That is to say MAC layer , The network card will send the packet again , Get it to the gateway .
The communication protocol between gateway and gateway becomes routing protocol , Commonly used OSPF and BGP.
Thanks to the communication between gateways , Network packets can get the information of the next gateway from one gateway MAC Address , Until the target server is found .
Remove the target server MAC head , To the network layer of the operating system , Find out IP It's right , Just take it off IP head .IP What will be written on the head is TCP agreement , Then give it to the transport layer , namely TCP layer .
In this layer , For the package received , There is a reply package indicating that you have received ( just TCP A description of the layer , Not the result of the order request ).
If after a while , The sender did not receive a reply , Sending end TCP The layer will resend the packet ( Resend means TCP End retry , It's not that the browser requests the order again , Unless it is TCP Something went wrong. , If the connection is broken ).
The network packet arrived safely TCP After the layer ,TCP There is a target port number in the header , Through port number , You can find the port number that the e-commerce website is monitoring .
The process of e-commerce website has been HTTP Requested content , Will pass RPC call ( Remote procedure call ) To tell the relevant process what to do .
After the relevant processes are handled , Just reply to one HTTPS My bag , Inform the results of the order , The packet eventually enters the sender browser , Show payment success .
The network protocol to learn later :
application layer :DHCP HTTP HTTPS RTMP P2P DNS GTP RPC
Transport layer :UDP TCP
The network layer :ICMP IP OSPF BGP IPSec GRE
The link layer :ARP VLAN STP
The physical layer : Network jumpers
版权声明
本文为[Pistachio 2021]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210625510837.html
边栏推荐
- Temperature control via mqc582tt + PNET
- 防抖函数和节流函数
- Nexus私服——(二) 3.2.0版 控制台安装,初始密码位置
- Unity中的UGUI源码解析之事件系统(9)-输入模块(下)
- Junit簡介與入門
- feign调用服务,被调用服务seata事务不开启或者xid为空
- [Reading Notes - > statistics] 07-03 introduction to the concept of discrete probability distribution Poisson distribution
- Strategy mode (2.28-3.6)
- Send a shutdown command to the LAN computer every 30 seconds
- Enum enumeration type
猜你喜欢
![[Reading Notes - > statistics] 07-01 introduction to the concept of discrete probability distribution geometric distribution](/img/47/2b22d990cd3ea83d57016d2dfc6f41.png)
[Reading Notes - > statistics] 07-01 introduction to the concept of discrete probability distribution geometric distribution

Clonal map of writing in mind

Pyqt5+Yolov5+Mss实现一个实时桌面检测软件

MySQL数据库第十一次
![[C] file operation](/img/fd/ddf94b0ffa743f2288f723a263a045.png)
[C] file operation

Data distribution, correlation analysis and visualization method of data exploratory analysis (EDA)

Database 13th job transaction management

Onzième emploi dans la base de données MySQL - application de la vue

Measuring the global recursive DNS infrastructure: a view from the edge

Pytorch builds a two-way LSTM to realize time series forecasting (load forecasting)
随机推荐
Interpretation of the report Download | the future of database and the development trend and challenges of database in the 14th five year plan
Empty object mode (3.14-3.20)
13.9.1-PointersOnC-20220421
Leetcode 1557. Minimum number of vertices to reach all nodes
Detailed explanation of Neptune w800 lighting (interruption) project
The chain of implicit trust: an analysis of the web third party resources loading
Security challenges in an increasingly tangled web
2022-1-17 to 2022-1-30 iterator mode
Clonal map of writing in mind
Database 13th job transaction management
JUnit assertion
Onzième emploi dans la base de données MySQL - application de la vue
物联网测试都有哪些挑战,软件检测机构如何保证质量
【C#】LINQ
Detailed explanation of ten functional features of ETL's kettle tool
Pass files when openfeign is called
The SQL backup bak in the batch compression folder is rar, and then delete the RAR 3 days ago
Leetcode 1561. Maximum number of coins you can get
After the MySQL database runs the code, the question mark is displayed in Chinese?
Query result processing