tcp timestamp
Description
Protocol suite: TCP/IP.
Protocol type: Transport layer protocol.
Option length: 10 bytes.
The TCP Timestamp option obsoletes the TCP Echo request and Echo reply options.
RFC 1323:
The timestamps are used for two distinct mechanisms: RTTM (Round Trip Time Measurement) and PAWS (Protected Against Wrapped Squences).
结构图
Kind. 8 bits. Set to 8.
Length. 8 bits. Set to 10.
Timestamp Value (TSval). 32 bits.
This field contains the current value of the timestamp clock of the TCP sending the option.
TImestamp Echo Reply (TSecr). 32 bits.
This field only valid if the ACK bit is set in the TCP header. If it is valid, it echos a timestamp value that was sent by the remote TCP in the TSval field of a Timestamps option. When TSecr is not valid, its value must be zero. The TSecr value will generally be from the most recent Timestamp option that was received; however, there are exceptions that are explained below. A TCP may send the Timestamp option in an initial SYN segment(i.e., segment containing a SYN bit and no ACK bit), and may send a TSopt in other segments only if it received a TSopt in the initial SYN segment for the connection.
Linux内核中的使用
如果支持Timestamp选项,那么可以用此选项来计算RTT。
static void tcp_ack_saw_tstamp(struct sock *sk , int flag)
{
/* RTTM Rule: A TSecr value received in a segment is used to
* update the averaged RTT measurement only if the segment
* acknowledges some new data, i.e., only if it advances the
* left edge of the send window.
*
* Changed: reset backoff as soon as we see the first valid
* sample. If we do not, we get strongly overestimated rto.
* With timestamps samples are accepted even from very
* old segments: f.e., when rtt=1 increases to 8, we retransmit
* 5 times and after 8 seconds delayed answer arrives rto
* becomes 120 seconds!
*/
struct tcp_sock *tp = tcp_sk(sk);
tcp_valid_rtt_meas(sk, tcp_time_stamp - tp->rx_opt.rcv_tsecr);
}
rtt即等于现在的时间tcp_time_stamp减去Timestamp Echo Reply,即tp->rx_opt.rcv_tsecr。
TCP timestamp option的作用:
1)allow more accurate round-trip time measurements for deriving the retransmission timeout estimator.
2)protect against old segments from the previous incarnations of the TCP connection.
3)allow detection of unnecessary retransmissions.
tcp_tw_recycle/tcp_timestamps都开启的条件下,60s内同一源ip主机的socket connect请求中的timestamp必须是递增的。
原文
http://blog.csdn.net/zhangskd/article/details/7195795
tcp_tw_recycle和tcp_timestamps导致connect失败问题
http://blog.sina.com.cn/s/blog_781b0c850100znjd.html
tcp timestamp的更多相关文章
- TCP连接建立系列 — 客户端的端口选取和重用
主要内容:connect()时的端口选取和端口重用. 内核版本:3.15.2 我的博客:http://blog.csdn.net/zhangskd 端口选取 connect()时本地端口是如何选取的呢 ...
- TCP 、UDP、IP包的最大长度
1.概述 首先要看TCP/IP协议,涉及到四层:链路层,网络层,传输层,应用层. 其中以太网(Ethernet)的数据帧在链路层 IP包在网络层 TCP或UDP包在传输层 TCP或UDP中的数据(Da ...
- Multipath TCP and load balancers
Load balancers play a very important role in today’s Internet. Most Internet services are provided b ...
- TCP中RTT的测量和RTO的计算
https://blog.csdn.net/zhangskd/article/details/7196707 tcp传输往返时间是指:发送方发送tcp断开时, 到发送方接收到改段立即响应的所耗费的时间 ...
- tcp timewait 问题 转载
TIME WAIT 带来的问题 先引用一个名言: The TIME_WAIT state is our friend and is there to help us (i.e., to let old ...
- 【Azure 应用服务】Azure Web App的服务(基于Windows 操作系统部署)在被安全漏洞扫描时发现了TCP timestamps漏洞
问题背景 什么是TCP timestamps(TCP 时间戳)? The remote host implements TCP Timestamps, as defined by RFC1323 (h ...
- TCP服务端收到syn但是不回复syn ack问题分析
文章转载自:https://blog.csdn.net/jueshengtianya/article/details/52130667 最近在分析客户的一个问题时遇到了一种奇怪的情况,客户在服务端开启 ...
- 【lwip】12-一文解决TCP原理
目录 前言 12.1 TCP协议简介 12.2 TCP相关的一些概念词 12.2.1 MSL 12.2.2 MSS 12.3 TCP工作特性 12.3.1 面向连接 12.3.2 全双工通信 12.3 ...
- hping原理、安装、使用详解介绍
[原理基础] Hping是一个命令行下使用的TCP/IP数据包组装/分析工具,其命令模式很像Unix下的ping命令,但是它不是只能发送ICMP回应请求,它还可以支持TCP.UDP.ICMP和RAW ...
随机推荐
- 基于jquery的表单校验插件 - rjboy的Validform使用体验
官方地址:http://validform.rjboy.cn/document.html 引用js后再加上以下css就可以使用了 .Validform_checktip{ margin-left:8p ...
- Error: L6218E: Undefined symbol TIM_ARRPreloadConfig (referred from pwm_output.o).
出错原因:模板FWLIB中没有添加stm32f10x_tim.c文件.添加即可 一般利用库开发,将ppp.c(ppp.c又调用了库stm32f10x_xx.h)写好之后的调用步骤: 1 将ppp.c和 ...
- 编译器错误消息: CS0234: 命名空间“Purple”中不存在类型或命名空间名称“Model”(是否缺少程序集引用?)
编译错误 “/storeimg”应用程序中的服务器错误. 编译错误 说明: 在编译向该请求提供服务所需资源的过程中出现错误.请检查下列特定错误详细信息并适当地修改源代码. 编译器错误消息: CS023 ...
- html标签搜索引擎友好度总结
H系列标签: H标签当中数H1的权重最高,H1相当于我们一篇作文的标题,H2.H3等标签是属于页面的相关性主题标签,h标签的权重也是相对递减的,如果你没有出现h1,那么h2的权重也就相当 ...
- 树莓派:使用OpenCV调用自带的摄像头.
总所周知,树莓派上,调用摄像头的指令有raspistill和raspivid.若要使用opencv对摄像头进行调用,不少人会出现 cvCaptureFromCAM(0)函数无法找到Pi Cam的错误情 ...
- jquery判断自己是父节点的第几个子节点
<div> <span>内容</span> <span>内容</span> <span>内容</span> < ...
- git查看历史命令
1 git show git show 分支名/HEAD/hash值 2 git log参数 --oneline 单行信息--decorate 输出commit引用信息--graph 图形化输出--a ...
- 新建的表如果还没有数据,用exp导的时候会忽略
源地址:http://www.07net01.com/2015/07/884873.html
- 一机运行多个resin的配置
对于java应用服务器,常用的一般为tomcat.jboss.resin. 一. 概述 经常会有这种情况: 1.一台服务器上,跑多个java应用 2.网站负载高,需要采用负载均衡(轮询)的方式来解决 ...
- ext 3.2 tree 在IE10中点击事件失效的bug
ext3.2 中的tree在IE中进行兼容性测试,遇到IE10时,无法点击,其他版本的IE(7.8.9.11)均正常.此bug是由于ext-all.js中的getAttributeNS方法不能兼容IE ...