Computer Networks (BCA) 5th Sem Previous Year Solved Question Paper 2022

Practice Mode:
7.

What are the congestion prevention policies ? Discuss the working of token bucket and leaky bucket algorithm with example.

Explanation

Congestion Prevention Policies:
    1. Traffic Shaping:
        ◦ Smooths the traffic flow by controlling the rate at which data is sent.
    2. Quality of Service (QoS):
        ◦ Prioritizes traffic based on specific criteria to ensure that critical applications receive better service.
    3. Load Shedding:
        ◦ Discards non-essential traffic during congestion to prioritize critical traffic.
    4. Traffic Policing:
        ◦ Monitors and enforces traffic rates to prevent excessive traffic.
    5. Admission Control:
        ◦ Controls the entry of new connections or data flows to prevent overloading the network.
    6. Routing Algorithms:
        ◦ Dynamic routing algorithms can adapt to network conditions, avoiding congested paths.
    7. Redundancy:
        ◦ Provides alternate paths and resources to handle traffic during congestion.
    8. Capacity Planning:
        ◦ Ensures that the network infrastructure can handle expected traffic loads.

Token Bucket Algorithm:
Working:
    1. Concept:
        ◦ In the token bucket algorithm, a token bucket is used to control the rate at which traffic is allowed to enter the network.
    2. Token Generation:
        ◦ The token bucket initially contains a fixed number of tokens. Tokens are generated at a constant rate and added to the bucket.
    3. Packet Transmission:
        ◦ Before a packet is transmitted, a token is required from the bucket. If tokens are available, the packet is sent; otherwise, it is queued.
    4. Token Consumption:
        ◦ Each transmitted packet consumes one token from the bucket.
    5. Rate Control:
        ◦ The rate at which tokens are generated determines the allowed traffic rate.
Example:
    • Suppose the token bucket has a capacity of 10 tokens, and tokens are generated at a rate of 2 tokens per second.
    • Initially, the bucket is full with 10 tokens.
    • If a packet arrives, it can only be transmitted if a token is available in the bucket.
    • If five packets arrive simultaneously, the first five packets will be transmitted immediately (as there are enough tokens).
    • After that, the bucket will be empty, and the next packets will be transmitted as soon as new tokens are generated.

Leaky Bucket Algorithm:
Working:
    1. Concept:
        ◦ In the leaky bucket algorithm, a fixed-capacity bucket is used to control the rate at which traffic is sent.
    2. Arrival of Packets:
        ◦ Packets arriving at the bucket are stored temporarily.
    3. Bucket Capacity:
        ◦ The bucket has a fixed capacity, and if it overflows, excess packets are discarded.
    4. Constant Rate:
        ◦ Packets are released from the bucket at a constant rate, regardless of the arrival rate.
    5. Smooth Traffic Flow:
        ◦ The leaky bucket helps smooth out bursts of incoming traffic by regulating the rate at which packets are released.
Example:
    • Suppose the leaky bucket has a capacity of 10 packets and releases packets at a rate of 2 packets per second.
    • If 15 packets arrive in 5 seconds, the first 10 packets will be stored in the bucket, and the remaining 5 packets will be discarded.
    • The bucket will release packets at a constant rate of 2 packets per second, preventing congestion by controlling the output rate.

Comparison:
    • Token Bucket vs. Leaky Bucket:
        ◦ Token Bucket: Tokens are generated at a fixed rate; unused tokens accumulate in the bucket.
        ◦ Leaky Bucket: Packets are released at a fixed rate; excess packets are discarded.

both the token bucket and leaky bucket algorithms are traffic shaping mechanisms that help prevent congestion by controlling the rate at which packets are transmitted. The choice between them depends on the specific requirements of the network and the desired traffic control characteristics.