Method and system for packet discard precedence for video transport

Discard precedence priority of packets carrying an encoded video stream in a packet network is determined based on priority information included in the encoded video stream. A video streamer segments an encoded video stream and encapsulates the segment in an Internet Protocol (IP) packet. Priority information associated with the IP packet is determined based on at least one priority indicator associated with the segment that was included in the encoded video stream. Alternately, priority information associated with an Ethernet frame is determined based on at least one priority indicator associated with the segment that was included in the encoded video stream.

FIELD OF THE INVENTION

This invention generally relates to prioritizing data packets, and in particular relates to using video encoding information for packet discard selection.

BACKGROUND OF THE INVENTION

Networks can become congested during periods of high usage. Network congestion increases the likelihood that packets being delivered over the network will not be delivered in a timely manner and, in some cases, packets may not delivered at all. For some types of applications, such as email applications or word processing applications, packet delay is not problematic. Moreover, if the packets are transported using a reliable transport technology, such as Transmission Control Protocol (TCP), the packets will eventually be resent if the recipient fails to acknowledge receipt. However, packet delay will greatly impact other types of applications, such as audio and video applications.

Certain network protocols include the ability to prioritize traffic to a limited extent. Packets typically obtain a priority based on an administrative setting that identifies certain categories of traffic, such as video traffic, as higher priority than non-video traffic. However, application-based priority may not be suitable where the majority of the traffic delivered over the network is the same application type.

Video is typically highly compressed before being transmitted over a network. The precise format of digital video varies depending on the type of encoder and encoding parameters used to generate the digitized video, but in general, video compression algorithms are based on reducing spatial redundancy and temporal redundancy. Spatial redundancy relates to similar samples within the same picture frame. For example, in a scene showing a close-up of a white sheet, a significant portion of the video information may be essentially the same data repeated over and over. Temporal redundancy relates to similar images between two adjacent picture frames. For example, in a scene showing very little movement, successive frames will be nearly identical to one another with only a very small portion of the video information changing from frame to frame. Video encoders are able to recognize such redundancy and generate data files that eliminate redundant video information but contain information that allows recreation of the redundant information during the decoding process so the video can be recreated and displayed at a quality very close to the original, uncompressed raw video. The encoding process results in a lower bit rate video stream than the original raw, uncompressed video stream.

A compressed digital video file or stream typically contains different types of video segments that have differing degrees of importance, or priority, based on the particular encoding algorithm used to create the digital video file. For example, Moving Picture Experts Group-2 (MPEG-2) encoders create three types of frames, referred to as an I-picture, a P-picture, and a B-picture. From the perspective of decoding the digital video file, an I-picture is more important than a P-picture or a B-picture because an I-picture is a reference frame, and a P-picture and a B-picture are predictively-coded pictures based on I-pictures. Consequently, if video packets must be discarded during times of network congestion, it would be beneficial if the video packets could be discarded based on the type of data carried by the video packet, rather than arbitrarily discarding video packets. What is needed, therefore, is a way to identify the types of video data carried by a video packet so that during congestion low-priority video packets can be discarded in favor of high-priority video packets.

SUMMARY OF THE INVENTION

The present invention uses video encoding information to set a priority field used by a network device to selectively discard video packets when a network is congested. According to one embodiment of the invention, a video encoder encodes a video into encoded video information. The encoded video information is segmented and encapsulated in a packet for delivery over a network. The packet has a packet payload portion for carrying the video segment and a packet header portion containing routing and priority information used by network devices while forwarding the packet through the network. Priority information relating to the respective video segment that is included in the encoded video information is mapped to a priority field in the packet header portion of the packet. A first packet carrying a video segment may be identified as a high priority packet based on the priority information included in the encoded video information, and a second packet carrying an adjacent video segment may be prioritized as a low priority packet based on the priority information included in the encoded video information. The packet is transmitted over the network for delivery to a user device. The network device responsible for forwarding packets determines that the network is congested and based on the priority field in the packet either forwards the packet or discards the packet.

