ArticleslgStudy

computer science

Traffic shaping

Traffic shaping is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Traffic shaping rather than just read about it. In short: Traffic shaping is a bandwidth management technique used on computer networks which delays some or all datagrams to bring them into compliance with a desired traffic profile. Traffic shaping is used to optimize or guarantee performance, improve latency, or increase usable bandwidth for some kinds of packets by delaying other kinds.

Key takeaways

  • Traffic shaping belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Traffic shaping to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Traffic shaping from memory before moving on to harder problems.

Reference excerpt

Traffic shaping is a bandwidth management technique used on computer networks which delays some or all datagrams to bring them into compliance with a desired traffic profile. Traffic shaping is used to optimize or guarantee performance, improve latency, or increase usable bandwidth for some kinds of packets by delaying other kinds. It is often confused with traffic policing, the distinct but related practice of packet dropping and packet marking. One type of traffic shaping is application-based traffic shaping. In application-based traffic shaping, fingerprinting tools are first used to identify applications of interest, which are then subject to shaping policies. Some controversial cases of application-based traffic shaping include bandwidth throttling of peer-to-peer file sharing traffic. Many application protocols use encryption to circumvent application-based traffic shaping. Another type of traffic shaping is route-based traffic shaping. Route-based traffic shaping is conducted based on previous-hop or next-hop information.

Functionality If a link becomes utilized to the point where there is a significant level of congestion, latency can rise substantially. Traffic shaping can be used to prevent this from occurring and keep latency in check. 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 generic cell rate algorithm. 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) or by an element in the network.

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 traffic policing. Shaping is widely used for teletraffic engineering, and appears in domestic ISPs' networks as one of several Internet Traffic Management Practices (ITMPs). Some Internet service providers (ISPs) may use traffic shaping to limit resources consumed by peer-to-peer file-sharing networks, such as BitTorrent. Data centers use traffic shaping to maintain service level agreements for the variety of applications and the many tenants hosted as they all share the same physical network. Audio Video Bridging includes an integral traffic-shaping provision defined in IEEE 802.1Qav. Nodes in an IP network that buffer packets before sending on a link that is at capacity produce an unintended traffic shaping effect. This can appear across, for example, a low bandwidth link, a particularly expensive WAN link or satellite hop.

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, one for each separately shaped class, until they can be transmitted in compliance with the associated traffic contract. Transmission 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 packet loss).

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 a strategy known as tail drop and which results in traffic policing as well as shaping. A more sophisticated implementation could apply a dropping algorithm such as random early detection.

Traffic classification Simple traffic shaping schemes shape all traffic uniformly. More sophisticated shapers first classify traffic. Traffic classification categorises traffic (for example, based on port number or protocol). Different classes can then be shaped separately to achieve a desired effect.

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. Self-limiting sources shape the traffic they generate to a greater or lesser degree. Congestion control mechanisms can also affect traffic shaping of sorts - for example, TCP's window mechanism implements a variable rate constraint related to bandwidth-delay product. TCP Nice, a modified version of TCP developed by researchers at the University of Texas at Austin, allows applications to request that certain TCP connections be managed by the operating system as near-zero-cost background transfers, or nice flows. Such flows interfere only minimally with foreground (non-nice) flows, while reaping a large fraction of spare network bandwidth.

Relationship to bandwidth management Traffic shaping is a specific technique and one of several that, combined, constitute bandwidth management.

ISPs and traffic management

Traffic shaping is of interest, especially to ISPs. Their high-cost, high-traffic networks are their major assets, and as such, are the focus of their attention. They sometimes use traffic shaping to optimize the use of their network, sometimes by shaping traffic according to their assessment of importance and thus discouraging use of certain applications.

Enterprises

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Traffic shaping

Start with the simplest possible case. Write down what Traffic shaping claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Traffic shaping before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Traffic shaping ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Traffic shaping

In research
Traffic shaping appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Traffic shaping in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Traffic shaping is common in secondary-school and first-year university syllabi. It links to neighbouring topics Network performance, Network scheduling algorithms, Teletraffic, so understanding it makes those chapters shorter.
In everyday life
Look for Traffic shaping outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Traffic shaping in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Traffic shaping means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Traffic shaping out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Traffic shaping in simple terms?

Traffic shaping is a bandwidth management technique used on computer networks which delays some or all datagrams to bring them into compliance with a desired traffic profile. Traffic shaping is used to optimize or guarantee performance, improve latency, or increase usable bandwidth for some kinds o…

Why does Traffic shaping matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Traffic shaping?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Traffic shaping.

Tags

  • Network performance
  • Network scheduling algorithms
  • Teletraffic

Keep exploring