Experiment 7 DCCN FINAL

Embed Size (px)

Citation preview

  • 8/3/2019 Experiment 7 DCCN FINAL

    1/12

    EXPERIMENT 7

    AIM OF THE EXPERIMENT :Verification ofstop and waitprotocol.

    THEORY / DEFINATIONS :

    Stop and Wait protocol :Stop and Waitis a reliable transmission flow control protocol

    This protocol works only in Point to PointTransmission. The

    transmitting node has window of size ONE. Aftertransmission of a frame the transmitting node waits for a replyfrom the receiving node. If the transmitted frame reachesthe receiver without error, the receiver transmits anacknowledgement. If the transmitted frame reaches thereceiver with error, the receiver do not transmitacknowledgement. If the transmitter receives anacknowledgement it transmits the next frame if any. Else if itstimerexpires, it retransmits the same frame again.

    This concept of the Transmitting node waiting aftertransmission for a reply from the receiver is known as STOPand WAIT.It is used inX.25 WAN protocol.

    Algorithm for Stop and Wait protocol :1. Parse the Input.txt file and store the data file path andindex from the file. Store the index value to the local variableerr (Error Probability value)

    2. Call the in built function form packet and pass data filepath, which is got by parsing the file Input.txt.

    3. Repeat the loop until the transmitting list (transmittingnode) becomes empty

  • 8/3/2019 Experiment 7 DCCN FINAL

    2/12

    -i-Get the first frame of the transmitting list and transmit todestination.

    -ii-Call the Error Check function, pass the frame got and thevariable err value as

    parameters. The returned value is stored in a localvariable iret.-iii-If the value of the iret is 0 (No Error Condition),

    ->Form the positive acknowledgement and place it inthe transmission list of

    Node2.->To form positive acknowledgements create a new

    frame and set the datafield as "POS". Then set this frame as the first frame of

    Node2.

    ->Get the acknowledgement value from the receivingnodes transmission list.

    -If the acknowledgement has error or the timer hasexpired

    >Resend the same frame-If the acknowledgement has no error nor the timer

    has expired>Delete the first frame from the transmission list of

    Node1.

    >Delete the acknowledgement frame from Node2transmission list.

    -iv-If the value of the iret is 1 (Error Condition),->Resend the first frame of the transmitting list to

    destination.

    Flow Chart :

  • 8/3/2019 Experiment 7 DCCN FINAL

    3/12

  • 8/3/2019 Experiment 7 DCCN FINAL

    4/12

  • 8/3/2019 Experiment 7 DCCN FINAL

    5/12

  • 8/3/2019 Experiment 7 DCCN FINAL

    6/12

    PROCEDURE :

    1. Open Netsim analytics2. Programming -> Transmission flow control

    The file to be transmittedis selected.

  • 8/3/2019 Experiment 7 DCCN FINAL

    7/12

    SAMPLE WITHOUT ERROR:> Mode was selected as sample. Algorithm as stop and wait. Bit error

    rate was no error.

  • 8/3/2019 Experiment 7 DCCN FINAL

    8/12

    4. The protocol is Run and the transmission is observed.

  • 8/3/2019 Experiment 7 DCCN FINAL

    9/12

    5.Bit error rate is set to 10^5 and the protocol is run. Thetransmission is observed

  • 8/3/2019 Experiment 7 DCCN FINAL

    10/12

    6. Errors in transmission are observed

    OUTPUT :

  • 8/3/2019 Experiment 7 DCCN FINAL

    11/12

    The first figure shows the outputwhen the protocol isimplemented without Bit error rate and the second figureshows the output when the protocol is implemented with Biterror rate of 10^5

    CONCLUSION :

    The Stop and Wait protocolwas implementedwith andwithout Bit error rate using a user written protocol. It wasobserved that the Stop and wait protocol is time consumingas the senderhas to wait for the time slot fixedfor eachand every transmitted frame to receive theacknowledgementfrom the receiver.

  • 8/3/2019 Experiment 7 DCCN FINAL

    12/12

    Jayadev Pattanaik

    Reg. No : 0901209345

    5th sem, CSE B , Group 1