According to one embodiment of the invention, video segments are encapsulated in a Real-time Transport Protocol (RTP) packet having an RTP payload portion for carrying the video segments and an RTP header portion. The RTP packet is then encapsulated in a User Datagram Protocol (UDP) packet having a payload portion for carrying the RTP packet, and a header portion. The UDP packet is then encapsulated in an Internet Protocol (IP) packet having a payload portion for carrying the UDP packet and an IP header. The IP packet is then encapsulated in an Ethernet frame having a payload portion for carrying the IP packet and a header portion. The IP packet uses a Differentiated Services (DS) Per-Hop-Behavior (PHB) group called Assured Forwarding (AF). The AF PHB group is a mechanism for offering different levels of forwarding assurances for IP packets. The AF group includes four AF classes, each of which has three possible drop precedence values. A desired AF class and drop precedence value is identified via a Differentiated Service Code Point (DSCP) field in the IP header. In case of congestion, the AF drop precedence value of a packet determines the relative importance of the packet within the respective AF class. The drop precedence value of the AF class is determined based on a priority indicator from the encoded video information associated with the video segment carried in the RTP payload.

According to another embodiment of the invention, the Ethernet frame header contains a user priority field comprising three bits of data. Rather than using a DSCP field in the IP header, the user priority field in the Ethernet frame header is set to a particular value to indicate a discard priority based on the priority indicator from the encoded video information associated with the video segment carried in the RTP payload. Using the user priority bits in the Ethernet frame header rather than the DSCP field in the IP header enables packet discarding decisions to be made at a lower level in a network stack.

According to one embodiment of the invention, the encoded video information is an MPEG-2 file, and the encoded video information is segmented into a plurality of transport stream packets. Each transport stream packet in the segment has an associated priority bit that can be set (i.e., “1”) or reset (i.e., “0”). If the associated priority bit of any of the transport stream packets in the segment is set to indicate that the transport stream packet has a higher priority than other transport stream packets that have the priority bit reset, the priority information of the IP packet carrying the segment is set to indicate the transport stream packet should not be discarded. According to another embodiment of the invention, the priority information of the IP packet carrying the segment can vary based on the number of transport stream packets in the segment having the priority bit set. For example, if the segment comprises seven transport stream packets and if five to seven of the transport stream packets have the associated priority bit set, the priority information of the IP packet carrying the transport stream segments can be set to a first priority level to indicate that the segment should not be discarded. If two to four of the transport stream packets have the associated priority bit set, the priority information of the IP packet carrying the transport stream segments can be set to a second priority level that is lower than the first priority level. If none or one transport stream packet has the associated priority bit set, the priority information of the IP packet carrying the transport stream segments can be set to a third priority level that is lower than the second priority level.

According to another embodiment of the invention, the encoded video information is an MPEG-4 file, and the encoded video information is segmented into separate Network Abstraction Layer (NAL) units. The priority information of the packet carrying the NAL unit is based on a nal_ref_idc (NRI) value in an NRI field of a NAL header. According to another embodiment of the invention, each segment carries a plurality of NAL units, and the priority information of the packet carrying the plurality of NAL units is based on the highest NRI value of all the NAL units in the segment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention relates to setting priority information of a packet carrying a video segment based on a priority indicator included in encoded video information from which the video segment was generated. The present invention enables selective discarding of video packets during network congestion in a manner that minimizes video playback disruption.FIG. 1is a block diagram illustrating a system suitable for carrying out aspects of the present invention. A service provider10provides video programs, such as broadcast programming or video on demand programming, to a plurality of end users12. The service provider10includes equipment, represented by a video streamer14, capable of encapsulating and transmitting video to the end users12over a network16. While for purposes of illustration the video streamer14is shown as a single apparatus, the functionality provided by the video streamer14may involve one or more pieces of equipment. A video storage18contains one or more encoded video files20that contain encoded video information associated with a respective program or movie. The encoded video files20can be in any suitable encoding format that includes in the encoded video information priority indicators that can be used to denote a priority of units of the encoded video information. The format of the units of encoded video information may differ depending on the particular encoding algorithm used. For example, if the video files are encoded with a Moving Pictures Expert Group-4 (MPEG-4) encoder, the units may be a Network Abstraction Layer (NAL) unit. If the video files are encoded with an MPEG-2 encoder, the units may be a Transport Stream Packet.

