## 3 Algorithm Design and Analysis
### TCP-SCTP Method
#### 3.3.1 TCP-SCTP Method Description  
From the analysis results of the third part, after SCTP and TCP PER reached 30%, their real-time throughput and average throughput dropped to under 5 KBps, especially after the arrival of the PER rose to 40%. This suggests that the link status became very poor. As shown in Figure 4, when the PER reached 30%, the packet loss rate of TCP and SCTP was around 5%. In this algorithm, 5% packet loss rate was selected as the critical point of path switching.  
The TCP-SCTP method first needed to obtain the packet loss rate of packets, which was the standard procedure to judge the network link status. With the trace file format, the method could calculate the packet loss rate by counting the number of lost packets and the number of sent packets. After the packet loss rate reached 5% in the link, the throughput of packets in the link decreased greatly, and the packet loss events increased. The current protocols did not effectively improve network congestion. The TCP-SCTP method could improve the current network transmission by calling the MS-SCTP method or the TCP-SCTP switch process and continuing to observe the transmission quality of the link.  
From Figure 3, when the packet loss rate was less than 5%, the PER was less than 30%. There was still a throughput of more than 10 KBps in the link. At this point, it could wait for a period of time to detect the packet loss rate in the link. If the packet loss rate continued to increase, it indicated the link was becoming worse. If the packet loss rate increased three times, the MS-SCTP method or the TCP-SCTP switch process was called by the TCP-SCTP method. The detection cycle was set by the DetectSlot parameter.  
If the packet loss rate detected was greater than 5%, or the packet loss rate continued to increase, it indicated that the current situation of the network was poor. It needed to decide as soon as possible whether the network link was in better or worse condition in order to take appropriate measures. For this reason, a DetectSlot parameter was introduced on the interval of detecting packet loss rate. DetectSlot was used to represent the frequency at which the TCP-SCTP method calculated the packet loss rate. The method adjusted the interval time of packet loss rate dynamically according to the network status. If the network was normal, the time interval for the next packet loss detection was set longer. If the network was poor, the next detection should have been done as soon as possible. Each change in DetectSlot was a multiple of two.  
If the packet loss rate detected reached 5%, the next time interval was set to half the time interval for this time (DetectSlot/2). If the packet loss rate detected was less than 5%, but the packet loss rate detected this time was larger than the packet loss rate detected last time, then the time interval of the next detection should also have been set to half of the time interval of this detection (DetectSlot/2). If the packet loss rate detected this time was lower than the packet loss rate detected last time, which indicated that the network condition started to improve, then the next detection time was twice as long as the interval of this detection (DetectSlot \(\times\) 2).