Traffic shaping

From Wikipedia, the free encyclopedia

Jump to: navigation, search

Traffic shaping (also known as "packet shaping") is the control of computer network traffic in order to optimize or guarantee performance, lower latency, and/or increase usable bandwidth by delaying packets that meet certain criteria.[1] More specifically, traffic shaping is any action on a set of packets (often called a stream or a flow) which imposes additional delay on those packets such that they conform to some predetermined constraint (a contract or traffic profile).[2] Traffic shaping provides a means to control the volume of traffic being sent into a network in a specified period (bandwidth throttling), or the maximum rate at which the traffic is sent (rate limiting), or more complex criteria such as GCRA. This control can be accomplished in many ways and for many reasons; however traffic shaping is always achieved by delaying packets. Traffic shaping is commonly applied at the network edges to control traffic entering the network, but can also be applied by the traffic source (for example, computer or network card[3]) or by an element in the network. Traffic policing is the distinct but related practice of packet dropping and packet marking.[4]


[edit] Uses

Traffic shaping is sometimes applied by traffic sources to ensure the traffic they send complies with a contract which may be enforced in the network by a policer.

It is widely used for network traffic engineering, and appears in domestic ISPs' networks.

Nodes in an IP network which buffer packets before sending on a link which is at capacity result in a traffic shaping effect. This can appear at for example a low bandwidth link (such as dial-up), a particularly expensive WAN link or satellite hop.

Traffic shaping is often used in combination with:

[edit] Implementation

A traffic shaper works by delaying metered traffic such that each packet complies with the relevant traffic contract. Metering may be implemented with for example the leaky bucket or token bucket algorithms (the former typically in ATM and the latter in IP networks). Metered packets or cells are then stored in a FIFO buffer for each separately shaped class, until they can be transmitted in compliance with the prevailing traffic contract. This may occur immediately (if the traffic arriving at the shaper is already compliant), after some delay (waiting in the buffer until its scheduled release time) or never (in case of buffer overflow).

[edit] Overflow Condition

All traffic shaper implementations have a finite buffer, and must cope with the case where the buffer is full. A simple and common approach is to drop traffic arriving while the buffer is full (tail drop), thus resulting in traffic policing as well as shaping. A more sophisticated implementation could apply a dropping algorithm such as Random Early Discard; a crude alternative would be to allow overflowing traffic through unshaped.

[edit] Traffic Classification

Simple traffic shaping schemes shape all traffic uniformly by rate. More sophisticated shapers first classify traffic. Traffic classification categorises traffic (for example, based on port number or protocol). Each resulting traffic class can be treated differently to differentiate the service implied for the user (data generator/ consumer). For example, each traffic class could be subject to a different rate limit, shaped separately and/or prioritized relative to other traffic classes. This differentiation can be used by a network operator to treat different types of application traffic differently (for example, prioritize voice over file sharing for the responsiveness perceived by end users), and to offer premium services at a higher price point than basic ones[5].

Classification is achieved by various means. Matching bit patterns of data to those of known protocols is a simple, yet widely-used technique. An example to match the BitTorrent protocol handshaking phase would be a check to see if a packet began with character 19 which was then followed by the 19-byte string 'BitTorrent protocol'.[6] Upon classifying a traffic flow using a particular protocol, a predetermined policy can be applied to it and other flows to either guarantee a certain quality (as with VoIP or media streaming service[7]) or to provide best-effort delivery. This may be applied at the ingress point (the point at which traffic enters the network) with a granularity that allows the traffic-shaping control mechanism to separate traffic into individual flows and shape them differently [8].

[edit] Self-Limiting Sources

A self-limiting source produces traffic which never exceeds some upper bound, for example media sources which cannot transmit faster than their encoded rate allows.[9] Self-limiting sources shape the traffic they generate to a greater or lesser degree. Congestion control mechanisms can also effect traffic shaping of sorts - for example TCP's window mechanism implements a variable rate constraint related to bandwidth-delay product.

[edit] Relationship to Traffic Management

Traffic shaping is a specific technique and one of several which combined comprise Traffic Management[10]. Current common usage, particularly in discussion of domestic Internet service provision, frequently confuses traffic shaping with traffic management and traffic policing, with classification policies and in general with any measure deliberately taken by an ISP which is detrimental to the user's IP traffic performance.

[edit] ISPs and Traffic Management

See bandwidth management, and also Teletraffic engineering in broadband networks