While for purposes of illustration the invention will be described herein in the context of a video on demand service, the invention can be used in the transport of encoded video in any context, including broadcast streams of programming in MPEG-4 or MPEG-2 formats. Moreover, while the encoded video files20are shown as being associated with the service provider10for purposes of illustration, in practice the encoded video files20may be provided upon request by a third party or, in the case of broadcast television, the service provider10typically receives an encoded video stream from an external programming source, such as the television networks NBC or ABC, on an ongoing basis.

Upon request by an end user12to view a particular program, the video streamer14begins to segment the respective encoded video file20into segments suitable for transport over the network16. As will be described in greater detail herein, the video streamer14encapsulates the segments in packets, addresses the packets to the respective end user12, and transmits or otherwise communicates the packets over the network16for delivery to the respective end user12. The network16comprises one or more switching devices22that forward each packet to either another switching device22or the end user12. The switching devices22can comprise any apparatus capable of receiving and forwarding a packet based on a destination address, and can comprise a router or an Ethernet switch, for example. The packets are ultimately delivered to a playback device associated with the end user12, such as a set top box, that extracts the segment of encoded video information from the packet, decodes the encoded video information, and provides the content for playback to the end user12on a display device, such as a television or computer monitor.

Depending on the demand of the end users12and other factors, at times the network16may suffer congestion. Congestion as used herein means any determination by one or more switching devices22that a current rate of network traffic constitutes congestion. During periods of congestion, packets may not be delivered in a timely manner to an end user12or, if a packet is dropped or discarded, the packets may not be delivered at all. A discarded or delayed packet may or may not be problematic depending on the data contained in the packet and the network transport protocol used to deliver the packet. Some network transport protocols, such as Transmission Control Protocol (TCP), are reliable transport protocols that verify the delivery of each packet of information and will continue to re-transmit the packet of information until such verification is received. Other types of network transport protocols, such as User Datagram Protocol, provide unreliable transport of packets and do not verify whether a packet is delivered or not. Likewise, some applications such as email or word processing are not sensitive to packet delay, while other applications such as video and audio applications are extremely sensitive to delayed or discarded packets. During congestion, the switching devices22may discard packets to reduce congestion. The present invention provides a method and apparatus for intelligently discarding video packets based on priority indicators included in the encoded video information.

FIG. 2is a block diagram illustrating components of a packet according to one embodiment of the present invention. The video streamer14transmits a plurality of data packets24and24A to the network16for delivery to the end user12. The packet24A is representative of each of the packets24and comprises a video segment26which includes one or more video units from a respective encoded video file20. The video segment26is encapsulated in a Real-time Transport Protocol (RTP) packet28which includes an RTP header30and a payload portion that comprises the video segment26. The RTP header30contains information that can be used for a variety of purposes as described in the Internet Engineering Task Force (IETF) Network Working Group Request for Comments 3550 entitled “RTP: A Transport Protocol for Real-Time Applications,” which is hereby incorporated herein by reference in its entirety.

The RTP packet28is encapsulated in a User Datagram Packet (UDP)32which includes a UDP header34and a payload portion comprising the RTP packet28. The UDP header34contains information that can be used for a variety of purposes as described in the IETF Request for Comments 768 entitled “User Datagram Protocol,” which is hereby incorporated herein by reference in its entirety. The UDP packet32is encapsulated in an IP packet36which includes an Internet Protocol (IP) header38and a payload portion comprising the UDP packet32. The IP header38includes information for routing by a layer three switching device22, such as a router, and can include various additional information as described in the following IETF Requests for Comments, each of which is hereby incorporated herein by reference in its entirety:

