20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines...

17
2010 1 The Data Link Layer Chapter 3
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    0

Transcript of 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines...

Page 1: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 1

The Data Link Layer

Chapter 3

Page 2: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 2

Design IssuesControls communication between 2 machines directly connected by

“wire”-like link

• Services Provided to the Network Layer

• Framing: frame as an unit for physical layer to send in one go

• Error Control

• Flow Control, not sending faster than can be received

Page 3: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 3

Services Provided to Network LayerUnacknowledged connectionless service.

• no recovering of lost or corrupted frame

• when the error rate is very low

• real-time traffic, like speech or video

Acknowledged connectionless service.

• returns information a frame has safely arrived.

• time-out, resend, frames received twice

• unreliable channels, such as wireless systems.

Acknowledged connection-oriented service.

• established connection before any data is sent.

• provides the network layer with a reliable bit stream.

Page 4: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 4

Framing, character countTime gaps between frames are not suitable

•times are variable in networks•received gaps can be smaller or larger

Need to be combined with other methods

Page 5: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 5

Framing, flag bytes

(a) A frame delimited by flag bytes.(b) Four examples of byte sequences before and after stuffing.

Page 6: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 6

Framing, bit stuffing

Flag is 6 “1” bits

After 5 “1”’s a “0” is added

Page 7: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 7

Error-Detecting Codes, CRC

Cyclic redundancy Checksrelated to polynomial theoriesusually implemented in hardwareusing 16 of 32 bit generators

-detect burst errors fewer than r+1 bits-any odd number of bit errors-up to an certain even number of errors

Page 8: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 8

Error-Correcting Codes

Use of a Hamming code, adding extra bits, to correct errors.

Error-correcting codes used in the early days, noisy linesLater lines and electronics got better: error-detection and resendNow used for wireless communication and high speed ethernet

Page 9: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 9

Protocols

• ACK (acknowledgements) for correct frames

• possible NACK for lost or corrupted frames (piggybacked)

• Pipelining

• error correction by resend of lost or corrupted frames

• Flow control

Page 10: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 10

Stop and Wait Protocols A Simplex Protocol for a Noisy Channel

• sender waits for an ack for each send frame• frames may be damaged or lost, same for acks• no nacks for lost or error frames

• might be used to increase the data rate• sender uses a timer and re-sends frame• a 1-bit frame number (0 and 1) is needed for data and

ack frames, to separate a re-send frame from the original one

• also called: alternating bit protocol

Page 11: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 11

Pipelining

• Sender needs to buffer a send frame until its ack has arrived• the buffer is a sliding window on all frames in the stream

last packet bit arrives, send ACK

sender receiver

RTT

last bit transmitted, t = L / R

first packet bit arrives

ACK arrives, send next packet, t = RTT + L / R

Page 12: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 12

Go Back N• receiver has no buffer

• it can only accept (and send to its higher layer) a correct frame with the next expected sequence number

• sends an ack for that sequence number, this implies that all previous frames have arrived

• otherwise it discards the frame and

• either sends nothing back or

• an ack for the last accepted frame

• or a nack for the next frame

• receiver timer to send ack (or nack) in separate frame

• do not wait too long for return frame to piggyback the ack or nack

Page 13: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 13

Go Back N, sender

• buffer for a number of already send but not yet acked frames

• a timer for the oldest frame in the buffer

• resend in case of time-out, an ack for an already acked frame or a nack

• in case of a resend:

• all next already send frames must be resend

• more than 1 bit for sequence numbers are needed:

• Nr_Buf <= Max_Seq+1

Page 14: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 14

Selective Repeat• also receiver buffers frames:

• can store out-of-order correct frames• only 1 frame has to be resend in case of error or lost• nacks are usually used for error or lost frames

• just makes it faster• Nr_Buf <= (Max_Seq+1)/2 (0…Max_Seq)• sender needs timer of each send frame• receiver timer to send ack (or nack) in separate frame

• do not wait too long for return frame to piggyback the ack or nack

Page 15: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 15

Selective Repeat buffers

Page 16: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 16

Go Back N vs Selective Repeat

Page 17: 20101 The Data Link Layer Chapter 3. 20102 Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.

2010 17

Protocol Verification

Modeling needed

• Finite State Machine Models

• Petri Net Models

Formal verification

• Uppaal

• PVS