What are the duties of the data link

  • Slides: 34
Download presentation

What are the duties of the data link layer? Ö Main Point: Provide a

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 Services Provided to the Network Layer Ö

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 connection-oriented services 컴퓨터네트워크강의

DL Service (1/2) Ö Unacknowledged connectionless service Ú the source machine send independent frames

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 컴퓨터네트워크강의

DL Service (2/2) ÖAcknowledged connection-oriented service Ú the source and destination machines establish a

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. 컴퓨터네트워크강의

Placement of the DL protocol 컴퓨터네트워크강의

Placement of the DL protocol 컴퓨터네트워크강의

Framing Ö How do we do it reliably? Ú Data Link Layer는 physical layer로부터

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 컴퓨터네트워크강의

Character count Ö 각 frame의 character의 수를 header에 명시하는 방법 Ö 단점 : transmission

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

Starting and ending characters, with character stuffing Ö 각 frame 시작에는 DLE STX(Data Link

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

(a) Data sent by the network layer DLE STX A DLE B DLE ETX

(a) Data sent by the network layer DLE STX A DLE B DLE ETX (b) Data after being character stuffed by the data link layer DLE STX A DLE B DLE ETX Stuffed DLE (c) Data passed to the network layer on the receiving side DLE 컴퓨터네트워크강의 STX A DLE B DLE ETX

Starting and ending flags, with bit stuffing Ö flag byte 라고 불리 우는 특별한

Starting and ending flags, with bit stuffing Ö flag byte 라고 불리 우는 특별한 bit 형태를 frame의 시작과 끝에 삽입 : 01111110 Ö bit stuffing (a) 0110111111110010 (b) 011011111011111010010 Stuffed bits (c) 0110111111110010 컴퓨터네트워크강의

Ö Error Control Ú Frame이 올바르게 전달되었는지 확인 • positive acknowledgement, • negative acknowledgement

Ö Error Control Ú Frame이 올바르게 전달되었는지 확인 • positive acknowledgement, • negative acknowledgement Ú time 조절 Ö Flow Control Ú sender와 receiver의 속도의 차이가 있는 경우 receiver의 buffer가 넘치지 않도록 sender의 데이터 전송을 제어 컴퓨터네트워크강의

3. 2 Error Detection and Correction Ö Error-Correcting Codes Ú include enough redundant information

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 컴퓨터네트워크강의

3. 2. 1 Error-Correcting Codes Ö n-bit cordword : Ú n = m bit

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 2 d+1 distance code Ú http: //tigerking. korea. ac. kr/~chcho/강의/Tanenb/HTML/lect 6/ 컴퓨터네트워크강의

Ö Parity bit Ú it is chosen so that the number of 1 bits

Ö 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 컴퓨터네트워크강의

Hamming code Ú the bits of the codeword are numbered consecutively, starting with bit

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 H a m m I n g c o d e 컴퓨터네트워크강의 ASCII 1001000 1100001 1101101001 1101110 1100111 0100000 1100011 1101111 1100100 1100101 00110010000 10111001001 11101010101 01101011001 01101010110 11111001111 10011000000 11111000011 0010101111100 00111000101 Order of bit transmission

3. 2. 2 Error-Detecting Codes Ö Polynomial Code(cyclic redundancy code or CRC code) Ú

3. 2. 2 Error-Detecting Codes Ö Polynomial Code(cyclic redundancy code or CRC code) Ú Polynomial arithmetic 10011011 +11001010 0101 -10101111 01010001 11111010 Algorithm 1. Let r be the degree of G(x). Append r zero bits to the loworder end of the frame, so it now contains m+r bits and corresponds to the polynomial xr. M(x). Ú 2. Divide the bit string corresponding to G(x) into the bit string corresponding to xr. M(x) using modulo 2 division. Ú 3. Substract the remainder(which is always r or fewer bits) from the bit string corresponding to xr. M(x) using modulo 2 substraction. The result is the checksummed frame to be transmitted. Call its polynomial T(x). Ú 컴퓨터네트워크강의

Example of CRC Frame : 1101011011 Generator : 10011 Message after appending 4 zero

Example of CRC Frame : 1101011011 Generator : 10011 Message after appending 4 zero bits : 11010110000 Transmitted frame : 11010110111110 [T(x) + E(x)] / G(x) = E(x) / G(X) ( T(X) / G(x) = 0 ) 컴퓨터네트워크강의 1100001010 10011 11010110110000 10011 00000 00010 00000 00101 00000 01011 00000 10110 10011 01010 00000 10100 10011 Remainder 01110 00000 1110

Elementary Data Link Protocols Ö An Unrestricted Simplex Protocol Ú Assumption • utopia provides

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. 컴퓨터네트워크강의

Ö Simplex Stop-and-Wait Protocol Ú After having passed a packet to its network layer,

Ö 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 re. Quest) Ú protocols in which the sender waits for a positive acknowledgement before advancing to the next data item use sequence number 컴퓨터네트워크강의

