Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http问与答 #48

Open
zhuzhh opened this issue Apr 21, 2020 · 0 comments
Open

http问与答 #48

zhuzhh opened this issue Apr 21, 2020 · 0 comments

Comments

@zhuzhh
Copy link
Owner

zhuzhh commented Apr 21, 2020

TCP、UDP各自特点

tcp:面向连接的、可靠的、

keep-alive上面作用

在http1.0中,每个tcp请求或响应都被分配一个新的连接,就导致了连接启动缓慢。
http1.1引入keep-alive概念,在同一个tcp连接中对多个请求或响应使用同一个连接
**局限性:**但是不支持多个请求一起发送
http2.0引入多路复用技术改善http1,1的keep-alive带来的缺陷。
但是数据包的丢失会使得tcp重传,从而降低传输效率
http2.0中,所有的流都是共享同一个连接,当数据包丢失超过阈值,h2的运行效率还不如h1

http2.0做了哪些改进?

1、建立连接后,可以多路复用
2、建立连接后,一次的请求与被响应,视为流
3、数据传输基于二进制分帧(tcp传输是基于字符流的)

四大特点:服务器推送、队头压缩、

http2.0有哪些缺陷?

基于TCP,导致队头阻塞

http3.0做了哪些改进?

弃用TCP

TCP哪些特点

面向连接的、可靠的、基于字节流的传输层协议
所以tcp做了以下工作:传输过程中加入了序列号、数据重传、拥塞控制、使用校验和确保无错传输。
创建连接过程中,很多参数被初始化,例如序号被初始化,保证按序传输和连接的强壮性,确保数据传输和断开的可靠。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant