400 likes | 614 Views
Data Link Control. Line Discipline Flow Control Error Control. The McGraw-Hill Companies, Inc., 1998. WCB/McGraw-Hill. Figure 10-2. The McGraw-Hill Companies, Inc., 1998. WCB/McGraw-Hill. Figure 10-3. Line Disipline. There may be many devices trying to send the data .
E N D
Data Link Control • Line Discipline • Flow Control • Error Control The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-2 The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-3 Line Disipline • There may be many devices trying to send the data . • Line disipline determines which device can send the data at a given time . • It determines the data sent by a sender is received to correct user. • It also keep track that receiver is ready to accept the data. The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-4 ENQ/ACK (Enquiry/Acknowledgement) • This method is used in peer to peer networks. • Both the sender and receiver has a dedicated link. • It coordinates when the sender can start sending data and is the receiver ready to accept it or it is down or off? The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
How this method works • The sender first sends an enquiry(ENQ) frame to check that receiver is ready to receive data or not? • If receiver is ready it sends an Acknowledgement (ACK). • If not ready Negative Acknowledgement (NAK). • If the ACK or NAK frame is lost in between, the sender re sends it. (For three times). Else the Communication is stopped. • If ACQ is received the data transmission is started. • EOT is send in the last to indicate End Of Transmission.
Figure 10-5 ENQ/ACK The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-6 Poll/Select (Multipoint Discipline) • When we have client/server kind of a setup. • Primary system controls the line and provide services to secondary devices. • Polling :- It is used when primary device wants to receive data, and it ask the secondary devices if they have any data to send. This is called polling. The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-6 Poll/Select (Multipoint Discipline) • Selecting:- When the primary device wants to send data to any secondary device. It tells them to get ready to receive data. • It includes the address of the node to which the data is to be send. The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-7 Select • In Select mode the primary device send data to any secondary device. • It sends SEL (Select Frame) with the address of receiver. • It is received by all the secondary devices. • The secondary devices check the address field and send back ACK if they are ready. • The data transmission get started . The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Select Figure 10-7 The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-8 Poll • The Primary device ask each secondary device that if any one wants to sends data. • It sends a POLL frame to every Secondary device one-by-one. • If the first device does not have data it sends NACK. • Then it goes to second device and so on. • If any one has data to send they reply with ACK. • After that data transmission get started and end with EOT. The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Poll Figure 10-8 The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Flow Control • If the sender is sending data at fast speed and the receiver is slow , the receiver will not be able to receive the data after a certain point of time. • We need some flow control methods to avoid this. • Two Methods
Figure 10-9 The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-10 Stop and Wait The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Stop and wait • The sender sends a frame and wait for the acknowledgement from the receiver. • After receiving the frame only then the next frame is sent. • The frames are received accurately and are never lost, if any acknowledgement is not received the next frame is not sent. • This process is very slow and takes up a lot of time to get back the acknowledgement , and the sender will have to wait for a long time.
Sliding Window protocol • In this multiple frames are sent before the sender starts waiting for the acknowledgement. • The receiver sends a common ACK frame for these multiple frames. • Sliding windows is a logical collection of boxes at sender and receiver side. • These boxes hold frames in them. • The sender will send frames if the receiver window is not full. • The window boxes are numbered from 0 to some predefined number.
Figure 10-11 Sliding Window The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-12 Sender Sliding Window The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-13 Receiver Sliding Window The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Sliding Window Example Figure 10-14 The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Sender Figure 10-14-continued The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Receiver Figure 10-14-continued The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-15 Error Control • It detects for any errors in the data and retransmits the data back. • The damaged frames are retransmitted back. • ARQ (Automatic Repeat Request) • Types of errors that ARQ can correct:- • Damaged data frames • Lost Data Frames • Lost ACK and NAK The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-15 Different Methods of Error Control The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Stop and Wait ARQ • The sender Keeps a copy of the sent frame. • Wait for the ACK from the receiver. • If an NACK comes back retransmission of that frame. • If it does not come back the retransmission of the copy of that frame. • If Time out then retransmission of frame. • Damaged Data Frames • Lost Data Frames • Lost Acknowledgement Frame.
Figure 10-16 Damaged Frame The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-17 Lost Frame The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-18 Lost ACK The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Sliding Window ARQ • In this the copy of all the sent frames is kept until they get an acknowledgement. • Wait for ACK and/or NAK frames for acknowledgement. • ACK frame, represent the number of next frame and NAK frame represent the number of Damaged frame. • Timer is also their in the sending device if the Acknowledgment is lost or Data frame is lost in between. • Types • Go-Back-n ARQ for damaged data frames • Go-Back-in ARQ for lost data frames • Go-Back-n ARQ for lost acknowledgement frames • Selective reject ARQ
Figure 10-19 Damaged Frame The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-20 Lost Frame The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-21 Lost ACK The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill
Figure 10-22 Selective Reject The McGraw-Hill Companies, Inc., 1998 WCB/McGraw-Hill