Research on Matrix-type Packet Loss Compensation Scheme for Wireless Video Transmission on Subway

As the mainstream wireless LAN technology, Wi-Fi can achieve fast data transfer. With the subway moving in a high speed, video data transmission between the metro and the ground is achieved through Wi-Fi technology. This paper aims at solving the Caton problem caused by switching packet loss in the process of playing real-time video on the train terminal, and proposes matrix-type packet loss compensation scheme. Finally, the feasibility of the scheme is verified by experiments.


Introduction
In recent years, the problem of traffic congestion has seriously affected and restricted the cities' development in China [1].Rail transit has become the primary choice for most urban trips [2].The subway plays as an important form of rail transportation, its fast, security, environmental protection, large capacity, which makes it play an irreplaceable role in people's work and life.With the subway construction going to a high-speed development period, Subway has now entered a period of comprehensive network operations.Passengers' needs for the Metro to play real-time video information are also increasing [3].
This paper is just in this background and proposes a real-time wireless video transmission scheme.As the subway is always in a state of motion, it is unrealistic to transmit video data by cable.This article uses the mainstream Wi-Fi technology for real-time video data transmission.However, Wi-Fi technology, although able to meet the requirements of moving data transmission for the terminal, the technology itself also has some limitations, such as, a single Wi-Fi has a limited coverage, Wi-Fi's signal strength is not stable and so on.Limited coverage cannot meet the needs of continuous receiving video data in the process of subway moving.Now is to deploy multiple wireless AP next to the subway lines to cover the entire range of traffic section.
With the train moving at a high speed, the train terminal undergoes the process of switching from the coverage of one AP to the coverage of another AP.As the switch takes some time, it means that there will be switching loss inevitably during the switching process.It is due to the existence of the switch packet loss, which results in the train terminal appearing Caton phenomenon in the process of playing real-time video.In order to improve the users' satisfaction for the public transport, the video playback fluency should be improved.As a result, packet loss has become an urgent problem to be solved.
As the previous investigators, Jiang Lei, who proposed a WLAN based on the prediction of switching technology (WHFT).WHFT allowed the on-board AP to establish a connection with a new AP (such as APn+1) before disengaging from the old AP (such as APn), that was, connection before interruption.In addition, the adjacent Aps overlap each other with a sufficient area, a zero switching time can be realized [4].Cheng Hanlin evaluated the effect of packet size on video quality and presented the concept of maximum packet size.If there was no video transmission recovery protection (such as FEC), the video transmission quality of the larger packet size was better than the smaller packet size.This approach only took into account the impact of a single factor on the quality of video transmission, without considering the actual transmission environment [5].Jiang Xueyuan proposed a study based on the Gilbert model, simulated of the real wireless transmission environment.The packet loss mode with the specified packet loss feature was obtained by reverse modelling [6].However, the proposed solutions for the packet loss were just used in a single scene, and there were no specific measures for real-time video data transmission.They were not suitable for improving packet loss in complex transmission environment.This article is based on the subway, such a complex and volatile transmission environment, a matrix packet loss compensation scheme is proposed.Aiming at solving the Caton problem due to the switching packet loss in the process of real-time video data transmission through the Wi-Fi way [7] [8] [9] [10].
2 Analysis of wireless video transmission system between subway cars and ground

IST2017
Figure 1 shows the overall structure diagram of the subway communication system.Each subway line has a central machine room.Switches and various types of servers are deployed in the center room.The switches in the center room are connected to the trackside APs by fiber.Trackside APs transmit the real-time video data to the vehicle Aps.However, a single wireless AP has a limited coverage, in order to allow the moving train to receive continuous data, multiple wireless APs should be deployed along the track.In general, a wireless AP is deployed every 300-500 meters.So as to cover the whole range of vehicles, and there is a certain overlap between adjacent APs.

