• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

quic-go测试

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

QUICQuick UDP Internet Connections)是基于UDP的多路复用和安全的通用传输层协议,相当于在UDP上实现了TCP+TLS+HTTP/2数据传输。

理论上quic采用UDP传输数据,封装了TLSHTTP/2HTTP3协议中,quic仅封装TLSHTTP3协议数据基于quic协议传输),首次连接加载时间为2RTT,之后重新为1RTT

QUICHTTP3的基础。目前quic协议未定稿,变动频繁。

quic-go测试示例

git clone https://gitee.com/yuxio/quic-go.git
cd quic-go/example
go build -o ser main.go
go build -o cli client/main.go

运行:

示例采用单向认证方式,证书签发的CN=localhost,不能使用IP。

 ./ser -bind ":8088" 
server GET localhost:8088/demo/tiles
server Responding with 200
server Peer closed session with error: Application error 0x100
server Connection 0xfc314d4e5df5d38b closed.
./cli https://localhost:8088/demo/tiles
GET https://localhost:8088/demo/tiles
client Starting new connection to localhost ([::]:52586 -> 127.0.0.1:8088), source connection ID (empty), destination connection ID 0xfc314d4e5df5d38b, version TLS dev version (WIP)
Got response for https://localhost:8088/demo/tiles: &http.Response{Status:"200 OK", StatusCode:200, Proto:"HTTP/3", ProtoMajor:3, ProtoMinor:0, Header:http.Header{}, Body:(*http3.body)(0xc000324a00), ContentLength:0, TransferEncoding:[]string(nil), Close:false, Uncompressed:false, Trailer:http.Header(nil), Request:(*http.Request)(nil), TLS:(*tls.ConnectionState)(nil)}
Request Body:
<html><head><style>img{width:40px;height:40px;}</style></head><body><img src="/demo/tile?cachebust=0">...<img src="/demo/tile?cachebust=199"></body></html>
client Closing session with error: Application error 0x100
client Connection 0xfc314d4e5df5d38b closed.

QUIC单向认证(22数据帧)

目前测试quic-go:同等条件下QUICHTTP2传输的数据包少,时间应该较短,目前测试效果不佳,但相差不大。大数据量、多次连接时QUIC才能体现优势。

简单测试单次链接时间:连接--发送--接收--断开
grpc_simple: 28ms
grpc_single: 44ms
grpc_dul: 51ms
http_simple: 21ms
http_single: 32ms
http_dual: 38ms
quic_single: 35ms

 

参考:

  1. Cronet网络库系列()HTTPS/HTTP2/HTTP3/QUIC/WebSocket详解

  2. 快速读懂QUIC协议

  3. 如何看待 HTTP/3

  4. HTTP/2.0 相比1.0有哪些重大改进?


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
go环境安装以及LiteIDE安装与使用发布时间:2022-07-10
下一篇:
51.笔记go语言——go语言数据结构发布时间:2022-07-10
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap