# Studying Semi-TCP and Its Application in Marine Internet
## 3 Improvement Measures of the Algorithm  
According to the introduction of the RTS/CTS handshake protocol in Section 2.1.1, the RTS and CTS frames reserve slot-time in the Network Allocation Vector (NAV) field (the specific value is the duration bit in the control frame) to indicate how long the node needs to back off after receiving the frame, so it can avoid collisions in sending data frames. The RTS/CTS protocol is proposed to solve the hidden terminal problem, but the exposed terminal problem also affects the network performance due to channel wastage caused by exposed terminals. An exposed terminal refers to a node that is within the coverage of the sending node and outside the coverage of the receiving node. As shown in Figure 2, node C sends data to node F, but node A wants to send data to B too. Node A in this case is an exposed terminal. After receiving the RTS of node C, node A will perform a backoff. However, in reality, the respective receiving nodes are not within the receiving range of the sending node. Therefore, the two types of data do not collide at the receiving end so that node A can send data to node B. This exposed terminal problem causes a waste of channels. Figure 2: An example of exposed terminals. Not only the exposed terminal problem, but for a congested network with heavy traffic loads, there will naturally be interactions of many nCTS frames. This will also cause great trouble. Suppose that node A needs to send data frames to node B, and node B replies an nCTS, then node A will not send data in the originally reserved time slot after receiving the frame. As shown in Figure 3, the surrounding neighboring nodes can be considered separately. Node D is a hidden terminal, after receiving an nCTS, it will perform a backoff according to its duration. Node C, as an exposed terminal, will also perform a backoff after receiving an RTS. Node E can receive two control frames and will select the larger duration of the RTS and nCTS to back off. At this point, nodes A, C, D, and E will all be unable to send data, which will result in waste of channels and increase the network congestion. In order to solve the above problems and optimize the performance of Semi-TCP, we have designed the following algorithm:  
1. Set the duration of an nCTS to 0 to solve the backoff problem of the hidden terminal in Figure 2.
2. After the node receives an RTS frame that is not destined to itself, the node records the sending address of the frame, and at the same time initiates a Timer-for-Exposed-Terminal (TET). If no CTS or retransmitted RTS to this address is received within the certain time interval, it is determined that there is an exposed terminal and the backoff can be cancelled. 3. If an nCTS is received before the Timer-for-Exposed-Terminal (TET) times out, cancel the backoff. 4. When the node receives an RTS frame that is not sent to itself before the TET times out: (i) if it receives an RTS frame from another node that is not for itself, it records a new address and resets the timer; (ii) if receiving a CTS frame that is not addressed to itself, it unconditionally backs off according to Duration. 5. If the node receives any control frame sent to itself when the TET is on, it will be treated as a backoff state. Regarding the duration of the TET, we have to consider the case of retransmission RTS and set the minimum value that meets the requirement. After analyzing the RTS/CTS protocol, the node will start a retransmission timer after sending the RTS frame. The value of this retransmission timer is shown in formula (1), where PropDelay is the propagation delay and SIFS is the short frame interval, transmitDelay (CTS) is the transmission delay of the CTS frame, and slotTime is the waiting time. \[holdForCts=PropDelay+SIFS+transmitDelay(CTS)+PropDlay+slotTime \tag{1}\]  
After the interval, if no response is received from the other nodes within the specified time, the RTS frame will be retransmitted. Therefore, after a node receives an RTS frame that is not sent  
Figure 3: Interaction of nCTS.