5 DLL-LLC- Book


Published on

To achieve unnecessary control over data communication link
A logic is added above the physical interface which is referred as Data Link Control/ Protocol
To see the need of data link control, some of the requirements and objectives for data communication are listed as follows
Frame synchronization- start and end should be recognizable
Flow control- the sender and receiver data rate
Error control- check the error and correct it
Addressing- identify the address
Control and Data on same link- should have control information
Link Management- the initiation, maintenance and termination
We will study the three mechanisms that are a part of data link control
Flow control, error detection and error control

A presentation prepared by my friend's friend. I have done no editing at all, I'm just uploading the presentation as it is.

Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

5 DLL-LLC- Book

  1. 1. Introduction  To achieve unnecessary control over data communication link  A logic is added above the physical interface which is referred as Data Link Control/ Protocol  To see the need of data link control, some of the requirements and objectives for data communication are listed as follows  Frame synchronization- start and end should be recognizable  Flow control- the sender and receiver data rate  Error control- check the error and correct it  Addressing- identify the address  Control and Data on same link- should have control information  Link Management- the initiation, maintenance and termination  We will study the three mechanisms that are a part of data link control  Flow control, error detection and error control
  2. 2. Flow Control Flow control is used to make sure that the transmitted data is not over whelming the receiver The receiver allocates a data buffer for the processing before passing it to higher level software In the absence the system may bottle neck
  3. 3. Ideal Flow Control In the absence of errors, the model in figure depicts a vertical time sequence It has advantage of showing time dependencies Each arrow represents a single frame (data + control info) It was an errorless communication However, transmitted frame suffers a variable amount of delay
  4. 4. Stop and Wait Flow Control Simplest form of flow control Source transmit a frame, after reception the destination indicates its willingness to accept more data by sending back an acknowledgment of the frame just received The source waits for the acknowledgment The destination can thus stop the data flow by with holding acknowledgment If a larger data is broken down into smaller blocks, this is done for the following reasons
  5. 5. Stop and Wait Flow Control  Limited buffer size  Longer the transmission, more likely there will be an error  Smaller frames, errors are detected sooner and retransmitted faster  On LANs not to permit a station to hold a medium for longer time With multiple frames of a message, stop and wait may be inadequate We know about transmission time and propagation delay
  6. 6. Stop and Wait Flow Control
  7. 7. Stop and Wait Flow Control As per previous figure transmission time is normalized to 1 and propagation is expressed as variable ‘a’ When a<1 the propagation time is less than transmission time The frame is long and before it is transmitted it arrives destination When a>1 the propagation time is greater than transmission time The sender completes transmission before the frame arrives at receiver Note that for a>1 line is always underutilized and for a<1 line is inefficiently utilized In essence for high data rates or for long distances stop and flow control provides inefficient line utilization
  8. 8. Sliding Windows Flow Control As per the previous flow control the efficiency can be improved by allowing multiple frames to be in transit at same time A and B are connected via full duplex link (A -> B) B allocates a buffer for n frames to be received from A To keep track of the frames, they are labeled B ack a frame by sending ack that includes sequence number of next expected The scheme can be used to ack multiple frames A and B both maintains a list; sent sequence numbers and received sequence numbers Each of these lists can be thought of as a window or frame Additional comments need to be made
  9. 9. Sliding Windows Flow ControlTo represent a sequence number, it occupies a field in a frame For K-bit field, the range of sequence number is O through 2k -1
  10. 10. Sliding Windows Flow Control Receiver can control the size of the sending window By limiting the size of the sending window data flow from sender to receiver can be limited Let 3 bits sequence has max of 7 frames, A->B After transmitting some frames without ack A shrunk its window to 4 frames B then transmits RR3 (receive ready) which is ack of receive frames With this ack A is back up to permission of transmitting 7 frames starting from 3 onwards RNR (receive not ready) a station can cut off a flow of frames if it exceeds its buffer size
  11. 11. Sliding Windows Flow Control
  12. 12. Sliding Window Transmission If 2 stations exchange data, each has to maintain 2 windows (two directional) One for transmit and one for receive And each one has to send data and ack to other Piggybank- provides efficient support for above requirement Each frame holds sequence number of frame + field that holds sequence number for ack Thus a station sends data and ack both in one frame, saving communication capacity If station has ack but no data, it sends a separate ack frame Similarly no ack but data to send, it must repeat the last ack it sent  Because data frame includes a field for ack number and some number has to be put in that field  Duplications are simply ignored  Pipe line concept
  13. 13. Error detecting We talked about transmission impairments and the effect of data rate and signal-to-noise ratio on bit error rate. Regardless of the design of the transmission system, there will be errors, resulting in the change of one or more bits in a transmitted frame. So, how can a receiver know if the data received is error free?  There are several methods that can be implemented to accomplish this. Some of these methods are simple and somewhat effective – others are complicated and very effective.
  14. 14. Error Detection Data transmission can contain errors Single-bit Burst errors of length n How to detect errors If only data is transmitted, errors cannot be detected  Send more information with data that satisfies a special relationship  Add redundancy
  15. 15. Error Detection Methods Parity bit The simplest error-detection scheme is to append a parity bit to the end of a block of data. A typical example is ASCII transmission, in which a parity bit is attached to each 7-bit ASCII character. The value of this bit is selected so that the character has an even number of 1s (even parity) or an odd number of 1s (odd parity). If one bit (or any odd number of bits) is erroneously inverted during transmission then the receiver will detect an error. Note, however, that if two (or any even number) of bits are inverted due to error, an undetected error occurs. Typically, Even parity is used for synchronous transmission and Odd parity for asynchronous transmission
  16. 16. Error Detection Methods Vertical Redundancy Check (VRC) Append a single bit at the end of data block such that the number of ones is even  Even Parity (odd parity is similar) 0110011  01100110 0110001  01100011 VRC is also known as Parity Check Performance:  Detects all odd-number errors in a data block
  17. 17. Longitudinal Redundancy Check (LRC) Organize data into a table and create a parity for each column 11100111 11011101 00111001 10101001 11100111 11011101 00111001 10101001 10101010 11100111 11011101 00111001 10101001 10101010 Original Data LRC
  18. 18. Checksum A checksum error detection method give us more accuracy if used with a parity bit method. The checksum field can be one or more bytes A checksum method will basically check the sum of all the '1's in a message and check that value against the checksum value added by the sender to the message. A checksum method can provide more precision to your error detection efforts, there are still limitations. A simple checksum cannot detect an even number of errors which sum to zero, an insertion of bytes which sum to zero (add 0), or even the re-ordering of bytes in the message. While there are some more advanced implementations of the checksum method, including Fletcher's checksum method
  19. 19. CRC (cyclic redundancy check) A better method to detect errors in a large block of data involves the use of CRC codes. The hardware required to implement a CRC code is slightly more complicated than other error detection codes but it has an error detection effectiveness greater than 99.9%. CRC, which can be described as follows. Given a k-bit block of bits, or message, the transmitter generates an n-bit sequence, known as a frame check sequence (FCS) Making a resulting frame, consisting of k + n bits which is exactly divisible by some predetermined number. The receiver then divides the incoming frame by that number and, if there is no remainder, assumes there was no error.
  20. 20. CRC Concept Let M(x) be the message polynomial Let P(x) be the generator polynomial P(x) is fixed for a given CRC scheme P(x) is known both by sender and receiver Create a block polynomial F(x) based on M(x) and P(x) such that F(x) is divisible by P(x) )( 0 )( )( )( xP xQ xP xF +=
  21. 21. Cyclic Redundancy Check Sending 1.Multiply M(x) by xn 2.Divide xn M(x) by P(x) 3.Ignore the quotient and keep the reminder C(x) 4.Form and send F(x) = xn M(x)+C(x) Receiving 1.Receive F’(x) 2.Divide F’(x) by P(x) 3.Accept if remainder is 0, reject otherwise
  22. 22. Generating Polynomial One way of considering CRC systems is to treat the stream of transmitted bits as a representation of a polynomial with coefficients of 1: Let us assume k message bits and n bits of redundancy Associate bits with coefficients of a polynomial 1 0 1 1 0 1 1 1x6 +0x5 +1x4 +1x3 +0x2 +1x1 +1x0 = x6 +x4 +x3 +x+1
  23. 23. Generating Polynomial CRC-16: G(x) = x16 + x15 + x2 + 1 detects single and double bit errors All errors with an odd number of bits Burst errors of length 16 or less Most errors for longer bursts CRC-32: G(x) = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 Used in ethernet Also 32 bits of 1 added on front of the message  Initialize the LFSR to all 1s
  24. 24. Modulo 2 Arithmetic Modulo 2 arithmetic uses binary addition with no carries, which is just the exclusive-OR operation. For example:
  25. 25. Example Send  M(x) = 110011  x5 +x4 +x+1 (6 bits)  P(x) = 11001  x4 +x3 +1 (5 bits, n = 4)  4 bits of redundancy  Form xn M(x)  110011 0000  x9 +x8 +x5 +x4  Divide xn M(x) by P(x) to find C(x) 100001 1001 11001 10000 11001 110011000011001 = C(x) Receive Send the block 110011 1001 00000 11001 11001 11001 110011100111001 No remainder  Accept
  26. 26. Designing of CRC polynomial  The most commonly used polynomial lengths are  9 bits (CRC-8)  17 bits (CRC-16)  33 bits (CRC-32)  65 bits (CRC-64)  CRC-8: x8+x2+x+1  Used in: 802.16 (along with error correction).  CRC-CCITT: x16+x12+x5+1  Used in: HDLC, SDLC, PPP default  IBM-CRC-16 (ANSI): x16+x15+x2+1  802.3: x32+x26+x23+x22 +x16+x12+x11+x10 +x8+x7+x5+x4+x2+x+1  Append 32 bits to the message.  Detects all bursts of length 32 or less.  Used in: Ethernet, PPP option
  27. 27. Hamming Distance Based Checks If we want to detect d bit errors in an n bit word we can map every n bit word into a bigger n+d+1 bit word so that the minimum Hamming distance between each valid mapping is d+1. Meaning if error-correcting bits are included with a message, and if those bits can be arranged such that different incorrect bits produce different error results, then bad bits could be identified. In a 7-bit message, there are seven possible single bit errors, so three error control bits could potentially specify not only that an error occurred but also which bit caused the error. Hamming studied the existing coding schemes. To start with he developed a nomenclature to describe the system, including the number of data bits and error-correction bits in a block.
  28. 28. Calculating the Hamming Code  The key to the Hamming Code is the use of extra parity bits to allow the identification of a single error.  Create the code word as follows:  Mark all bit positions that are powers of two as parity bits. (positions 1, 2, 4, 8, 16, 32, 64, etc.)  All other bit positions are for the data to be encode  Each parity bit calculates the parity for some of the bits in the code word.  The position of the parity bit determines the sequence of bits.  Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. (1,3,5,7,9,11,13,15,...)  Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. (2,3,6,7,10,11,14,15,...)  Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc. (4,5,6,7,12,13,14,15,20,21,22,23,...)  Position 8: check 8 bits, skip 8 bits, check 8 bits, skip 8 bits, etc. (8-15,24-31,40-47,...)  Position 16: check 16 bits, skip 16 bits, check 16 bits, skip 16 bits, etc. (16-31,48-63,80-95,...)  Position 32: check 32 bits, skip 32 bits, check 32 bits, skip 32 bits, etc. (32-63,96-127,160-191,...)  Set a parity bit to 1 if the total number of ones in the positions it checked is odd and 0 if the total number of ones in the positions it checks is even.
  29. 29. Example With Hamming, can find errors quickly by just looking at one pattern: Let's say error in a data bit: 100 sent 111000 became: 111001 i.e. data 101, but check bits wrong Check bit 1 - 1 - checks bits 3,5 - 1 0 - OK Check bit 2 - 1 - checks bits 3,6 - 1 1 - WRONG Check bit 4 - 0 - checks bits 5,6 - 0 1 - WRONG The bad bit is bit 2 + 4 = bit 6. Data was corrupted. Data should be 100.
  30. 30. Example Let's say error in a check bit: 100 sent 111000 became: 011000 i.e. data 100, but check bits wrong Check bit 1 - 0 - checks bits 3,5 - 1 0 - WRONG Check bit 2 - 1 - checks bits 3,6 - 1 0 - OK Check bit 4 - 0 - checks bits 5,6 - 0 0 - OK The bad bit is bit 1. Check bit was corrupted. Data is fine.
  31. 31. Finding and fixing a bad bit Do a example and then add an error and check the result For above example create a code word of 011100101010. Insert and error suppose the word that was received was 011100101110 instead. Then the receiver could calculate which bit was wrong and correct it. The method is to verify each check bit. Write down all the incorrect parity bits. Doing so, you will discover that parity bits 2 and 8 are incorrect. It is not an accident that 2 + 8 = 10, and that bit position 10 is the location of the bad bit. In general, check each parity bit, and add the positions that are wrong, this will give you the location of the bad bit.
  32. 32. Error Correction There are various methods used to correct errors.  An obvious and simple one is to just detect the error and then do nothing, assuming that something else will fix it. This method is fine when something else is able to fix the error, but is of no use if there is no something else! _____In computers radiation can cause the gates to change state from time to time. Modern computer memory corrects these errors it is called FEC (Forward Error Control) to differentiate it from ARQ systems.
  33. 33. Techniques For Error Control The most common are based on some or all of the following ingredients: Error detection. Techniques and coding of data. Positive acknowledgment. Retransmission after timeout. The source retransmits a frame that has not been acknowledged after a predetermined amount of time. Negative acknowledgment and retransmission. The estimation returns a negative acknowledgment to frames in which an error is detected. The source retransmits such frames.
  34. 34. ARQ (Automatic Repeat reQuest) In data communication protocols, it is common to just ignore errors that are received, while acknowledging correct data. If an error is received, the lack of an acknowledgement eventually leads to a retransmission after some timeout period. The effect of ARQ is to turn an unreliable data link into a reliable one This technique is called ARQ (for Automatic Repeat reQuest). Three versions of ARQ have been standardized: Stop-and-wait Go-back-N Selective-reject
  35. 35. Stop N Wait ARQ Based on the stop-and-wait flow-control technique The source station transmits a single frame and then must await an acknowledgment (ACK). No other data frames can be sent until the destination station's reply arrives at the source station. Error Control - Two sorts of errors could occur. First, the frame that arrives at the destination could be damaged; the receiver detects this by error detection technique referred to earlier and simply discards the frame. To account for this possibility, the source station is equipped with a timer. After a frame is transmitted, the source station waits for an acknowledgment. If no acknowledgment is received by the time the timer expires, then the same frame is sent again, keeping a copy at transmitter
  36. 36. Stop N wait  Second, damaged acknowledgment.  Station A sends to station B, which responds with an acknowledgment (ACK).  The ACK is damaged in transit and is not recognized by A, which eventually ends timer & generate frame  This duplicate frame arrives and is accepted by B, which has therefore accepted two copies of the same frame as if they were separate.  To avoid this problem, frames are alternately labeled with 0 or 1  ACK are of the form ACKO and ACK1.  In keeping with the sliding-window convention, an ACKO acknowledges receipt of a frame numbered 1 and indicates that the receiver is ready for a frame numbered 0.  The sliding-window flow control technique can be adapted to provide more efficient line use.
  37. 37. Go back N ARQ The form of error control based on sliding-window flow control In go-back-N ARQ, a station may send a series of frames sequentially numbered The number of unacknowledged frames outstanding is determined by window size, using the sliding-window flow control technique. While no errors occur, the destination will acknowledge (RR = receive ready) If the destination station detects an error in a frame, it sends a negative acknowledgment (REJ = reject) for that frame. The destination station will discard that frame and all future incoming frames until the frame in error is correctly received. Thus, at source station, when it receives an REJ, must retransmit the frame in error plus all succeeding frames that were transmitted in the interim.
  38. 38. GO Back N  When A is sending to B the following errors could occur which is called Damaged frame.  There are three sub cases:  A transmits frame i. B detects an error and has previously successfully received frame (i - 1). B sends REJ i, indicated that frame i is rejected.  When A receives the REJ, it must retransmit frame i and all subsequent frames, since the original transmission of i.  Frame i is lost in transit. A subsequently sends frame (i + 1). B receives frame (i + 1) out of order and sends an REJ i  Frame i is lost in transit, and A does not soon send additional frames.  B receives nothing and returns neither an RR nor an REJ.  When A's timer expires, it transmits an RR frame that includes a bit known as the P bit, set to =1  B interprets the RR frame with a P bit of 1 as a command that must be acknowledged by sending an RR indicating the next frame that it expects.  When A receives the RR, it retransmits frame i.
  39. 39. Go Back N  Damaged RR. There are two sub cases:  B receives frame i and sends RR (i + I), which is lost in transit.  Because acknowledgments are cumulative (e.g., RR 6 means that all frames  through 5 are acknowledged),  A will receive a subsequent RR to a subsequent frame and that it will arrive before the timer associated with frame i expires.  If A's timer expires, it transmits an RR command as in case of pervious slide. It sets another timer, called the P-bit timer.  If B fails to respond to the RR command, or if its response is damaged, then A's P-bit timer will expire. At this point  A will try again by issuing a new RR command and restarting the P-bit timer.  This procedure is tried for a number of iterations.  If A fails to obtain an Ack after some maximum number of attempts, it initiates a reset procedure.  Damaged REJ. If an REJ is lost, this is equivalent to the case lost in transit
  40. 40. Selective-reject ARQ With selective-reject ARQ, the only frames retransmitted are those that receive a negative acknowledgment, in this case called SREJ, or that time-out. This would appear to be more efficient than go-back-N, because it minimizes the amount of retransmission. On the other hand, the receiver must maintain a buffer large enough to save post-SREJ frames until the frame in error is retransmitted and it must contain logic for reinserting that frame in the proper sequence. The transmitter, too, requires more complex logic to be able to send a frame out of sequence. Because of such complications, select-reject ARQ is much less used than go-back- N ARQ. The window-size limitation is more restrictive for selective-reject than for go back- N. Consider the case of a 3-bit sequence-number size for selective-reject.
  41. 41. Selective reject  Allow a window size of seven, and consider the following scenario 1. Station A sends frames 0 through 6 to station B. Frame (0,1,2,3,4,5,6,7,0,1,2,3,4,5) 2. Station B receives all seven frames and cumulatively Ack with RR 7. 3. Because of some noise burst, the RR 7 is lost/corrupted 4. A’s times out and retransmits frame 0 - 6. 5. B has already advanced its receive window to accept frames 7,0,1,2,3,4, and 5 6. Thus, B assumes that frame 7 has been lost and that this is a new frame 0,which it accepts.  The problem with this scenario is that there is an overlap between the sending and receiving windows.  To overcome the problem, the maximum window size should be no more than half the range of sequence numbers.  In this above scenario, if only four unacknowledged frames may be outstanding, no confusion can result.  In general, for a k-bit sequence number field, which provides a sequence number range of 2k, the maximum window size is limited to 2k-1.
  42. 42. OTHER DATA LINK CONTROL PROTOCOLS In addition to HDLC, there are a number of other important data link control protocols. LAPB LAPD Logical Link Control (LLC) Frame Relay Asynchronous Transfer Mode (ATM)
  43. 43. Frame structure
  44. 44. LAPB LAPB (Link Access Procedure, Balanced) was issued by ITU-T as part of its X.25 packet-switching network-interface standard. It is a subset of HDLC that provides only the asynchronous balanced mode (ABM); it is designed for the point-to-point link between a user system and a packet-switching network node. Its frame format is the same as that of HDLC.
  45. 45. LAPD LAPD (Link Access Procedure, D-Channel) was issued by ITU-T as part of its set of recommendations on ISDN (Integrated Services Digital Network). LAPD provides data link control over the D channel, which is a logical channel at the user-ISDN interface. There are several key differences between LAPD and HDLC. Like LAPB, LAPD is restricted to ABM. LAPD always uses 7-bit sequence numbers; 3-bit sequence numbers are not allowed. The FCS for LAPD is always the 16-bit CRC. Finally, the address field for LAPD is a 16-bit field that actually contains two sub-addresses:  one is used to identify one of possibly multiple devices on the user side of the interface, and  The other is used to identify one of possibly multiple logical users of LAPD on the user side of the interface.
  46. 46. LLC LLC is part of the IEEE 802 family of standards for controlling operation over alocal area network (LAN). LLC is lacking some features found in HDLC and also has some features not found in HDLC. The most obvious difference between LLC and HDLC is the difference in frame format. Link control functions in the case of LLC are actually divided between two layers: A medium access control (MAC) layer, and The LLC layer, which operates on top of the MAC layer.
  47. 47. LLC Above Figure shows the structure of the combined MAC/LLC frame; The shaded portion corresponds to the fields produced at the LLC layer. The unshaded portions are the header and trailer of the MAC frame. The MAC layer includes source and destination addresses for devices attached to the LAN. Two addresses are needed as there is no concept of primary and secondary in the LAN environment; therefore, both the sender and receiver must be identified. Error detection is done at the MAC level, using a 32-bit CRC. Finally, there are some control functions peculiar to medium- access control that may be included in a MAC control field.
  48. 48. Frame Relay Frame relay is a data link control facility designed to provide a streamlined capability for use over high-speed packet- switched networks. It is used in place of X.25,which consists of both a data link control protocol (LAPB) and a network-layerprotocol (called X.25 packet layer). The data link control protocol defined for frame relay is LAPF (Link Access Procedure for Frame-Mode Bearer Services). There are actually two protocols: a control protocol, which has similar features to HDLC, and a core protocol, which is a subset of the control protocol. There are several key differences between the LAPF control protocol and HDLC.
  49. 49. Asynchronous Transfer Mode (ATM) Like frame relay, ATM is designed to provide a streamlined data-transfer capability across high- speed networks. Unlike frame relay, ATM is not based on HDLC. Instead, ATM is based on a completely new frame format, known as a cell, that provides minimum processing overhead.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.