Download presentation
Presentation is loading. Please wait.
1
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 1 Data Link Control Chapter 7
2
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 2 Placement of the Data Link Protocol
3
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 3
4
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 4 Functions of Data Link Control Frame synchronization Flow control Error control Addressing Control and data on same link Link management By performing all of the above functions, the datalink layer aims at providing a reliable point-to-point communication link for used by the upper layers
5
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 5 Frame Synchronization Why framing? Easier to detect errors by breaking the bit stream up into discrete frames and compute the checksum for each frame Data in upper layer (e.g. IP layer in TCP/IP) is organized in units of packets
6
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 6 Frame Synchronization Common methods: Character count Starting and ending characters, with character stuffing Starting and ending flags, with bit stuffing (will be discussed in HDLC) Others
7
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 7 Character Count
8
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 8 Starting/ending Characters
9
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 9 Flow Control to assure that transmitting entity does not overwhelm receiving entity with data size of receiver's buffer is limited
10
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 10 Common Flow Control Methods Stop and Wait Protocol Sliding Window Protocols
11
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 11 We first consider flow control for for error-free transmission. For transmission with errors, techniques such as Automatic Repeat reQuest (ARQ, will be discussed later) are used.
12
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 12 Stop and Wait Source transmit a frame, stop and wait for acknowledgement Destination send back an acknowledgement after reception Source send the next frame when ACK is received Destination can stop flow by not send ACK Works well for a few large frames
13
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 13 Fragmentation Large block of data may be split into small frames –Limited buffer size –Errors detected sooner (when whole frame received) –On error, retransmission of smaller frames is needed –Prevents one station occupying medium for long periods Stop and wait becomes inadequate
14
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 14
15
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 15 Stop and Wait - Utilization a = (Propagation Delay)/(Frame transmission time) a>1: under-utilized a<1: inefficiently utilized (since time is still wasted in waiting the ACK) therefore, not suitable for very high data rates or very long distance transmission (why?)
16
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 16 Sliding-Window Efficiency improved if multiple frames can be transmitted at the same time Consider transmission from A to B: - B can buffers n frames - A can send up to n frames without ACK - or window size = n - frame sequence number: 0 to m-1 - n<m, and m is a power of 2
17
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 17
18
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 18
19
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 19 Sliding Window Enhacements Receiver can acknowledge frames without permitting further transmission (Receive Not Ready) Must send a normal acknowledge to resume If duplex, use piggybacking –If no data to send, use acknowledgement frame –If data but no acknowledgement to send, send last acknowledgement number again
20
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 20 Why Error Detection? Consider a transmission system with BER=1E-6 Frame size = 1000 bits Prob that a frame received with no error = 0.999, or 1 error frame per 1000 transmitted frames, too large! Frame error rate increases when frame size increases
21
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 21
22
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 22 Cyclic Redundancy Check (CRC) K-bit message n-bit frame check sequence (FCS) use Modulo 2 Arithmetic, just the same as exclusive-or operation: 1111 11001 + 1010× 11 -------------------- 0101 11001 11001 ----------- 101011
23
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 23 Generation of FCS Define: T=(k+n)-bit transmitted frame, with n<k M=k-bit message F=n-bit FCS P=a predetermined (n+1)-bit divisor T=2 n M + F, where F=Remainder of (2 n M)/P
24
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 24 Example of FCS Generation M=1010001101 (10 bits) P=110101 (6 bits) F: to be calculated, should be 5 bits 1101010110 P 110101 101000110100000 2 n M 110101 111011 110101 111010 110101 111110 110101 101100 110101 110010 110101 01110 F
25
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 25 Example of Error Checking M=1010001101 (10 bits) P=110101 (6 bits) F=01110 1101010110 P 110101 101000110101110 T 110101 111011 110101 111010 110101 111110 110101 101111 110101 00000 No Error!
26
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 26 Widely Used Polynomials CRC-16: X 16 + X 15 + X 2 + 1 CRC-CCITT: X 16 + X 12 + X 5 + 1 CRC-32: X 32 + X 26 + X 23 + X 16 + X 12 + X 11 + X 10 + X 8 + X 7 + X 5 + X 4 + X 2 + X + 1
27
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 27 Automatic Repeat Request (ARQ) Why ARQ? Error-free transmission is not possible in real life ARQ involves: Error detection Positive acknowledgement Retransmission after timeout Negative acknowledgement and retransmission
28
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 28 Stop-and-Wait ARQ based on Stop-and-Wait flow control, plus timeout mechanism – simple – inefficient
29
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 29 Stop and Wait ARQ Source transmits single frame Wait for ACK If received frame damaged, discard it –Transmitter has timeout –If no ACK within timeout, retransmit If ACK damaged,transmitter will not recognize it –Transmitter will retransmit –Receive gets two copies of frame –Use ACK0 and ACK1
30
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 30
31
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 31 Go-back-N ARQ allow multiple frames to be transmitted at the same time to improve performance +ve ack (RR=Receive Ready) for sliding-window flow control -ve ack (REJ=Reject) for frame retransmission request
32
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 32 RR2 = Receive Ready 2, or the receiver is now ready to receive frame #2, or the receiver is now looking for frame #2 P bit = indicates that P-bit timer expires
33
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 33 Selective-reject ARQ Only frames with -ve ack (SREJ) are retransmitted more efficient larger buffer than Go-back-N
34
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 34 High-level Data Link Control (HDLC) The most important data link control protocol 3 station types 2 link configurations 3 data transfer models
35
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 35 Station Types Primary station –Controls operation of link –Frames issued are called commands –Maintains separate logical link to each secondary station Secondary station –Under control of primary station –Frames issued called responses Combined station –May issue commands and responses
36
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 36 HDLC Link Configurations Unbalanced –One primary and one or more secondary stations –Supports full duplex and half duplex Balanced –Two combined stations –Supports full duplex and half duplex
37
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 37 Data Transfer Modes Normal response mode (NRM) used with unbalanced configuration used on multidrop lines Asynchronous response mode (ARM) rarely used Asynchronous balanced mode (ABM)
38
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 38 Asynchronous Balanced mode (ABM) most widely used of the 3 modes used with a balanced configuration each combined station may initiate transmission without receiving permission from the other used as the data link layer protocol of the widely used packet-switched X.25 networks
39
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 39 Frame Structure Synchronous transmission All transmissions in frames Single frame format for all data and control exchanges
40
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 40 Flag Field delimit the frame at both ends with 01111110 a single flag may be used as the closing flag of one frame and the opening flag of the next receiver continuously hunting for the flag, if found, it continues to hunt for ending flag if the pattern 01111110 appears inside the frame, then...
41
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 41 Figure 6. 11 Bit Stuffing Bit stuffing
42
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 42 Address Field for identifying the secondary station not needed for point-to-point link (e.g. PPP) 11111111 means all stations, for broadcast use Control Field HDLC defines 3 types of frames, each with a different control field format: Information frames (I-frames) carry the data Supervisory frames (S-frames) provide the ARQ mechanism when piggybacking is not used (e.g. when there is acknowledgement to be sent, but no data to be sent back) Unnumbered frames (U-frames) provide supplemental link control functions
43
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 43 Notes: 3-bit sequence numbers are used N(S) is the sequence number of the frame N(R): which number I-frame expected to be received S: indicate the flow control and error control functions: Receive Ready (RR) Receive Not Ready (RNR) Reject (REJ): initiate the go-back-N ARQ Selective Reject (SREJ): request retransmission of just a single frame
44
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 44 Poll/Final Bit Use depends on context Command frame P bit 1 to solicit (poll) response from peer Response frame F bit 1 indicates response to soliciting command Information Field present only in I-frames and some U-frames in I-frames it contains upper layer data (e.g. IP packets) Frame Check Sequence Field normal code is the 16-bit CRC-CCITT
45
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 45 HDLC Operations Consists of the exchange of I-frames, S-frames, and U-frames Involves 3 phases: - Initialization - Data Transfer - Disconnect
46
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 46 Initialization signals the other side that initialization is requested specifies the mode (NRM, ABM, or ARM) specifies whether 3- or 7-bit sequence numbers are used example:
47
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 47 Examples of Operation (1)
48
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 48 Examples of Operation (2)
49
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Data Link Control Slide 49 Other Data Link Protocols LAPB used in X.25 subset of HDLC which provides only the Asynchronous Balanced Mode (ABM) LAPD used in ISDN also similar to HDLC LAPDm used in GSM Point-to-Point Protocol (PPP) use subset of HDLC widely used in dialup access to Internet also widely used in connecting WAN routers LLC IEEE 802, used in LAN
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.