Download presentation
Presentation is loading. Please wait.
Published byMina Redington Modified over 9 years ago
1
C) All rights reserved by Professor Wen-Tsuen Chen1 Chapter 3 The Data link Layer ä For reliable, efficient communication between two adjacent machines ä Adjacent: two machines are physically connected by a communication channel ä Wire-like communication channel: data are delivered in order © All rights reserved. No part of these slides may be reproduced, in any form or by any means, without permission in writing from form or by any means, without permission in writing from Professor Wen-Tsuen Chen (email: wtchen@cs.nthu.edu.tw). Professor Wen-Tsuen Chen (email: wtchen@cs.nthu.edu.tw).
2
C) All rights reserved by Professor Wen-Tsuen Chen2
3
3 Design Issues ä Well-defined service interface to the network layer ä Framing ä Flow control ä Error control
4
C) All rights reserved by Professor Wen-Tsuen Chen4 DLL Services ä Unacknowledged connectionless service í Suitable for use in reliable channel. ä Acknowledged connectionless service í Suitable for use in unreliable channels, such as wireless channels. ä Acknowledged connection-oriented service í Provides the network layer processes with the equivalent of a reliable data link.
5
C) All rights reserved by Professor Wen-Tsuen Chen5 Character Count
6
C) All rights reserved by Professor Wen-Tsuen Chen6 Character Delimiters
7
C) All rights reserved by Professor Wen-Tsuen Chen7 Flags with Bit Stuffing ä Used in HDLC and SDLC of IBM 0111111001111110 starting flag ending flag ä When line idle, stream of flags are sent. ä Data Bit Stuffing
8
C) All rights reserved by Professor Wen-Tsuen Chen8 Data Framing ä Character count ä Starting and ending characters with character stuffing ä Starting and ending flags with bit stuffing ä Physical layer coding violations
9
C) All rights reserved by Professor Wen-Tsuen Chen9 Flow Control ä A technique for assuring that a transmitting entity does not overwhelm a receiving entity with data. ä Stop-and-wait flow control ä Sliding window flow control
10
C) All rights reserved by Professor Wen-Tsuen Chen10 ä A source transmits a frame. ä Upon reception, the destination sends back an acknowledgment. ä The source must wait until it receives the acknowledgment before sending the next frame. Stop-and-wait Flow control frame1 ack frame2 time sourcedestination
11
C) All rights reserved by Professor Wen-Tsuen Chen11 Link Utilization ä a = where t prop = propagation time t frame = frame transmission Time
12
C) All rights reserved by Professor Wen-Tsuen Chen12 ä Stop-and-wait utilization u is the ratio of single frame transmission time to the total time of a link engaged in transmission of the frame u = ä Stop-and-wait flow control is suitable when a is small
13
C) All rights reserved by Professor Wen-Tsuen Chen13 ä Multiple frames are transmitted in pipelining fashion. Sliding-Window Flow Control Window of outstanding frames are transmitted and waiting for ACK Last frame acknowledged Window of frames that are accepted and not yet sent to host Frames already acknowledged Frames already received
14
C) All rights reserved by Professor Wen-Tsuen Chen14
15
C) All rights reserved by Professor Wen-Tsuen Chen15 ä Stop-and-wait protocol is a special case of sliding- window protocol with window size 1.
16
C) All rights reserved by Professor Wen-Tsuen Chen16 Link Utilization
17
C) All rights reserved by Professor Wen-Tsuen Chen17 ä u = where N is the window size Optimal window size
18
C) All rights reserved by Professor Wen-Tsuen Chen18 Error Control ä Error detection and correction ä Three types of frames at receiver end: valid frame, lost frame, and damaged frame. ä Techniques for error control: í Positive acknowledgment í Retransmission after timeout í Negative acknowledgment and retransmission
19
C) All rights reserved by Professor Wen-Tsuen Chen19 Error Control (cont.) ä These techniques are referred to as automatic repeat request(ARQ). ä Three versions of ARQ have been standardized: ä stop-and-wait ARQ ä Go-back-N ARQ ä Selective-reject ARQ
20
C) All rights reserved by Professor Wen-Tsuen Chen20 Error Correction and Detection ä Error Correction with the Hamming Code
21
C) All rights reserved by Professor Wen-Tsuen Chen21 Error Correction and Detection(cont.) ä Error correction codes are sometimes used when retransmission cannot be requested, such as in a simplex channel, space communications.
22
C) All rights reserved by Professor Wen-Tsuen Chen22 Error Detection Codes ä Parity Check ä Cyclic redundancy check (CRC) í Easy hardware implementation í Detection of burst errors ä An error detection code, called frame check sequence (FCS) is appended to a data frame for transmission. dataFCS
23
C) All rights reserved by Professor Wen-Tsuen Chen23 Cyclic Redundancy Check ä Use modulo 2 Arithmetic to compute CRC code and detect errors.
24
C) All rights reserved by Professor Wen-Tsuen Chen24 Polynomial Representation of CRC G(X) : generator polynomial of degree r M(X) : message polynomial Where R(X) : remainder polynomial T(X) : transmitted polynomial Hence T(X) is divisible by G(X)
25
C) All rights reserved by Professor Wen-Tsuen Chen25 ä T’(x) : received polynomial T’(x) = T(x) + E(x) T’(x) = T(x) + E(x) Where E(X) : error polynomial with coefficient is in positions where errors occur. Where E(X) : error polynomial with coefficient is in positions where errors occur. ä If T’(x) is not divisible by G(x), i.e. E(x) is not divisible by G(x), then error is detected. ä An error E(X) will only be undetectable, if it is divisible by G(X). ä If T’(x) is divisible by G(x), the received frame is considered as a “valid” frame.
26
C) All rights reserved by Professor Wen-Tsuen Chen26 ä With suitable chosen G(X), the following errors can be detected: í All single-bit errors. í All double-bit errors, if G(X) has at least three terms. í Any odd number of errors, if G(X) contains a factor (x+1). í Any burst error with length degree of G(X). í Most larger burst errors. ä Widely used G(X):
27
C) All rights reserved by Professor Wen-Tsuen Chen27
28
C) All rights reserved by Professor Wen-Tsuen Chen28
29
C) All rights reserved by Professor Wen-Tsuen Chen29 ARQ Protocols ä Stop-and-Wait ARQ: good for small a, where a= propagation time/frame transmission time. ä Go-back-n ARQ: Receiver discards all subsequent frames of a damaged frame, sending no ack’s for the discard frames. ä Selective-Repeat ARQ: Receiver stores all the correct frames following the bad one. Sender retransmits only the bad frame, not all its successors.
30
C) All rights reserved by Professor Wen-Tsuen Chen30
31
C) All rights reserved by Professor Wen-Tsuen Chen31
32
C) All rights reserved by Professor Wen-Tsuen Chen32
33
C) All rights reserved by Professor Wen-Tsuen Chen33 SLIDING WINDOW PROTOCOLS ä Both Go-back-n and Selective-repeat ARQs uses the pipelining technique. ä The optimal sender’s windows size is 1+2a. ä Maximum sender’s window size of Go- back-n ARQ is Max-seq, where the sequence number are 0, 1,..., Max-seq. Receiver window size is 1. ä Max sender’s and receiver’s window size of Selective-repeat ARQ is (Max-seq+1)/2.
34
C) All rights reserved by Professor Wen-Tsuen Chen34 ä Consider the following scenario with window size=8 À The sender sends frame 0 thru 7. Á The receiver sends ack for frame 7. Â The sender sends another eight frames, frame 0 thru 7. Ã The receiver sends ack for frame 7. ä The second batch of eight frames may be lost, Ambiguity occurs in the second acknowledgment. ä Maximum window size of Go-back-n ARQ is Max-seq, where the frame sequence numbers are 0,1,...,Maxseq-1.
35
C) All rights reserved by Professor Wen-Tsuen Chen35 ä Consider the following scenario with window size=7 À Frame 0,...,6 are sent Á Frames are received, the window are advanced to 7,0,...,5  Acknowledgments are all lost à Frame 0,...,6 are re-sent Ä Frame 0,...,5 are erroneously accepted ä Maximum window size of the Selective-Reject ARQ is (Max-seq+1)/2, where the frame sequence numbers are 0,1,...,Maxseq-1.
36
C) All rights reserved by Professor Wen-Tsuen Chen36
37
C) All rights reserved by Professor Wen-Tsuen Chen37 Utilization of ARQ Protocols ä Stop-and-Wait ARQ Where Nr = the expected number of transmissions of a frame. Assume the probability that a single frame is in error is P and ACKs and NAKs are never in error.
38
C) All rights reserved by Professor Wen-Tsuen Chen38 Utilization of ARQ Protocols (cont.) ä Selective-Reapeat ARQ
39
C) All rights reserved by Professor Wen-Tsuen Chen39 Utilization of ARQ Protocols (cont.) Where f(i) = the total number of frames transmitted if the original frame must be transmitted i times. =1+ (i-1) k Each error generates a requirement to retransmit k frames. k 2a+1 for N 2a+1, and k=N for N<2a+1. ä Go-back-N ARQ
40
C) All rights reserved by Professor Wen-Tsuen Chen40 Utilization of ARQ Protocols (cont.)
41
C) All rights reserved by Professor Wen-Tsuen Chen41 ARQ Programs
42
C) All rights reserved by Professor Wen-Tsuen Chen42 Stop-and-Wait AQR Program
43
C) All rights reserved by Professor Wen-Tsuen Chen43 Go-back-N AQR Program
44
C) All rights reserved by Professor Wen-Tsuen Chen44
45
C) All rights reserved by Professor Wen-Tsuen Chen45 Selective-Reject AQR Program
46
C) All rights reserved by Professor Wen-Tsuen Chen46
47
C) All rights reserved by Professor Wen-Tsuen Chen47 Software Timers
48
C) All rights reserved by Professor Wen-Tsuen Chen48 HDLC - High-level Data Link Control ä SDLC (Synchronous Data Link Control) of IBM’s SNA ä ADCCP (Advanced Data Communication Control Procedure): ANSI ä HDLC: ISO 33009, ISO 4335 ä LAP (Link Access Procedure): X.25 of CCITT ä LAPB: CCITT
49
C) All rights reserved by Professor Wen-Tsuen Chen49 ä A frame is delimited with the flag sequence 01111110. On idle point-to-point lines, flag sequences are transmitted continuously. ä Address is primarily used to identify multidrop terminals. ä Checksum: CRC-CCITT, for detecting damaged flag bytes. Frame Format
50
C) All rights reserved by Professor Wen-Tsuen Chen50 Three Kinds of frames
51
C) All rights reserved by Professor Wen-Tsuen Chen51 Supervisory frame ä Type 0 (Receive Ready): are ack frame used to indicate the next frame expected ä Type 1 (Reject): a negative ack, Next is the first frame in sequence not received correctly. Use go- back-n protocol ä Type 2 (Receive not Ready): An ack as Type 0 and telling the sender to stop sending ä Type 3 (Selective Reject): Retransmission of only the frame specified in Next field. Use Selective Repeat protocol
52
C) All rights reserved by Professor Wen-Tsuen Chen52 HDLC commands and Responses
53
C) All rights reserved by Professor Wen-Tsuen Chen53 Basic Characteristics ä Three Station types: À Primary station: controls operation of the link and issues command frames. Á Secondary station: under the control of the primary station, issues response frames. Â Combined station: combines the features of primary and secondary.
54
C) All rights reserved by Professor Wen-Tsuen Chen54 Basic Characteristics (cont.) ä Two link configurations: À Unbalanced configuration: consists of one primary and one or two secondary stations. Á Balanced configuration: consists of two combined stations.
55
C) All rights reserved by Professor Wen-Tsuen Chen55 Basic Characteristics (cont.) ä Three Data transfer modes: À Normal response mode (NRM): Used with an unbalanced configuration. Á Asynchronous balance mode (ABM): Used with a balanced configuration. Most widely used. Â Asynchronous response mode (ARM): Used with an unbalanced configuration. The secondary may initiate transmission. Rarely used.
56
C) All rights reserved by Professor Wen-Tsuen Chen56 HDLC Operation ä Three phases: Line setup, data transfer, disconnect.
57
C) All rights reserved by Professor Wen-Tsuen Chen57 DLL in Internet
58
C) All rights reserved by Professor Wen-Tsuen Chen58 SLIP - Serial Line IP ä SLIP (Serial Line IP): to connect SUN workstations to the Internet over a dial-up line using a modem. ä RFC 1055 ä Sending IP packets over the line, with a special flag byte at the end for framing. Using character stuffing. ä Many problems: no error detection, supporting only IP, no authentication, etc.
59
C) All rights reserved by Professor Wen-Tsuen Chen59 PPP - Point-to-Point Protocol ä RFC 1661, RFC 1662, RFC 1663 ä A multiprotocol framing mechanism suitable for use over modems, HDLC lines, SONET, and other physical layers. ä Supports error detection, option negotiation, optionally reliable transmission using HDLC framing. ä Character-oriented
60
C) All rights reserved by Professor Wen-Tsuen Chen60 PPP Frame Format ä Protocol: indicates network layer protocol used, such as IP, IPX, AppleTalk, or to be negotiated.
61
C) All rights reserved by Professor Wen-Tsuen Chen61 LCP - Link Control Protocol ä Used in PPP for bringing lines up and down.
62
C) All rights reserved by Professor Wen-Tsuen Chen62 NCP - Network Control Protocol ä Used in PPP to negotiate network layer options
63
C) All rights reserved by Professor Wen-Tsuen Chen63 DLL in ATM ä Transmission convergence sublayer of the ATM physical layer. ä Header error control: correcting single-bit error of a cell header. ä Cell delineation: cell framing.
64
C) All rights reserved by Professor Wen-Tsuen Chen64 ATM Cell Format
65
C) All rights reserved by Professor Wen-Tsuen Chen65
66
C) All rights reserved by Professor Wen-Tsuen Chen66 Header Error Control ä HEC checksum: Remainder of the 32 header bits divided by the polynomial x**8+x**2+x+1, added with 01010101 to provide robustness in face of headers containing mostly 0 bits. ä Correcting all single-bit errors and detecting many multi-bit errors. ä Suitable for optical fiber: 99.64% of all errors are single-bit errors.
67
C) All rights reserved by Professor Wen-Tsuen Chen67
68
C) All rights reserved by Professor Wen-Tsuen Chen68 CELL DELINEATION ä Using the HEC to delineate a cell. ä Cell delineation heuristic: see Fig. 3-30. ä To protect against malicious users, payload bits are scrambled on transmission and descrambled on reception.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.