SCTP如何比TCP更好? (在交通场景中)

时间:2015-10-07 07:52:55

标签: sockets tcp network-programming sctp

SCTP使用多个流发送单个文件,TCP使用单个流发送单个文件。 现在问题是“

  

SCTP如何比TCP好?

“(在流量情景中

2 个答案:

答案 0 :(得分:2)

SCTP在任何方面都不比TCP“好”,但它做了不同的事情。

TCP通过不可靠的无序数据包传输模拟可靠的,有序的八位字节,这在概念上非常类似于从文件读取(没有搜索能力)。

SCTP模拟可靠的顺序消息传送系统(其中“消息”意味着与某个已知长度的已定义数据块一样多)。与UDP一样,它一次传递一条完整的消息。与TCP一样,它保证消息的到达,以及它们发送的相对顺序。

SCTP能够在单独的流中发送不同的消息,从而可以减少延迟,防止线头阻塞,并在某些情况下更好地利用可用带宽。具有样式信息和图像的网页是典型的例子 通过多个流发送单个文件(这没有任何意义)。

(还有一些其他功能我没有命名,因为它们与问题没什么关系)

答案 1 :(得分:0)

SCTP can be considered as mix of UDP and TCP because it is message based like UDP and connection oriented like TCP to ensure in sequence delivery of messages along with congestion control mechanism. That is, SCTP is connection oriented but operates at message level. It involves bundling of several connections into a single SCTP association operating on messages or chunks rather than bytes. This capability of SCTP to transmit several independent streams of chunks in parallel is referred to as Multistreaming which avoids head of line blocking. That is, in case of TCP, even though 3rd & 4th packet are fine, but if 2nd packet was lost, TCP shall do retransmission due to which 3rd and 4th packet has to wait until the 2nd packet is successfully/correctly received. However, incase of SCTP, this head of line blocking is reduced as single association is split into multiple independent streams of chunks(messages). Also, note that SCTP facilitates to send messages in unordered mode too, which can completely avoid the head of line blocking wherein the upper layers should have mechanism for reordering of messages if required.