Presentation is loading. Please wait.

Presentation is loading. Please wait.

D ATA L INK L AYER By Dr. Nawaporn Wisitpongphan.

Similar presentations


Presentation on theme: "D ATA L INK L AYER By Dr. Nawaporn Wisitpongphan."— Presentation transcript:

1 D ATA L INK L AYER By Dr. Nawaporn Wisitpongphan

2 I NTRODUCTION TO SOME RANDOM TOPIC IN C OMPUTER N ETWORK

3 E PIDEMIC R OUTING

4 O UTLINE

5 5 D ATA L INK C ONTROL P ROTOCOLS Data Link Control Protocols Line Discipline Line Discipline Flow Control Flow Control Error Control Error Control Who should Send now? How much data Can be sent? How can error be corrected?

6 6 D ATA L INK C ONTROL P ROTOCOLS Line Disciplin e Poll/S elect ENQ/ACK In half-duplex transmissions, it is essential that only one device transmit at a time. If both ends of the link put signals on the line simultaneously, they collide, leaving nothing on the line but noise. The coordination of half-duplex transmission is part of a procedure called line discipline.

7 ENQ/ACK ENQ/ACK coordinates which device may start a transmission and whether or not the intended recipient is ready and enabled. See fig 10.4 Using ENQ/ACK, a session can be initiated by either station on a link as long as both are of equal rank. In both half-duplex and full-duplex transmission, the initiating device establishes the session. In half duplex, the initiator then sends its data while the responder waits. The responder may take over the link when the initiator is finished or has requested a response. In full duplex, both devices can transmit simultaneously once the session has been established. How it works? Refer fig. 10.5 7

8 ENQ/ACK

9 P OLL /S ELECT The poll/select method of line discipline works with topologies where one device is designated as a primary station and the other devices are secondary stations. Multipoint systems must coordinate several nodes, not just two. The question to be determined in these cases, therefore, is more than just, are you ready? It is also, which of the several nodes has the right to use the channel?

10 P OLL /S ELECT : H OW DOES IT WORK ? Whenever multipoint link consists of a primary device and multiple secondary devices using a single transmission line, all exchanges must be made through primary device. The primary device controls the link; the secondary device follow its instructions. It is up to the primary to determine which device is allowed to use the channel at a given time The primary, therefore is always the initiator of a session. If the primary wants to receive data and send data. It apply function called poll and select respectively.

11 A DDRESSING IN P OLL /S ELECT For point-to-point configurations, there is no need for addressing; any transmission put onto the link by one device can be intended only for the other. For the primary device in a multipoint topology to be able to identify and communicate with a specific secondary device, however, there must be an addressing convention. For this reason, every device on a link has an address that can be used for identification.

12 POLL The polling function is used by the primary device to solicit transmission from the secondary devices. As noted, the secondaries are not allowed to transmit data unless asked (don’t call us-we’ll call you). By keeping all control with the primary, the multipoint system guarantees that only one transmission can occur at a time, thereby ensuring against signal collision. When the primary is ready to receive data, it must ask (poll) each device in turn if it has anything to send. When the first secondary is approached, it responds either with a NAK frame if it has nothing to send or with data (in the form of a data frame) if it does.

13 POLL (C ONT ) There are two possibilities for terminating the exchange: either the secondary sends all its data, finishing with an EOT frame Or the primary says, “time’s up” which of these occurs depends on the protocol and the length of the message. Once a secondary has finished transmitting, the primary can poll the remaining devices

14 14 P OLL

15 S ELECT The select mode is used whenever the primary device has something to send. But first, it must ensure that the target device is prepared to receive. So the primary must alert the secondary to the upcoming transmission and wait for an acknowledgment of the secondary’s ready status. Before sending data, the primary, the primary creates and transmits a select (SEL) frame, one field of which includes the address of the intended secondary. If the secondary is awake and running, it returns an ACK frame to the primary. The primary then sends one or more data frames each addressed to the intended secondary.

16 16 S ELECT

17 17 D ATA L INK C ONTROL P ROTOCOLS Data Link Control Protocols Line Discipline Line Discipline Flow Control Flow Control Error Control Error Control Who should Send now? How much data Can be sent? How can error be corrected?

18 18 F LOW C ONTROL / S TOP & W AIT Flow Control Sliding Window Stop-and-Wait Send 1 frame at a time Send several frames at a time

19 19 S TOP - AND -W AIT F LOW C ONTROL Procedure 1. Source transmits frame 2. Destination receives frame and replies with acknowledgement (ACK) 3. Source waits for ACK before sending the next frame 4. Destination can stop flow by not send ACK Works well for a few large frames Stop and wait becomes inadequate if large block of data is split into small frames

