Need an explanation of sliding window for networking

Click For Summary

Discussion Overview

The discussion revolves around the concept of the sliding window mechanism in networking, particularly in the context of file transmission using protocols like TCP. Participants seek to clarify how the sliding window operates, including aspects of packet transmission, acknowledgments, and error handling.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses confusion about the sliding window mechanism, specifically regarding how packets are sent, acknowledged, and how the window moves.
  • Another participant critiques a Wikipedia article and suggests an alternative source, explaining that TCP uses a built-in buffer to allow receivers to read ahead and improve performance by adjusting the window size.
  • A participant describes the use of hash codes in TCP for verifying data integrity, noting that mismatches prompt retransmission requests.
  • One participant outlines the basic principles of data transmission, including packet loss, acknowledgment requirements, and the sliding window concept, emphasizing the negotiation of window size and the role of acknowledgments in managing packet flow.
  • A later reply asks for clarification on the specific network protocol and library the original poster intends to use.

Areas of Agreement / Disagreement

Participants present varying levels of understanding and detail regarding the sliding window mechanism, with no consensus reached on all aspects of its operation. Some explanations are more technical, while others remain more general, indicating differing perspectives on the topic.

Contextual Notes

The discussion includes assumptions about the reader's prior knowledge of networking concepts and does not resolve uncertainties regarding specific implementations or variations of the sliding window mechanism across different protocols.

serp777
Messages
117
Reaction score
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
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:
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.
 
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!
 
Hey serp777.

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

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 123 ·
5
Replies
123
Views
20K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 9 ·
Replies
9
Views
9K