自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 TCP协议栈:RFC3042-使用Limited Transmit算法高效恢复丢包

发送者收到了2个重复ACK,但是不能发送新的数据包,导致不能触发3个重复ACK,从而不能触发快速重传。当满足如下两个条件,则允许再发送2两个包:1. 接收窗口允许发送2.网络中的数据报文 <= cwnd + 2因为发送者收到了两个重复ACK,则说明接收者已经收到了2个包,发送者再发两个报文符合数据包守恒原则。...

2020-01-16 22:50:12 284

原创 TCP协议栈:RFC3390-初始拥塞窗口

RFC2581的建议(1999年)初始窗口为1或2个SMSSRCF3390的建议(2002年)//min (4*MSS, max (2*MSS, 4380 bytes))If (MSS <= 1095 bytes) then win <= 4 * MSS;If (1095 bytes < MSS < 2190 bytes) then win...

2020-01-16 20:35:38 419

原创 TCP协议栈:RFC3465-拥塞控制中的ABC算法

1.背景根据RFC2581,拥塞避免和慢启动中的cwnd的增长与ACK的数量相关,而RFC3465把cwnd的增长修改为与ACK的字节数相关。2.拥塞避免阶段总目标是,在一个RTT,cwnd增加一个SMSS。2.1 RFC2581的方法//收到ACKcwnd += 1/cwnd2.2 RCF3465的方法bytes_acked变量存储被确认的字节数。//...

2020-01-16 19:16:17 342

原创 nginx的location时怎么组织的

概述location的配置项,如"root",可以配置在http块、server块、location块,所以location的数据结构有三个层级。第一级在cycle->conf_ctx[HTTP]->loc_conf[i]第二级在cscf(ngx_http_core_srv_conf_t),cscf->ctx->loc_conf[i]第三级在clcf(ngx...

2019-11-07 21:51:36 135

原创 maglev hash算法

maglev hash算法先把n个server填满大小为m的数组table(m > n,m为素数); 然后算法选择table[hash(input)]中的sever。1. 对每个server构建排列表(permutation)1.1 计算排列表的大小为m,计算如下:offset = hash1(sever) % mskip = hash2(server) %(...

2019-11-04 23:31:45 1122

原创 nginx对http头部的处理

数据结构 ngx_http_request_t{ ngx_http_headers_in_t headers_in; //存放分析后的request headers ngx_http_headers_out_t headers_out; //存放待发送的response headers ngx_chain_t ...

2019-11-03 18:57:31 858

原创 nginx:upstream的keep-alive是怎么实现的

数据结构//变量kcftypedef struct { ngx_uint_t max_cached; //keepalive参数,有多少ngx_http_upstream_keepalive_cache_t ngx_uint_t requests; //每个连接处理多少请...

2019-10-31 22:57:02 595

原创 nginx的upstream与算法是怎么组织的

upstream的数据结构ngx_http_upstream_main_conf_t { ngx_array_t upstreams; /* ngx_http_upstream_srv_conf_t* */}ngx_http_upstream_srv_conf_t { ngx_http_upstream_peer_t ...

2019-10-30 23:53:35 235

原创 nginx是怎么支持websocket的

nginx配置配置如下server { location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_pass http://web...

2019-10-30 22:14:43 393

原创 nginx的事件处理函数

1. 数据结构connection中有read/write两种事件struct ngx_connection_s { void *data; ngx_event_t *read; ngx_event_t *write; ...}struct ngx_event_s {... n...

2019-10-27 22:48:35 365

原创 物理网卡加入network namespace

1,iproute版本iproute与内核版本一致https://www.kernel.org/pub/linux/utils/net/iproute2/2,NS命令参考添加删除nsip netns add NS-NAMEip netns del  NS-NAME把eth1加入nsip link set eth1 netns NS-NAME访问、

2016-05-27 16:26:02 1576

原创 Linux 4.4-4.6对TCP/IP协议栈的性能优化

优化内容Linux 4.6: Faster SO_REUSEPORT for TCPLinux 4.5 :Faster SO_REUSEPORT for UDPLinux 4.4:  TCP listener handling completely lockless, making TCP servers faster and more scalable性能测试todo

2016-05-20 13:51:50 1637

原创 openssl生成sha2自签署证书

生成自签署证书openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout test.key -out test.crt -subj "/C=cn/ST=bj/O=test/OU=dev/CN=test.cn/emailAddress=admin@test.cn"验证openssl x509 -noout

2016-05-19 15:35:15 1205

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除