Anzeige
Anzeige

Más contenido relacionado

Anzeige

Chapter3 transport

  1. Multiplexing/demultiplexing application transport network link physical P1 application transport network link physical application transport network link physical P2 P3 P4 P1 host 1 host 2 host 3 = process = socket delivering received segments to correct socket gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) Demultiplexing at rcv host: Multiplexing at send host:
  2. Connection-oriented demux (cont) Client IP:B server IP: C SP: 9157 DP: 80 D-IP:C S-IP: A D-IP:C S-IP: B D-IP:C S-IP: B P1 client IP: A P1 P2 P4 SP: 9157 DP: 80 P5 P6 P3 SP: 5775 DP: 80
  3. Connection-oriented demux: Threaded Web Server Client IP:B server IP: C SP: 9157 DP: 80 P4 D-IP:C S-IP: A D-IP:C S-IP: B D-IP:C S-IP: B P1 client IP: A P1 P2 SP: 9157 DP: 80 P3 SP: 5775 DP: 80
  4. Reliable data transfer: getting started send side receive side rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer udt_send(): called by rdt, to transfer packet over unreliable channel to receiver rdt_rcv(): called when packet arrives on rcv-side of channel deliver_data(): called by rdt to deliver data to upper
  5. rdt2.0: FSM specification Wait for call from above snkpkt = make_pkt(data, checksum) udt_send(sndpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) sender receiver rdt_send(data)  udt_send(NAK) rdt_rcv(rcvpkt) && corrupt(rcvpkt) Wait for ACK or NAK Wait for call from below
  6. rdt2.0: operation with no errors Wait for call from above snkpkt = make_pkt(data, checksum) udt_send(sndpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from below rdt_send(data)  udt_send(NAK) rdt_rcv(rcvpkt) && corrupt(rcvpkt) Wait for ACK or NAK
  7. rdt2.0: error scenario Wait for call from above snkpkt = make_pkt(data, checksum) udt_send(sndpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from below rdt_send(data)  udt_send(NAK) rdt_rcv(rcvpkt) && corrupt(rcvpkt) Wait for ACK or NAK
  8. rdt2.1: sender, handles garbled ACK/NAKs Wait for call 0 from above sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_send(data) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) rdt_send(data) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isNAK(rcvpkt) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt)   Wait for ACK or NAK 0 Wait for call 1 from above Wait for ACK or NAK 1
  9. rdt2.1: receiver, handles garbled ACK/NAKs sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq0(rcvpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq0(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && not corrupt(rcvpkt) && has_seq1(rcvpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt) sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt) Wait for 0 from below Wait for 1 from below
  10. rdt2.2: sender, receiver fragments sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_send(data) udt_send(sndpkt) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) sender FSM fragment rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt) extract(rcvpkt,data) deliver_data(data) sndpkt = make_pkt(ACK1, chksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && (corrupt(rcvpkt) || has_seq1(rcvpkt)) udt_send(sndpkt) receiver FSM fragment  Wait for call 0 from above Wait for ACK 0 Wait for 0 from below
  11. rdt3.0 sender sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) start_timer rdt_send(data) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,1) ) sndpkt = make_pkt(1, data, checksum) udt_send(sndpkt) start_timer rdt_send(data) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,0) rdt_rcv(rcvpkt) && ( corrupt(rcvpkt) || isACK(rcvpkt,0) ) rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && isACK(rcvpkt,1) stop_timer stop_timer udt_send(sndpkt) start_timer timeout udt_send(sndpkt) start_timer timeout rdt_rcv(rcvpkt)  rdt_rcv(rcvpkt)    Wait for ACK0 Wait for call 1 from above Wait for call 0from above Wait for ACK1
  12. rdt3.0 in action
  13. rdt3.0 in action
  14. rdt3.0: stop-and-wait operation first packet bit transmitted, t = 0 sender receiver RTT last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R
  15. Pipelining: increased utilization first packet bit transmitted, t = 0 sender receiver RTT last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK Increase utilization by a factor of 3!
  16. GBN: sender extended FSM start_timer udt_send(sndpkt[base]) udt_send(sndpkt[base+1]) … udt_send(sndpkt[nextseqnum-1]) timeout 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 = getacknum(rcvpkt)+1 If (base == nextseqnum) stop_timer else start_timer rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) base=1 nextseqnum=1 rdt_rcv(rcvpkt) && corrupt(rcvpkt)  Wait
  17. GBN in action
  18. Selective repeat: sender, receiver windows
  19. Selective repeat in action
  20. TCP segment structure URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) # bytes rcvr willing to accept counting by bytes of data (not segments!) Internet checksum (as in UDP) source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number Receive window Urg data pnter checksum F S R P A U head len not used Options (variable length)
  21. Example RTT estimation:
  22. TCP: retransmission scenarios Host A Seq=100, 20 bytes data ACK=100 premature timeout Host B Seq=92, 8 bytes data ACK=120 Seq=92, 8 bytes data ACK=120 Seq=92 timeout SendBase = 100 SendBase = 120 SendBase = 120 Sendbase = 100 time Seq=92 timeout Host A Seq=92, 8 bytes data ACK=100 loss timeout lost ACK scenario Host B X Seq=92, 8 bytes data ACK=100 time
  23. TCP retransmission scenarios (more) SendBase = 120 Host A Seq=92, 8 bytes data ACK=100 loss timeout Cumulative ACK scenario Host B X Seq=100, 20 bytes data ACK=120 time
  24. TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed Arrival of in-order segment with expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. # . Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK , indicating seq. # of next expected byte Immediate send ACK, provided that segment starts at lower end of gap
  25. Figure 3.37 Resending a segment after triple duplicate ACK Host A timeout Host B time X resend 2 nd segment
  26. Fast retransmit algorithm: event: ACK received, with ACK field value of y if (y > SendBase) { SendBase = y if (there are currently not-yet-acknowledged segments) start timer } else { increment count of dup ACKs received for y if (count of dup ACKs received for y = 3) { resend segment with sequence number y } a duplicate ACK for already ACKed segment fast retransmit
  27. TCP Connection Management (cont) TCP client lifecycle TCP server lifecycle
  28. TCP sender congestion control SS or CA SS or CA SS or CA Congestion Avoidance (CA) Slow Start (SS) State CongWin and Threshold not changed Increment duplicate ACK count for segment being acked Duplicate ACK Enter slow start Threshold = CongWin/2, CongWin = 1 MSS, Set state to “Slow Start” Timeout Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS. Threshold = CongWin/2, CongWin = Threshold, Set state to “Congestion Avoidance” Loss event detected by triple duplicate ACK Additive increase, resulting in increase of CongWin by 1 MSS every RTT CongWin = CongWin+MSS * (MSS/CongWin) ACK receipt for previously unacked data Resulting in a doubling of CongWin every RTT CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance” ACK receipt for previously unacked data Commentary TCP Sender Action Event

Hinweis der Redaktion

  1. Kurose and Ross forgot to say anything about wrapping the carry and adding it to low order bit
Anzeige