Traffic shaping is of interest especially to Internet Service Providers (ISPs). Their high-cost, high-traffic networks are their major assets, and as such, are the focus of all their attentions. They often use traffic shaping as a method to optimize the use of their network, sometimes by intelligently shaping traffic according to importance, other times by discouraging uses of applications by harsh means.[11] There are those who believe it is not the ISPs place to decide what is "important"; in such cases per-client traffic shaping is more effective without creating potential controversies about what traffic is being controlled.

[edit] Benefits

To ISPs, mere protocol identification (classification) gives the intangible yet significant benefit of seeing what internet traffic is flowing through the network. From this they can see which subscribers are doing what on their network and can target services to the subscriber base they have attracted. However as time progresses, more and more protocols are using tunneling and encryption to defeat these methods. Also, many protocols are very difficult or impossible to detect. In such cases, per-client shaping is more effective. By establishing policies based on the IP or IP grouping of a client, end users cannot defeat shaping by disguising protocols or encrypting their traffic.

In addition, intelligent shaping schemes can guarantee a particular Quality of Service (often measured in jitter, packet loss, and latency) for an application or a user while still allowing other traffic to use all remaining bandwidth. This allows ISPs to offer Differentiated services and to upsell existing services to subscribers (such as offering minimum-latency computer gaming for an additional fee on top of basic internet).

More importantly, shaping allows ISPs to tier their services using software, reducing their costs and increasing the menu of products they can offer.

For Wireless ISP's, particularly those who use Wifi based protocols, Congestive Collapse is a serious problem. Due to the unfortunate nature of Wifi when several stations are all trying to access a single access point at once, once the load is past roughly 95% channel load, the throughput starts to drop dramatically. Whilst the channel stays at the same usage (roughly 99%), the throughput just gets slower and slower due to the number of retries. TCP cannot detect this as congestion, since packets are not lost, so continues to send data at the same speed. Therefore traffic shaping must be used on a WISP in order to avoid this very serious problem.

[edit] Traffic Classification

For the debate about ISPs degrading performance of some kinds of Internet traffic, see network neutrality.

Networks operators often distinguish between different types of traffic. Each type of traffic is called a class, and the process of determining which class a packet falls into is classification.

Operators often distinguish three broad types of network traffic: Sensitive, Best-Effort, and Undesired.

[edit] Sensitive Traffic

Sensitive traffic is traffic the operator has an expectation to deliver on time. This includes VoIP, online gaming, video conferencing, and web browsing. Shaping schemes are generally tailored in such a way that the quality of service of these selected uses is guaranteed, or at least prioritized over other classes of traffic. This can be accomplished by the absence of shaping for this traffic class, or by prioritizing sensitive traffic above other classes.

[edit] Best-Effort Traffic

Best effort traffic is all other kinds of non-detrimental traffic. This is traffic that the ISP deems isn't sensitive to Quality of Service metrics (jitter, packet loss, latency). A typical example would be peer-to-peer and email applications[12]. Traffic management schemes are generally tailored so best-effort traffic gets the what is left after sensitive traffic.

[edit] Undesired Traffic

This category is generally limited to the delivery of spam and traffic created by worms, botnets, and other malicious attacks. In some networks, this definition can include such traffic as non-local VoIP (for example, Skype) or video streaming services to protect the market for the 'in-house' services of the same type. In these cases, traffic management schemes identify and block this traffic entirely, or severely hampering its operation.

[edit] File Sharing

Peer-to-peer File Sharing applications are often designed to use any and all available bandwidth which impacts QoS-sensitive applications (like online gaming) that use comparatively small amounts of bandwidth. P2P programs can also suffer from download strategy inefficiencies, namely downloading files from any available peer, regardless of link cost. However, the biggest problem with P2P is not the downloads themselves; it is typically the discovery process[citation needed]. The applications use ICMP and regular HTTP traffic to discover servers and download directories of available files.

Recent figures show that the usage of one-fifth of the highest-usage subscribers must be added together to make up only close to 80% of P2P traffic on ISP networks[citation needed]. Sandvine Incorporated has determined, through traffic analysis, that P2P traffic accounts for up to 60% of traffic on most networks.[13] This shows, in contrast to previous studies and forecasts, that P2P has become mainstream.

If P2P is being used by more than the top fifth of an ISP's subscriber base, a harsh anti-P2P policy may have disastrous consequences on subscriber numbers[citation needed], increasing the subscriber churn rate. In some extreme cases this may damage the ISPs reputation permanently[citation needed].

