1 / 36

CMPT 371

CMPT 371. Data Communications and Networking Pipelined reliable data transfer. Stop and Wait: Utilization: examples (3). a = ( R × d ) / ( V × L ) U = T f / T t = 1 / (1+2a) Case 1: WAN using ATM over optical fiber link d = 1000 km, L = 424 bits, R = 155.52 Mbps

Télécharger la présentation

CMPT 371

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPT 371 Data Communications and Networking Pipelined reliable data transfer

  2. Stop and Wait: Utilization: examples (3) a = ( R × d ) / ( V × L ) U = Tf / Tt= 1 / (1+2a) • Case 1: WAN using ATM over optical fiber link • d = 1000 km, L = 424 bits, R = 155.52 Mbps V = 2×108 m/s • Gives a ≈ 1850, and U = 0.00027

  3. Stop and Wait Utilization: examples (4) a = ( R × d ) / ( V × L ) U = Tf / Tt= 1 / (1+2a) • Case 2: LAN • d = 0.1 to 10 km, L = 1000 bits, R = 10 Mbps V = 2×108 m/s • Gives a = 0.005 to 0.5, and U = 0.5 to 0.99

  4. Stop and Wait Utilization: examples (5) a = ( R × d ) / ( V × L ) U = Tf / Tt= 1 / (1+2a) • Case 3: Modem • d = 5000 km, L = 1000 bits, R = 56,000 V = 2×108 m/s • Gives a = 1.4, and U = 0.26

  5. Stop and Wait: Utilization Factors • Utilization improves when a is smaller a = ( R × d ) / ( V × L ) • Therefore, utilization improves when • The length of the frame, L, increases • The data rate, R, and/or the link length, d, decrease • The bit length of the link (Rd/V) is less than the frame length

  6. Stop and Wait: Utilization Factors • Physical factors, optimization of performance limit L, R, and d • Available buffer size, and resource sharing will limit L • Performance optimization indicates small L (minimize retransmission) • Performance optimization indicates largest possible R • Link length, d, set by topology of network

  7. Stop and Wait: Utilization Factors t0 t0 t0+a t0+1 t0+1 t0+a t0+1+a t0+1+a t0+1+2a t0+1+2a Rd/V ≥ L (a ≥1) Rd/V< L (a<1) Stalling 2003: figure 7.2

  8. Improving Stop and Wait Flow Control • Stop and Wait Flow Control utilizes the channel inefficiently particularly when the link length is greater than the frame length • WHY? • Because Stop and Wait Flow Control allows only one frame to be in transit between two given stations • Consider a more complicated system of flow control (Sliding Window) which allows N≥1 frames to be in transit. • What is the cost of allowing multiple frames to be in transit simultaneously? • All frames of data in transit must be buffered at the sending station until after the ACK from the receiving station arrives at the sending station, buffering at the receiving station may or may not be used • Increased complexity, frames may arrive out of order or be duplicated • More information needed in frame headers

  9. Why multiple Frames? Destination Source Frame 0 Frame 1 Frame 5 Frame 4 Frame 3 Frame 2 a = 4 W=6 Destination Source Frame 1 a = 4 W=1

  10. Improving Stop and Wait Flow Control • Stop and Wait Flow Control utilizes the channel inefficiently particularly when the link length is greater than the frame length • WHY? Because Stop and Wait Flow Control allows only one frame to be in transit between two given stations • Consider a more complicated system of flow control (Sliding Window) which allows N≥1 frames to be in transit. • What is the cost of allowing multiple frames to be in transit simultaneously? • All frames of data in transit must be buffered at the sending station until after the ACK from the receiving station arrives at the sending station, buffering at the receiving station may or may not be used • Increased complexity, frames may arrive out of order or be duplicated • More information needed in frame headers

  11. Sliding Window Flow Control Stallings 2003; Figure 7.3

  12. Description: following diagrams The packet with packet number base is shown after the . It is the oldest unacknowledged packet. Packets [0, base-1] have already been sent and acknowledged Packets between and the right hand end of the dark blue window are in the sliding window Packets between base and the darker blue window [base, nextseqnum-1] have been sent but have not been acknowledged

  13. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 F0 F1 ACK1 F2 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 ACK2 F3 F4 ACK5 ACK4 F5 ACK6 Sliding Window Flow Control

  14. Sliding Window Flow Control • At the receiver • After an acknowledgement is sent the window “slides” to the right by m. For the previous example m=1 • both ends of the receiver’s sliding window move together (the length of the window does not change) • The number of the ACK indicates the next packet the receiver expects (the first packet the receiver must save in its sliding window buffer) • ACKs are usually cumulative: By sending ACKn the receiver is saying I have all packets up to packet n-1, the next packet I expect is n. • Darker blue shows the remaining unused buffer space

  15. Sliding Window Flow Control • At the source • When an ACK is received the window “slides” to the right by m. In the previous example m=1 • Both ends of the source’s sliding window move together (the length of the window does not change) • Packets are sent one after the other until the end of the sliding window is reached • When ACKn is received the source knows that the first packet it needs to save in its sliding window buffer is packet n. • Darker blue shows the remaining unused buffer space

  16. Sliding Window Utilization 1 The total time to send a frame of data and receive the resulting ACK is Tt = tFRAME + tACK+ ( 2 × tPROP)+ tPROCF+ tQF+ tPROCA+tQA The total time spent transmitting data frames for a window of length W frames is Tf= W× tFRAME The link utilization, U, of the channel in the absence of errors and losses is U = Tf / Tt If errors and losses make retransmissions necessary, and the average number of transmissions per frame is Nrsw then U = Tf / ( Nrsw× Tt)

  17. Assume protocol has the following properties Processing and queuing time is negligible (tPROCF≈ 0, tPROCA≈ 0, tQF≈ 0 , tQA≈ 0) The acknowledgment frame is small compared to the data frame (tFRAME>> tACKor tFRAME+ tACK≈tFRAME) No errors or losses The maximum link utilization, U, is Where a = tPROP/ tFRAME = ( R × d ) / ( V × L ) Sliding Window Utilization: 2

  18. Sliding Window ARQ Utilization: 1 • All frames of data in transit must be buffered at the sending station until after the ACK from the receiving station arrives at the sending station. Frames are numbered modulo M • Source entity (sender) transmits frames from its sliding window until its send buffer is exhausted. A timeout timer is set when each frame begins transmitting. • Destination entity (receiver) receives a frame and • Sends and ACK then advances its sliding window if it has one • Sends a NACK

  19. Sliding Window ARQ Utilization: 2 • Source entity receives ACK or NACK and stops timer for received frame. • If an ACK is received the source entity may advance its sliding window • If a NACK is received the NACKed frame is retransmitted. Frames following the NACKed frame may also be retransmitted. • If a timeout timer expires the frame with an expired timer is retransmitted. Frames following that frame may also be retransmitted.

  20. Continuous ARQs: Go Back N • Not all implementations or protocols with flow control based on sliding windows use or allow NACKs, your textbook shows an example, Go Back N without NACKs. • When a packet transmission timer expires, the expired frame and all previously transmitted frames following the expired frame will be retransmitted. • One timer is used, it is set when the first packet enters the pipeline and reset each time an ACK is received (only if more packets are presently in the pipeline) • In all cases the destination entity does not buffer frames. If a frame is received out of order the frame is discarded.

  21. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 0 0 0 0 0 0 0 F0 F1 * ACK1 ACK1 ACK1 ACK1 F2 F2 F3 ACK1 F4 ACK2 F1 F5 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 Go Back N ARQ: Lost Frame (timeout) 0 0 Discard packet 0 Timeout expired Discard packet 0 Discard packet 0 Discard packet 0 0 0

  22. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 0 0 0 0 0 0 F0 F1 ACK5 ACK4 ACK6 ACK2 ACK1 F2 F7 F3 F4 ACK7 F6 F5 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 Go Back N ARQ: Lost ACK 0 F1 0 0 0 * 0 0 0 0 0

  23. Choosing window size • To choose the optimal window size need to look at the utilization • First need limits on the window size • Smallest 1 frame (becomes stop and wait) • Largest determined by the largest integer N that can fit into the sequence number field in the packet header. • For N available packet can have window as large as N-1 • If window is of length N there may be ambiguity as to whether the packet is a retransmission of packet M from the previous cycle or a new packet M for this cycle

  24. Why is N-1 the limit? (1) 3 2 0 2 3 0 0 3 1 1 2 1 0? 2 1 0 3 • Consider a window size > N-1. For example consider N=4, with a window size of 4. • The first four packets are sent and received, the ACKs of the four packets are lost • The source times out because no ACKs are received and retransmits the first 4 packets. • The receiver expects the second four packets, 0, 1, 2, 3 • It receives packet 0, it will think it is the expected packet 0

  25. Why is N-1 the limit? (2) 0 2 1 3 2 0 2 1 1 0 3 0? 2 1 0 • Consider a window size = N-1. For example consider N=4, with a window size of 3. • The first three packets are sent and received, the ACKs of the three packets are lost • The source times out because no ACKs are received and retransmits the first 3 packets. • The receiver expects the second three packets, 3, 0, 1 (it already sent the ACKS) • It receives packet 0, packet 0 is out of order and will be dropped

  26. Go Back N Utilization: 1 • If errors and losses make retransmissions necessary then U = Tf / ( Nrsw× Tt) If no timers expire, Nrsw,,is the average number of transmissions per frame, Na. Otherwise Nrswis a function f(Na) • Let Pf be the probability that a given frame contains errors. • The probability that it will take i attempts to transmit the frame is • Each error requires that K frames be retransmitted • The average number of retransmissions Na (original transmission and i-1 retransmissions of K frames)

  27. What is K? Frame 8 Frame 5 Destination Source Frame 5 Frame 7 Frame 6 ACK 3 ACK 2 ACK 1 ACK 4 W = 8 a>4 K≈9 Destination Source Frame 1 Frame 2 W = 2 K≈2 • Round trip travel time means Tt/ TFRAME frames will be transmitted before the ACK for the first frame is received. • For a window length W≥Tt/ TFRAME :.K≈Tt/ TFRAME (=2a+1) • For a window length W <Tt/ TFRAME :. K≈W • .

  28. Go Back N ARQ Utilization: 2 • Now substitute our estimates of K • To give

  29. Go Back N ARQ Utilization: 3 • Assume that • Processing time is negligible, transmission time for Frames is » than for ACKs • no ACKs or NACKs are lost or damaged, and that the timeout timer never expires • Then • If the assumption is relaxed then the longer time for retransmission (timeout duration) must be included in the analysis. A separate probability for retransmission frames due to lost ACKs and NACKs may also be introduced

  30. Selective Repeat ARQs: When the source entity receives a NACK, only the NACKed frame will be retransmitted. When a timer expires, only the expired frame will be retransmitted. The destination entity buffers segments and maintains its own sliding window. The destination entity resequences frames that arrive out of order

  31. 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 F0 F1 * ACK4 ACK5 ACK0 ACK3 F2 F6 F3 ACK2 F4 ACK1 F1 F5 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 Selective Repeat ARQ: timeout (text) T imeout

  32. Choosing window size • To choose the optimal window size need to look at the utilization • First need limits on the window size • Smallest 1 frame (becomes stop and wait) • Largest determined by the largest integer N that can fit into the sequence number field in the packet header. • For N available sequence numbers can have window as large as N/2 • If window is of length N there may be ambiguity as to whether the packet is a retransmission of packet M from the previous cycle or a new packet M for this cycle

  33. Why is N/2 the limit? (1) 3 2 0 2 3 0 1 1 0 2 1 0? 2 1 0 • Consider a window size > N/2. For example consider N=4, with a window size of 3. • The first three packets are sent and received, the ACKs of the three packets are lost • The source times out because no ACKs are received and retransmits the first 3 packets. • The receiver expects the second three packets, 3, 0, 1 (it already sent the ACKS) • It receives packet 0, can’t tell if packet 3 missing or retransmitting packet 0

  34. Why is N/2 the limit? (2) 3 2 0 2 3 0 1 1 0 1 0? 1 0 • Consider a window size > N/2. For example consider N=4, with a window size of 2. • The first two packets are sent and received, the ACKs of the two packets are lost • The source times out because no ACKs are received and retransmits the first 2 packets. • The receiver expects the second two packets, 2, 3 (it already sent the ACKS for 0 and 1) • It receives packet 0, must be a retransmission!

  35. Selective Repeat Utilization: 1 • If errors and losses make retransmissions necessary, then for sliding window flow control U = Tf / ( Nrsw× Tt) If no timers expire, Nrsw,,is the average number of transmissions per frame, Na. Otherwise Nrswis a function f(Na) • Let Pf be the probability that a given frame contains errors. • The probability that it will take i attempts to transmit the frame is • Each error requires that 1 frame be retransmitted • The average number of retransmissions Na (original transmission and i-1 retransmissions)

  36. Selective Repeat Utilization: 2 • Assume that no ACKs or NACKs are lost or damaged, and that the timeout timer never expires • Then Nr is the average number of transmissions per frame and the channel utilization is • Also assuming that • Processing time is negligible • The acknowledgment frame is small compared to the data frame . U = (1-Pf)Tf / Tt

More Related