20 20 S TOP - AND -W AIT F LOW C ONTROL

21 21 S TOP - AND -W AIT L INK U TILIZATION Transmission Time is normalized to 1, Propagation Delay is expressed as ‘a’

22 22 F LOW C ONTROL / S LIDING W INDOW Flow Control Sliding Window Stop-and-Wait Send 1 frame at a time Send several frames at a time

23 S LIDING -W INDOWS F LOW C ONTROL Allows multiple frames to be in transit Receiver has buffer for W frames Transmitter sends up to W frames once without ACK from receiver ACK includes sequence number of next frame expected Sequence number is bounded by size of field (k) frames are numbered modulo 2 k giving max window size of up to 2 k - 1 23

24 S LIDING -W INDOWS F LOW C ONTROL Receiver can ACK frames without permitting further transmission (Receive Not Ready) Must send a normal acknowledgment to resume data transmission Can use Piggyback ACKs in Full Duplex Links Send data and ACK together in 1 frame If a station has only ACK to send (No data) : Send a separate ACK frame (RR/RNR) If a station has only data to send (No new ACK) : Send a repeat (as previous) ACK frame 24

25 25 S LIDING -W INDOW D IAGRAM

26 26 S LIDING -W INDOW E XAMPLE

27 27 D ATA L INK C ONTROL P ROTOCOLS Data Link Control Protocols Line Discipline Line Discipline Flow Control Flow Control Error Control Error Control Who should Send now? How much data Can be sent? How can error be corrected?

28 E RROR C ONTROL Detection and correction of errors such as: Lost frames Damaged frames Common techniques use: Error detection : CRC Positive acknowledgment Retransmission after timeout Negative acknowledgement & retransmission 28

29 29 A UTOMATIC R EPEAT R EQUEST (ARQ) Collective name for such error control mechanisms, including: Stop-and-Wait Go-back-N Selective-Reject (selective retransmission)

30 S TOP - AND -W AIT ARQ Based on Stop-and-Wait Flow Control Source transmits single frame & wait for ACK If received frame damaged, discard it Transmitter has timeout If no ACK within timeout, retransmit If ACK is damaged, transmitter will not recognize it Transmitter will retransmit Receive gets two copies of frame - Discard Use alternate numbering and ACK0 / ACK1 30

31 31 S TOP - AND -W AIT ARQ Possible Transmission Errors Data Lost ACK Lost Pros Simple Cons inefficient

32 G O -B ACK -N ARQ Based on Sliding-Window Flow Control If no error, ACK as usual Use window to control number of outstanding frames If error, reply with rejection Discard that frame and all future frames until error frame received correctly Transmitter must go back and retransmit that frame and all subsequent frames 32

33 G O -B ACK -N – H ANDLING E RROR Damaged Frame Error in frame i so receiver rejects frame i Transmitter retransmits frames from i Lost Frame Frame i lost and either Transmitter sends i+1 and receiver gets frame i+1 out of sequence and rejects frame i Or transmitter times out and send ACK with P-bit set which receiver responds to with ACK i Transmitter then retransmits frames from i 33

34 G O -B ACK -N - H ANDLING Damaged Acknowledgement Receiver gets frame i, sends ACK ( i+1 ) which is lost ACKs are cumulative, so next ACK ( i+n ) may arrive before transmitter times out on frame i If transmitter times out, it sends ACK with P-bit set Can be repeated a number of times before a reset procedure is initiated Damaged Rejection Reject for damaged frame is lost Handled as for lost frame when transmitter times out 34

35 S ELECTIVE -R EJECT ARQ Also called Selective-Retransmission Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimizes retransmission Receiver must maintain large enough buffer More complex logic in transmitter Hence less widely used Useful for satellite links with long propagation delays 35

36 36 G O B ACK N VS. S ELECTIVE R EJECT

37 PREVIEW OF THE N EXT C LASS

38 38 E VOLUTION OF C ONTENTION P ROTOCOLS Developed in the 1970s for a packet radio network Aloha Slotted Aloha Improvement: Start transmission only at fixed times (slots) CSMA CSMA = Carrier Sense Multiple Access Improvement: Start transmission only if no transmission is ongoing CD = Collision Detection Improvement: Stop ongoing transmission if a collision is detected (e.g. Ethernet) CSMA/CD


Download ppt "D ATA L INK L AYER By Dr. Nawaporn Wisitpongphan."

Similar presentations


Ads by Google