Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, in the process of flowing a data stream of a video service from a service source end device to a terminal device, the data stream needs to be forwarded by a multi-hop network node device and carried by a multi-port link between devices. Taking an operator self-operated IPTV service as an example, a service source end device of a data stream is on an IPTV platform in a provincial center, as shown in a schematic view of an IPTV bearer network architecture provided in fig. 1, the data stream needs to sequentially pass through an integrated access switch LSW (load balancing switch), a metropolitan area network core router CR (core router), a metropolitan area network broadband access gateway BNG (broadband network gateway), a two-layer aggregation switch), an access network optical line terminal OLT (optical line terminal ), a home gateway unit (optical network unit), and finally reach an IPTV set-top box STB (set-top-box, that is, a terminal device). The network node devices are connected by optical fibers at the physical layer. When a data stream is generated at a service source end device, the data stream needs to be encapsulated by multiple layers of protocols, including an application layer, a transmission layer, an IP layer, and the like, and after becoming an IP data packet, the data stream is transmitted by the service source end device in a manner of sending the data stream to a network according to a destination IP address.
In the prior art, in a service source device, when a video service packet is encapsulated by an RTP (real-time transport protocol), a sequence number of the RTP needs to be provided for a packet receiver to repack a packet sequence and perform packet loss detection. Fig. 2 provides a schematic diagram of encapsulation of a video service packet in a point-to-point protocol over ethernet (PPPoE) scenario. The header includes a 14-bit (bytes) ethernet header, an 8-bit PPPoE header, a 20-bit IP header, an 8-bit UDP header, an 8-bit RTP header, and several video packets (which may be, for example, MPEG2 TS, moving picture experts group2 transport stream, moving picture experts group2 transport data) with a length of 188 bits for carrying video data, and a final check bit CRC (cyclic redundancy check). Fig. 3 provides a schematic diagram of encapsulation of a video service packet in an IpoE (internet protocol over ethernet) scenario. The header includes a 14-bit (bytes) ethernet header, a 20-bit IP header, an 8-bit UDP header, an 8-bit RTP header, and several video packets (which may be, for example, MPEG2 TS, moving picture experts group2 transport stream, moving picture experts group2 transport data) with a length of 188 bits for carrying video data, and a last check bit CRC (cyclic redundancy check). In PPPoE scenario, the sequence number of RTP is located in the 53 th and 54 th consecutive bytes; in the IPoE scenario, the sequence number of RTP is located in the 45 th, 46 th consecutive bytes. Meanwhile, the RTP protocol is positioned in a transmission layer in a network protocol stack, and the network node equipment only analyzes the video service message in the data stream to an IP layer in the network transmission process of the data stream, so that the message is forwarded according to a target IP address. Since the RTP protocol is encapsulated inside the IP header, further parsing of the packet not only causes a decrease in network forwarding efficiency, but also presents a security risk of leaking user private data. In summary, the network node device cannot directly use the sequence number in the RTP protocol to perform packet loss detection on the video service packet. The direct measurement technology and the indirect measurement technology provided by the prior art have the problems of limited application scenes and low measurement precision.
In order to solve the above problem, an embodiment of the present application provides a method for detecting a video service packet, which is shown in fig. 4 and includes the following steps:
101. the service source end device maps the sequence number of the RTP of the video service message of the predetermined service to the predetermined field of the IP header of the video service message.
The predetermined service may be a video service, for example: iptv (btv), iptv (vod), self-service OTT, internet OTT video, and the like. Each service employs a different network bearer scheme and encapsulation protocol. Taking the video service carried by the operator as an example, the BTV service uses RTP/RTCP/RTSP protocol to encapsulate the service packet in the streaming media application layer, the transport layer uses UDP protocol encapsulation, and the network carrying mode is multicast. The VOD service is encapsulated by adopting HDP/HLS/DASH/HSS protocol at the application layer, the transmission layer is encapsulated by adopting TCP protocol, and the network bearing mode is unicast. The self-operated OTT video service application layer adopts HDP/HLS/DASH/HSS protocol encapsulation, the transmission layer adopts TCP protocol encapsulation, and the network bearing mode is unicast. The internet OTT video service application layer adopts HLS/DASH/HSS protocol encapsulation, the transmission layer adopts TCP protocol encapsulation, and the network bearing mode is unicast.
In general, in the header of an RTP (RTP packet), there are 16bits for identifying the sequence number of the RTP of a message transmitted by a sender, and the sequence number is increased by 1 every time a message is transmitted. The sequence number can be used for detecting packet loss and disorder of the message by a service receiver. However, since the RTP protocol is located in the transport layer of the TCP/IP protocol stack, the parsing of the packet by the network node device is only parsed to the IP layer, and the sequence number is not perceived. In step 101, mapping the sequence number of the RTP to the IP header for the video service packet (e.g., IPv4 packet and IPv6 packet), so that the network node device can perform packet loss and out-of-order statistics on the video service packet according to the sequence number of the RTP of the IP header, thereby achieving the purpose of network fault detection. The video service message is an IPV4 message, and the predetermined field includes an option field of the IPV4 message. If the video service message is an IPV6 message, the predetermined field includes an extension header of the IPV6 message.
Specifically, at the service source end device, for the IPv4 packet, the option field in the header of the IPv4 packet is used to perform mapping and padding of the sequence number of the RTP to the IP header. The mapping mode of the RTP sequence number to the IP header of the IPv4 message is shown in fig. 5, where an option of an IPv4 message header is a selectable item of the IP header, the length of the option is an integer multiple of 32bits, the first 8 bits are code fields, and include a 1-bit copy bit to identify whether a packet is copied to all packets, a 2-bit class bit to identify the use category of the option, and a 5-bit field to record the number of the option. The middle 8 bits are used to identify the length (length) of the option, and the remaining 5 numbers of the option field of the current IP header are available, 26, 27, 28, 29, and 31, respectively. In the present invention, number 31 is defined to identify the option field for recording the sequence number of RTP. The last 16bits are used to store the sequence number of the RTP so that the sequence number of the RTP is mapped into the IP header. Also shown in FIG. 5 is the identification in the RTP header, V (version) 2bits, used to designate the RTP version number; the protocol initial version is 0 and the version number specified in RFC3550 is 2. P (padding, additional information) 1bit, if the bit is set, additional information is included at the end of the packet, and the last byte of the additional information indicates the length of the additional information (including the byte itself). This field exists because some encryption mechanisms require fixed-length data blocks, or in order to transport multiple RTP packets in one underlying protocol data unit. X (extension) 1bit if the bit is set, there is an extension header after the fixed header. CC (CSRC count, contract Source count) 4bits, how many CSRC identifiers there are after the fixed header. M (marker) 1bit, the function of which depends on the profile definition. Profile can change the length of the bit, but keep the total length of marker and payload type constant (8 bits total). PT (payload type): 7bits, marks the type of information the RTP packet carries. sequence number:16bits, sequence number. timestamp:32bits, timestamp. Reflecting the sampling time of the first byte in the packet carried by the RTP packet. SSRC identifier (Synchronization source identifier): 32bits, Synchronization source identifier. There should be a different SSRC for each data flow during an RTP session. CSRC identifier list:0to 15 entries, 32bits each, identifies the special source identifier. Also shown in fig. 5 is the inclusion of a fixed portion and a variable portion in the IP header, where the variable portion includes the code, length, and sequence number of RTP as described above. The fixed part comprises the following marks: version, which identifies the version of the IP protocol, the current IP protocol version number is 4, and the next-generation IP protocol version number is 6. IHL (IP header length), length of IP header. TOS (type of service). Total length: total length of IP message. The sum of the length of the header and the length of the data portion. Identification (identification): each datagram sent by the host is uniquely identified. Usually every message sent, its value is incremented by one. When the length of the IP packet exceeds the MTU (maximum transmission unit) of the transmission network, fragmentation is necessary, and the value of this identification field is copied into the identification fields of all data fragments, so that the fragments can be reassembled into the original data according to the content of the identification fields when reaching the final destination. Flag (flag): and 3 bits in total. R, DF and MF. Currently, only the last two bits are valid, DF: a value of 1 indicates no fragmentation, and a value of 0 indicates fragmentation. MF: a value of 1 indicates "more slices" and a value of 0 indicates that this is the last slice. Slice displacement (flag offset): the slice is offset from the first bit in the original data packet. TTL (time to live), the maximum number of routers allowed to pass an IP packet. Every time a router is passed, the TTL is decremented by 1, and when 0, the router discards the datagram. The TTL field is an 8-bit field initially set by the sending end, the recommended initial value is specified by the distribution number RFC, and the current value is 64. The TTL is often set to a maximum value of 255 when sending ICMP echo reply. Protocol (protocol) indicates which protocol is used for the data carried in the IP packet, so that the IP layer of the destination host can know which process the datagram is handed over to (different protocols have different processes for processing). Like the port numbers, protocol numbers are used here, TCP having a protocol number of 6 and UDP having a protocol number of 17. The protocol number of ICMP is 1, and the protocol number of IGMP is 2. Header checksum (header checksum): the checksum of the IP header is calculated and the integrity of the IP header is checked. The source address identifies the source end device of the IP datagram. Destination address: the destination address of the IP datagram is identified.
In addition, at the service source end device, for the IPv6 packet, an extension header (as part of the dashed box in fig. 6) may be defined to carry the sequence number of the RTP. Referring to fig. 6, the extension header protocol number is identified with an undefined 252 and carries an option, the option type format being set to 0x1D (00011101). When there are multiple extension headers in the IPv6 packet, the extension header of the sequence number newly added to carry the RTP should be located before the upper layer protocol header, as shown in fig. 6, and before the UDP header, for example, next header 17(PDU), where Hdr ExtLen is 0 and the header length is zero. The serial number of RTP occupies 32bit, the first 16bit bearing service source terminal device maps the RTP serial number to the value of the serial number of the extension head of IP header, and the latter 16bit is completed by 0.
102. And the service source end equipment transmits the video service message to the network node equipment in a data flow mode, so that the network node equipment transmits the data flow to the terminal equipment.
103. And the network node equipment receives the data stream and acquires the video service message from the data stream.
104. And the network node equipment analyzes the IP header of the video service message and acquires the source address and the destination address of the video service message.
105. And the network node equipment determines the service flow to which the video service message belongs according to the source address and the destination address of the video service message.
106. And in a preset statistical period, determining that the transmission fault of the service flow occurs when the number of the RTP sequence numbers which are continuously lost is larger than M according to the sequencing of the RTP sequence numbers in the IP headers of the video service messages in the service flow, wherein M is a maximum packet loss retransmission number threshold value.
If the condition in 106 is not satisfied, it is determined that the traffic flow has no transmission failure. Thus, when a network node device (e.g., a router) receives a video service packet forwarded to the node by an upstream device, an IP header in the video service packet is identified according to a source address and a destination address binary group of the IP header, and a sequence number of the video service packet at an RTP of the IP header is obtained according to the IP header. When the serial number of the video service packet in the RTP of the IP header is discontinuous (missing), it is determined that the upstream network device or the link has a packet loss, and if the number of consecutive packet losses Nt is greater than or equal to M in the statistical period and M is the maximum packet loss retransmission number threshold value specified by the ARQ standard, it is determined that the service flow has a transmission failure, for example, the upstream device or the link of the network node device has a failure. If a plurality of monitoring points are deployed on the IP network node equipment, the purpose of network fault delimitation can be achieved, and if each piece of IP network node equipment is deployed to be a monitoring point, the delimitation range can be accurate to equipment and a link level.
Finally, the network node device forwards the data stream to the next hop device according to the destination address, and if the next hop device is another network node device, the step 102 and 106 are repeatedly executed in the another network node device until the data stream is forwarded to the terminal device, and the terminal device receives the video service packet and decapsulates the video service packet.
In the above scheme, since the service source end device maps the serial number of the RTP in the predetermined field of the IP header of the video service packet, when detecting the video service packet, each network node device in the network can directly resolve the serial number of the RTP of each video service packet according to the service flow to which the service packet belongs, so that the network node device determines whether the service flow has a transmission failure or not according to the serial number of the RTP included in the IP header of the video service packet in the service flow, thereby avoiding the limitation that some direct measurement technologies in the prior art can only support a point-to-point scenario, and simultaneously, the measurement accuracy is improved without using a detection packet and additional bandwidth is not occupied.
Referring to fig. 7, there is provided a service source device, including:
a processing module 71, configured to map a sequence number of an RTP of a video service packet of a predetermined service to a predetermined field of an IP header of the video service packet;
a sending module 72, configured to send the video service packet generated by the processing module 71 to the network node device in a data stream form, so that the network node device sends the data stream to a terminal device.
Optionally, if the video service packet is an IPV4 packet, the predetermined field includes an option field of the IPV4 packet. If the video service message is an IPV6 message, the predetermined field includes an extension header of the IPV6 message.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and the function thereof is not described herein again.
In the case of using an integrated module, the service source end device includes: the device comprises a storage unit, a processing unit and an interface unit. The processing unit is configured to control and manage actions of the service source device, for example, the processing unit is configured to support the service source device to execute the process 101 in fig. 4; the interface unit is configured to support information interaction between the service source device and other devices, for example, the interface unit is configured to support the service source device to execute the process 102 in fig. 4. And the storage unit is used for storing the program codes and data of the service source end equipment.
For example, the processing unit is a processor, the storage unit is a memory, and the interface unit is a communication interface. The service source device is shown in fig. 8, and includes a communication interface 801, a processor 802, a memory 803, and a bus 804, where the communication interface 801 and the processor 802 are connected to the memory 803 through the bus 804.
The processor 802 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an Application-Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to control the execution of programs in accordance with the teachings of the present disclosure.
The Memory 803 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The memory 803 is used for storing application program codes for executing the scheme of the application, and the execution of the application program codes is controlled by the processor 802. The communication interface 801 is used for information interaction with other devices, for example, to support the service source device to perform step 102. The processor 802 is configured to execute the application program code stored in the memory 803, so as to implement the method performed by the service source device in the embodiment of the present application, for example, step 101.
Referring to fig. 9, there is provided a network node device comprising:
a receiving module 91, configured to receive a data stream, and obtain the video service packet from the data stream; the data stream comprises a video service message of a predetermined service, wherein the sequence number of the RTP of the video service message is mapped to a predetermined field of the IP header of the video service message;
an analyzing module 92, configured to analyze the IP header of the video service packet obtained by the receiving module 91, and obtain a source address and a destination address of the video service packet;
a processing module 93, configured to determine a service flow to which the video service packet belongs according to the source address and the destination address of the video service packet obtained by the parsing module 92;
the processing module 93 is further configured to determine that a transmission failure occurs in the service stream when it is determined that the number of consecutive lost RTP sequence numbers is greater than M according to the ordering of the RTP sequence numbers in the IP headers of the video service messages in the service stream in a predetermined statistical period, where M is a maximum packet loss retransmission number threshold.
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and the function thereof is not described herein again.
In case of an integrated module, the network node device comprises: the device comprises a storage unit, a processing unit and an interface unit. The processing unit is configured to control and manage actions of the network node device, for example, the processing unit is configured to support the network node device to execute the process 104 and 106 in fig. 4; the interface unit is configured to support information interaction between the network node device and other devices, for example, the interface unit is configured to support the network node device to execute the process 103 in fig. 4. A storage unit for storing program codes and data of the network node device.
For example, the processing unit is a processor, the storage unit is a memory, and the interface unit is a communication interface. The network node device shown in fig. 10 includes a communication interface 1001, a processor 1002, a memory 1003, and a bus 1004, and the communication interface 1001 and the processor 1002 are connected to the memory 1003 through the bus 1004.
The processor 1002 may be a general-purpose Central Processing Unit (CPU), a microprocessor, an Application-Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to control the execution of programs in accordance with the teachings of the present disclosure.
The Memory 1003 may be a Read-Only Memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory may be self-contained and coupled to the processor via a bus. The memory may also be integral to the processor.
The memory 1003 is used for storing application program codes for executing the scheme of the application, and the processor 1002 controls the execution. The communication interface 1001 is used for information interaction with other devices, for example, to support the network node device to execute step 103. The processor 1002 is configured to execute the application program code stored in the memory 1003, so as to implement the method executed by the network node device in the embodiment of the present application, for example, step 104 and step 106.
Further, a computing storage medium (or media) is also provided, which comprises instructions that when executed perform the method operations performed by the service source end device or the network node device in the above embodiments. Additionally, a computer program product is also provided, comprising the above-described computing storage medium (or media).
All relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and the function thereof is not described herein again.
It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.