To ensure that an IP packet makes it to its destination on time, the network and its equipment have to be configured properly. This is one part of Quality of Service (QoS), in which each IP packet sent is assigned a priority level. When two IP packets arrive at a QoS-enabled router or switch and a conflict arises as to which of several IP packets is discarded from a full queue or gets sent out from the queue, the choice is made on the basis of a packet’s priority. This priority is embedded within the IP packet’s header in a section called Type of Service (ToS).
The current QoS for IP packets is called Differentiated Services (DiffServ or DS) and is based on different services that travel over a network having different requirements for delay, jitter, reliability and so on. By differentiating between various data, choices can be made as to which packet goes first or which packet gets dropped when there is data congestion.
Don’t be confused with another part of the header called TTL (Time to Live), which sounds like a broadcasting term, but is really used to make sure an IP packet does not cycle around through several network switches and their queues without finding a destination. TTL starts off as a number that is subtracted from each time it passes through a switch; when the TTL reaches zero; the packed is discarded.
IP packet header
An IP packet contains a header that describes several important aspects of the data being transported by the packet. One of these is the ToS. ToS has gone through several revisions, but its latest redesign has gained widespread acceptance and is an integral part of QoS, which is essential for streaming media. The header of an IP packet contains many parts, some of which must be examined by the router or switch in order to implement QoS. As the IP packet arrives, the ToS section of the header is inspected, and the packet is placed within a queue following the QoS rules the router or switch has been given. If the ToS has not been set on a particular IP packet, then it is assumed that it has a default priority, and the system will make a “best effort” to deliver the packet. (See Figure 1.)
The previous standard for ToS (RFC 791) had the ToS field broken into two separate parts: the precedence, consisting of three bits that provide seven levels of priority from the highest (network control 111) to the lowest (routine 000). Streaming audio or video will, of course, be set to a medium or high priority. There were several bits used to indicate the importance of delay, throughput, reliability and cost. In the latest incarnation of ToS (RFC 2475), all that has been eliminated. Now, 6 bits are used to indicate one of 64 levels of priority (000000 being the lowest). The last 2 bits are used to indicate network traffic congestion. (See Figure 2.)
The ToS field is set at the source where the IP packet was created, such as where the video was converted to IP. The ToS is set by the software generating the IP packet, and packets generated by different software can and should have different priority levels for passing through the network. Every streaming media IP packet coming from that video converter should have its ToS field set to a priority level that helps it to pass through various routers and switches without being dropped or put in the back of the queue. All this depends on the equipment the IP packet is passing through being set up for QoS.
The ToS field can also be set by some of the equipment the IP packet passes through, as you will see below.
Each device on the network that examines and passes IP packets uses a set of rules that it follows when QoS in implemented. There are no real guidelines to follow when setting up these rules, and each network is configured for the benefit of the data it will carry. Routers work on Layer 3 of the OSI network model, meaning that they examine the IP packets and their headers for information about how to act upon the packets passing through them. At Layer 3, they have access to the TOS field of the IP packet. By examining the ToS field, the router can determine the priority of this IP packet and apply its own rules as to how to handle this packet.
But not every router has its QoS rules set up, and that can lead to high-priority data being lost. QoS is a mystery for many engineers, but it will become much more important as more audio, video and transport streams travel over IP networks.
In the absence of ToS, routers can base their QoS rules on the type of data passing through them. In general, the QOS rules can be applied to the following categories of traffic:
- Network services ( UTP, TCP, port number, IP source or destination address);
- Protocol used (IP, IPX, subnet or VLAN);
- MAC address (for specific equipment); and
- Physical port of the router.
The network engineer would determine which type of traffic needs to have higher or lower priority and set the rules accordingly. If a video server were streaming video over the network, its MAC address could be programmed into the rules of the router to always have the highest priority to make sure the video got to its destination without interruption. When IP packets with a ToS set to 000 passes through a router or switch, and it is assigned a priority by the above rules, some equipment will actually alter the ToS field in the IP packet to reflect the priority it has been assigned, so it will pass through the routers and switches downstream at that same priority. Once again, this type of alteration would be needed on a public network but should not be needed on a dedicated video/audio network, where the broadcast engineer has control of all the elements used that make up the network. When planning a network that will carry audio, video and transport streams, QoS must be taken into consideration — from making sure the originating equipment has its ToS fields set to the proper priority level to setting up the QoS rules on each switch and router to match the overall network policies. These network policies would have set out the priority levels for each type of traffic that will pass over the network, making sure that the priority for the streaming media does not stop necessary network housekeeping data exchanges.
The next “Transition to Digital” tutorial will cover QoS and network switches.