Request for Comments 791 entitled “Internet Protocol Darpa Internet Program Protocol Specification;”

Request for Comments 2474 entitled “Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers;”

Request for Comments 2475 entitled “An Architecture for Differentiated Services;”

Request for Comments 2597 entitled “Assured Forwarding PHB Group;”

Request for Comments 3140 entitled “Per Hop Behavior Identification Codes;”

Request for Comments 3246 entitled “An Expedited Forwarding PHB;” and

Request for Comments 4594 entitled “Configuration Guidelines for DiffServ Service Classes.”

The IP packet36is encapsulated in an Ethernet frame40, which includes an Ethernet header42and a payload portion comprising the IP packet36. The Ethernet header42includes various information including information for routing by a layer two switching device22, such as an Ethernet switch. The Ethernet header42includes various additional information as defined in the Institute of Electrical and Electronics Engineers (IEEE) 802.3 standards, each of which is hereby incorporated herein by reference. References herein to layer three or layer two are references to the Open Systems Interconnection Basic Reference Model, as will be understood by those skilled in the art.

FIG. 3is a flow diagram illustrating a method for setting priority information of a packet according to one embodiment of the invention.FIG. 4is a block diagram illustrating a particular embodiment of the process described inFIG. 3wherein MPEG-2 encoded video information is used to set priority information of a packet. For purposes of illustrationFIGS. 3 and 4will be discussed together. The video streamer14receives a stream of encoded video information (step100), as illustrated inFIG. 4by a video stream44. For purposes of illustration it will be assumed that the stream of encoded video information is in MPEG-2 format, but the invention is not limited to MPEG-2 encoding and can be used with a variety of encoding formats. The stream of encoded video information may be associated with a file of encoded video information stored in the video storage18, or may comprise a stream of encoded video information being provided over a feed from a broadcaster, such as NBC, or from being received from some other source.

The video streamer14segments the encoded video stream44in preparation for encapsulation of the segments into an RTP packet28(step102). The segmentation can be any desired division of the video stream44, so long as each segment has associated therewith one or more priority indicators that are included in the video stream44. Depending on the transport protocol used, certain segmentations may be preferable to other segmentations. For example, assuming the segment will be encapsulated in an RTP packet28, IETF Request for Comments 2250 entitled “RTP Payload Format for MPEG1/MPEG2 Video” (hereinafter “RFC 2250”), which is hereby incorporated herein by reference in its entirety, describes two approaches for encapsulating an MPEG-2 video stream in an RTP packet28. One approach involves the use of an MPEG-2 transport stream (TS). A transport stream comprises a number of fixed length transport stream packets, such as TS packets46A-46G. The video segment26can comprise one or more of the TS packets46. Typically, seven TS packets, such as TS packets46A-46G, are included in the video segment26. A TS packet header48includes various information, including a priority bit field50A indicating a priority of the video information contained in a payload portion52A of the TS packet46A relative to other TS packets46having the same package identifier (PID) value. Assume for purposes of illustration the video segment26will carry the TS packets46A-46G. The video segment26is then encapsulated in an RTP packet30, which is in turn encapsulated in a UDP packet32. The UDP packet34is encapsulated in an IP packet36(step104).

