Player of cable television RTP (Real Time Protocol) streaming protocol
By introducing path analysis and NAT crossing processing modules into the player of the cable TV RTP stream protocol, the NAT crossing channel is established using STUN technology, which solves the problem of RTP stream not being received in cross-subnet transmission, and realizes the stable transmission of audio and video data and high-quality playback.
Patent Information
- Application Number
- CN202411527994.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-03
AI Technical Summary
In the case of cross-subnet transmission, due to the failure of NAT penetration, the RTP stream cannot be received, resulting in the audio and video data being unable to successfully penetrate the NAT, affecting the normal operation and user experience of the player.
A player of cable TV RTP streaming protocol is designed, including path analysis module, NAT crossing processing module, information acquisition module and RTP streaming module. The external IP address and port information are obtained through STUN technology, and the NAT crossing channel is established to ensure RTP Stable transmission of streams.
It effectively solves the problem that RTP stream cannot be received during cross-subnet transmission, ensures low latency and high-quality transmission of audio and video data, and improves user experience and system stability.
Smart Images

Figure CN119255056A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network audio and video transmission, and in particular to a player of cable television RTP stream protocol. Background Art
[0002] A cable TV RTP streaming protocol player is a device or software specifically used to process and play RTP (Real-time Transport Protocol) streams, and is mainly used for audio and video streaming in cable TV networks. The RTP protocol is designed to provide data transmission services in multicast or unicast networks, ensuring low latency and real-time performance of audio and video data. However, in the case of cross-subnet transmission, due to the existence of NAT (Network Address Translation), the RTP stream may not be able to successfully penetrate NAT, resulting in the target receiving end being unable to receive audio and video data, thus affecting the normal operation of the player. This problem usually manifests itself as audio and video screen freezes or cannot be displayed at all, seriously affecting the user experience. Summary of the invention
[0003] The purpose of the present invention is to provide a player of cable television RTP stream protocol to overcome the above-mentioned shortcomings in the prior art.
[0004] To achieve the above technical objectives, the technical solution of the present invention is implemented as follows:
[0005] Cable TV RTP streaming protocol player, including:
[0006] Path analysis module, used to obtain the source address and destination address of the RTP stream and perform network path analysis;
[0007] NAT traversal processing module, used to determine whether NAT traversal processing is required based on the network path analysis results;
[0008] The information acquisition module is used to obtain the external IP address and port information using STUN technology when NAT traversal is required;
[0009] The NAT traversal channel establishment module uses the acquired external IP address and port information to establish a NAT traversal channel;
[0010] The RTP stream transmission module is used to transmit the RTP stream through the established NAT traversal channel to ensure the stability of cross-subnet transmission.
[0011] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required includes the following steps:
[0012] Evaluate the type of NAT devices in the network path;
[0013] Test the external connection capability of NAT equipment;
[0014] Confirm whether the NAT device supports port mapping;
[0015] If the NAT device does not support port mapping, it is determined that NAT traversal processing is required, otherwise the current connection mode continues to be used.
[0016] These steps can more effectively solve the problem of RTP stream being unable to be received due to NAT penetration failure in cross-subnet transmission.
[0017] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required further includes the following steps:
[0018] Collect delay data of the current network path;
[0019] Evaluate the changing trends of latency data;
[0020] Determine whether the NAT penetration policy needs to be adjusted based on the stability of the delay data;
[0021] If T(N)>T_threshold, it is determined that the NAT penetration policy needs to be adjusted, where T(N) represents the average delay of the current network path, and T_threshold represents the preset maximum delay threshold.
[0022] These steps further improve the reliability of NAT traversal by dynamically evaluating the status of the network path.
[0023] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required further includes the following steps:
[0024] Collect the connection records of the current NAT device;
[0025] Analyze the error information in the connection log;
[0026] Determine whether to adjust the NAT penetration policy based on the frequency of error messages;
[0027] If E(N)>E_threshold, it is determined that the NAT penetration policy needs to be adjusted, where E(N) represents the error frequency in the current NAT device connection record, and E_threshold represents the preset error frequency threshold.
[0028] By monitoring and analyzing the connection records of NAT devices, potential NAT penetration problems can be discovered and handled in a timely manner.
[0029] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required further includes the following steps:
[0030] Evaluate the bandwidth status of network paths;
[0031] Measure the maximum available bandwidth of the current network path;
[0032] Based on the maximum available bandwidth, determine whether it is necessary to adjust the NAT traversal policy;
[0033] If B(N) < B_threshold, it is determined that the NAT traversal policy needs to be adjusted, where B(N) represents the maximum available bandwidth of the current network path, and B_threshold represents the preset minimum bandwidth threshold.
[0034] Through bandwidth evaluation, it can be ensured that NAT traversal can be stably performed in a low-bandwidth environment.
[0035] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required further includes the following steps:
[0036] Evaluate the security of the network path;
[0037] Test the packet loss rate in the network path;
[0038] Based on the packet loss rate, determine whether it is necessary to adjust the NAT traversal policy;
[0039] If L(N) > L_threshold, it is determined that the NAT traversal policy needs to be adjusted, where L(N) represents the packet loss rate of the current network path, and L_threshold represents the preset maximum packet loss rate.
[0040] Through the evaluation of the packet loss rate, the stability of network transmission can be further improved.
[0041] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required further includes the following steps:
[0042] Evaluate the congestion situation of the network path;
[0043] Detect the congestion index of the network path;
[0044] Based on the congestion index, determine whether it is necessary to adjust the NAT traversal policy;
[0045] If C(N) > C_threshold, it is determined that the NAT traversal policy needs to be adjusted, where C(N) represents the congestion index of the current network path, C(N) = a * delay + b * packet loss rate + c * (1 - bandwidth utilization rate), the parameters a, b, and c respectively represent the weights of delay, packet loss rate, and bandwidth utilization rate, and C_threshold represents the preset maximum congestion index.
[0046] Through the evaluation of the congestion situation, the effectiveness of NAT traversal can be ensured in a high-congestion environment.
[0047] Preferably, based on the network path analysis result, determining whether NAT traversal processing is required further includes the following steps:
[0048] Identify each node in the network and its attributes, including the location, type and status of all devices participating in the communication and intermediate network devices;
[0049] Analyze the connection paths between these nodes and evaluate the performance indicators of each path, including latency, bandwidth, and packet loss rate;
[0050] Whether NAT traversal processing is required is determined based on the performance indicator.
[0051] Beneficial effects of the present invention:
[0052] The present invention can solve the problem that the RTP stream cannot be received due to NAT penetration failure in the case of cross-subnet transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a schematic diagram of the functional module structure of the player described in the embodiment of the present invention. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present invention are described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0055] Next, refer to the attached Figure 1 , describing the various steps of the player of the cable TV RTP stream protocol of the present invention and how to solve the problem that the RTP stream cannot be received due to the failure of NAT penetration in the case of cross-subnet transmission. The first is to obtain the source address and destination address of the RTP stream, and perform network path analysis. In this step, the player first captures or receives the RTP stream data packets from the cable TV server through the network interface, and these data packets contain the source address (i.e. the IP address and port of the sender) and the destination address (i.e. the IP address and port of the receiver). Subsequently, the player analyzes these addresses to determine the network environment where the source address and the destination address are located, such as whether there are different subnets, and whether there is a network address translation (NAT) device. For example, in one embodiment, the cable TV server is located on a server with a fixed public network IP address on the Internet, and the set-top box of the home user is located in the intranet and is protected by NAT.
[0056] Based on the results of the network path analysis, determine whether NAT traversal is required. At this stage, the player uses the information collected previously to decide whether NAT traversal needs to be performed to achieve direct communication between the source address and the destination address. If it is detected that both parties are in the same LAN or there is no NAT obstacle, the RTP stream connection can be established directly without further NAT traversal operations. However, in most cases, especially when the recipient is in a private network, measures must be taken to penetrate the NAT device to ensure that the data packets transmitted from the public Internet can be accurately delivered to the target receiving end. Specifically, assuming that the NAT function is enabled on the router in the user's home, the player will determine that the NAT traversal process needs to be executed to solve the problem of cross-network transmission.
[0057] If NAT traversal is required, STUN technology is used to obtain external IP address and port information. At this point, the player will initiate a request to a specific service on the public network - the STUN server, asking it to return its real IP address and open port number displayed to the outside world. In this process, the STUN server acts as an intermediary to help the client know its public network identity. This operation is particularly critical for devices that are hidden behind the network and only have a series of internal private IP addresses. Specifically, when the set-top box tries to contact an external cable TV service provider, it will first query the STUN server to understand the public network IP and port number combination after NAT, which is the key information point actually used to transmit RTP data packets.
[0058] Use the external IP address and port information obtained to establish a NAT traversal channel. In this step, the player uses the public address information obtained from the STUN server to establish a direct connection path between the local device and the target end, which is the so-called NAT traversal channel. The purpose of this is to enable a stable two-way communication link with the sender on the other side of the Internet, even if the receiver is located in the intranet, to achieve high-quality, low-latency live video transmission. For example, through this step, even if the user's home router has strict firewall settings turned on, the player can still successfully receive live streaming data from the outside without changing any routing rules.
[0059] The RTP stream is transmitted through the established NAT traversal channel to ensure the stability of cross-subnet transmission. Once NAT traversal is completed, the RTP data stream can be efficiently transmitted from the source to the destination through the constructed virtual direct path, without being hindered by intermediate devices such as routers. In order to maintain the stability and security of this path, the player usually needs to maintain an active connection continuously, such as through a timed heartbeat detection mechanism or sending keep-alive packets to avoid automatic closure due to session timeout. In a specific example, suppose a user is watching a live high-definition sports event. Even if the Wi-Fi signal is temporarily lost and the connection is interrupted, the player can still quickly restore communication with the server with the pre-set retry strategy, continue to enjoy a smooth viewing experience, and avoid a series of problems caused by frequent disconnection and reconnection.
[0060] Furthermore, the present invention determines whether NAT traversal processing is required based on the network path analysis result, including the following steps: evaluating the NAT device type in the network path; testing the external connection capability of the NAT device; confirming whether the NAT device supports port mapping; if the NAT device does not support port mapping, determining that NAT traversal processing is required, otherwise continuing to use the current connection mode. Through these steps, the problem of RTP stream being unable to be received due to NAT penetration failure in the case of cross-subnet transmission can be more effectively solved.
[0061] Evaluating the type of NAT device in the network path is the first step, and its main purpose is to determine the specific type of NAT device contained in the network path. NAT devices have different working modes, and common types include full cone NAT, restricted cone NAT, port restricted cone NAT, and symmetric NAT. Different types of NAT devices have different support capabilities and security for external connections. For example, in one embodiment, assume that a cable TV RTP stream player is located in the user's home network, and the gateway router of the network is a port restricted cone NAT device. This step helps with subsequent NAT device function testing and provides a basis for selecting appropriate NAT traversal technology.
[0062] Testing the external connection capability of the NAT device is the second step. The main purpose is to verify whether the NAT device can successfully establish a connection from the inside to the outside. This is usually achieved by sending a specific data packet and waiting for the response of the external server. For example, you can send an ICMP (Internet Control Message Protocol) or UDP (User Datagram Protocol) data packet. In this process, you can determine whether the NAT device allows the internal host to establish a connection with the external host by analyzing the returned response. Specifically, if the NAT device allows this connection, it means that its external connection capability is strong, and the port mapping capability can be further tested. For example, in the aforementioned home network, by sending a UDP data packet, the external server can successfully respond, indicating that the NAT device has good external connection capabilities.
[0063] Confirming whether the NAT device supports port mapping is the third step. The main purpose is to check whether the NAT device supports mapping the port of the internal network to a specific port of the external network. This step is usually implemented by sending specific UPnP (Universal Plug and Play) or PNRP (Point-to-Point Name Resolution Protocol) requests to the NAT device. These requests will tell the NAT device to map a certain internal port to a port on the external network within a specific time period. If the NAT device successfully responds to these requests and is able to establish a mapping, it means that the NAT device supports port mapping. Specifically, in the aforementioned example, if the NAT device responds to the UPnP request and establishes the required port mapping, the player can directly use these mappings to receive the RTP stream without the need for NAT traversal processing.
[0064] If the NAT device does not support port mapping, it is determined that NAT traversal is required, otherwise the current connection method continues to be used. This is the fourth step and also a decision step. If port mapping is not supported, it means that the NAT device cannot automatically map the port of the internal host to the external network, which will cause the external host to be unable to communicate directly with the internal host. At this time, specific NAT traversal technologies such as STUN (Simple Traversal UDP through NAT), TURN (Traversal Using Relays around NAT) or ICE (Interactive Connection Establishment) are required. These technologies can help establish connections between internal and external network hosts through intermediate servers or relay points. For example, if the NAT device in the aforementioned home network does not support port mapping, the player will use the STUN server to discover its public IP address and port, and establish a direct connection with the peer host, or use the TURN server to forward the RTP stream.
[0065] Through the above four steps, the problem of RTP stream being unable to be received due to NAT penetration failure in cross-subnet transmission can be solved more effectively. Specifically, these steps ensure that potential problems are identified in the network path and appropriate measures are taken to bypass these obstacles, ultimately achieving stable and reliable RTP stream transmission.
[0066] Furthermore, the present invention further includes the following steps to determine whether NAT traversal processing is needed based on the network path analysis result: collecting delay data of the current network path; evaluating the change trend of the delay data; determining whether the NAT traversal strategy needs to be adjusted based on the stability of the delay data; if T(N)>T_threshold, where T(N) represents the average delay of the current network path and T_threshold represents the preset maximum delay threshold, determining that the NAT traversal strategy needs to be adjusted. These steps further improve the reliability of NAT traversal by dynamically evaluating the state of the network path.
[0067] First, you need to collect latency data for the current network path. Specifically, this step involves sending test packets between multiple nodes on the network path and recording the round-trip time of these packets to calculate network latency. For example, in a cable TV RTP streaming protocol player scenario, latency can be measured by sending a Ping request to the content server and recording the return time.
[0068] Next, evaluate the changing trend of the delay data. This step requires time series analysis of the collected delay data to determine whether there are significant fluctuations or trend changes in network delay. In one embodiment, the average delay over a period of time can be calculated using a sliding window technique, and a delay trend graph can be plotted. If a significant upward trend in delay is found, it may indicate that the network condition is deteriorating and further measures need to be taken.
[0069] Then, based on the stability of the delay data, determine whether the NAT traversal strategy needs to be adjusted. In this step, it is necessary to evaluate the stability of the delay data, that is, whether the network delay has large fluctuations. If the delay data is relatively stable, but the value is high, the performance can be improved by optimizing the NAT traversal configuration. Specifically, statistical methods, such as standard deviation or variance, can be used to quantify the fluctuation of the delay data.
[0070] Finally, if T(N)>T_threshold, it is determined that the NAT penetration policy needs to be adjusted. In this formula, T(N) represents the average delay of the current network path, which is usually between a few milliseconds and hundreds of milliseconds, depending on the network environment; T_threshold represents the preset maximum delay threshold, which is a critical value set according to the application scenario. For example, for a player of the cable TV RTP streaming protocol, T_threshold may be set to 100 milliseconds, because exceeding this threshold may affect the smooth playback of the video. If T(N) is greater than 100 milliseconds, the system will automatically trigger the adjustment of the NAT penetration policy to reduce latency and ensure service quality.
[0071] Through the above steps, the system can dynamically evaluate the status of the network path and adjust the NAT penetration policy when necessary, thereby improving the reliability of NAT penetration and the overall service quality.
[0072] Furthermore, the present invention further includes the following steps to determine whether NAT traversal processing is required based on the network path analysis result: collecting the connection record of the current NAT device; analyzing the error information in the connection record; determining whether the NAT traversal strategy needs to be adjusted based on the frequency of the error information; if E(N)>E_threshold, where E(N) represents the error frequency in the current NAT device connection record, and E_threshold represents the preset error frequency threshold, it is determined that the NAT traversal strategy needs to be adjusted. By monitoring and analyzing the connection record of the NAT device, potential NAT traversal problems can be discovered and handled in a timely manner.
[0073] Collecting the connection records of the current NAT device involves collecting logs or data packet records of the NAT device, which usually contain information such as the start time, source address, destination address, port, and connection status of the connection. The purpose of this step is to obtain all relevant connection data for subsequent analysis. For example, in one embodiment, a player of the cable TV RTP streaming protocol can be configured to regularly collect connection logs of the NAT device and store these logs on a central server for centralized management.
[0074] Analyzing error information in connection records involves identifying and extracting error information from the collected connection records. These error messages may include connection timeouts, packet loss, port binding failures, and other issues. The purpose of this step is to determine the quality of the connection by identifying errors. For example, the specific analysis process may include using regular expressions to match specific error codes or error messages in the log. Once an error is detected, it is recorded in a separate error log file for further processing.
[0075] Determine whether to adjust the NAT penetration strategy based on the error message frequency, which involves calculating and evaluating the frequency of error messages. By analyzing the error records in the error log, the number of errors occurring within a certain time window can be calculated and compared with a preset threshold. If the error frequency exceeds the threshold, it is considered necessary to adjust the NAT penetration strategy. Specifically, it can be implemented through a simple algorithm. For example, calculate the number of errors per hour in the past 24 hours, and then take the average as the error frequency E(N). For example, in a specific instance, if an average of 3 connection timeout errors occur per hour in the past 24 hours, and the preset error frequency threshold E_threshold is 2, the system will determine that it is necessary to adjust the NAT penetration strategy.
[0076] If E(N) > E_threshold, where E(N) represents the error frequency in the current NAT device connection record and E_threshold represents the preset error frequency threshold, it is determined that it is necessary to adjust the NAT penetration strategy. The value range of the parameter E(N) in this formula is usually a decimal or integer greater than or equal to 0, representing the error frequency per unit time. The parameter E_threshold is set based on historical data analysis and experience, and is usually also a decimal or integer. The meaning of the formula is that if the error frequency exceeds the preset threshold within a certain period of time, that is, E(N) > E_threshold, it is considered that the current NAT penetration strategy cannot effectively guarantee the connection quality and needs to be adjusted. Specifically, the setting of the threshold can refer to the requirements of the actual business scenario. Usually, it is necessary to minimize misjudgment under the premise of ensuring service quality, so the optimal value may vary depending on the application scenario. For example, for a player using the cable TV RTP stream protocol, the threshold may be set to 2 times per hour to ensure that users do not encounter frequent playback interruptions during viewing.
[0077] By monitoring and analyzing the connection records of the NAT device, potential NAT penetration problems can be discovered and processed in a timely manner, thereby improving the overall stability and user experience of the player using the cable TV RTP stream protocol.
[0078] Furthermore, the method for determining whether to perform NAT traversal processing based on the network path analysis result of the present invention further includes the following steps: evaluating the bandwidth status of the network path; measuring the maximum available bandwidth of the current network path; determining whether to adjust the NAT penetration strategy based on the maximum available bandwidth; if B(N) < B_threshold, where B(N) represents the maximum available bandwidth of the current network path and B_threshold represents the preset minimum bandwidth threshold, it is determined that it is necessary to adjust the NAT penetration strategy. Through bandwidth evaluation, stable NAT penetration can be ensured even in a low-bandwidth environment.
[0079] Evaluate the bandwidth status of the network path. This step involves a preliminary bandwidth assessment of the network link from the player to the target node. The purpose of the assessment is to obtain the overall situation of the network, including information such as network congestion level and signal strength, in preparation for subsequent precise measurement. In one embodiment, the network path latency and packet loss rate can be detected by sending ICMP (Internet Control Message Protocol) packets to preliminarily judge the quality of the network condition.
[0080] Measure the maximum available bandwidth of the current network path. This is based on the preliminary assessment and further precisely measures the maximum data transfer rate that the current network path can support. This step usually uses specialized bandwidth measurement tools or algorithms, such as PathMTU Discovery or BWCTL tool. For example, using the BWCTL tool can continuously send data packets of different sizes within a certain time, record their transmission time and packet loss rate, and then calculate the maximum available bandwidth of the current path.
[0081] Based on the maximum available bandwidth, determine whether to adjust the NAT traversal strategy. This step decides whether to adjust the specific NAT traversal strategy according to the measured maximum available bandwidth data. The content of the adjustment may include selecting a more efficient traversal method or reducing the amount of data stream transmission, etc. The purpose is to optimize the bandwidth utilization while ensuring the data transmission quality. For example, when the measurement result shows insufficient bandwidth, the player may preferentially choose UDP Hole Punching rather than the more bandwidth-consuming ICE (Interactive Connectivity Establishment) technology to establish a connection.
[0082] If B(N) < B_threshold, the NAT traversal strategy needs to be adjusted. In this step, B(N) represents the maximum available bandwidth of the current network path, and B_threshold is a pre-set minimum bandwidth threshold, generally ranging from 1 Mbps to 5 Mbps, depending on the requirements of specific applications. In this formula, if B(N) is less than B_threshold, it indicates that the current network environment may not be suitable for the existing NAT traversal strategy and corresponding adjustments need to be made. Specifically, when the player of the cable TV RTP stream protocol detects that the maximum available bandwidth of the network is 1.5 Mbps and the pre-set minimum bandwidth threshold is 2 Mbps, the system will automatically adjust the NAT traversal strategy and select a method more suitable for the low-bandwidth environment to maintain stable video transmission.
[0083] Through these steps, the present invention can dynamically adjust the NAT traversal strategy in different network environments, thereby ensuring that the player of the cable TV RTP stream protocol can also achieve stable video stream transmission under low-bandwidth conditions.
[0084] Further, the present invention further comprises the following steps to determine whether NAT traversal processing is needed based on the network path analysis result: evaluating the security of the network path; testing the packet loss rate in the network path; determining whether the NAT traversal strategy needs to be adjusted based on the packet loss rate; if L(N)>L_threshold, where L(N) represents the packet loss rate of the current network path, and L_threshold represents the preset maximum packet loss rate, determining that the NAT traversal strategy needs to be adjusted. By evaluating the packet loss rate, the stability of network transmission can be further improved.
[0085] Assessing the security of a network path involves checking the security of all nodes from the source to the destination address. This step typically includes verifying the identity of each node, ensuring that data is not tampered with during transmission, and ensuring that there is no unauthorized access. For example, in one embodiment, end-to-end encryption technology, such as TLS or IPsec, is used to ensure the security of transmission, thereby reducing security risks that may be introduced by intermediate nodes.
[0086] Testing the packet loss rate in a network path involves sending a series of packets and measuring which packets fail to reach the destination to determine the stability of the network. Packet loss rate is an important indicator for evaluating the health of a network and can help identify network congestion or other problems. Specifically, the loss rate can be calculated by sending a series of test packets to the target device and counting the proportion of these packets that failed to be successfully delivered.
[0087] Judging whether the NAT penetration strategy needs to be adjusted based on the packet loss rate is to decide whether the existing NAT penetration strategy needs to be adjusted based on the test results. If the detected loss rate exceeds the predetermined threshold, the system will automatically trigger the corresponding adjustment measures. For example, if the current NAT penetration method causes serious packet loss in a cable TV RTP streaming protocol player application scenario, the system will try to use alternative penetration technologies such as STUN (Session Traversal Utilities for NAT), TURN (Traversal Using Relays around NAT) or ICE (Interactive Connectivity Establishment).
[0088] If L(N)>L_threshold, where L(N) represents the packet loss rate of the current network path and L_threshold represents the preset maximum packet loss rate, the system will determine that the NAT penetration policy needs to be adjusted. The parameter L(N) usually ranges from 0 to 1 and represents the proportion of lost packets. The optimal value generally depends on the specific application scenario, but in general, the ideal loss rate should be close to 0. The setting of the parameter L_threshold is usually determined based on actual experience and technical standards. For example, assuming that L_threshold is set to 0.05, that is, the maximum allowable loss rate is 5%, if the L(N) obtained by the test is 0.07, it will trigger a policy adjustment to improve the reliability of network transmission. The formula L(N)>L_threshold means that when the packet loss rate of the current network path exceeds the preset threshold, the current NAT penetration policy needs to be re-evaluated and adjusted to optimize network performance and improve service quality.
[0089] Further, the present invention further comprises the following steps of judging whether NAT traversal is needed based on the network path analysis result: evaluating the congestion of the network path; detecting the congestion index of the network path; judging whether the NAT traversal strategy needs to be adjusted based on the congestion index; if C(N)>C_threshold, where C(N) represents the congestion index of the current network path, and C_threshold represents the preset maximum congestion index, determining that the NAT traversal strategy needs to be adjusted. By evaluating the congestion situation, the effectiveness of NAT traversal can be ensured in a high congestion environment.
[0090] In the step of assessing the congestion of the network path, the main purpose is to analyze whether the network path from the source to the destination is unobstructed. This includes but is not limited to checking link bandwidth utilization, packet loss rate, latency and other indicators. Specifically, the degree of congestion can be assessed by sending a series of data packets and measuring the delay and loss rate of these data packets at the receiving end. The results of the assessment will provide basic data for subsequent steps.
[0091] In the step of detecting the congestion index of the network path, a specific value needs to be calculated to quantify the degree of congestion of the network path. Usually, the congestion index C(N) is calculated based on the various indicators obtained from the above evaluation (such as delay, packet loss rate, and bandwidth utilization). Specifically, it can be calculated by the following formula: C(N) = a*delay + b*packet loss rate + c*(1-bandwidth utilization). Here, parameters a, b, and c represent the weights of delay, packet loss rate, and bandwidth utilization, respectively. These weight values generally range from 0 to 1, and the optimal value depends on the specific network environment and application requirements. Through this formula, the congestion index can fully reflect the degree of congestion of the current network path.
[0092] In the step of judging whether the NAT penetration strategy needs to be adjusted based on the congestion index, the calculated congestion index C(N) is compared with the preset maximum congestion index C_threshold. If C(N)>C_threshold, it is considered that the current network path is in a highly congested state and the NAT penetration strategy needs to be adjusted to optimize data transmission. This step is decisive and determines how to deal with the network path problem later.
[0093] If C(N)>C_threshold, where C(N) represents the congestion index of the current network path and C_threshold represents the preset maximum congestion index, it is determined that the NAT penetration strategy needs to be adjusted. Specifically, this may include selecting a different transmission path, changing the transmission protocol (for example, from UDP to TCP), increasing the number of retransmissions, or reducing the transmission rate to mitigate the negative impact of congestion.
[0094] For example, in one embodiment, consider a player of a cable TV RTP streaming protocol, which needs to receive a video stream from a server. When the system evaluates the congestion of the network path, it is found that the network delay from the server to the player is high, the packet loss rate reaches 2%, and the bandwidth utilization rate is only 60%. According to the formula C(N)=0.4*delay+0.3*packet loss rate+0.3*(1-bandwidth utilization), the congestion index of the current path is calculated to be C(N)=0.4*200ms+0.3*2%+0.3*(1-60%)=80.4+0.6+0.12=81.12. Assuming that the preset C_threshold is 70, because 81.12>70, the system determines that the NAT penetration strategy needs to be adjusted, such as selecting a more stable transmission path or reducing the resolution of the video stream to ensure smooth playback.
[0095] The purpose of the above steps is to ensure the effectiveness of NAT penetration in a high-congestion environment, thereby improving the stability of data transmission and user experience.
[0096] Next, the present invention is described based on the network path analysis results, and judging whether NAT traversal processing is needed also includes the following steps: evaluating the network. First, it is necessary to identify each node in the network and its attributes. Specifically, this includes determining the location, type and status of all devices involved in the communication and intermediate network devices. Next, the connection paths between these nodes are analyzed, and the performance indicators such as the delay, bandwidth and packet loss rate of each path are evaluated. Subsequently, it is judged whether NAT traversal processing is needed based on these performance indicators.
[0097] Identifying network nodes means identifying and recording all devices in the network, such as servers, routers, switches, and clients. This step is achieved through network scanning technology, such as using ICMP, ARP, or DNS queries to obtain device information. The IP address, MAC address, and device type of each device will be recorded.
[0098] Path performance analysis refers to detailed performance testing of the communication paths between identified nodes. The main performance indicators include latency, bandwidth, and packet loss rate. Latency can be obtained by sending ICMP requests and measuring the response time; bandwidth can be measured using bandwidth test tools to measure the maximum transmission rate; packet loss rate can be calculated by sending a series of data packets and counting the number of packets not received. The goal of this step is to fully understand the current status of the network path in order to provide a basis for subsequent decisions.
[0099] Judging the need for NAT traversal means deciding whether NAT traversal is needed based on the results of path performance analysis. If a node on the path is behind NAT and the path performance index is lower than the preset threshold (such as delay greater than 50 milliseconds, bandwidth less than 10Mbps, packet loss rate higher than 1%), it is determined that NAT traversal is needed. Otherwise, NAT traversal is not needed.
[0100] For example, in one embodiment, when a player of the cable TV RTP streaming protocol plays a high-definition video stream in a network environment, it is found through network path analysis that the delay of a certain path is 60 milliseconds, the bandwidth is 9Mbps, and the packet loss rate is 1.5%. According to the preset threshold (delay 50 milliseconds, bandwidth 10Mbps, packet loss rate 1%), it can be judged that the performance of this path is poor. Therefore, NAT traversal processing is required to improve the transmission quality of the video stream.
[0101] In a specific example, assume that the communication path between the player and the video streaming server includes a router behind NAT. Through path performance analysis, it is found that the average delay of this path is \(D\) milliseconds, the bandwidth is \(B\) Mbps, and the packet loss rate is \(P\%\). According to the formula:
[0102] \[\text{Does NAT traversal need to be performed?}=\begin{cases}
[0103] \text{Yes},&\text{if}D>50\text{or}B<10\text{or}P>1\\
[0104] \text{No},&\text{otherwise}
[0105] \end{cases}\]
[0106] Among them, \(D\) is in milliseconds, usually ranging from 0 to hundreds of milliseconds, \(B\) is in Mbps, usually ranging from a few Mbps to hundreds of Mbps, and \(P\) is in percentage, ranging from 0% to 100%. The purpose of this formula is to ensure that NAT traversal is only performed when the path performance is poor to optimize resource utilization and user experience. Specifically, when the path performance is poor (high latency, low bandwidth, and high packet loss), NAT traversal processing can significantly improve the quality of the video stream.
[0107] The cable TV RTP stream protocol player of the present invention includes the following main steps and technical means, aiming to solve the problem that the RTP stream cannot be received due to NAT penetration failure in the case of cross-subnet transmission:
[0108] 1. Obtain network address information: First, the player needs to obtain the source address and destination address of the RTP stream. This process is usually implemented through standard network protocols to clarify the start and end nodes of the RTP stream transmission. This step provides basic data for subsequent network path analysis.
[0109] 2. Perform network path analysis: The player analyzes the acquired source and destination addresses to understand the network topology between the two, especially whether there is a NAT (Network Address Translation) device. This step is crucial to determine whether NAT penetration processing is required later. Specifically, if the analysis results show that there is a NAT device in the transmission path, it proceeds to the next stage; otherwise, it can directly perform RTP stream transmission to avoid unnecessary penetration processing.
[0110] 3. Determine the necessity of NAT penetration and perform corresponding operations: Once it is determined that there is NAT in the path and it needs to be handled, the player will use STUN (Session Traversal Utilities for NAT) technology to obtain the external IP address and port mapping information of the device on the internal network side. This information is crucial for establishing a direct communication link from the public network to the private network, solving the problem that the internal and external networks cannot communicate directly with each other in the traditional NAT environment.
[0111] 4. Establish NAT penetration channel: After obtaining the necessary port mapping, the player will use this information to create a reliable connection channel that can penetrate the NAT barrier. The existence of this channel ensures that the consistency and accuracy of data packet transmission can be maintained even between different subnets.
[0112] 5. Stable transmission of RTP stream: Through the NAT penetration channel established above, the player can achieve safe and efficient transmission of RTP stream data. Especially for cross-subnet scenarios, this mechanism greatly improves the stability and availability of transmission, and effectively prevents problems such as streaming media interruption caused by unsuccessful NAT penetration.
[0113] In summary, the core of the present invention lies in its precise path analysis capability and efficient NAT traversal technology. The combination of the two not only ensures that the RTP stream can be smoothly transmitted in a complex network environment, but also provides users with a smoother and more stable viewing experience.
[0114] The methods, programs, systems, devices, etc. of the embodiments of the present invention may be executed or implemented in a single or multiple networked computers, or may be practiced in a distributed computing environment. In the embodiments of this specification, in these distributed computing environments, tasks may be performed by remote processing devices connected via a communication network.
[0115] Those skilled in the art should understand that the embodiments of the present specification may be provided as methods, systems or computer program products. Therefore, those skilled in the art may imagine that the functional modules / units or controllers and related method steps described in the above embodiments may be implemented in software, hardware or a combination of software / hardware.
[0116] Unless explicitly stated, the actions or steps of the methods, programs, and embodiments of the present invention do not have to be performed in a specific order and can still achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0117] In this article, multiple embodiments of the present invention are described, but for the sake of brevity, the description of each embodiment is not exhaustive, and the same or similar features or parts between the embodiments may be omitted. In this article, "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" are meant to be applicable to at least one embodiment or example according to the present invention, but not all embodiments. The above terms do not necessarily mean to refer to the same embodiment or example. In the absence of contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.
[0118] The exemplary systems and methods of the present invention have been specifically shown and described with reference to the above embodiments, which are merely examples of the best modes for implementing the present systems and methods. It will be appreciated by those skilled in the art that various changes may be made to the embodiments of the systems and methods described herein when implementing the present systems and / or methods without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A player for cable TV RTP streaming protocol, characterized in that: It includes: A path analysis module, which is used to obtain the source address and destination address of the RTP stream and perform network path analysis; A NAT traversal processing module, which is used to determine whether NAT traversal processing is required based on the network path analysis result; An information acquisition module, which is used to obtain the external IP address and port information by using the STUN technology when NAT traversal processing is required; A NAT traversal channel establishment module, which establishes a NAT traversal channel by using the obtained external IP address and port information; An RTP stream transmission module, which is used to transmit the RTP stream through the established NAT traversal channel to ensure the stability of cross-subnet transmission.
2. The player of the cable TV RTP stream protocol according to claim 1, wherein Determining whether NAT traversal processing is required based on the network path analysis result includes the following steps: Evaluating the type of NAT device in the network path; Testing the external connection ability of the NAT device; Confirming whether the NAT device supports port mapping; If the NAT device does not support port mapping, it is determined that NAT traversal processing is required, otherwise the current connection method is continued to be used.
3. The player of the cable TV RTP stream protocol according to claim 2, wherein Determining whether NAT traversal processing is required based on the network path analysis result further includes the following steps: Collecting the delay data of the current network path; Evaluating the change trend of the delay data; Judging whether to adjust the NAT penetration strategy based on the stability of the delay data; If T(N)>T_threshold, it is determined that the NAT penetration strategy needs to be adjusted, where T(N) represents the average delay of the current network path, and T_threshold represents the preset maximum delay threshold.
4. The player of the cable TV RTP stream protocol according to claim 3, wherein Determining whether NAT traversal processing is required based on the network path analysis result further includes the following steps: Collecting the connection records of the current NAT device; Analyzing the error information in the connection records; Judging whether to adjust the NAT penetration strategy based on the error information frequency; If E(N)>E_threshold, it is determined that the NAT penetration strategy needs to be adjusted, where E(N) represents the error frequency in the connection records of the current NAT device, and E_threshold represents the preset error frequency threshold.
5. The player of the cable TV RTP stream protocol according to claim 4, wherein Determining whether NAT traversal processing is required based on the network path analysis result further includes the following steps: Evaluating the bandwidth status of the network path; Measuring the maximum available bandwidth of the current network path; Judging whether to adjust the NAT penetration strategy based on the maximum available bandwidth; If B(N)<B_threshold, it is determined that the NAT penetration strategy needs to be adjusted, where B(N) represents the maximum available bandwidth of the current network path, and B_threshold represents the preset minimum bandwidth threshold.
6. The player of the cable TV RTP stream protocol according to claim 5, wherein Determining whether NAT traversal processing is required based on the network path analysis result further includes the following steps: Evaluating the security of the network path; Test the packet loss rate in the network path; Determine whether to adjust the NAT penetration policy based on the packet loss rate; If L(N)>L_threshold, it is determined that the NAT penetration policy needs to be adjusted, where L(N) represents the packet loss rate of the current network path, and L_threshold represents the preset maximum packet loss rate.
7. The player of the cable TV RTP streaming protocol according to claim 6, characterized in that: Based on the network path analysis result, determining whether NAT traversal is required also includes the following steps: Assess congestion on network paths; Detect the congestion index of the network path; Determine whether to adjust the NAT penetration policy based on the congestion index; If C(N)>C_threshold, it is determined that the NAT penetration strategy needs to be adjusted, where C(N) represents the congestion index of the current network path, C(N)=a*delay+b*packet loss rate+c*(1-bandwidth utilization), parameters a, b and c represent the weights of delay, packet loss rate and bandwidth utilization respectively, and C_threshold represents the preset maximum congestion index.
8. The player of the cable TV RTP streaming protocol according to claim 7, characterized in that: Based on the network path analysis result, determining whether NAT traversal is required also includes the following steps: Identify each node in the network and its attributes, including the location, type and status of all devices participating in the communication and intermediate network devices; Analyze the connection paths between these nodes and evaluate the performance indicators of each path, including latency, bandwidth, and packet loss rate; Whether NAT traversal processing is required is determined based on the performance indicator.
Citation Information
Cited By
Remote intelligent control system for multimedia equipment and implementation method of remote intelligent control system
CN120835055A
Remote intelligent control system for multimedia device and implementation method thereof
CN120835055B
