TCP的URG标志和内核实现之一:协议
来源:互联网 发布:数据分析科技 编辑:程序博客网 时间:2024/05/21 07:04
定义urgent数据的目的:
urgent机制,是用于通知应用层需要接收urgent data,在urgent data接收完成后,通知应用层urgent data数据接收完毕。相关协议文本RFC793 RFC1122 RFC6093
哪些数据是urgent data?
协议规定
在TCP报头的URG位有效的时候,通过TCP报头中的urgent pointer来标识urgent data的位置,但是在urgent pointer的解析方式上各个协议文本的描述有差异:解读一:RFC793 P17,描述是“The urgent pointer points to the sequence number of the octet following the urgent data.”,在P41有描述“This mechanism permits a point in the data stream to be designated as the end of urgent information. Whenever this point is in advance of the receive sequence number (RCV.NXT) at the receiving TCP, that TCP must tell the user to go into "urgent mode"; when the receive sequence number catches up to the urgent pointer, the TCP must tell user to go”,可以认为是:当前接收的报文中SEQ在SEG.SEQ+Urgent Pointer之前的都是,而urgent pointer是第一个非urgent data( TCP已经接受,但是还没有提交给应用的数据是不是呢?)
解读二:在P56的描述是“If the urgent flag is set, then SND.UP <-SND.NXT-1 and set the urgent pointer in the outgoing segments”,也就是urgent pointer是最后一个urgent data字节。而在RFC1122中消除了这一歧义:在P84中说明“the urgent pointer points to the sequence number of the LAST octet (not LAST+1) in a sequence of urgent data”
linux实现
虽然在RFC1122中消除了这一歧义,linux仍然使用了解读一的解析方式,如果要使用解读二定义的方式,需要使用tcp_stdurg这个配置项。
urgent data数据能有多长?
协议规定
按照RFC793 P41的描述,长度不受限,RFC1122 P84中,更是明确了“A TCP MUST support a sequence of urgent data of any length”
linux实现
其实,linux只支持1BYTE的urgent data
urgent data与OOB数据
OOB数据说的是带外数据,也就是这些数据不是放到TCP流供读取的,而是通过额外的接口来获取,linux默认把urgent data实现为OOB数据;而按照协议的规定,urgent data不是out of band data
由于OOB数据的协议和实现上存在很多不确定因素,因此现在已经不建议使用了
0 0
- TCP的URG标志和内核实现之一:协议
- TCP的URG标志和内核实现之二:发送的实现
- TCP的URG标志和内核实现之三:接收的实现
- TCP协议中的URG和PSH标志位的区别
- TCP协议中的PSH和URG标志位
- TCP报文的URG和PSH标志位
- TCP标志中的URG和PSH位
- TCP标志中的URG和PSH位
- TCP标志中的URG和PSH位
- 网络---TCP协议中的urg和psh的区别
- TCP标志位中的PSH和URG的区别和联系
- TCP报文中的URG和PSH标志位
- TCP协议包头中的URG和PSH
- TCP协议中的URG和PSH位
- TCP协议字段中的URG和PSH
- TCP协议中URG和PSH
- URG和PSH标志位
- TCP协议定时器+URG,PSH的区别+TCP连接释放
- MySQL修改root密码的多种方法
- TRUNCATE DELETE DROP区别
- man的数字含义
- Mysql不会使用所搞得笑
- 如何集成支付宝
- TCP的URG标志和内核实现之一:协议
- Viewday05
- DIV+CSS规范命名大全集合
- 对于递归查询语法的一些理解
- activity生命周期(有没有onfreeze()呢??)
- 设计模式之状态模式浅析
- 矩阵变换:沿任意轴旋转及其推导
- 杭电4985 Little Pony and Permutation(水置换)
- Unity3D