Need an explanation of sliding window for networking

In summary, the conversation discusses the concept of sliding windows in TCP communication. Sliding windows allow for better performance by allowing the receiver to read ahead and request more data at once. It also uses packet numbers and acknowledgements to ensure that lost data is retransmitted. Different protocols may have variations in how they implement sliding windows. The speaker also asks about the network protocol and library being used.
  • #1
serp777
117
6
So I have a school project that requires me to use a sliding window in order to transmit a file to a server, but I'm having trouble understanding how sliding window works.

I don't really understand how rejects are done and how the program knows to send a new packet and then move onto the next window. Can someone explain it to me please? I've tried googling it several times but I just can't seem to grasp it entirely. Thanks for your help.
 
Technology news on Phys.org
  • #2
Worst wikipedia article ever. Read this:
http://searchnetworking.techtarget.com/definition/sliding-windows
Basically it seems tcp has a built in buffer, so a reciever can read ahead of whatever application is reading it. Since tcp sends "confirmations" of transmissions recieved, it can get better performance by asking for more chunks of data at a time, or increasing the size of the "window.
 
Last edited:
  • #3
TCP will also use hash codes to verify that the data got sent correctly. As an example, if you sent the string hello world then a hash code of the string as well as its length would be sent. The receiver would rehash the data and if the new hash doesn't match the old it will request a retransmission of the block.
 
  • #4
There are several ways of sending data and confirming that the data has been received (not received correctly, that is another theme).
  1. Every transfer chops the data into smaller chunks, called "packets" or "frames".
  2. There is a finite probability that a packet is lost in transmission. If so, it needs to be retransmitted.
  3. The simplest way is to send one packet and require a receipt (an "acknowledge") for that packet before the next packet is sent. If no acknowledge is received inside a specific time limit, the packet is retransmitted.
  4. In order to ensure that the retransmitted packet is not confused with the next packet (the packet may have been received, but the acknowledge may have been lost), all packets are identified with a packet number.
  5. If few packets are lost, waiting for an acknowledge after every packet wastes time and bandwidth. You may then decide to send a number of packets before requiring an acknowledge. This is the basic "sliding window" principle.
  • The number of packets sent before an acknowledge is required is called the "window".
  • The window size must be negotiated between the sender and the receiver before starting the transfer
  • After transmitting the number of packets that the window size specifies, the sender stops and waits for an acknowledge.
  • The acknowledge from the receiver contains the packet number of the next expected packet (or the last received packet, it depends on the protocol)
  • If no acknowledge if forthcoming, the sender usually sends a control packet requesting an acknowledge.
Different protocols use slightly different variations here. A special case is TCP, which dynamically adjusts the size of the window depending on whether packets are lost or not.

Note: This is just a short summary of the subject!
 
  • #5
Hey serp777.

What network protocol are you thinking of using and what network library are you thinking of using?
 

What is a sliding window in networking?

A sliding window is a technique used in computer networking to improve the efficiency and reliability of data transmission. It involves sending multiple packets of data without waiting for an acknowledgement from the receiver. The sender maintains a window of the maximum number of unacknowledged packets that can be sent at one time, and the receiver sends back an acknowledgement for each successfully received packet.

How does a sliding window work?

A sliding window works by allowing the sender to continue sending data without waiting for an acknowledgement from the receiver. The sender maintains a window of the maximum number of unacknowledged packets that can be sent at one time, and the receiver sends back an acknowledgement for each successfully received packet. As the sender receives acknowledgements, it moves the window forward, allowing for the transmission of more packets.

What are the advantages of using a sliding window in networking?

Using a sliding window in networking has several advantages. It allows for faster data transmission by eliminating the need to wait for acknowledgements after each packet. It also improves reliability by allowing for the retransmission of any lost or corrupted packets. Additionally, it helps to prevent network congestion by regulating the flow of data between the sender and receiver.

Are there any limitations or drawbacks to using a sliding window in networking?

While a sliding window can improve efficiency and reliability in networking, it does have some limitations. One limitation is that it requires both the sender and receiver to support the sliding window protocol. Additionally, it may not be suitable for real-time applications or networks with high error rates, as it can lead to delays if packets need to be retransmitted.

Can you give an example of how a sliding window is used in networking?

One example of a sliding window in networking is the TCP protocol. TCP uses a sliding window to regulate the flow of data between the sender and receiver. The sender maintains a window of unacknowledged packets, and as acknowledgements are received, the window slides forward, allowing for the transmission of more packets. This helps to prevent network congestion and ensures reliable data transmission.

Similar threads

  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
1
Views
982
  • Computing and Technology
Replies
4
Views
1K
Replies
5
Views
2K
  • Computing and Technology
Replies
12
Views
3K
  • Sticky
  • Programming and Computer Science
Replies
13
Views
4K
  • Computing and Technology
4
Replies
123
Views
15K
  • Programming and Computer Science
Replies
21
Views
1K
  • Special and General Relativity
Replies
24
Views
2K
Back
Top