Figure 2. Wireless communication system between subway cars and ground
Wireless communication system between subway and the ground in figure 2 is the focus of this paper.Real-time video data is transmitted wirelessly between the rails and the train terminals.In the figure, the trackside AP is the sender and the on-board AP is the receiver.There are multiple APs along the subway line.With the train moving at a high speed, the video data received by the on-board AP comes from different trackside APs, that is, switching between different trackside APs.

Design of matrix packet loss compensation program 3.1 Working principle
As shown in Figure 3 is the principle diagram of matrix packet loss compensation, three data streams are now defined: the fast stream, the slow stream and the combined stream.The fast stream is sent five seconds earlier than the slow stream.The combined stream is the final video stream that needs to be played.

IST2017
There are three buffers in the system, to receive fast flow, slow flow and combined flow respectively.The source of the combined stream is the data from the slow flow, when the data packet loss occurs in the slow flow, the missing data in the slow flow will be found from the fast flow and then stored in the combined stream.So that the combined stream is a complete data stream.
As the fast flow is sent five seconds earlier than the slow flow, when the slow flow appears data loss, this lost part of the data has been cached in the fast flow in advance, so the lost part of the slow stream can be found directly from the fast stream.In Figure 3, when the signal is interrupted for two seconds, slow flow of data loss is the number 6 and 7.At this time, this part of the data existed in the fast flow normally.When the combined stream cannot find the data labeled 6 and 7 in the slow flow, they can be just obtained in the fast flow.Thereby a complete one-way data is formed to send to the terminal.Through this compensation way which deal with the packet loss can effectively improve the Caton phenomenon in the process of playing real-time video on the train terminal.

IST2017
switching.The normal Wi-Fi module cannot switch, unless the original AP signal is completely gone.However, in the practical application of subway, there must be some overlap between neighboring APs, instead of waiting for the signal to be completely lost and then switching to another AP.The Wi-Fi signal strength indicator is represented by the signal power absolute value dbm (negative value).From the flow chart can be seen that with the train moving at a high-speed, if the signal strength of the serving AP is less than a certain threshold (-60dbm) and the currently serving AP's signal strength is smaller than the signal strength of the neighboring AP, the on-board AP will switch from the current AP to the next neighboring AP.

Critical code
(1) SubwayServerDemux.c file is to send the data stream.One-way stream is transformed into two streams through the function subwayDemuxSend and then sent out.Define static void subwayDemuxSend (SubwayServerDemux* subway) as a static function; (2) SubwayClient.c is the receiver.Two streams are received through the function subway_recv.Define static void subway_recv (SubwayClient* subway) as a static function; (3) SubwayServer.cfile is to add RTP head.The function subway_recv adds the RTP head to the transmitted TS stream.Define static void subway_recv (SubwayServer* subway) as a static function; (4) SubwayClientMux.cparses the head and restores the stream.The function SubwayClientMuxPush analyzes the two received data and is defined as void SubwayClientMuxPush (SubwayClientMux* subway, StrmBuffer **psb).The function subwayMuxSend is to restore two video streams to one way stream.Define static void subwayMuxSend (SubwayClientMux* subway) as a static function.

Parameter configuration
First of all, setting up the PC and input set-top box connection through the ping command.And then setting the parameters of the set-top box configuration.The multicast address configured at the input set-top box output must be the same as the multicast address configured at the input of the output settop box, in order to establish the correct connection between two such set-top boxes.The specific parameters of the configuration are shown in Table 1and Table 2  Functional analysis of each part: 1) The PC side is the sending end, send the original one-way video stream to the first set-top box; 2) The input set-top box has two network ports.The left side is in and the right side is out.The in port is connected with the PC side and receive the one-way video stream from the PC.This input settop box transforms the one video stream data into two identical content, but different transmission time point video streams through the internal programming (fast stream and slow stream).
3) The switch is the transmission medium.It transmits the two-way video stream from the output of the input set-top box to the output set-top box.
4) The in port of output set-top box is connected to the switch and receive the two-way video stream.Two receiving video streams are restored to one stream through the internal programming.The final output to the video playback terminal is a complete video stream data.In the laboratory experiment platform, in order to simulate the real environment of the packet loss.
The measure is now taken by unplug the network between the out port of the input set-top box and the switch.The packet loss time setting in the program is five seconds.In the absence of taking any measures, unplug the network will appear Caton phenomenon on the video terminal.And when a packet loss compensation scheme is adopted, in the five seconds packet loss time, even unplug the network, the video terminal can still play the video smoothly.

