Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

2.3 Traffic Shaping and Policing

Lesson 10 of 34 in the free High Speed Networks notes on Siksha Sarovar, written by Rohit Jangra.

2.3.1 Smoothing out the Bursts

Application data is often bursty (e.g., a web browser downloading a 5MB image). Traffic shaping smooths this data into a steady stream to prevent network spikes.

Study Deep: Token Bucket vs. Leaky Bucket

The key difference is flexibility:

  • Leaky Bucket: Rigid. No matter what, output is constant. Good for voice.
  • Token Bucket: Allows for Bursts. If a user hasn't sent data for 10 seconds, they "save up" tokens and can burst at line speed for a short duration. This is how modern ISPs manage "Speed Boost" features.

2.3.2 The Leaky Bucket Algorithm

Imagine a bucket with a small hole at the bottom. No matter how fast you pour water in, it leaks out at a constant rate.

  • Input: Any bursty rate.
  • Output: Constant rate.
  • Overflow: If the bucket fills up, any new water is "spilled" (dropped).
  • Usage: Ideal for CBR (Constant Bit Rate) traffic.

2.3.3 The Token Bucket Algorithm

The Token Bucket allows for some "burstiness" while still maintaining an average rate.

  • Tokens: A "token" is added to the bucket periodically (e.g., every 10ms).
  • Sending: To send a packet, the sender must "spend" a token.
  • The Advantage: If the sender hasn't sent anything for a while, the bucket fills with tokens. This allow the sender to send a "burst" of packets all at once until the tokens are gone.
  • Usage: The industry standard for modern Internet QoS.

2.3.4 Policing vs. Shaping

  • Traffic Shaping: Buffers excess packets and sends them later. (Adds delay but avoids loss).
  • Traffic Policing: Drops excess packets immediately or marks them with a low priority bit (Tagging). (No added delay, but causes loss).

2.3.5 Implementation in ATM: GCRA

In ATM networks, the Leaky Bucket is implemented as the GCRA (Generic Cell Rate Algorithm).

  • It checks every incoming cell against a Theoretical Arrival Time (TAT).
  • If a cell arrives too early (violating the PCR - Peak Cell Rate), it is marked as non-compliant.