For purposes of illustration, assume that the network16uses Differentiated Services (DS). The video streamer14sets a DSCP field56of the IP header38based on the priority bit fields50A-50G from the TS packets46A-46G in the video segment26(step106). Preferably an Assured Forwarding Per-Hop-Behavior Group is used. There are four AF classes available in the AF group. Each AF class offers three levels of drop, or discard, precedence. Typically, a single AF class is sufficient for use in the present invention, but in applications where greater than three packet discard preference levels are desired, multiple AF classes may be used. Note that a discard precedence value is the inverse of a packet priority in that a high discard precedence value indicates a low packet priority (e.g., a packet with a high discard precedence value will be discarded before a packet with a low discard precedence value). A particular AF class and discard precedence value is indicated through the use of an AF codepoint. An AF codepoint is a six bit value. For example, AF class 1 with low discard precedence has an AF codepoint=‘001010’ and will be referred to herein as an “AF1LDP codepoint,” AF class 1 with medium discard precedence has an AF codepoint=‘001100’ and will be referred to herein as an “AF1MDP codepoint,” and AF class 1 with high discard precedence has an AF codepoint=‘001110’ and will be referred to herein as an “AF1HDP codepoint.”

According to one embodiment of the invention, the discard precedence of the video segment26is determined by examining the priority bit fields50A-50G of the TS packets46A-46G in the video segment26. If any of the priority bit fields50A-50G are set, then the DSCP field56is set to the value of the AF1LDP codepoint. If none of the priority bit fields50A-50G are set, the DSCP field56is set to the value of the AF1HDP codepoint. According to another embodiment of the invention, three levels of discard precedence are used by basing the discard precedence of the video segment26on the number of priority bit fields50A-50G that are set in the TS packets46A-46G. For example, if N represents the number of TS packets46in the video segment26, assume that Nprepresents the number of TS packets46that have the associated priority bit field50set. If 0<Np<=N1, then the DSCP field56is set to the AF1HDP codepoint. If N1<Np<=N2, then the DSCP field56is set to the AF1MDP codepoint. If N2<Np<=N, then the DSCP field56is set to the AF1LDP codepoint. N1and N2can be set to any desired number of TS packets46. For example, if N=7, N2may be equal to 3, and N1may be equal to 1. After the DSCP field56is set to the desired AF1 codepoint, the IP packet36is encapsulated in an Ethernet frame40and forwarded over the network16for delivery to the end user12(step108).

FIG. 5is a flow diagram illustrating a process for discarding a packet according to one embodiment of the invention. The switching device22receives the Ethernet frame40carrying the IP packet36(step200). The switching device22determines whether the network16is congested (step202). The determination can be made using any designated criteria suitable for defining the network16as being congested. For example, the switching device22can determine an incoming packet queue fill at the arrival instant of the IP packet36. If the queue length exceeds a predetermined threshold, the switching device22may determine that the network16is congested. If the network16is not congested, the Ethernet frame40is delivered to either another switching device22that is in the path to the end user12or is delivered directly to the end user12if the switching device22is the last switching device22along the path to the end user12(step204). If the network16is congested, the switching device22obtains the AF codepoint from the DSCP field56of the Ethernet frame40(step206). If the AF codepoint is an AF1HDP, the Ethernet frame40is discarded. If the AF codepoint is an AF1LDP, the Ethernet frame40is forwarded to another switching device22or the end user12, as described above (step208).

FIG. 6is a block diagram illustrating a process for setting priority information of an Ethernet frame40carrying MPEG-2 encoded video information according to one embodiment of the invention. The description of the video stream44, the TS packets46, the priority bit fields50, the PID fields68, and the payload portions52are the same as described with respect toFIG. 4and will not be repeated herein. The video segment26contains a plurality of TS packets46and is encapsulated in an RTP packet28. The RTP packet28is encapsulated in a UDP packet32and the UDP packet32is encapsulated in an IP packet36. However, unlikeFIG. 4, the embodiment illustrated inFIG. 6does not use differentiated services at the IP layer, and instead uses a user priority field58in the Ethernet header48to set the priority information of the Ethernet frame40. The user priority field58contains three bits that can be used to indicate discard precedence levels for the video segment26. The discard precedence levels used may be in accordance with the IEEE 802.1ad standard, which is hereby incorporated by reference herein. IEEE 802.1ad specifies that the user priority field58can be used to define seven transmission classes and one discard precedence level (‘7×1’), six transmission classes and two discard precedence levels (‘6×2’), or five transmission classes and three discard levels (‘5×3’). Note that a single discard level will support two discard priorities. The present invention may use any of these options depending on the number of desired discard levels. Assume for the purpose of illustration that the embodiment illustrated inFIG. 6uses seven transmission classes and one discard level. As discussed with regard toFIG. 4, the video streamer14can determine if any of the priority bit fields50A-50G are set and, if so, set the priority discard level of the user priority field58to a low discard precedence. Alternately, if none of the priority bit fields50A-50G are set, the video streamer14can set the user priority field58to a high discard precedence.

