12695_data link control

36
Data Link Control

Upload: sahilprabhakar

Post on 17-Dec-2015

224 views

Category:

Documents


2 download

DESCRIPTION

Computer Networks

TRANSCRIPT

  • Data Link Control

  • FLOW AND ERROR CONTROLThe most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link control.Flow Control Error ControlTopics discussed in this section:

  • Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment.

  • Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.

  • PROTOCOLSNow let us see how the data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another. The protocols are normally implemented in software by using one of the common programming languages.

  • Taxonomy of protocols

  • NOISELESS CHANNELSLet us first assume we have an ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel.Simplest Protocol Stop-and-Wait ProtocolTopics discussed in this section:

  • The design of the simplest protocol with no flow or error control

  • Flow diagram

  • Design of Stop-and-Wait Protocol

  • Flow diagram

  • NOISY CHANNELSAlthough the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent. We discuss three protocols in this section that use error control.Stop-and-Wait Automatic Repeat Request Go-Back-N Automatic Repeat Request Selective Repeat Automatic Repeat RequestTopics discussed in this section:

  • Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent frame and retransmitting of the frame when the timer expires.

  • In Stop-and-Wait ARQ, we use sequence numbers to number the frames. The sequence numbers are based on modulo-2 arithmetic. In Stop-and-Wait ARQ, the acknowledgment number always announces in modulo-2 arithmetic the sequence number of the next frame expected.

  • Flow and Error Control MechanismsStop-AND-WAIT ARQGo-BACK-N ARQSELECTIVE REPEAT ARQFlow and Error control Mechanisms for Noisy Channel

  • Stop-and-Wait ARQKeep a copy of the frame until ACK is received.Frame 0 is acknowledged by ACK 1 and vice-versa.Lost and corrupted frames are considered as same and No ACK is sent.Senders control variable S = holds number of recently sent frameReceivers control variable R = holds number of the next frame expectedSender starts a timer when it sends a frame.If an ack does not arrive within an allotted time period, sender assumes that packet is corrupted or lost. Sender will resend the same packet.

  • Operation of Stop-and-Wait ARQNormal OperationFrame is lostAcknowledgment is lostAcknowledgment is delayed

  • Operation of Stop-and-Wait ARQFrame is lost

  • Operation of Stop-and-Wait ARQlost ACK frame

    In Stop-and-Wait ARQ, numbering frames prevents the retaining of duplicate frames.

  • Stop-and-Wait ARQ, delayed ACKThe value of R at the receiver site is still 1, which means the receiver expects to see frame 1.Numbered acknowledgments are needed if an acknowledgment is delayed and the next frame is lost.

  • PiggybackingBidirectional transmissionMethod to combine a data frame with an acknowledgement.

  • Go-back-N ARQSending multiple frames at a time. Keep the copy of the frames before ACK is received.Sequence number is included in each frame in the header. If there are m bits for sequence number then we can have maximum 2m 1.Sender Sliding WindowWindow size is fixed here.

  • In the Go-Back-N Protocol, the sequence numbers are modulo 2m,where m is the size of the sequence number field in bits.

  • Send window for Go-Back-N ARQ

  • The send window is an abstract concept defining an imaginary box of size 2m 1 with three variables: Sf, Sn, and Ssize.

  • The send window can slide one or more slots when a valid acknowledgment arrives.

  • Receive window for Go-Back-N ARQ

  • The receive window is an abstract concept defining an imaginary box of size 1 with one single variable Rn. The window slideswhen a correct frame has arrived; sliding occurs one slot at a time.

  • Design of Go-Back-N ARQ

  • Window size for Go-Back-N ARQ

  • In Go-Back-N ARQ, the size of the send window must be less than 2m;the size of the receiver window is always 1.

  • Go-Back-N ARQ, normal operation

  • Go-Back-N ARQ, lost frameFrame 2 is lost. When the receiver receives frame 3, it is discarded because the receiver is expecting frame 2, not frame 3 (according to its window)Acknowledgements are cumulative

  • Go-Back-N ARQ: sender window sizeIf size of window is less than 2m, and all three ACK are lost, the frame 0 timer expires and all three frames are resent. Receiver discards them as duplicate.If size of window is equal to 2m, and all three ACK are lost, sender will send the duplicate frame 0 but receiver will accept it as next frame as it expects that

  • Selective Repeat ARQ, lost frame

  • Selective Repeat ARQ, sender window sizeSize of window is 2 and all acknowledgements are lost, the timer for frame 0 expires and frame 0 is resent. Receiver is expecting frame 2, not frame 0, so this duplicate frame is correctly discarded.Size of window is 3 and all acknowledgements are lost, the sender sends a duplicate of frame 0. Receiver expects 0 as part of window and so accepts it.

    **********************