Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chap. 4 Data link layer 2.

Similar presentations


Presentation on theme: "Chap. 4 Data link layer 2."— Presentation transcript:

1 Chap. 4 Data link layer 2

2 Connection control Connection control
defines reliable transmission between two adjacent nodes three step Connection establishment Frame transmission Connection termination

3 Connection-oriented service or connection mode
Connectionless service or connectionless mode

4 acknowledged service unacknowledged service

5 Flow control Flow control
Ensuring the transmitter does not overwhelm capability of receiver preventing buffer overflow host controller protocol controller transmit buffer and receive buffer

6 Stop-and-wait flow control
Source transmits frame Destination receives frame and replies with acknowledgement Source waits for ACK before sending next frame Destination can stop flow by not send ACK Works well for a few large frames

7 Sliding Windows Flow Control
Allow multiple frames to be in transit Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame is numbered ACK includes number of next frame expected Sequence number bounded by size of field (k) Frames are numbered modulo 2k

8 Error detection Error detection
Additional bits added by transmitter for error detection code FCS (frame check sequence)

9 Parity bit Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones Even number of bit errors goes undetected ex ASCII code

10 Cyclic Redundancy Check
For data of k bits, transmitter generates FCS(frame check sequence) of n-k bits Transmit frame of n bits which is exactly divisible by some number (modulo 2 operation) Receive divides frame by that number modulo 2 operation exclusive-OR operation : 1^1 = 0, 1^0 = 1 Equation T : frame of n bits D : data of k bits F : FCS of n-k bits P : divisor of n-k+1 bits

11 Divisor Denoted using polynomial P=11001 => P(X)=X4+X3+1 CRC-16 : CAN P(X)=X16+X15+X2+1 CRC-32 : IEEE 802.3 Example Transmitter ASCII data of ‘a’ Odd parity bit Divisor of P(X)=X4+X3+1 Receiver Frame is divided by divisor If remainder is not 0, error is occurred

12 Error control Error control
If error is detected after error detection procedure, error recovery process is started Sequence number is used for error recovery Type of error lost frame : if frames are out of sequence damaged frame : if error is detected after receiving

13 Stop-and-wait ARQ ARQ (automatic repeat request)
Procedure for error recovery Source transmits single frame Wait for ACK If received frame damaged, discard it Transmitter has timeout If no ACK within timeout, retransmit

14 If ACK is damaged, transmitter will not recognize
Transmitter will retransmit Receive gets two copies of frame Use ACK0 and ACK1

15 Go-back-N ARQ Based on sliding window
If no error, ACK as usual with next frame expected Use window to control number of outstanding frames If error, reply with rejection Discard that frame and all future frames until error frame received correctly Transmitter must go back and retransmit that frame and all subsequent frames

16 Selective Reject ARQ Also called selective retransmission
Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimizes retransmission Receiver must maintain large enough buffer More complex login in transmitter


Download ppt "Chap. 4 Data link layer 2."

Similar presentations


Ads by Google