SCTP为什么不需要time_wait

There is no need to maintain state information in this case. RFC 4960 defines a sort of default handling for unknown (out of the blue) packets.

Let’s say, you have two sides in your association: side A and side B. v1/v2 are verification tags used by these sides. Side A initiated shutdown.

`
A                      B
       Shutdown(v1)
  -------------------->
    Shutdown_ack(v2)
  <--------------------
  Shutdown_complete(v1)
  -------------------->
`

When side A sends SHUTDOWN COMPLETE it deallocates all the resources used by this association. As far as side A concerns the association is gone.

If for some reasons SHUTDOWN COMPLETE chunk has been lost, side B will re-transmit SHUTDOWN ACK chunk after t2 timer (RFC 4960 term) expiration.

When side A receives this retransmitted SHUTDOWN ACK chunk, it will not be able to determinate to which association it belongs, because that association has already been closed. So, side A will treat this packet as “out of the blue”. RFC 4960 chapter 8.4 describes how to handle out of the blue packet, bullet #5 describes how to handle “out of the blue” SHUTDOWN ACK.

In this case side A will reply with SHUTDOWN COMPLETE. However, packet that carries SHUTDOWN COMPLETE chunk will be slightly different from the original one. The new packet will have t-bit set to 1 and contain what is called reflected verification tag (which is just verification tag from the packet that contained SHUTDOWN ACK).  A B Shutdown(v1) --------------------> Shutdown_ack(v2) <-------------------- Shutdown_complete(v1) -------LOST-------- Shutdown_ack(v2) <-------------------- Shutdown_complete(v2), t-bit=1 -------------------->

Side B knows how to handle packet with t-bit set to 1 and process SHUTDOWN COMPLETE.

As far as you can see, side A does not keep any state information once it sent SHUTDOWN COMPLETE. If any packets belong to this association arrives after that, they will be treated as “out of the blue”.

总的来说,就是a端知道如何处理不属于任何关联的shutdown ack包(作为out of the blue处理),并发送t-bit标记为1的包回去,b端也知道如何处理这个t-bit标记为1的包,不会发生故障。

原回答链接:https://stackoverflow.com/questions/42746899/why-does-sctp-not-require-a-time-wait-state

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值