Buffer is a region of memory used to temporarily hold data while it is being moved from one place to another. A buffer is used when moving data between processes within a computer. Majority of buffers are implemented in software. Buffers are generally used when there is a difference between the rate at which data is received and the rate at which it can be processed. If we remove buffers, then either we will have data loss, or we will have lower bandwidth utilization.
What is Buffering ?
In Buffering, Whether the communication is direct or indirect, message exchanged by communicating processes reside in a temporary queue.
Types of Buffering :
- Zero Capacity –
This queue cannot keep any message waiting in it. Thus it has maximum length 0. For this, a sending process must be blocked until the receiving process receives the message. It is also known as no buffering.
- Bounded Capacity –
This queue has finite length n. Thus it can have n messages waiting in it. If the queue is not full, new message can be placed in the queue, and a sending process is not blocked. It is also known as automatic buffering.
- Unbounded Capacity –
This queue has infinite length. Thus any number of messages can wait in it. In such a system, a sending process is never blocked.
Need of Buffering :
- It helps in matching speed between two devices, between which the data is transmitted. For example, a hard disk has to store the file received from the modem.
- It helps the devices with different data transfer size to get adapted to each other.
- It helps devices to manipulate data before sending or receiving.
- It also supports copy semantics.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Computer Networks | Set 1
- Computer Networks | Set 2
- Computer Networks | Set 5
- Computer Networks | Set 3
- Computer Networks | Set 4
- Computer Networks | Set 12
- Computer Networks | Set 6
- Computer Networks | Set 7
- Computer Networks | Set 8
- Computer Networks | Set 9
- Computer Networks | Set 10
- Computer Networks | Set 11
- Last Minute Notes - Computer Networks
- Commonly asked Computer Networks Interview Questions | Set 1
- Network Devices (Hub, Repeater, Bridge, Switch, Router, Gateways and Brouter)
- Traceroute in Network Layer
- Congestion Control in Computer Networks
- Error Detection in Computer Networks
- Types of Network Topology
- Computer Network | Leaky bucket algorithm
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.