The Data Link Layer - Universidade Federal Fluminense › ~debora › redes1 › pdf ›...

Post on 26-Jun-2020

1 views 0 download

Transcript of The Data Link Layer - Universidade Federal Fluminense › ~debora › redes1 › pdf ›...

1

The Data Link Layer

Chapter 3

Data Link Layer Design Issues

• Services Provided to the Network Layer• Framing• Error Control• Flow Control

2

Functions of the Data Link Layer

• Provide service interface to the network layer• Dealing with transmission errors• Regulating data flow

• Slow receivers not swamped by fast senders

Functions of the Data Link Layer (2)

Relationship between packets and frames.

3

Services Provided to Network Layer

(a) Virtual communication.(b) Actual communication.

Services Provided to Network Layer (2)

Placement of the data link protocol.

4

Framing

A character stream. (a) Without errors. (b) With one error.

Framing (2)

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

5

Framing (3)

Bit stuffing(a) The original data.(b) The data as they appear on the line.(c) The data as they are stored in receiver’s memory after destuffing.

Bits

Sinal NRZ

Onda de Relógio

Manchester

11 11 00 00 00 11 11 00 11JJ KK

Violação de Códigos

a) Bit “1” - transição positiva (subida) no meio do bit

b) Bit “0” - transição negativa (descida) no meio do bit

c) Bits “J” e “K” - ausência de transição

6

Presença e Ausência de Sinal no Meio

Tempo

Intervalo de silêncio IFG - interframe gap

Error Detection and Correction

• Error-Correcting Codes• Error-Detecting Codes

7

Error-Detecting Codes

Calculation of the polynomial code checksum.

Sliding Window Protocols

• A One-Bit Sliding Window Protocol• A Protocol Using Go Back N• A Protocol Using Selective Repeat

8

Quadro 0

ACK 0ACK 0

Transmissor Receptor

T

Intervalosde Timeout

Quadro 1

Quadro 0

ACK 1ACK 1

ACK 1ACK 1

Quadro 1

Controle de Erro: Protocolo Stop-and-Wait

Quadro 1 Quadro 1

Quadro 1

Quadro 1

Sliding Window Protocols (2)

A sliding window of size 1, with a 3-bit sequence number.(a) Initially.(b) After the first frame has been sent.(c) After the first frame has been received.(d) After the first acknowledgement has been received.

9

A One-Bit Sliding Window Protocol (2)

Two scenarios for protocol 4. (a) Normal case. (b) Abnormal case. The notation is (seq, ack, packet number). An asterisk indicates where a network layer accepts a packet.

A Protocol Using Go Back N

Pipelining and error recovery. Effect on an error when(a) Receiver’s window size is 1.(b) Receiver’s window size is large.

10

Controle de Erro: Protocolo Selective Repeat

0 1 2 3 4 5 6 7 8 2 3 4 5 6

0 1 EE 3 4 5 6 7 8 2 33 44 55 66

Quadros bufferizados

Tempo

A1 A8

9 10 11

9 10 11

A9

Intervalo de TIMEOUT

12

Quadros descartados

Controle de Fluxoa) Regula o fluxo de quadros entre transmissor e receptorb) Resolve o problema de diferença entre velocidade de

transmissão e recepçãoc) Não permite que uma estação transmissora mais rápida

sobrecarregue uma estação receptorad) Técnicas:

– Stop-and-Wait– Sliding Window

11

Protocolo Stop-and-Wait

Quadro 0

ACK 0ACK 0

Quadro 0

Quadro 1

ACK 1ACK 1

Quadro 1

Transmissor Receptor

Quadro 0

ACK 0ACK 0

Quadro 0

T

Quadro 1

ACK 1ACK 1

Quadro 1

Protocolo Sliding Window

Quadro 0 Quadro 0

ACK 3ACK 3

Quadro 1 Quadro 1

Transmissor Receptor

Quadro 4 Quadro 4

T

Quadro 0 Quadro 0

Quadro 2 Quadro 2Quadro 3 Quadro 3

Quadro 1 Quadro 1Quadro 2 Quadro 2

ACK 2ACK 2

12

ReceptorTransmissor

Envia Ack de três quadros0 1 2 3 4 0 1

Protocolo Sliding Window

Recebe Ack de três quadros0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

Recebe um quadro0

Recebe dois quadros0 1 2

Recebe um quadro0 1 2 3

Envia Ack de quatro quadros0 1 2 3

Envia um quadro0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

Envia dois quadros0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

Envia um quadro0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

Recebe Ack de quatro quadros0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

Recebe um quadro0 1 2 3 40 1 2 3 4 0 1 2 3 4 0 1 2 3 4

Envia um quadro

Recebe dois quadros0 1 2 3 4 0 1

Envia dois quadros0 1 2 3 4 0 1 2 3 4 0 1 2 3 4

A Sliding Window Protocol Using Selective Repeat (5)

(a) Initial situation with a window size seven.(b) After seven frames sent and received, but not acknowledged.(c) Initial situation with a window size of four.(d) After four frames sent and received, but not acknowledged.

13

The Data Link Layer in the Internet

A home personal computer acting as an internet host.

PPP – Point to Point Protocol

The PPP full frame format for unnumbered mode operation.

14

PPP – Point to Point Protocol (2)

A simplified phase diagram for bring a line up and down.

PPP – Point to Point Protocol (3)

The LCP frame types.