
- DCN Tutorial
- Data Comm & Networks Home
- DCN - Overview
- DCN - Computer Network Types
- DCN - Network LAN Technologies
- DCN - Computer Network Topologies
- DCN - Computer Network Models
- DCN - Computer Network Security
- Physical Layer
- DCN - Physical Layer Introduction
- DCN - Digital Transmission
- DCN - Analog Transmission
- DCN - Transmission media
- DCN - Wireless Transmission
- DCN - Multiplexing
- DCN - Network Switching
- Data Link Layer
- DCN - Data Link Layer Introduction
- DCN - Error detection and Correction
- DCN - Data Link Control & Protocols
- Network Layer
- DCN - Network Layer Introduction
- DCN - Network Addressing
- DCN - Routing
- DCN - Internetworking
- DCN - Network Layer Protocols
- Transport Layer
- DCN - Transport Layer Introduction
- DCN - Transmission Control Protocol
- DCN - User Datagram Protocol
- Application Layer
- DCN - Application Layer Introduction
- DCN - Client-Server Model
- DCN - Application Protocols
- DCN - Network Services
- DCN Useful Resources
- DCN - Quick Guide
- DCN - Useful Resources
A One-Bit Sliding Window Protocol
Sliding window protocols are data link layer protocols for reliable and sequential delivery of data frames. The sliding window is also used in Transmission Control Protocol. In these protocols, the sender has a buffer called the sending window and the receiver has buffer called the receiving window.
In one – bit sliding window protocol, the size of the window is 1. So the sender transmits a frame, waits for its acknowledgment, then transmits the next frame. Thus it uses the concept of stop and waits for the protocol. This protocol provides for full – duplex communications. Hence, the acknowledgment is attached along with the next data frame to be sent by piggybacking.
Working Principle
The data frames to be transmitted additionally have an acknowledgment field, ack field that is of a few bits length. The ack field contains the sequence number of the last frame received without error. If this sequence number matches with the sequence number of the frame to be sent, then it is inferred that there is no error and the frame is transmitted. Otherwise, it is inferred that there is an error in the frame and the previous frame is retransmitted.
Since this is a bi-directional protocol, the same algorithm applies to both the communicating parties.
The algorithm of One – bit Sliding Window Protocol
begin frame s, r; //s and r denotes frames to be sent and received SeqNo = 0; // Initialise sequence number of outbound frame RSeqNo = 0; // Initialise sequence number of expected frame while (true) //check repeatedly do Wait_For_Event(); //wait for availability of packet if ( Event(Request_For_Transfer) AND canSend) then Get_Data_From_Network_Layer(); s = Make_Frame(SeqNo); Store_Copy_Frame(s); Start_Timer(s); SeqNo = SeqNo + 1; end if; Wait_For_Event(); //wait for arrival of frame if ( Event(Frame_Arrival) then r = Receive_Frame_From_Physical_Layer(); if ( r.SeqNo = RSeqNo ) then Extract_Data(r); Deliver_Data_To_Network_Layer(r); Stop_Timer(r); RSeqNo = RSeqNo + 1; end if end if s.ack = r.SeqNo; Send_Frame_To_Physical_Layer(s); Start_Timer(s); SeqNo = SeqNo + 1; end while end
Illustrative Example
The following diagram depicts a scenario with sequence numbers 0, 1, 2, 3, 0, 1, 2 and so on. It depicts the sliding windows in the sending and the receiving stations during frame transmission.
- Related Articles
- What is three-bit sliding window protocol?
- Sliding Window Protocol
- Sliding Window Protocol (Selective Repeat)
- Difference between Stop and Wait protocol and Sliding Window protocol
- What is a Sliding Window Protocol in Computer Network?
- Bit-Map Protocol
- Sliding Window Maximum in C++
- Sliding Window Median in C++
- Calculating average of a sliding window in JavaScript
- Token Passing in Bit-Map Protocol
- What is Bit Map protocol in computer networks?
- Find all subarrays with sum equal to number? JavaScript (Sliding Window Algorithm)
- Sliding Friction
- Four children were asked to arrange forces due to rolling, static and sliding frictions in a decreasing order. The correct arrangement is:(a) Rolling, Static, Sliding(b) Rolling, Sliding, Static (c) Static, Sliding, Rolling(d) Sliding, Static, Rolling
- Out of sliding friction, static friction and rolling friction:(a) which one is the smallest?(b) which one is the largest?
