Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / C#
Article

Go-Back-N Simulator

Rate me:
Please Sign up or sign in to vote.
1.14/5 (13 votes)
6 May 20072 min read 68.9K   1.8K   15   5
GO - BACK - N Simulator

Sample Image - gbn.jpg

Introduction

This is a GO-BACK-N simulation writen in C# 2.0. Go-Back-N ARQ is a specific instance of the Automatic Repeat-reQuest (ARQ) Protocol, in which the sending process continues to send a number of frames specified by a window size without receiving an ACK packet from the receiver. The receiver process keeps track of the sequence number of the next frame it expects to receive, and sends that number with every ACK it sends. If a frame from the sender does not reach the receiver, the receiver will stop acknowledging received frames. Once the sender has sent all of the frames in its window, it will detect that all of the frames since the first lost frame are outstanding, and will go back to sequence number of the last ACK it received from the receiver process and fill its window starting with that frame and continue the process over again.

Work Structure


The simulation includes two different programs. One of them does server operations and the other one does client operations. Firstly client accepts a 10240(40*256) Bytes long file. It splits these bytes into 40 segments. Then user selects the probability of corruption while client is sending segments to the server, the probability of corruption while server is sending acknowledges to the client side and window size which determines the number of segments that are sent in the same time.

The client sends segments to the server with the probability of corruption that user has chosen. If packets are dropped, acknowledges are not sent back to client. If packets are received, server can not send acknowledges to client side. Because of the probability of corruption in acks, acks can be dropped.

After all segments are sent, user can defrag all segments and get the file.

Multi threads are used to send segments.

Conclusion

This simulation performs an unreliable channel using TCP!!! Packets and acknowledges are consciously dropped to show working structure of Go-Back-N.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Chief Technology Officer
Turkey Turkey
---

Comments and Discussions

 
GeneralNot a quality article. Pin
Rob Graham6-May-07 15:52
Rob Graham6-May-07 15:52 
GeneralRe: Not a quality article. Pin
M Sait Ozen6-May-07 21:23
M Sait Ozen6-May-07 21:23 
GeneralRe: Not a quality article. Pin
plutoa1009-May-07 15:01
plutoa1009-May-07 15:01 
QuestionStop and wait Pin
kuzman22-Mar-07 14:07
kuzman22-Mar-07 14:07 
AnswerRe: Stop and wait Pin
M Sait Ozen22-Mar-07 23:40
M Sait Ozen22-Mar-07 23:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.