redes de computadores aula 6
play

Redes de Computadores Aula 6 Aula passada Aula de hoje Camada de - PowerPoint PPT Presentation

Redes de Computadores Aula 6 Aula passada Aula de hoje Camada de transporte Eficincia Multiplexao Go-Back N Princpios de Selective Repeat transmisso confivel Stop-and-wait Figueiredo 2011 Eficincia do Stop-and-Wait


  1. Redes de Computadores Aula 6 Aula passada Aula de hoje Camada de transporte Eficiência Multiplexação Go-Back N Princípios de Selective Repeat transmissão confiável Stop-and-wait Figueiredo – 2011

  2. Eficiência do Stop-and-Wait Início da transmissão Pacote L bytes Fim da transmissão Taxa de transmissão R Propagação p Vazão máxima Recebe confirmação do canal? Utilização? Muito ruim! tempo tempo Figueiredo – 2011

  3. Eficiência do Stop-and-Wait Pacote L bytes Taxa de transmissão R Propagação p Vazão = L / (L/R + 2p) Ex. L = 1000 bytes, R = 1Gbps, p = 10ms V = 400Kbps Apesar do enlace ser de 1Gbps! U = 0.4/1000 = 0.0004! Como melhorar eficiência? Figueiredo – 2011

  4. Protocolos com Pipeline Pipeline: transmissor permite múltiplos pacotes “em trânsito”, antes de receber ACK Problemas que teremos que resolver? Significado do ACK, número de sequência, ordenação, bufferização Figueiredo – 2011

  5. Vazão com Pipeline Supor pipeline de 3 pacotes Ganho na Tx P1 vazão? Tx P2 Ganho na Tx P3 utilização? Tx ACK 1 Transmissão Tx ACK 2 de 3 pacotes Rx ACK 1 Tx ACK 3 Vazão 3 vezes Tx P4 Rx ACK 2 maior! Tx P5 Rx ACK 3 Tx P6 tempo tempo Figueiredo – 2011

  6. Protocolos com Pipeline (ou Janela) Go-back N Selective Repeat: Tx poder ter até N Tx pode ter até N pacotes sem ACK no pacotes sem ACK no pipeline pipeline Rx transmite ACKs RX envia ACK cumulativos individual para Não envia ACK se pacotes tiver faltando na Tx mantém um sequência timer para cada Tx tem timer para pacote pacote mais antigo sem ACK Retransmite somente o pacote Retransmite todos se timer expira os pacotes se timer expira Figueiredo – 2011

  7. Go-Back-N Sender: k-bit seq # in pkt header “window” of up to N, consecutive unack’ed pkts allowed ❒ ACK(n): ACKs all pkts up to, including seq # n - “cumulative ACK” ❍ may receive duplicate ACKs (see receiver) ❒ timer for each in-flight pkt ❒ timeout(n): retransmit pkt n and all higher seq # pkts in window Figueiredo – 2011

  8. GBN: sender extended FSM rdt_send(data) if (nextseqnum < base+N) { sndpkt[nextseqnum] = make_pkt(nextseqnum,data,chksum) udt_send(sndpkt[nextseqnum]) if (base == nextseqnum) start_timer nextseqnum++ } else Λ refuse_data(data) base=1 nextseqnum=1 timeout start_timer Wait udt_send(sndpkt[base]) udt_send(sndpkt[base+1]) rdt_rcv(rcvpkt) … && corrupt(rcvpkt) udt_send(sndpkt[nextseqnum-1]) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) base = getacknum(rcvpkt)+1 If (base == nextseqnum) stop_timer else start_timer Figueiredo – 2011

  9. GBN: receiver extended FSM default udt_send(sndpkt) rdt_rcv(rcvpkt) && notcurrupt(rcvpkt) Λ && hasseqnum(rcvpkt,expectedseqnum) Wait extract(rcvpkt,data) expectedseqnum=1 deliver_data(data) sndpkt = sndpkt = make_pkt(expectedseqnum,ACK,chksum) make_pkt(expectedseqnum,ACK,chksum) udt_send(sndpkt) expectedseqnum++ ACK-only: always send ACK for correctly-received pkt with highest in-order seq # may generate duplicate ACKs need only remember expectedseqnum out-of-order pkt: discard (don’t buffer) -> no receiver buffering! Re-ACK pkt with highest in-order seq # Figueiredo – 2011

  10. GBN in action Figueiredo – 2011

  11. Selective Repeat receiver individually acknowledges all correctly received pkts buffers pkts, as needed, for eventual in-order delivery to upper layer sender only resends pkts for which ACK not received sender timer for each unACKed pkt sender window N consecutive seq #’s again limits seq #s of sent, unACKed pkts Figueiredo – 2011

  12. Selective repeat: sender, receiver windows Figueiredo – 2011

  13. Selective repeat receiver sender pkt n in [rcvbase, rcvbase+N-1] data from above : if next available seq # in ❒ send ACK(n) window, send pkt ❒ out-of-order: buffer timeout(n): ❒ in-order: deliver (also deliver buffered, in-order resend pkt n, restart timer pkts), advance window to ACK(n) in [sendbase,sendbase+N]: next not-yet-received pkt mark pkt n as received pkt n in [rcvbase-N,rcvbase-1] if n smallest unACKed pkt, ❒ ACK(n) advance window base to otherwise: next unACKed seq # ❒ ignore Figueiredo – 2011

  14. Selective repeat in action Figueiredo – 2011

  15. Selective repeat: dilemma Example: seq #’s: 0, 1, 2, 3 window size=3 receiver sees no difference in two scenarios! incorrectly passes duplicate data as new in (a) Q: what relationship between seq # size and window size? Figueiredo – 2011

Recommend


More recommend