P2P protocols are designed specifically to avoid being classified as such[vague], and with enough robustness that they do not depend on specific QoS properties in the network (in-order packet delivery, jitter, etc. - typically this is achieved through increased buffering and reliable transport, with the user experiencing increased download time as a result). File sharing traffic can be appropriately classified as Best-Effort traffic. At peak times when sensitive traffic is at its height, download speeds will decrease. However, since P2P downloads are often background activities, it affects the subscriber experience little, so long as the download speeds increase to their full potential when all other subscribers hang up their VoIP phones. Exceptions are real-time P2P VoIP and P2P video streaming services who need permanent QoS and use excessive[citation needed] overhead and parity traffic to enforce this as far as possible.

Many P2P applications[citation needed] can be configured to act as self-limiting sources, serving as a traffic shaper configured to the user's (as opposed to the network operator's) traffic specification.

Some vendors advocate managing clients rather than specific protocols, particularly for ISPs. By managing per-client (that is, per customer), if the client chooses to use their fair share of the bandwidth running P2P applications, they can do so, but if their application is abusive, they only clog their own bandwidth and cannot affect the bandwidth used by other customers.

[edit] Enterprises

Traffic Shaping and Prioritization is becoming more and more common in the corporate market. Most companies with remote offices are now connected via a WAN (Wide Area Network). Applications tend to become centrally hosted at the head office and remote offices are expected to pull data from central databases and server farms. As applications become more hungry in terms of bandwidth and prices of dedicated circuits being relatively high in most areas of the world, instead of increasing the size of their WAN circuits, companies feel the need to properly manage their circuits to make sure business-oriented traffic gets priority over best-effort traffic. Traffic shaping is thus a good means for companies to avoid purchasing additional bandwidth while properly managing these resources.

Other upcoming technologies to this regards are Application Acceleration and WAN Optimization and Compression which are fundamentally different from Traffic Shaping. Traffic Shaping defines bandwidth rules (or partitions as some vendors call them) whereas Application Acceleration using multiple techniques like TCP Performance Enhancing Proxy. WAN Optimization and Compression (WOC) on the other hand would use compression and differential algorithms and techniques to compress data streams or send only differences in file updates. The latter is quite effective for chatty protocols like CIFS.

[edit] See also

[edit] References

  1. ^ IETF RFC 2475 "An Architecture for Differentiated Services" section - definition of "Shaper"
  2. ^ ITU-T I.371 : Traffic control and congestion control in B-ISDN Section 7.2.7 defines and discusses Traffic Shaping in B-ISDN
  3. ^ IEEE INFOCOM 2001. Arsenic: a user-accessible gigabit Ethernet interface Pratt, I., Fraser, K., Computer Laboratory, Cambridge University; Twentieth Annual Joint Conference of the IEEE Computer and Communications Societies. Proceedings 2001 Volume 1, pages: 67-76 vol.1. Describes a gigabit Ethernet NIC with transmit traffic shaping.
  4. ^ Cisco Tech Notes: Comparing Traffic Policing and Traffic Shaping for Bandwidth Limiting. Document ID: 19645 Graphs illustrate differences in typical output
  5. ^ PlusNet's Traffic Classes show classification and prioritisation policies used to differentiate between more and less expensive Internet service
  6. ^ BitTorrent Protocol
  7. ^ SIN 450 Issue 1.2 May 2007 Suppliers' Information Note For The BT Network BT Wholesale - BT IPstream Advanced Services - End User Speed Control and Downstream Quality of Service - Service Description
  8. ^ Ferguson P., Huston G., Quality of Service: Delivering QoS on the Internet and in Corporate Networks, John Wiley & Sons, Inc., 1998. ISBN 0-471-24358-2.
  9. ^ Helzer, Xu Congestion Control for Multimedia Streaming with Self-Limiting Sources Josh Helzer, Lisong Xu
  10. ^ ATM Forum Traffic Management Specification, Version 4.0 Approved Specification 0056.00, Section 5.5, Traffic Shaping
  11. ^ CNet: Is Comcast's BitTorrent filtering violating the law? Analysis of Comcast's impersonation techniques for limiting BitTorrent usage.
  12. ^ The spam problem has actually led some network operators to implement Traffic shaping on SMTP traffic. See Tarpit (networking)
  13. ^ Leydon, John. "P2P swamps broadband networks".  The Register article which refers to Sandvine report - access to the actual report requires registration with Sandvine
  • "Deploying IP and MPLS QoS for Multiservice Networks: Theory and Practice" by John Evans, Clarence Filsfils (Morgan Kaufmann, 2007, ISBN 0-12-370549-5)
  • "Peer-to-Peer File Sharing: The Impact of File Sharing on Service Provider Networks", Sandvine Incorporated, copyright 2002

[edit] External links

Personal tools