Computer Networks Leaky Bucket Tips
Computer Networks Leaky Bucket Tips
https://rtpnotes.vercel.app
https://pgmsite.netlify.app
Computer-Networks-Leaky-Bucket-Tips
What is leaky bucket algorithm?
Basic Algorithm for Remembering
Algorithm in detail
1. Read Bucket size, Outgoing rate, number of packets
2. Loop through each packet
2.1 Read the incoming packet size
2.2 Check if the incoming packet can be accomodated in the buffer
2.3 Simulate outgoing data
2.4 Negative value check and decrementing packet size
The bucket has a specific size, which represents the maximum amount of data that can be
buffered at any given time.
Data entering the network is likened to pouring water into the bucket.
The outgoing data rate is equivalent to the leak at the bottom of the bucket. Data
continuously flows out of the bucket at this rate.
Algorithm in detail
1. Read Bucket size, Outgoing rate, number of packets
// Prompt the user to enter bucket size, outgoing rate, and number of
packets
printf("Enter the bucket size (Bytes): ");
scanf("%d", &buck_size);
while(n != 0) {
return 0;