If two or more discard priorities are desired, 6×2 or 5×3 options can be used. Assume that three levels of discard priorities are desired, and that the 5×3 option will be used. Further, assume that N represents the number of TS packets46in the video segment26, and assume that Nprepresents the number of TS packets46that have the associated priority bit field50set. If 0<Np<=N1, then a high discard precedence can be indicated in the user priority field58. If N1<Np<=N2, then a medium discard precedence can be indicated in the user priority field58. If N2<Np<=N, then a low discard precedence can be indicated in the user priority field58. N1and N2can be set to any desired number of TS packets46. For example, if N=7, N2may be equal to 3, and N1may be equal to 1. The embodiment illustrated inFIG. 6enables packet discard selection to be made by a layer two device, such as an Ethernet switch rather than a layer three device, such as a router.

FIG. 7is a block diagram illustrating a process for setting priority information of an IP packet36carrying MPEG-2 encoded video information according to another embodiment of the invention. The embodiment illustrated inFIG. 7is similar to the embodiment illustrated inFIG. 4, except the video stream44is an MPEG-2 elementary stream. As discussed previously, RFC 2250 describes two approaches for encapsulating an MPEG-2 video stream in an RTP packet28. The embodiment illustrated inFIG. 7relates to the second approach described in RFC 2250 relating to transport based on an MPEG-2 elementary stream. The video streamer14segments the video stream44into a video segment26in accordance with the rules contained in RFC 2250. In such an embodiment, the RTP header30is extended in accordance with RFC 2250 and a picture type field60is set to a value to indicate a picture type based on whether the video segment26is associated with an I-picture, a B-picture, or a P-picture. If the picture type is an I-picture, the picture type field60is set to a value of 1, if the picture type is a P-picture, the picture type field60is set to a value of 2, and if the picture type is a B-picture, the picture type field60is set to a value of 3.

The RTP packet28is then encapsulated in a UDP packet32, which in turn is encapsulated in an IP packet36. The video streamer14can set the DSCP field56based on the picture type field60and the desired number of discard precedence levels. For example, if only two discard precedence levels are desired and if the picture type field60indicates an I-picture or a P-picture, the DSCP field56can be set to the AF1LDP codepoint. If the picture type field60indicates a B-picture, the DSCP field56can be set to the AF1HDP codepoint. If three discard precedence levels are desired, and if the picture type field60indicates an I-picture, the DSCP field56can be set to the AF1LDP codepoint. If the picture type field60indicates a P-picture, the DSCP field56can be set to the AF1MDP codepoint. If the picture type field60indicates a B-picture, the DSCP field56can be set to the AF1HDP codepoint. The IP packet36is then encapsulated in an Ethernet frame40and forwarded for delivery by the network16.

FIG. 8is a block diagram illustrating a process for setting priority information of an Ethernet frame carrying MPEG-2 encoded video information according to another embodiment of the invention. As discussed with regard to

