TCP Three-way Handshake

TCP Connection Management

Out-of-Order and Duplication(复制) Problem

  • Old segment from previous connections to come
  • Use long sequence number (32-bits)
  • Establish randomly selected initial sequence number (ISN)
  • Accept sequence numbers from a small window(To allow the network to clear old segments from the network)
  • Enforces a time-out period at end of connection, called maximum segment lifetime (MSL), usually 2 minutes but round-trip delay dependent

TCP Header – Seq and Ack

Sequence Number

  • Byte count
  • First byte in segment
  • 32 bits long
  • 0 <= SN <= 2^32-1
  • Initial sequence number (ISN) selected during connection setup (SYN flag bit is 1);

Acknowledgement Number

  • SN of next byte expected by receiver
  • Acknowledges that all prior bytes in stream have been received correctly
  • Valid if ACK flag is set

TCP Header – Control bits

Control

  • 6 bits
  • URG: urgent pointer flag
    • Urgent message end = SN + urgent pointer
  • ACK: ACK packet flag
    • PSH: override TCP buffering
  • RST: reset connection
    • Upon receipt of RST, connection is terminated and application layer notified(被通知)
  • SYN: establish connection
  • FIN: close connection

TCP Connection Management

  • “Three-way Handshake”
  • ISN’s protect against segments from prior connections
    1092889-20171012210252949-441252491.png

If host always uses the same ISN
1092889-20171012210348199-1551210248.png

TCP Connection Closing

“Graceful Close”
1092889-20171012210435309-1559410898.png

TCP Tree-way handshake

  • Establish connection
  • Transfer data
  • Close the connection

转载于:https://www.cnblogs.com/vancasola/p/7703822.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值