Currently serving the Web and mobile live streaming media systems, generally due to the backbone of the core computer Room network quality assurance, while the media stream publishing client if the network to the server appears to be a card, will affect all streaming media player users, Therefore, in order to protect the media stream to publish the client-to-server network quality, most of the backbone of the core computer room to deploy the source media server, media streaming publishing clients to publish media streams in the source media (that is, only the release stream service), stream Media server through the media Flow State Management Server sharing media flow status information, In order to realize the source media server to each other according to a certain rules of the transmission of media streams, each source of the media under the tree-shaped structure to mount a multi-stage streaming media server (provide from the top to the bottom of the relay service), the transfer media server and then hang up the edge of the streaming media server (streaming service only), Such a streaming server deployment structure brings up the following issues:1 due to the high cost of the core network, the traffic expense of the source media server is higher;2 Intermediate multistage Streaming Media server increases the end-to-end delay, Reduced user experience;3 backbone network core room is stable, but the distribution of the national media Stream publishing end with the network quality is not necessarily the fastest . In order to overcome these problems, this paper proposes a method based on network traffic statistics and feedback to realize the traffic flow scheduling of the Edge machine Room media, which is described as follows:
1 The Entire network for streaming media server Division backbone Core Room and the edge of the computer room, the main and standby two core room to deploy a streaming media server (provide a small number of transit services across network operators) and core-level media streaming Management Server, Multiple edge rooms deploy edge streaming media servers (both publishing and playback streaming services) and edge-level media streaming management servers.
2 Edge-level Media stream Management Server in each edge room and the core-level media stream Management Server of the main standby two core room at the same time establish a network connection, the connection is established immediately after the computer room ID, At the same time, the connection is also used for reporting or querying the media flow information and the quality statistics of the machine Room network.
3 each Edge room deploys the modified LVS, which analyzes the media stream name and then directs all requests to publish or play a media stream with the same name as possible to boot to the same edge streaming media server and provide streaming media services.
4 Each core room of the intermediary streaming media server initiated after the active connection to the room's core-level media streaming Management Server, immediately after the connection to escalate the streaming media server ID, and maintain a constant connection, and constantly report their own load information.
5Edge Streaming Media server in each edge room starts to connect to the edge-level media stream Management Server of the computer room and immediately reports to the streaming media server after connection.ID, and maintain a constant connection, constantly reporting their own load information, edge-level media streaming Management Server at the time of re-or new boot if set the ' Issued to other computer room speed Test option ' (this option is set when the edge-level media streaming Management Server and the edge streaming media server in this room are restarted at the same time, this option is not required if the instant restart is not necessary due to an upgrade of the edge-level media streaming Management Server, as the edge streaming service in this room is still running and The media streaming Management Server establishes a connection that, if successful, immediately reports the media stream information posted to it and the traffic statistics to other rooms) or within a certain period of time (e.g.5seconds), did not receive from the edge streaming media server about this roomAto another roomBNetwork Statistics Information (maybe another computer room to hang up or the room to another computer room before the poor quality of the network caused two machines room no direct push play stream, but the latter situation still need to constantly speed, because the network when bad, non-static), Edge Media streaming Management Server in the Edge room Select a streaming server from all the edge streaming servers connected to it according to certain rules (e.g., the current load is the lightest)Bany of the edge streaming media serversS1A publishing stream whose name is distinguished by a prefix specialization to distinguish it from the normal media stream, which is the file stream from the disk multimedia file (its bitrate is higher than the maximum single-channel stream rate expected by the streaming media system )1times, not too large, wasteful flow, too small, insufficient to provide reference data), dedicated to speed, for the post-order flow scheduling accumulated parameter indicators, the selected streaming media server constantly loop read the aforementioned disk files, and then periodic (such as2seconds) reports the network Quality statistics report to the edge-level media streaming Management Server (the edge-level media Flow Management Server is calculated and summarizedARoom toBThe network quality statistic results of the computer room are reported to the core-level media stream Management Server of the core computer room, and the statistic results includeARoom toBstream data, the number of stuck releases, current total traffic, etc.) untilARoom toBRoom2The statistics of the media stream above the end of this round byARoom toBcomputer room direction of the network speed measurement (because the speed of the traffic is not to serve the user's invalid traffic, so in the real media streaming network quality statistics, timely stop, so as not to waste traffic, combined with operators generally by peak settlement of traffic costs, so if the two rooms are not media streaming, can be carried out speed, Normal does not exceed peak traffic),Bcomputer room or other edge room toAthe speed of the engine room direction should be carried out separately, because the network quality of two directions can be different (upstream and downstream different).
5_1 ms5 to an edge streaming media server s5 S5 Report the media streaming Management Server in its room M5 Span style= "font-family: the song Body;" >, M5 record MS5 and s5 ms5 s5 The correspondence of
6 When streaming media playback client C1 A1 Edge Streaming Media server to an edge room S6 request to play a media stream MS6 , if the S6 already exists MS6, direct forwarding; otherwise perform step 6_1 below .
6_1 S6to the edge-level media streaming server in its own roomM6Query the best bearerMS6the streaming media server network to pull, M6query itself, if the computer room a streaming media server has been hostedMS6, toS6back to the streaming media server to pull (through the third step, the same edge room as far as possible to a certain media streaming traffic relay services focused on a first-class media streaming server, so the same computer room two flow server traffic Exchange probability is very low, but if for a media stream has a large audience, May exceed the load of a single streaming media server, for completeness considerations, design this link); otherwise,M6If you maintain normal links with the core Media stream Management Server of the main core room, forward the query to it, otherwise forward the query to the core-level media stream Management Server in the core room. Core-level media streaming Management ServerTM6after receiving the query, follow the request parameters to collect all the hosts from the media stream information that was escalated by the previous edge media streaming Management ServerMS6list of streaming media servers, if the list is empty (descriptionMS6not present), replyM6The stream does not exist,M6receive a reply and then reply toS6,S6receive the backC1Turn off the network connection to it after sending a non-broadcast prompt; otherwise, the streaming media servers in the list are in the same room asA1the network quality statistic result of direction chooses the optimal load according to certain algorithmMS6Streaming Server network pull, the algorithm mainly consider the indicator for the speed, transit level (in principle, not more than two levels, such as media streaming publishingMS6to a stream server in Changchun Unicom roomS6_1Is a level, Shanwei computer room of a streaming media serverS6_2fromS6_1Play stream is the second level, in this algorithm only consider the second level to ensure that the total number of forwarding layer does not exceed3If the operator, the region is close, if you choose to pull it as a parameter and attach the direct play stream flag as1Reply toM6,M6and then reply toS6,S6View the direct play stream flag as1to pull the stream directly forward; otherwise see if a streaming media server is hosted in the core roomMS6, and if you add the direct stream flag as a parameter with its drag as1Reply toM6,M6and then reply toS6,S6View the direct play stream flag as1to pull the stream directly forward; otherwise, pick one of the lightest-load streaming media servers from the core room.S6_3The ground pull is attached as a parameter simultaneouslyMS6publish a streaming media server directly on itS6_4the direct Play stream flag is0replyM6,M6replyS6,S6Check to see the direct play stream flag as0, toS6_3request to play media streamMS6,also included in the play request parameterS6_4Web-torn,S6_3after receiving the play request, removeS6_4To the ground, to its stream,S6_4upon receipt of the request, theS6_3Forwarding Media streamsMs6,s6_3After you receive the media stream ,S6forwards the stream.
7 in each core room of the intermediary streaming media server when pulling to the new media stream, to its top room media streaming Management Server escalated the streaming media server to start hosting the flow notification, when the media stream is disconnected when the report does not host the media stream notification, the transit stream media does not report network quality information.
8when an edge roomA8the streaming media serverS8_1received another roomB8the streaming media servers8_2the playback Media streamMS8after the request, if the current flow does not exist, the first outgoing flow has been announced to theS8_2,then close the connection;S8_1tos8_2forwards the media stream while periodically (for example,2seconds) toA8Media Stream Management Server in the roomM8escalationS8_1tos8_2direction of the network report. The quality of the report depends on the speed, no lag, also includesA8,B8the computer roomID,S8_1,s8_2the serverIDwith the serverIPand other information so thatM8by summarizing the report with other reports, a statistical report is reported periodically to the media Stream Management Server in the main standby core room. WhenS8_1about Media detectedMS8appear card immediately (by the flow side detection, because the inflow side bad detection, for example, the code rate has a lot of small, not fixed, can not say that the small rate on a certain card, also can not be measured by the frame rate, because in a streaming media system with the business different frame rate is different, some business video stream originally frame rate is -, in -frame, but the video stream of the business itself theFrame rate) to thes8_2sends a media stream stutter notification but does not turn off media streaming. s8_2received information aboutMS8the media stream stutter notification or self-detectedMS8the receiving speed is particularly low (e.g. below10Kworse, then by waitingS8_1notice, may have to wait for a long time because of the low speed of communication is slow to wait for a longer period naturally, and thens8_2do not close first fromS8_1Media stream , instead of a media streamMS8the name of the parameter is included with theS8_1implementation of paragraph6_1step, in the first6_1Step inTM8you need to exclude when calculating the optimal hosting serverS8_1all streaming media servers in your room. At the adoption of paragraph6_1step to receive a new play stream to ripS8_3after thes8_2still don't shut down from the firstS8_1the media stream, but try toS8_3play a stream for a period of time (e.g.2in seconds) fromS8_3the media stream pulled is not immediately forwarded tos8_2about theMS8The associated media stream plays the client, but instead compares theS8_3with theS8_1about media streamingMS8speed, if fromS8_3about media streamingMS8the Internet speed priority comes fromS8_1switch operation in the future, forwarding fromS8_3of aboutMS8Media Stream to all of the corresponding media streams to play the client and close theS8_1the Media streamMS8, or switch operation is not performed,S8_3the Media streamMS8.
9 The core-level media stream Management Server of main and standby core room, periodically synchronize all of its own media stream information and machine Room network quality information, mainly to supplement the information that does not exist, if there is a direct ignore do not update.
the use of this method can effectively reduce the core room flow, because the core room traffic is much more expensive in the edge room flow, and reduce the bandwidth cost, while reducing the intermediate transmission link, up to two levels of transit, thereby reducing the streaming time delay to improve the real-time, coupled with the user can access the nearest streaming media server, This brings the streaming media user-to-stream server network speed corresponding increase.
A method of traffic flow scheduling in Edge machine room based on network traffic statistics and feedback