FIG. 7, the video stream44is an MPEG-2 elementary stream. Also as discussed with regard toFIG. 7, the video streamer14segments the video stream44into a video segment26, encapsulates the video segment26into an RTP packet28, and sets the picture type field60based on the type of picture associated with the video segment26. The video streamer14then encapsulates the RTP packet28in a UDP packet32which in turn is encapsulated into an IP packet36. The IP packet36is encapsulated in an Ethernet frame40. The video streamer14sets the user priority field58based on the picture type field60and the desired number of discard precedence levels desired. For example, if only two discard precedence levels are desired and if the picture type field60indicates an I-picture or a P-picture, the user priority field58can be set to indicate a low discard precedence. If the picture type field60indicates a B-picture, the user priority field58can be set to a high discard precedence. If three discard precedence levels are desired, and if the picture type field60indicates an I-picture, the user priority field58can be set to a low discard precedence. If the picture type field60indicates a P-picture the user priority field58can be set to a medium discard precedence. If the picture type field60indicates a B-picture, the user priority field58can be set to a high discard precedence value. The Ethernet frame40is then forwarded for delivery by the network16.

FIG. 9is a block diagram illustrating a process for setting priority information of an IP packet carrying MPEG-4 encoded video information according to one embodiment of the invention. The embodiment illustrated inFIG. 9is similar to the embodiment illustrated inFIG. 4, except the video stream44is an MPEG-4 video stream. The video stream44comprises a plurality of NAL units, including NAL units62A-62F. Each NAL unit62includes a corresponding NAL header64A-64F. The NAL header64includes a 2-bit nal_ref idc (NRI) field that indicates a priority of the video data associated with the respective NAL unit62. In accordance with IETF Request for Comments 3984 entitled “RTP Payload Format for H.264 Video” (hereinafter “RFC 3984”), which is hereby incorporated herein by reference, the possible values of the NRI field are as follows:

an NRI value of ‘00’ is associated with a non-reference picture;

an NRI value of ‘01’ is associated with a coded slice data partition B;

an NRI value of ‘01’ is associated with a coded slice data partition C;

an NRI value of ‘10’ is associated with a non-IDR coded slice;

an NRI value of ‘10’ is associated with a coded slice data partition A; and

an NRI value of ‘11’ is associated with a coded slice of an IDR picture.

The larger the value of the NRI field, the higher the priority of the video data associated with the respective NAL unit62. RFC 3984 describes two methods of encapsulating NAL units62for transport over RTP; one method relates to encapsulating a single NAL unit62in each RTP packet28, and a second method relates to encapsulating multiple NAL units62in each RTP packet28. The embodiment illustrated inFIG. 9assumes that one NAL unit62is encapsulated in each RTP packet28, and thus the video segment26comprises one NAL unit62, such as the NAL unit64A. The video streamer14encapsulates the video segment26in an RTP packet28, which in turn is encapsulated in a UDP packet32. The UDP packet32is encapsulated in an IP packet36. The DSCP field56can be set to the desired AF codepoint based on the value of the NRI field of the NAL unit64A in the video segment26and the desired number of discard preference levels. For example, if three discard precedence levels are desired, and if the NRI value is ‘11,’ the DSCP field56can be set to the AF1LDP codepoint. If the NRI value is 0′ or ‘01,’ the DSCP field56can be set to the AF1MDP codepoint. If the NRI value is ‘00,’ the DSCP field56can be set to the AF1HDP codepoint. The IP packet36is then encapsulated in an Ethernet frame40and forwarded for delivery by the network16.