Experimental results
The final experimental results are reflected by the smoothness f of video playback.The smoothness of video playback is obtained by testing in some subway lines.The test here is the mosaic time t1 statistics in the process of video playback.The smoothness of video playback means the ratio of the time t2 of the mosaic does not occur during video playback to the total video playing time t.And finally through a large number of experiments calculated that after the implementation of matrix packet loss compensation scheme, relative to the original system without taking any measures, video playback smoothness from less than the original degree of 50% to the current 90%.Thereby greatly improving the fluency of video playback.

Conclusion
In this paper, the subject is wireless transmission system between the subway and the ground.Using Wi-Fi technology to transmit video data.Starting from the principle of Wi-Fi access, the paper analyzes the principle and procedure of AP switch and the packet loss during switch.A matrix packet loss compensation scheme is proposed to deal with packet loss.It compares before and after the program implementation of video playback quality through the experimental way.After using the packet loss compensation scheme, the Caton phenomenon caused by switching loss is significantly improved.Even if there is a short packet loss, the train terminal can still be able to playback video data smoothly, without giving users a poor visual experience due to packet loss.But although the Caton phenomenon has been largely improved, in the real experimental environment, video playback fluency cannot reach 100%.This is due to the subway running in the real environment, in addition to switching packet loss that effecting the video playback fluency, there may be a certain number of transmission packet loss.The problem of transmission packet loss is also the focus and direction of the next research.

2. 1 Figure 1 .
Figure 1.The overall structure diagram of the subway communication system

Figure 3 .
Figure 3. Schematic diagram of matrix packet loss compensation

Figure 4 .
Figure 4. Real-time video transmission process Figure 4 is the concrete realization of the proposed matrix packet loss compensation scheme in subway.The encoder outputs the original video stream.And then the set-top box transforms one stream to two streams through the internal programming.Two video streams are output from the settop box (STB1).The data are sent to the directional antenna through the switch.Directional antenna sends the two video streams to the receiving end through wireless way.The location labeled 3 is two streams.The two-way video streams are restored to one way by the set-top box, the location labeled 4 is the final restored combination stream.The end of the one-way video stream is received and played on the train terminal player.

Figure 5 .
Figure 5. AP switch flow chartIn the flow chart of Figure5, the signal strength value is detected by a customized Wi-Fi module.This Wi-Fi module is different from the generic Wi-Fi module, it is designed specifically for

Figure 6 .
Figure 6.Experimental platform buildingThe experimental platform is divided into five parts: PC, input set-top box (encoding device), switch, output set-top box (decoding equipment), and video terminal.Functional analysis of each part:1) The PC side is the sending end, send the original one-way video stream to the first set-top box;2) The input set-top box has two network ports.The left side is in and the right side is out.The in port is connected with the PC side and receive the one-way video stream from the PC.This input settop box transforms the one video stream data into two identical content, but different transmission time point video streams through the internal programming (fast stream and slow stream).3)The switch is the transmission medium.It transmits the two-way video stream from the output of the input set-top box to the output set-top box.4)The in port of output set-top box is connected to the switch and receive the two-way video stream.Two receiving video streams are restored to one stream through the internal programming.The final output to the video playback terminal is a complete video stream data.5)Video terminal receives the video stream data from output set-top box and plays the multicast stream.

5 )
Video terminal receives the video stream data from output set-top box and plays the multicast stream.

Table 1 .
. Configuration parameters of the send packages

Table 2 .
Configuration parameters of the receive packages