Simulation of Sliding Window Protocol for 2- Bit Or 3- Bit Frames
Total Page:16
File Type:pdf, Size:1020Kb
IJCSN International Journal of Computer Science and Network, May 2014 ISSN (Online) : 2277-5420 www.IJCSN.org Conference Proceeding – RDFCORDGE - 2014 Simulation of Sliding Window PProtocolrotocol 1 Abhilasha Sahu, 2 Anubhuti Pandey, 3 Gourav Shukla, 4 R.Chetan, 5 Kiran Chhabra 1-4 Department of Computer Science and Engineering, MMCT,Raipur 5 Head of Department, Computer Science and Engineering, MM College of Technology, Raipur, Chhattisgarh, India. Abstract - The sliding window protocol is widely used in 1.1 Stop and Wait Protocol many standard network protocol. It ensures a correct data In a stop and wait protocol, the sender transfer over unreliable channel where packet may be waits for an acknowledgement after every duplicated, lost or re-ordered. It is the most important protocol frame it sends. of data link layer. In our project work, we are dealing with concept of sliding window protocol, it’s working and Only when an acknowledgement has been simulation of it through our software. received then the next frame is sent. 1.2 Sliding Window Protocol Keywords - sliding window, Protocol, Data link Layer. Sliding window protocol is a protocol used in data link layer in the OSI reference model. It is 1. Introduction used for flow control, that means it checks whether the packet is reached to the destination or not. It was introduced to overcome the The Sliding Window (SW) protocol has been widely limitation of stop and wait protocol. The main used in many popular communication protocols. The disadvantage of stop and wait is it’s efficiency protocol can ensure a correct data transfer over very poor which is over come in sliding window protocol. quality communication channels where the packets may Some of the main points of the sliding window be duplicated, lost, or re-ordered .A number of protocol are : parameters affects the performance characteristics of the SW protocol. Usually, these performance characteristics cannot be determined analytically. In the sliding window method, the sender can transmit several frames before needing Reliable transmission of data over unreliable channels is an acknowledgement. an old and well-studied problem in computer science. Without a satisfactory solution, computer networks The receiver acknowledges only some of would be useless, because they transmit data over the frames, using a single channels that often lose, duplicate, or reorder messages. acknowledgement to confirm receipt of One of the most efficient protocols for reliable multiple data frames. transmission is the Sliding Window (SW) protocol. Many popular communication protocols such as TCP 2. Methodology and HDLC are based on the Sliding Window protocol. 2.1 A one bit sliding window protocol Before tackling the general case, let us first examine a sliding window protocol with a maximum window size of 1. Such a protocol uses stop-and-wait since the sender transmits a frame and waits for its acknowledgement before sending the next one. Fig 1.1 Categories of flow control 2.2 A two bit sliding window protocol In a two bit sliding window protocol the maximum window size is of 4. That means at least 4 packets can be send without waiting for acknowledgement. 198 IJCSN International Journal of Computer Science and Network, May 2014 ISSN (Online) : 2277-5420 www.IJCSN.org Conference Proceeding – RDFCORDGE - 2014 2.3 A three bit sliding window protocol In this there is loss of acknowledgement from receiver to sender. The fig. shows the packet and Acknowledgement In a three bit sliding window protocol the maximum loss. window size is of 8. That means at least 8 packets can be send without waiting for acknowledgement. 2.5 Flow Chart: 2.4 Implementation In our project we are simulating the three cases that are 1) Ideal case 2) Packet loss 3) Acknowledgement loss 2.4.1Ideal case : In ideal case there is no loss of data or acknowledgement. An ideal condition is shown next. 3. Result It has sending and receiving window. Buttons for start, stop, change setting and help. Sequence number, type of simulation can be changed by change setting button. Fig.2.1 Ideal case 2.4.2. Packet loss : In this there is loss of packet from sender to receiver. When this loss happen the sender wait for a particular time period and resend the packet after the time out. Fig.3.1 Initial snap shot for transmission of data Packet sending operations are shown in this window. Each operation effect the sending and receiving window. Each packet contains acknowledgement number, sequence number and data packets. Fig 2.2 Loss of packet and acknowledgement 2.4.3 Acknowledgement loss : 199 IJCSN International Journal of Computer Science and Network, May 2014 ISSN (Online) : 2277-5420 www.IJCSN.org Conference Proceeding – RDFCORDGE - 2014 with damage frame case. In which the receiver checks the frame whether the data is correct or not, that is error detection. If the data is correct then it will sends positive acknowledgement otherwise a negative acknowledgement will be sent to the sender. Acknowledgement It gives us immense pleasure to express our deepest sense of gratitude to the people who have contributed either directly or indirectly in successful completion of the project. We owe a debt of gratitude to Dr.Shamita Chakraborty , Director, MM College of Technology, who provided us a good infrastructure & resources for completion of the project. We are highly indebted to our project guide. References [1] Wright GrayW.,Stevens Richard W, ”, The Fig. 3.2 Snap Shot of Working Project Implementation Volume 2. [2] Tanenbaum A.S, “Computer Networks”. [3] Schildt Herbert, “The Complete Reference, JAVA 2” [4] A.Forouzan Behrouz, “Data Communication And 4. Conclusion Networking”. We have done simulation of sliding window protocol for 2- bit or 3- bit frames. In future we are going to deal 200 .