1 / 34

The Data Link Layer

The Data Link Layer. 조 충 호. What are the duties of the data link layer?. Main Point: Provide a reliable bit stream What are the issues with the physical layer? Errors in the bit stream propagation delay finite data rate. 3.1 Data Link Layer design Issue.

joewhite
Télécharger la présentation

The Data Link Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Data Link Layer 조 충 호

  2. What are the duties of the data link layer? • Main Point: Provide a reliable bit stream • What are the issues with the physical layer? • Errors in the bit stream • propagation delay • finite data rate

  3. 3.1 Data Link Layer design Issue Services Provided to the Network Layer Principle services : transferring data from the network layer on the source machine to the network layer on the destination machine Serves the datalink layer What levels of services are offered? Unacknowledged connectionless services Acknowledged connectionless services Acknowledged connection-oriented services

  4. DL Service (1/2) Unacknowledged connectionless service the source machine send independent frames to the destination machine without having the destination machine acknowledge them. no connection is established it is appropriate when the error rate is very low so recovery is left to higher layers. real-time traffic (late data are worse than bad data) Acknowledged connectionless service no connections used, but each frame sent is individually acknowledged the sender knows whether or not a frame has arrived safely if it has not arrived within a specified time interval, it can be sent again it is useful over unreliable channels, such as wireless systems

  5. DL Service (2/2) Acknowledged connection-oriented service the source and destination machines establish a connection before any data are transferred Three phases a. the connection is established by having both sides initialize variables and counters needed to keep track of which frames have been received and which ones have not. b. one or more frames are actually transmitted c. the connection is released, freeing up the variables, buffers, and other resources used to maintain the connection.

  6. Placement of the DL protocol

  7. Framing How do we do it reliably? Data Link Layer는 physical layer로부터 bit stream을 받게 되는데, physical layer의 경우, error에 대한 검사가 일어나지 않는다. 가장 기본적인 방법으로는 bit stream을 frame 단위로 나누어(Framing)각 frame 마다의 checksum을 이용하여 error를 검사하고 수정하는 방법이다. Four possible solutions are... Character count Starting and ending characters, with character stuffing Starting and ending flags, with bit stuffing. Physical layer coding violation

  8. 각 frame의 character의 수를 header에 명시하는 방법 단점 : transmission 상에서의 error가 발생했을 경우 어디에 error가 발생했는지를 알 수가 없다. Character count character count (a) 5 1 2 3 4 8 2 3 4 7 2 8 1 4 9 7 1 error now a character count (b) 5 1 2 3 4 5 2 3 4 7 2 8 1 4 9 7 1 (a) : without errors (b) : with one error

  9. Starting and ending characters, with character stuffing 각 frame 시작에는 DLE STX(Data Link Escape Start of TeXt), 끝에는 DLE ETX(Data Link Escape End of TeXt)를 삽입하는 방법 character stuffing : data 내용 중 DLE가 포함되어 있을 경우 DLE를 붙여 보냄으로써 DLE STX나 DLE ETX와 구분 할 수 있도록 한다. 단점 : data의 크기에 제약이 따른다.

  10. DLE STX A DLE B DLE ETX DLE STX A DLE DLE B DLE ETX DLE STX A DLE B DLE ETX (a) Data sent by the network layer (b) Data after being character stuffed by the data link layer Stuffed DLE (c) Data passed to the network layer on the receiving side

  11. Starting and ending flags, with bit stuffing flag byte 라고 불리 우는 특별한 bit 형태를 frame의 시작과 끝에 삽입 : 01111110 bit stuffing (a) 011011111111111111110010 (b) 011011111011111011111010010 Stuffed bits (c) 011011111111111111110010

  12. Error Control Frame이 올바르게 전달되었는지 확인 positive acknowledgement, negative acknowledgement time 조절 Flow Control sender와 receiver의 속도의 차이가 있는 경우 receiver의 buffer가 넘치지 않도록 sender의 데이터 전송을 제어

  13. 3.2 Error Detection and Correction Error-Correcting Codes include enough redundant information along with each block of data sent to enable the receiver to deduce what the transmitted character must have been Error-Detecting Codes include only enough redundancy to allow the receiver to deduce that an error occurred, but not which error, and have it request a retransmission

  14. 3.2.1 Error-Correcting Codes n-bit cordword : n = m bit data + r check bits Hamming distance The number of different bits in two "code words" or bit strings. If 2 codewords are d hamming distance, it will require d single bit errors to convert to one into the other To detect d errors, we need d+1 distance code To correct d errors, we need 2d+1 distance code http://tigerking.korea.ac.kr/~chcho/강의/Tanenb/HTML/lect6/

  15. Parity bit it is chosen so that the number of 1 bits in the codeword is even(or odd). ex) 10110101 - even parity : 101101011 - odd parity : 101101010 A code with a single parity bit has a distance 2

  16. Hamming code the bits of the codeword are numbered consecutively, starting with bit 1 at the left end. the bits that are powers of 2(1, 2, 4, 8, 16, etc.) are check bits the rest(3, 5, 6, 7, 9, etc.) are filled up with the m data bits Check bits char ASCII H a m m I n g c o d e 1001000 1100001 1101101 1101101 1101001 1101110 1100111 0100000 1100011 1101111 1100100 1100101 00110010000 10111001001 11101010101 11101010101 01101011001 01101010110 11111001111 10011000000 11111000011 00101011111 11111001100 00111000101 Order of bit transmission

  17. 3.2.2 Error-Detecting Codes Polynomial Code(cyclic redundancy code or CRC code) Polynomial arithmetic 10011011 01010101 +11001010 -10101111 01010001 11111010 Algorithm 1. Let r be the degree of G(x). Append r zero bits to the low-order end of the frame, so it now contains m+r bits and corresponds to the polynomial xrM(x). 2. Divide the bit string corresponding to G(x) into the bit string corresponding to xrM(x) using modulo 2 division. 3. Substract the remainder(which is always r or fewer bits) from the bit string corresponding to xrM(x) using modulo 2 substraction. The result is the checksummed frame to be transmitted. Call its polynomial T(x).

  18. Example of CRC 1100001010 Frame : 1101011011 Generator : 10011 Message after appending 4 zero bits : 11010110000 10011 11010110110000 10011 10011 10011 00001 00000 Transmitted frame : 11010110111110 00010 00000 00101 00000 01011 00000 10110 10011 [T(x) + E(x)] / G(x) = E(x) / G(X) ( T(X) / G(x) = 0 ) 01010 00000 10100 Remainder 10011 01110 00000 1110

  19. Elementary Data Link Protocols An Unrestricted Simplex Protocol Assumption utopia provides for data transmission in one direction from sender to receiver communication channel is error free The receiver is assumed to be able to process all the input infinitely fast The sender just sits in a loop pumping data out onto the line as fast as it can Sender (Source machine) : network layer로부터 받은 data 를 physical layer로 보낸다. Receiver(Destination machine) : 대기하고 있다가 physical layer로부터 data를 받으면 network layer로 전송 No sequence numbers or acknowledgements are used.

  20. Simplex Stop-and-Wait Protocol After having passed a packet to its network layer, the receiver sends a little dummy frame back to the sender which, in effect, gives the sender permission to transmit the next frame. A Simplex Protocol for a Noisy Channel PAR(Positive acknowledgement with Retransmission ) or ARQ(Automatic Repeat reQuest) protocols in which the sender waits for a positive acknowledgement before advancing to the next data item use sequence number

  21. 3.4 Sliding Window Protocols A와 B는 full-duplex link 스테이션 B는 n개의 프레임을 수용할 수 있는 버퍼 보유 B는 n개의 프레임을 수신 가능 A는 ACK를 기다리지 않고, n개의 프레임을 전송 Window ; ACK없이 송/수신할 수 있는 프레임의 범위 송/수신측은 흐름제어를 위해 세 개의 포인트를 유지 송신하고 수신확인을 받은 프레임의 포인트 송신하고 아직 수신확인을 받지않은 프레임의 포인트 아직 송신하지 않은 프레임의 포인트

  22. example : window size=7

  23. Go-back-N & Selective Repeat Protocol http://tigerking.korea.ac.kr/~chcho/강의/datacom/06Dlinkc http://www.cs.wcu.edu/~holliday/cware/ErrorControl/arqSim.html

  24. 링크 설정 및 해제(1) 데이터 전송 이전에 데이타 링크설정 필요 데이터 전송 후에는 설정 해제 마지막 패킷이 수신측에서 상위층으로 전송되기 전에 링크 설정은 해제될 수 있다 링크 설정의 주체 Master-Slave 프로토콜 링크 설정 및 해제를 마스타에서 주도하여 제어 Balanced 프로토콜 양방향의 Master-Slave 프로토콜이 사용되고 있음. 설정 및 해제에 동기화 사용

  25. 링크 설정 및 해제(2)

  26. Example Data Link Protocols(1) 문자기반 프로토콜 BSC(Binary Syscnronous Control) SLIP(Serial Line IP) PPP(Point-to-Point Protocol): Asynchronous link with 8bits 비트지향 프로토콜 HDLC(High-level Data Link Control) LAP-B(Link Access Protocol on the B channel) LAP-D(Link Access Protocol on the D channel PPP(Point-to-Point Protocol): bit-oriented synchronous link

  27. Example Data Link Protocols(2) SDLC -- IBM’s SNA (Synchronous Data Link Protocol) ADCCP(Advanced Data Communication Control Procedure) -- ANSI HDLC(High-Level Data Link Control) -- ISO LAP(Link Access Procedure) LAPB

  28. HDLC Frames Bits 1 3 1 3 0 Seq P/F Next 1 0 Type P/F Next 1 1 Type P/F Modifier http://tigerking.korea.ac.kr/~chcho/강의/datacom/06Dlinkc

  29. 3.6.2. The Data Link Layer in the Internet Point-to-point communication router-router leased line connection thousands of organizations have one or more LANs, each with some number of hosts along with a router. dial-up host-router connection point-to-point lines play a major role in the Internet is the millions of individuals who have home connections to the Internet using modems and dial-up telephone lines.

  30. SLIP (Serial Line IP) The workstation just sends raw IP packets over the line, with a special flag byte(0xC0) at the end for framing character stuffing is used Problems it does not do any error detection or correction SLIP supports only IP each side must know the other’s IP address in advance SLIP does not provide any form of authentication SLIP is not an approved Internet Standard A home PC acting as an Internet

  31. PPP -- Point-to-Point Protocol A framing method that unambiguously delineates the end of one frame and the start of the next one. The frame format also handles error detection. A link control protocol for bringing lines up, testing them, negotiating options, and bringing them down again gracefully w-hen they are no longer needed. -- LCP(Link Control Protocol) A way to negotiate network-layer options in a way that is independent of the network layer protocol to be used. The method chosen is to have a different NCP(Network Control Protocol) for each network layer supported. The PPP full frame format for unnumbered mode operation Flag 01111110 Address 11111111 Control 00000011 Flag 01111110 Protocol Payload Checksum Bytes 1 1 1 1 or 2 Variable 2 or 4 1

  32. DLC in ATM • 헤더 에러 검사 (Header Error Check) • Header error control • Detection mode: • Protects header only • Discards cell when header error • Correction mode (optional): Correct 1 bit errors else discard when error detected • Reduced cell loss in face of single bit errors • Reduced error detection for multiple bit errors • Cell delineation for STM-1 • Recalculated link-by-link because of VPI/VCI value changes

  33. HEC Based cell delineation • Hunt상태에서 Bit-by-bit 옮겨 가며 선두위치로 간주하고 CRC check

  34. Cell Synchronization Algorithm Bit-by-bit-check Cell-by-Cell-check Correct HEC Hunt Incoorect HEC PRESYNC N 번 연속 incorrect HEC N 번 연속 correct HEC SYNC Cell-by-Cell-check

More Related