Download presentation
Presentation is loading. Please wait.
Published byCaleb Biglin Modified over 9 years ago
1
1 Chapter 2 Agenda Announcements / updates Gayle Laakman McDowell, 10/11, 4:30pm, UW2-005 GUIs / IDEs for remotely accessing uw1-320-lab Other references on sockets & signals in Linux Tegrity (not yet) Questions from last time? Sample programs ~css432/examples on uw1-320-lab memset() vs. bzero(), sigaction() vs. signal() sigactiondemo.c, socket-server3.c Sections 2.1-2.3 Chapter 1 exercises
2
2 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 2 Getting Connected Copyright © 2010, Elsevier Inc. All rights Reserved
3
3 Chapter 2 Outline Chapter 1: How to connect two nodes (hosts) in a network? Chapter 2: How to connect a host to a cloud? Physical media Encoding (bits) Framing (packets) Detecting errors Ensuring reliable transmission Mediating access among multiple hosts
4
4 Chapter 2 Perspectives on Connecting An end-user’s view of the Internet
5
5 Chapter 2 Links Physical transmission via radio waves / other form of electromagnetic radiation through some medium Full-duplex versus Half-duplex Full Half Local cable types Category 5 twisted pair Coax Multimode fiber LED-based, 2km Single-mode fiber laser-diode-based, 40km Carrier-supported cables/fibers DS1 (T1): 1.544Mbps, 24-digital voice circuits of 64 Kbps each DS3 (T3): 44.736Mbps, 28 DS1 links STS-1 (OC-1): Synchronous Transport Signal, 51.840Mbps STS-3, 12, 48, 192 (OC-3, OC-12, OC-48, OC-192) at time t at time u (from Prof. Fukuda’s slides)
6
6 Chapter 2 Links Last-Mile Links POTS: Plain Old Telephone Service ISDN: Integrated Services Digital Network ADSL: Asynchronous Digital Subscriber Line VDSL: Very high data rate Digital Subscriber Line Wireless Links AMPS, PCS, GSM: Wide-area analog/digital-based mobile phone services IEEE 802.11: wireless LAN with up to 54Mbps transfer rate BlueTooth radio interface: 1Mpbs piconet in 10m CODEC Voice line 28.8~56Kbps Digital line 64-128Kbps 1.554-8.448Mbps 16-640Kbps STS-N 12.96~ 55.2Mbps (from Prof. Fukuda’s slides)
7
7 Chapter 2 Links Frequency: # of waves per unit time (Hz) Wavelength: distance between the adjacent pair of maxima or minima of a wave (meters) Speed of light / frequency = wavelength. Frequency on a copper cable: 300Hz to 3300Hz; Wavelength for 300Hz wave through copper is speed of light on a copper / frequency 2/3 x 3 x 10 8 / 300 = 667 x 10 3 meters. Encoding: placing binary data on a signal Modulation: modifying the signals in terms of their frequency, amplitude or phase
8
8 Chapter 2 Links Electromagnetic spectrum
9
9 Chapter 2 Links Common services available to connect your home
10
10 Chapter 2 Encoding Signals travel between signaling components; bits flow between adaptors
11
11 Chapter 2 Encoding How to encode 1s and 0s?
12
12 Chapter 2 Encoding: NRZ Non-Return to Zero High signal = 1, Low signal = 0 NRZ encoding of a bit stream
13
13 Chapter 2 Encoding: NRZ Non-Return to Zero High signal = 1, Low signal = 0 NRZ encoding of a bit stream
14
14 Chapter 2 Encoding: NRZ Non-Return to Zero High signal = 1, Low signal = 0 Receiver maintains rolling average High = above average, Low = below average NRZ encoding of a bit stream
15
15 Chapter 2 Encoding: NRZ Non-Return to Zero High signal = 1, Low signal = 0 Receiver maintains rolling average High = above average, Low = below average Problems? NRZ encoding of a bit stream
16
16 Chapter 2 Encoding: NRZ Baseline wander Too many consecutive 0’s and 1’s cause average to change Differentiating high / low becomes problematic http://www.youtube.com/watch?v=KXrlG6eWhVo
17
17 Chapter 2 Encoding: NRZ Clock recovery Both the sending and decoding process is driven by a clock Every clock cycle, the sender transmits a bit and the receiver recovers a bit The sender and receiver have to be precisely synchronized Frequent transitions between high & low are necessary to enable clock recovery
18
18 Chapter 2 Encoding: NRZI Non-Return to Zero Inverted Transition (low high, or high low) = 1 No transition = 0
19
19 Chapter 2 Encoding: NRZI Non-Return to Zero Inverted Transition (low high, or high low) = 1 No transition = 0
20
20 Chapter 2 Encoding: NRZI Non-Return to Zero Inverted Transition (low high, or high low) = 1 No transition = 0 Solves for consecutive 1’s
21
21 Chapter 2 Manchester Encoding NRZ encoded data XOR clock 0: low high transition 1: high low transition
22
22 Chapter 2 Manchester Encoding NRZ encoded data XOR clock 0: low high transition 1: high low transition
23
23 Chapter 2 Manchester Encoding Problem with Manchester encoding?
24
24 Chapter 2 Manchester Encoding Problem with Manchester encoding Doubles the rate at which the signal transitions are made on the link Which means the receiver has half of the time to detect each pulse of the signal Baud rate: link’s signal transition rate In Manchester the bit rate is half the baud rate
25
25 Chapter 2 Encoding (so far) Different encoding strategies
26
26 Chapter 2 Encoding: 4B/5B 4B/5B encoding Insert extra bits into bit stream 4 bits of data encoded w/ 5 bits 5-bit code constraints: no more than one leading 0 (zero) no more than two trailing 0’s (after a 1) <= three consecutive 0s But: can have long string of 1s Transmitted using NRZI Transitions every <= 3 bits http://en.wikipedia.org/wiki/4B5B
27
27 Chapter 2 Encoding: 4B/5B 0 0 1 0 1 1 0 1 0 0 0 0 1 0
28
28 Chapter 2 Encoding: 4B/5B 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 0
29
29 Chapter 2 On packet-switched networks, blocks of data (frames) are exchanged between nodes It is the network adaptor that enables the nodes to exchange frames. Framing Bits flow between adaptors, frames between hosts
30
30 Chapter 2 Framing To send frame from node A node B Node A places frame in memory location (on A) Adaptor A sends bits from frame to Adaptor B Adaptor B reassembles frame in memory location on B Determining frame boundaries is the central challenge faced by the Adapter
31
31 Chapter 2 Framing Byte-oriented Protocols Frame as a collection of bytes (characters) rather than a collection of bits BISYNC (Binary Synchronous Communication) Protocol Developed by IBM (late 1960) DDCMP (Digital Data Communication Message Protocol) Used in DECNet
32
32 Chapter 2 Framing BISYNC – sentinel approach SYN : Beginning of a frame SOH : Start of Header STX : Start of text ETX : End of text (the sentinel) DLE : Data Link Escape byte stuffing to “escape” ETX chars in payload CRC: Cyclic Redundancy Check
33
33 Chapter 2 Framing Point-to-Point Protocol (PPP): Sentinel approach commonly used on Internet Flag: start/end of text character 0 1 1 1 1 1 1 0 Address, control : default numbers Protocol for demux : IP / IPX Payload : negotiated (1500 bytes) Checksum : for error detection
34
34 Chapter 2 Framing Byte-counting approach DDCMP count : how many bytes are contained in the frame body If count is corrupted Framing error
35
35 Chapter 2 Framing Bit-oriented Protocol HDLC : High level Data Link Control Beginning and Ending Sequences 0 1 1 1 1 1 1 0 HDLC Frame Format
36
36 Chapter 2 Framing HDLC Protocol: bit stuffing On the sending side, after 5 1s (not sentinel) Insert 0 before transmitting the next bit On the receiving side 5 consecutive 1’s Next bit 0 : Stuffed, so discard it 1 : Either End of the frame marker Or Error has been introduced in the bitstream Look at the next bit If 0 ( 01111110 ) End of the frame marker If 1 ( 01111111 ) Error, discard the whole frame The receiver needs to wait for next 01111110 before it can start again
37
37 Chapter 2 Framing SONET: Synchronous Optical Networking Clock-based framing Each frame is 125us long STS-n (STS-1 = 51.84 Mbps ) Interleaved every byte: keep 51Mbps for each STS-1
38
38 Chapter 2 Error Detection Bit errors are introduced into frames Electrical interference, thermal noise, etc. Two aspects Detecting errors Correcting errors Two approaches
39
39 Chapter 2 Error Detection Bit errors are introduced into frames Electrical interference, thermal noise, etc. Two aspects Detecting errors Correcting errors Two approaches Notify the sender of error, sender re-sends OK for relatively error-free media Receiver detects and corrects errors Reconstructs the message
40
40 Chapter 2 Error Detection Common technique for detecting transmission error CRC (Cyclic Redundancy Check) Used in HDLC, DDCMP, CSMA/CD, Token Ring Other approaches Two Dimensional Parity (BISYNC) Checksum (IP)
41
41 Chapter 2 Error Detection Basic Idea: Add additional information to a frame that can be used to check for errors Extreme Case: transmit 2 copies of data Identical No error Different Error Problems? General case: k additional bits for n bit message, k << n Ethernet frame: 12K bits data, 32 bits CRC
42
42 Chapter 2 Error Detection Extra bits are redundant They add no new information to the message Derived from the original message using some algorithm Both the sender and receiver know the algorithm SenderReceiver Receiver computes r using m If they match, no error m r m r
43
43 Chapter 2 Simple (one-dimensional) parity Add extra bit to a 7-bit code to balance the number of 1s in the byte. Odd parity: If odd # of 1s in 1 st 7 bits, extra bit = 0, else 1 Even parity If even # of 1s in 1 st 7 bits, extra bit = 0, else 1
44
44 Chapter 2 Simple (one-dimensional) parity Add extra bit to a 7-bit code to balance the number of 1s in the byte. Odd parity: If odd # of 1s in 1 st 7 bits, extra bit = 0, else 1 Even parity If even # of 1s in 1 st 7 bits, extra bit = 0, else 1
45
45 Chapter 2 Two-dimensional parity Two Dimensional Parity
46
46 Chapter 2 Two-dimensional parity Two Dimensional Parity
47
47 Chapter 2 Two-dimensional parity Two Dimensional Parity
48
48 Chapter 2 Two-dimensional parity Two Dimensional Parity
49
49 Chapter 2 Two-dimensional parity Two Dimensional Parity catches all 1-, 2-, & 3-bit errors, most 4-bit errors
50
50 Chapter 2 Internet Checksum Algorithm Sender: add data words, transmit sum Receiver add data words, compare to sum Match: no error One’s complement addition: -x represented as x, inverted (0s 1s, 1s 0s) 5 = 0101, -5 = 1010; 3 = 0011, -3 = 1100 Carryout must be added to sum -5 + -3 = 1010 + 1100 = 0110 + 1 = 0111 8 = 1000, -8 = 0111
51
51 Chapter 2 Internet Checksum Algorithm Advantages? Disadvantages?
52
52 Chapter 2 Internet Checksum Algorithm Advantages: Simple, fast (addition) Disadvantages: What if one word is incremented via error, another word is decremented by error? Sum will be the same
53
53 Chapter 2 Cyclic Redundancy Check (CRC) Goal: Minimize # of extra bits, maximize protection Approach: polynomial arithmetic Example: represent 110001 as a polynomial: 1*x 5 + 1*x 4 + 0*x 3 + 0*x 2 + 0*x 1 + 1*x 0 = x 5 + x 4 + 1 (polynomial of degree 5). A k-bit frame has a maximum degree of k-1 Let M(x) be a message polynomial and C(x) be a generator polynomial.
54
54 Chapter 2 Cyclic Redundancy Check (CRC) Sender & Receiver agree on C(x) Let M(x) / C(x) leave a remainder of 0. Sender sends M(x) Receiver receives M’(x) = M(x) + E(x) E(x) is the error (possibly 0) Receiver computes M’(x) / C(x) if the remainder is zero, then no error
55
55 Chapter 2 Cyclic Redundancy Check (CRC) Polynomial Arithmetic Modulo 2: Any polynomial B(x) can be divided by a divisor polynomial C(x) if B(x) is of higher degree than C(x). Any polynomial B(x) can be divided once by a divisor polynomial C(x) if B(x) is of the same degree as C(x). The remainder obtained when B(x) is divided by C(x) is obtained by subtracting C(x) from B(x). To subtract C(x) from B(x), we simply perform the exclusive-OR (XOR) operation on each pair of matching coefficients.
56
56 Chapter 2 Cyclic Redundancy Check (CRC) Let M(x) be a frame with m bits Let C(x) be a polynomial of degree r (r < m) Recall: a k-bit frame has a maximum degree of k-1 Append r zero bits to the low-order end of the frame, so it now contains m+r bits and corresponds to the polynomial x r M(x). Example: M(x) = 10011010 C(x) = 1101 x r M(x) =
57
57 Chapter 2 Cyclic Redundancy Check (CRC) Let M(x) be a frame with m bits Let C(x) be a polynomial of degree r (r < m) Recall: a k-bit frame has a maximum degree of k-1 Append r zero bits to the low-order end of the frame, so it now contains m+r bits and corresponds to the polynomial x r M(x). Example: M(x) = 10011010 C(x) = 1101 x r M(x) = 10011010000
58
58 Chapter 2 Cyclic Redundancy Check (CRC) Using polynomial arithmetic (modulo 2) on bit string representations of polynomials: Divide x r M(x) by C(x) Subtract the remainder from x r M(x) Remainder is always r or fewer bits Addition & subtraction are the same in modulo 2 The result is M’(x), the checksummed frame to be transmitted.
59
59 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division M(x) = 10011010 x r M(x) = 10011010000 C(x) = 1101 r = 3
60
60 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division x r M(x) = 10011010000 C(x) = 1101
61
61 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division x r M(x) = 10011010000 C(x) = 1101
62
62 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division x r M(x) = 10011010000 C(x) = 1101
63
63 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division x r M(x) = 10011010000 C(x) = 1101
64
64 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division x r M(x) = 10011010000 C(x) = 1101
65
65 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division x r M(x) = 10011010000 C(x) = 1101
66
66 Chapter 2 Cyclic Redundancy Check (CRC) CRC Calculation using Polynomial Long Division Send M(x) – Remainder = M(x) XOR Remainder = 10011010101 x r M(x) = 10011010000 C(x) = 1101
67
67 Chapter 2 Cyclic Redundancy Check (CRC) Properties of Generator Polynomial (C(x)) P(x): message sent P(x) + E(x): message received If (P(x) + E(x)) % C(x) <> 0: Error Else [i.e., (P(x) + E(x)) % C(x) == 0]: E(x) = 0, i.e., no error C(x) is factor of E(x)
68
68 Chapter 2 Cyclic Redundancy Check (CRC) Properties of Generator Polynomial In general, it is possible to prove that the following types of errors can be detected by a C(x) with the stated properties All single-bit errors, as long as the x k and x 0 terms have nonzero coefficients. All double-bit errors, as long as C(x) has a factor with at least three terms. Any odd number of errors, as long as C(x) contains the factor (x+1). Any “burst” error (i.e., sequence of consecutive error bits) for which the length of the burst is less than k bits. (Most burst errors of larger than k bits can also be detected.)
69
69 Chapter 2 Cyclic Redundancy Check (CRC) Six generator polynomials that have become international standards are: CRC-8 = x 8 +x 2 +x+1 (100000111) CRC-10 = x 10 +x 9 +x 5 +x 4 +x+1 (11000110011) CRC-12 = x 12 +x 11 +x 3 +x 2 +x+1 (1100000001111) CRC-16 = x 16 +x 15 +x 2 +1 (11000000000000101) CRC-CCITT = x 16 +x 12 +x 5 +1 (10001000000100001) CRC-32 = x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x 11 +x 10 +x 8 +x 7 +x 5 +x 4 +x 2 +x+1 (100000100110000010001110110110111)
70
70 Chapter 2 Reliable Transmission CRC is used to detect errors. What should be done when frames have errors?
71
71 Chapter 2 Reliable Transmission CRC is used to detect errors. What should be done when frames have errors? Fix them (error correction codes) But overhead is typically too high Discard them Requires a recovery capability in protocol Recovery is accomplished using a combination of two fundamental mechanisms Acknowledgements and Timeouts
72
72 Chapter 2 Reliable Transmission ACK: a small control frame that a protocol sends back to its peer acknowledging that it received the earlier frame A control frame is a frame with header only (no data) If the sender does not receive an ACK after a reasonable amount of time (a timeout period), it retransmits the original frame. The general strategy of using acknowledgements and timeouts to implement reliable delivery is sometimes called Automatic Repeat reQuest (ARQ).
73
73 Chapter 2 Reliable Transmission What could possibly go wrong?
74
74 Chapter 2 Stop and Wait Protocol Timeline showing four different scenarios for the stop-and-wait algorithm. (a) The ACK is received before the timer expires; (b) the original frame is lost; (c) the ACK is lost; (d) the timeout fires too soon
75
75 Chapter 2 Stop and Wait Protocol Scenario: Sender Transmits frame, awaits ACK. No ACK received within timeout period, retransmits frame Receives ACK … which frame is being acknowledged? Receiver Receives frame, sends ACK … but it may be lost or delayed Receives another frame … is it original or new frame? Solution?
76
76 Chapter 2 Stop and Wait Protocol Scenario: Sender Transmits frame, awaits ACK. No ACK received within timeout period, retransmits frame Receives ACK … which frame is being acknowledged? Receiver Receives frame, sends ACK … but it may be lost or delayed Receives another frame … is it original or new frame? Solution? Sequence number to distinguish frames
77
77 Chapter 2 Stop and Wait Protocol Timeline for stop-and-wait with 1-bit sequence number
78
78 Chapter 2 Stop and Wait Protocol The sender has only one outstanding frame on the link at a time This may be far below the link’s capacity Consider a 1.5 Mbps link with a 45 ms RTT Delay bandwidth = 1,500,000 bps x 0.045 s = 67,500 bits or approximately 8 KB Sender can send only one frame per RTT Assume a frame size of 1 KB Maximum sending rate 8192 bits per frame 0.045 seconds per frame = 182 Kbps 182Kbps / 1.5Mbps = 0.12 ~ one-eighth of the link’s capacity How can we increase utilization?
79
79 Chapter 2 Stop and Wait Protocol The sender has only one outstanding frame on the link at a time This may be far below the link’s capacity Consider a 1.5 Mbps link with a 45 ms RTT Delay bandwidth = 1,500,000 bps x 0.045 s = 67,500 bits or approximately 8 KB Sender can send only one frame per RTT Assume a frame size of 1 KB Maximum sending rate 8192 bits per frame 0.045 seconds per frame = 182 Kbps 182Kbps / 1.5Mbps = 0.12 ~ one-eighth of the link’s capacity How can we increase utilization? Sender should transmit up to 8 frames before waiting for an ACK
80
80 Chapter 2 Sliding Window Protocol Timeline for Sliding Window Protocol
81
81 Chapter 2 Sliding Window Protocol Sender assigns SeqNum to each frame. Sender maintains 3 variables Sending Window Size (SWS) Max # of outstanding (un-ACKed) frames the sender can transmit Last Acknowledgement Received (LAR) SeqNum of the last acknowledgement received Last Frame Sent (LFS) SeqNum of the last frame sent Sender also maintains the following invariant LFS – LAR ≤ SWS
82
82 Chapter 2 Sliding Window Protocol Sender associates a timer with each frame it transmits Retransmits frame if timer expires before ACK is received When an ACK arrives: Sender increments LAR (moves LAR to right), thereby allowing the sender to transmit [at least] one more frame Note that the sender has to be willing to buffer (store) up to SWS frames WHY?
83
83 Chapter 2 Sliding Window Protocol Receiver also maintains 3 variables Receiving Window Size (RWS) Max # of out-of-order frames that the receiver is willing to accept Largest Acceptable Frame (LAF) SeqNum of the largest acceptable frame Last Frame Received (LFR) SeqNum of the last frame received Receiver also maintains the following invariant LAF – LFR ≤ RWS
84
84 Chapter 2 Sliding Window Protocol When SeqNum frame arrives: If SeqNum ≤ LFR or SeqNum > LAF Discard it (the frame is outside the receiver window) If LFR < SeqNum ≤ LAF Accept it Now the receiver needs to decide whether or not to send an ACK … and if so, which SeqNum to acknowledge
85
85 Chapter 2 Sliding Window Protocol Additional variable: SeqNumToAck The largest SeqNum not yet acknowledged, s.t. all frames with sequence numbers <= SeqNumToAck have been received Receiver acknowledges the receipt of SeqNumToAck even if higher-numbered frames have been received This acknowledgement is said to be cumulative. The receiver then sets LFR = SeqNumToAck LAF = LFR + RWS
86
86 Chapter 2 Sliding Window Protocol For example, suppose LFR = 5 and RWS = 4 (i.e. the last ACK that the receiver sent was for SeqNum 5) LAF = 5 + 4 = 9 If frames 7 and 8 arrive, they will be buffered because they are within the receiver window But no ACK will be sent since frame 6 is yet to arrive Frames 7 and 8 are out of order Frame 6 eventually arrives (may have been delayed or lost & then retransmitted) Now Receiver Acknowledges Frame 8 and bumps LFR to 8 and LAF to 12
87
87 Chapter 2 Issues with Sliding Window Protocol When timeout occurs, the amount of data in transit decreases Since the sender is unable to advance its window When the frame loss occurs, this scheme is no longer keeping the pipe full The longer it takes to notice that a loss has occurred, the more severe the problem becomes How to improve this?
88
88 Chapter 2 Issues with Sliding Window Protocol When timeout occurs, the amount of data in transit decreases Since the sender is unable to advance its window When the frame loss occurs, this scheme is no longer keeping the pipe full The longer it takes to notice that a loss has occurred, the more severe the problem becomes How to improve this: Negative Acknowledgement (NAK) Additional Acknowledgement Selective Acknowledgement
89
89 Chapter 2 Issues with Sliding Window Protocol Negative Acknowledgement (NAK) Receiver sends NAK for frame 6 when frame 7 arrives (in the previous example) However this is unnecessary since sender’s timeout mechanism will be sufficient to catch the situation Additional Acknowledgement Receiver sends additional ACK for frame 5 when frame 7 arrives Sender uses duplicate ACK as a clue for frame loss Selective Acknowledgement Receiver will acknowledge exactly those frames it has received, rather than the highest number frames Receiver will acknowledge frames 7 and 8 Sender knows frame 6 is lost Sender can keep the pipe full (additional complexity)
90
90 Chapter 2 Issues with Sliding Window Protocol How to select the window size SWS is easy to compute Delay Bandwidth RWS can be anything Two common setting RWS = 1 No buffer at the receiver for frames that arrive out of order RWS = SWS Receiver can buffer as many frames as the sender transmit Would it make sense to set RWS > SWS?
91
91 Chapter 2 Issues with Sliding Window Protocol Finite Sequence Number Frame sequence number is specified in header field Finite size 3 bits: 8 possible sequence numbers: 0, 1, 2, 3, 4, 5, 6, 7 It is necessary to wrap around
92
92 Chapter 2 Issues with Sliding Window Protocol How to distinguish between different incarnations of the same sequence number? # of possible sequence numbers > # of outstanding frames allowed Stop and Wait: One outstanding frame 2 distinct sequence number (0 and 1) Let MaxSeqNum be the # of available sequence numbers SWS + 1 ≤ MaxSeqNum Is this sufficient?
93
93 Chapter 2 Issues with Sliding Window Protocol SWS + 1 ≤ MaxSeqNum Is this sufficient? Depends on RWS If RWS = 1, then sufficient If RWS = SWS, then not good enough For example, suppose we have 8 sequence numbers 0, 1, 2, 3, 4, 5, 6, 7 RWS = SWS = 7 Sender sends 0, 1, …, 6 Receiver receives 0, 1, …,6 Receiver acknowledges 0, 1, …, 6 But: all ACKs (0, 1, …, 6) are lost
94
94 Chapter 2 Issues with Sliding Window Protocol SWS + 1 ≤ MaxSeqNum Is this sufficient? Depends on RWS If RWS = 1, then sufficient If RWS = SWS, then not good enough For example, suppose we have 8 sequence numbers 0, 1, 2, 3, 4, 5, 6, 7 RWS = SWS = 7 Sender sends 0, 1, …, 6 Receiver receives 0, 1, …,6 Receiver acknowledges 0, 1, …, 6 But: all ACKs (0, 1, …, 6) are lost Sender retransmits 0, 1, …, 6
95
95 Chapter 2 Issues with Sliding Window Protocol SWS + 1 ≤ MaxSeqNum Is this sufficient? Depends on RWS If RWS = 1, then sufficient If RWS = SWS, then not good enough For example, suppose we have 8 sequence numbers 0, 1, 2, 3, 4, 5, 6, 7 RWS = SWS = 7 Sender sends 0, 1, …, 6 Receiver receives 0, 1, …,6 Receiver acknowledges 0, 1, …, 6 But: all ACKs (0, 1, …, 6) are lost Sender retransmits 0, 1, …, 6 Receiver is expecting 7, 0, …., 5
96
96 Chapter 2 Issues with Sliding Window Protocol To avoid this, If RWS = SWS SWS < (MaxSeqNum + 1)/2
97
97 Chapter 2 Issues with Sliding Window Protocol Serves three different roles Reliable Preserve the order Each frame has a sequence number The receiver makes sure that it does not pass a frame up to the next higher-level protocol until it has already passed up all frames with smaller sequence numbers Frame control Receiver is able to throttle the sender Keeps the sender from overrunning the receiver Transmitting more data than the receiver is able to process
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.