Recently, network programming has been developed for several days, mainly based on UDP, to achieve priority, packet sorting, splitting and restructuring, retransmission, speed control, and other functions.
The speed control mechanism is similar to the negative feedback mechanism in the circuit. Unlike UDP, only some of them require reliable transmission, and most of the packets are unreliable. Therefore, mechanisms like TCP speed and slow start are not implemented. In actual implementation, the receiving end uses statistics such as the actual receiving speed to be regularly fed back to the sending end to achieve the control speed. Set an appropriate initial speed. If the packet loss rate is low, the transmission speed is faster. If the packet loss rate exceeds the permitted range, the transmission speed is reduced.
In actual tests, generally, the transmission speed can be stable near the upper limit of the network capability, and the average value can be close to 90% ~ of the network capability ~ 95%. The additional load is the regular speed feedback. The feedback period can be determined based on the actual situation.