example : window size=7 컴퓨터네트워크강의

example : window size=7 컴퓨터네트워크강의

Go-back-N & Selective Repeat Protocol Ö http: //tigerking. korea. ac. kr/~chcho/강의/datacom/06 Dlinkc Ö http:

Go-back-N & Selective Repeat Protocol Ö http: //tigerking. korea. ac. kr/~chcho/강의/datacom/06 Dlinkc Ö http: //www. cs. wcu. edu/~holliday/cware/Error. Control/arq. Sim. html 컴퓨터네트워크강의

Example Data Link Protocols(1) Ö 문자기반 프로토콜 Ú BSC(Binary Syscnronous Control) Ú SLIP(Serial Line

Example Data Link Protocols(1) Ö 문자기반 프로토콜 Ú BSC(Binary Syscnronous Control) Ú SLIP(Serial Line IP) Ú PPP(Point-to-Point Protocol): Asynchronous link with 8 bits Ö 비트지향 프로토콜 Ú Ú 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 컴퓨터네트워크강의

Example Data Link Protocols(2) SDLC -- IBM’s SNA (Synchronous Data Link Protocol) ADCCP(Advanced Data

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 컴퓨터네트워크강의

HDLC Frames Bits 1 0 3 Seq 1 0 1 1 Type 1 P/F

HDLC Frames Bits 1 0 3 Seq 1 0 1 1 Type 1 P/F 3 Next P/F Modifier http: //tigerking. korea. ac. kr/~chcho/강의/datacom/06 Dlinkc 컴퓨터네트워크강의

3. 6. 2. The Data Link Layer in the Internet Ö Point-to-point communication Ö

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. 컴퓨터네트워크강의

SLIP (Serial Line IP) Ö The workstation just sends raw IP packets over the

SLIP (Serial Line IP) Ö The workstation just sends raw IP packets over the line, with a special flag byte(0 x. C 0) 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 컴퓨터네트워크강의

PPP -- Point-to-Point Protocol Ö A framing method that unambiguously delineates the end of

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 Bytes 1 1 or 2 Flag Address Control Protocol 01111110 1111 00000011 컴퓨터네트워크강의 Variable Payload 2 or 4 Checksum 1 Flag 01111110

DLC in ATM Ö헤더 에러 검사 (Header Error Check) Ú Header error control •

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 컴퓨터네트워크강의

Cell Synchronization Algorithm Bit-by-bit-check Correct HEC Cell-by-Cell-check Hunt Incoorect HEC PRESYNC 연속 t HEC

Cell Synchronization Algorithm Bit-by-bit-check Correct HEC Cell-by-Cell-check Hunt Incoorect HEC PRESYNC 연속 t HEC N 번 orrec inc SYNC Cell-by-Cell-check 컴퓨터네트워크강의 속 연 HEC t 번 N rrec co