
User Server Telematics watching with video video clip clips Chapter 4: Data Link Layer Application Layer Application Layer BeispielbildPresentation Layer Presentation Layer Session Layer Session Layer Transport Layer Transport Layer Network Layer Network Layer Network Layer Data Link Layer Data Link Layer Data Link Layer Physical Layer Physical Layer Physical Layer Univ.-Prof. Dr.-Ing. Jochen H. Schiller Computer Systems and Telematics (CST) Institute of Computer Science Freie Universität Berlin http://cst.mi.fu-berlin.de Contents ● Design Issues ● Error Detection and Correction ● Elementary Data Link Protocols ● Sliding Window Protocols ● High Level Data Link Control (HDLC) ● Point-to-Point Protocol (PPP) ● Protocol Verification Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.2 Design Issues Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.3 Design Issues ● The data link layer has a number of specific functions, for this it OSI Reference Model ● provides a well-defined service Application Layer interface to the network layer ● deals with transmission errors Presentation Layer ● regulates the flow of data Session Layer ● access to the medium ● prevent a slow receiver being not Transport Layer swamped by a fast sender Network Layer Data Link Layer Physical Layer Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.4 Layer 2: Division into two Parts ● Logical Link Control (LLC) (Layer 2b) ● Organization of the data to be sent into frames ● Guarantee (if possible) an error free transmission between neighboring nodes through: ● Detection (and recovery) of transfer errors ● Flow Control (avoidance of overloading the receiver) ● Buffer Management ● Medium Access Control (MAC) (Layer 2a) ● Control of the access to the communication channel in broadcast networks LLC IEEE 802.2 Logical Link Control ... Layer ANSI ATM ebene 802.3 802.4 802.5 802.6 Data Link Data X3T9.5 Forum Sicherungs- MAC ... CSMA/CD Token Token ATM LAN (Ethernet) Bus Ring DQDB FDDI Emulation ISO/OSI ConcreteReale Netze Networks Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.5 Services Provided to the Network Layer ● The data link layer provides services to the network layer ● Principal service is transferring data from the network layer of the source to the network layer of the destination machine Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.6 Services Provided to the Network Layer ● Communication of two processes on the network layer ● Virtual data path ● Actual data path Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.7 Services Provided to the Network Layer ● Service provided by the data link layer ● Unacknowledged connectionless service ● No logical connection beforehand ● Source sends independent frames ● Destination does not acknowledge frames ● Acknowledged connectionless service ● No logical connection beforehand ● Destination acknowledges frames ● Acknowledged connection-oriented service ● Logical connection beforehand ● Each sent frame is numbered ● Each sent frame is received once and in the right order Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.8 Services Provided to the Network Layer Router Packets here Routing process Routing process DLL DLL DLL DLL DLL DLL Process Process Process Process Process Process Frames here DLL Protocol Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.10 LLC: Frame Construction ● Organization of a message into uniform units (for simpler transmission) ● Well-defined interface to the upper layer (layer 3) ● Marking of the units: Error check Header Data Trailer Frame Checking Sequence (FCS) Control information (addresses, frame numbers,…) Mark the frame by: ● Start and end flags ● Start flag and length ● Code injuries Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.11 LLC: Frame Construction ● Marking the start and end of a frame ● Character count ● Flag bytes with byte stuffing ● Starting and ending flags with bit stuffing ● Physical layer coding violations Byte/bit-stream Frames Frame 1 Frame 2 Frame 3 Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.12 Framing: Character Count ● Specify the number of characters in the frame Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.13 Framing: Flag Bytes with Character Stuffing ● The start and end of a frame is represented by a special flag byte. ● Problem: What happens if the flag byte occurs in the data? ● Byte stuffing/character stuffing ● A special escape byte (ESC) is inserted (stuffed) by the sender and removed by the receiver ● If the escape byte occurs in the data, then it is also stuffed Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.14 Framing: Flag Bytes with Bit Stuffing ● Character stuffing is bound to the character set (disadvantage)! ● General form: Bit stuffing ● Frames begin and end with a special pattern: 01111110 ● Sender inserts after five 1s a 0-bit, i.e., 011111x... 0111110x... and the receiver removes it Original data: Transmitted data: After destuffing: Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.15 Framing: Physical Layer Coding Violations ● Only applicable if physical layer coding has some redundancy ● 1 bit data is encoded in 2 physical bits ● 1-bit coded as high-low, 0-bit coded as low-high, high-high and low-low are not used 1-bit 0-bit not used not used Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.16 Error Detection and Correction Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.17 Error Detection and Correction ● Next task of the LLC layer: protected transmission of the frames to the communication partner ● The transmission over layer 1 is not necessarily free of errors! ● Errors tend to come in bursts rather than single ● Question: how can errors be recognized and repaired? ● Error-detecting codes ● Error-correcting codes (Forward Error Correction, FEC) ● Scenario ● A frame consisting of m data bits and r redundant (check) bits ● Total length: n = m + r ● The n-bit unit with data and check bits is called codeword Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.18 Error-detecting and -correcting Codes: Parity bits From the data, compute a short checksum and send it together with the data to the receiver. The receiver also computes a checksum from the received data and compares it with those of the sender. Simplest procedure - parity bit: count the number of 1s: Sender: 10111001 PB: 1 sent: 101110011 odd-Bit errors are detected Receiver: 001011011 PB computed: 0 even-Bit errors are not detected Corrections are not possible! Variant: double parity Improvement of the parity bit procedure by further parity bits. For this, several blocks of bits are grouped and treated together: Sender: 1011 1 Receiver: 1011 1 0010 1 0110 0 1100 0 1100 0 0110 0 0110 0 0011 0111 An incorrect bit can be identified and corrected by this procedure. Check the terms even and odd parity! Parity bits often used in RAM (not networking) Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.19 Error Detection Cyclic redundancy check (CRC) Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.20 Error Detection with Cyclic Codes Problem: how to recognize errors in several bits, especially sequences of bit errors? The use of simple parity bits is not suitable. However, in data communication (modem, telephone cables) such errors arise frequently. Most often used: Polynomial Codes m-1 Idea: a m-bit PDU (am-1, …, a0) is seen as a polynomial am-1x + … + a0 with the coefficients ai “0” and “1”. Example: 1100101 is interpreted as x6x5x4x3x2x1x0 x6 + x5 + x2 + 1 Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.21 Error Detection with Cyclic Codes ● For computations, polynomial arithmetic modulo 2 is used, i.e., addition and subtraction without carriage. Both operations become Exclusive-OR (XOR) operations. ● Polynomial arithmetic is done modulo 2 ● Addition and subtraction are identical to exclusive OR (XOR), e.g. 10011011 00110011 11110000 01010101 + 11001010 + 11001101 - 10100110 - 10101111 01010001 11111110 01010110 11111010 Univ.-Prof. Dr.-Ing. Jochen H. Schiller ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 4: Data Link Layer 4.22 Error Detection with Cyclic Codes ● Idea for error detection: ● Sender and receiver agree upon a generator polynomial G(x) r r-1 1 0 G(x) = grx +gr-1x +…+ g1 x + g0x ● The first (g0) and the last (gr) coefficient have to be 1 r r-1 1 G(x) = x +gr-1x +…+ g1 x + 1 ● The sender interprets a data block of length m as polynomial M(x) m-1 1 0 M(x) = am-1x +…+ a1x + a0x ● The sender extends M(x), i.e., adds “redundant” bits in a way that the extended polynomial M’(x) is divisible by G(x) ● Redundancy = remainder R(x) by division of the sequence with G(x) ● The receiver divides the received extended M(x) by G(x).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages130 Page
-
File Size-