Skip to content

sharmaparnika/Stop_n_Wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Stop n Wait Protocol

AIM: Implementation of Stop and Wait Protocol

ALGORITHM:

Sender:

Step1: sequence ß 0
Step2: Accept new packet and assign sequence to it.
Step3: Send packet sequence with sequence number sequence.
Step4: Set timer for recently sent packets.
Step5: If error free acknowledgment from receiver and NextFrameExpected -> sequence then sequence -> NextFrameExpected.
Step6: If time out then go to step3.
Step7: Stop.

Receiver:

Step1: Start.
Step2: NextFrameExpected <- 0, repeat steps 3 forever.
Step3: If error-free frame received and sequence= NextFrameExpected, then pass packet to higher layer and NextFrameExpected <- NextFrameExpected+1(modulo 2).
Step4: Stop.

Sender Snapshot:

image

Receiver Snapshot:

image