FIG. 10is a block diagram illustrating a process for setting priority information of an IP packet36carrying MPEG-4 encoded video information according to another embodiment of the invention. The embodiment illustrated inFIG. 10is similar to the embodiment illustrated inFIG. 9, except the video segment26contains a plurality of NAL units62. The priority of the DSCP field56can be set based on the NRI values of the NAL units62according to any desired implementation. For example, if two levels of discard precedence are desired, the priority of the DSCP field56may be set to the AF1LDP codepoint if any of the NRI values have a value of ‘11,’ and set to the AF1HDP codepoint if none of the NRI values of the NAL units62in the video segment26have a value of ‘11.’ Alternately, if three levels of discard precedence are desired, the discard precedence can be based on the number of the NAL units62that have an NRI value of ‘11.’ For example, if N represents the number of NAL units62in the video segment26, assume that Nprepresents the number of NAL units62that have an NRI value=‘11.’ If 0<Np<=N1, then the DSCP field56is set to the AF1HDP codepoint. If N1<Np<=N2, then the DSCP field56is set to the AF1MDP codepoint. If N2<Np<=N, then the DSCP field56is set to the AF1LDP codepoint. N1and N2can be set to any desired number of NAL units62. For example, if N=7, N2may be equal to 3, and N1may be equal to 1. After the DSCP field56is set to the desired AF1 codepoint, the IP packet36is encapsulated in the Ethernet frame40and forwarded over the network16for delivery to the end user12.

FIG. 11is a block diagram illustrating a process for setting priority information of an Ethernet frame40carrying MPEG-4 encoded video information according to another embodiment of the invention.FIG. 11is similar to the embodiment illustrated inFIG. 9except rather than use the DSCP field56in the IP header38, the user priority field58in the Ethernet header42is used to indicate the priority of the video segment26. The user priority field58can be set based on the NRI value in the NAL header64A in the video segment26based on the number of discard precedence levels desired. If two discard precedence levels are desired, the user priority field58can be set to a low discard precedence priority if the NRI value is ‘11’, and set to a high discard precedence priority if the NRI value is ‘10’, ‘01,’ or ‘00’. If three discard precedence levels are desired, the user priority field58can be set to a low discard precedence priority if the NRI value is ‘11,’ set to a medium discard precedence priority if the NRI value is 0′ or ‘01,’ and set to a high discard precedence priority if the NRI value is ‘00.’ If four discard precedence priorities are desired, the user priority field58can be set to a low discard precedence priority if the NRI value is ‘11,’ set to a medium discard precedence priority if the NRI value is ‘10,’ set to a medium-high discard precedence priority if the NRI value is ‘01,’ and set to a high discard precedence priority if the NRI value is ‘00.’

FIG. 12is a block diagram illustrating a process for setting priority information of an Ethernet frame40carrying MPEG-4 encoded video information according to another embodiment of the invention.FIG. 12is similar to the embodiment described inFIG. 11, except that the video segment26contains a plurality of NAL units62. The user priority field58can be set based on the NRI values of the NAL units62according to any desired implementation. For example, assume that three levels of discard priorities are desired, and that the 5×3 option will be used. Further, assume that N represents the number of NAL units62in the video segment26, and assume that Nprepresents the number of NAL units62that have an NRI value=‘11.’ If 0<Np<=N1, then a high discard precedence can be indicated in the user priority field58. If N1<Np<=N2, then a medium discard precedence can be indicated in the user priority field58. If N2<

Np<=N, then a low discard precedence can be indicated in the user priority field58. N1and N2can be set to any desired number of NAL units62. For example, if N=7, N2may be equal to 3, and N1may be equal to 1.

FIG. 13is a block diagram illustrating components in a switching device22suitable for discarding packets according to one embodiment of the invention. The switching device22includes an input interface66adapted to receive data packets24via the network16. The switching device22includes a control system68that includes a memory70and a packet forwarding engine72. The control system68can comprise a special or general purpose processor executing a proprietary or conventional operating system. The memory70and the packet forwarding engine72include software, hardware, or a combination thereof adapted to provide the functionality described herein. The packet forwarding engine72may operate at layer two and use the DSCP field56and determine whether to discard or forward the data packet24if the network16is congested. Alternately, the packet forwarding engine72may operate at layer two and use the user priority field58and determine whether to discard or forward the data packet24if the network16is congested. An output interface74communicates data packets24to another switching device22or an end user12, as appropriate.