Unit 2, TCP header recap

P35 TCP header recap

在这里插入图片描述
refere to the documentation for detailed information. Here is just to walk through the main fields in the standard TCP header.

The basic TCP header you see in most conncections is 20 bytes long.

每行32bit, 4 octets, 2个字节bytes.

← 32 bits (4 octets)
source portdestination port
16 bits (max 65535)16 bits (max 65535)

Checksum: make sure no error is in the data. Simple ones compliment checksum.
把header中的每一个16bit的field相加,反转后得到checksum。接收端收到后,把header中的所有field(包括checksum)相加,通过one’s-complement,如果没有error的话应该是0xffff.
在这里插入图片描述

UAPRSF这几个位

  • 其中ACK只有在接收到对方的acknowledgement number时才为,并且只有在第一次发送SYN的时候为not set,其他时候都为1.因为第一次单向传送没有接收到对方的sequence number,自然不能ACK.
  • 其中SYN bits are set, denoting the sequence number (starting number) in the header, to synchronize. “This is my first byte of data.”
  • 互相交换各自的sequence number。

sequnce number每次最好取不同,一来防止安全问题(别人能猜出你的sequence numebr),二来为了不让packets一直在网络里。

offset tells where the data begins, so from the data you get options。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值