当前位置:网站首页>Technology sharing | common interface protocol analysis
Technology sharing | common interface protocol analysis
2022-07-05 18:58:00 【hogwarts_ beibei】
Transfer packets between services , Because of different application scenarios , Use different communication protocols for delivery . For example, website access , Often use HTTP Protocol delivery , File transfer usage FTP, Mail delivery use SMTP. The above three types of protocols are in the application layer of the network model . In addition to the common protocols of the application layer , For the transport layer TCP、UDP agreement , as well as Restful Architectural style 、RPC Basic network knowledge such as protocols should be understood and recognized .
Network protocol introduction
Before understanding the specific agreement , You need to know OSI Seven layer model 、TCP/IP Four layer model 、 Five layer architecture these three different network models .
Network protocol model comparison diagram :
- OSI The reference model is a conceptual framework for developing standards for coordinating interprocess communication , It is not a standard .
- TCP/IP The four layer model is the basic communication architecture of the Internet . It's often seen as a simplified seven level OSI Model .
- The five layer agreement is OSI and TCP/IP The synthesis of , The practical application is still TCP/IP Four story structure of .
- TCP/IP The protocol stack corresponds to TCP/IP The specific network protocol used in the four layer model .
TCP agreement
TCP The protocol is in the transport layer , A connection oriented 、 reliable 、 Transport layer communication protocol based on byte stream .TCP The working mode of the protocol is that... Is required when establishing a connection “ Three handshakes ”, When terminating the connection, you need to “ Four waves ”.“ Three handshakes ” and “ Four waves ” yes TCP Important knowledge points of the agreement , In the following chapters, we will introduce in detail through the combination of practice and theory .
Applicable scenario
TCP Connection oriented protocol 、 Error retransmission 、 Congestion control and other characteristics , It is suitable for scenarios with high reliability , For example, data transmission involving user information .
UDP agreement
UDP Once the protocol sends the data sent by the application to the network layer , Do not keep data backups . It's only in IP Multiplexing and data verification fields are added to the header of the packet . therefore UDP Packets are often considered unreliable .
Applicable scenario
UDP There is no need to establish a connection in advance 、 Implement simple features , It is very suitable for scenes with high real-time performance , Like streaming media 、 Online games, etc .
HTTP agreement
HTTP Protocol is the most common protocol in interface testing , Is for distributed 、 Application layer protocols for collaborative and hypermedia information systems .HTTP Is the foundation of data communication in the world wide web . The client sends... To the server HTTP request , The server will return the requested data in the response . During the test , It is often necessary to verify the request and response results , So understand HTTP agreement , For interface testing , It's the top priority .
In the following chapters, we will introduce HTTP、HTTPS The difference between agreements , as well as HTTP Basic knowledge information of the agreement .
RESTful agreement
origin
Roy Thomas Fielding Doctor Yu 2000 A style of World Wide Web software architecture proposed in his doctoral dissertation in . Its purpose is to facilitate different software to transmit information in the network .RESTful Is based on HTTP A resource request made on top of a protocol 、 The style of operation , To sum up in one sentence is to use URL To locate resources , Use HTTP Verb description operation .
HTTP The request method is RESTful api Typical applications in :
Method | significance |
---|---|
GET | Access to resources |
POST | Add or update |
PUT | Update resources |
DELETE | Delete resources |
Be careful : Different companies are using RESTful There are some differences in architectural style .
RPC agreement
RPC The English of is Remote Procedure Call , It's a good interpretation RPC The concept of agreement , That is to realize remote execution by calling local code ,RPC It is mainly used for service invocation within the company .RPC The advantage of the interface is higher transmission efficiency 、 Lower performance loss 、 Built in load balancing strategy 、 Better service governance .
common RPC agreement
Currently commonly used in the industry RPC The main agreements are as follows :
- Dubbo:Java High performance based on RPC agreement .
- gRPC: High performance general purpose RPC frame , be based on Protocol Buffers.PB It's a language neutral 、 Platform neutral data serialization framework .
- Thrift: And gRPC Similar multilingualism RPC frame .
边栏推荐
- Tupu software digital twin smart wind power system
- 深入底层C源码讲透Redis核心设计原理
- XML basic knowledge concept
- MySQL优化六个点的总结
- Find in MySQL_ in_ Detailed explanation of set() function usage
- 7-2 keep the linked list in order
- Word finds red text word finds color font word finds highlighted formatted text
- 什么是文本挖掘 ?「建议收藏」
- 5. Data access - entityframework integration
- SAP 特征 特性 说明
猜你喜欢
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
达梦数据库udf实现
Oracle日期格式转换 to_date,to_char,to_timetamp 相互转换
[detailed explanation of AUTOSAR 14 startup process]
2022 the most complete Tencent background automation testing and continuous deployment practice in the whole network [10000 words]
You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!
2022最新中高级Android面试题目,【原理+实战+视频+源码】
[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
A2L file parsing based on CAN bus (3)
随机推荐
vs2017 qt的各种坑
C language makes it easy to add, delete, modify and check the linked list "suggested collection"
Find in MySQL_ in_ Detailed explanation of set() function usage
2022最新Android面试笔试,一个安卓程序员的面试心得
Optimization of middle alignment of loading style of device player in easycvr electronic map
C final review
Oracle Chinese sorting Oracle Chinese field sorting
How to automatically install pythn third-party libraries
彻底理解为什么网络 I/O 会被阻塞?
Cronab log: how to record the output of my cron script
图扑软件数字孪生 | 基于 BIM 技术的可视化管理系统
紧固件行业供应商绩效考核繁琐?选对工具才能轻松逆袭!
The monthly list of Tencent cloud developer community videos was released in May 2022
cf:B. Almost Ternary Matrix【对称 + 找规律 + 构造 + 我是构造垃圾】
7-2 keep the linked list in order
爬虫01-爬虫基本原理讲解
2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
Benefits of automated testing
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
5. 数据访问 - EntityFramework集成