Download presentation
Presentation is loading. Please wait.
Published byBethanie Small Modified over 9 years ago
1
Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer
2
Spring 2001CS 5852 Building Blocks Node –Network Adaptor (memory is the speed bottleneck) –Router (input ports, switch fabric, output ports) Links –C = f λ –Cables –Leased Lines: T1(DS1), T3(DS3), OC-1(STS-1),OC- 3(STS-3),OC-48(STS-48,2.48Gbps) –Last mile links: modem, xDSL, ISDN, cable modem
3
Spring 2001CS 5853 Shannon’s Theorem C = B log (1+S/N) –C: channel capacity, in bps –B: bandwidth, in hertz –S: average signal power –N: average noise power dB = 10 * log (S/N) –dB: signal-noise ratio expressed in decibels 2 10
4
Spring 2001CS 5854 Shannon’s Theorem Example: –B : 300 Hz to 3300 Hz –N/S = 30 dB –C = 3000 log (1001) = 30 Kbps 2
5
Spring 2001CS 5855 Encoding Signals propagate over a physical medium –modulate electromagnetic waves –e.g., vary voltage Schemes –NRZ –NRZI –Manchester –4B/5B
6
Spring 2001CS 5856 Outline Framing Error Detection Sliding Window Algorithm Token rings (FDDI) Wireless 12. Data Link Layer
7
Spring 2001CS 5857 Data Link Layer –Framing –Error Detection –Sliding Window (reliable transmission, flow control) Medium Access Control (MAC) Sub-Layer –Token ring (FDDI) –Wireless Logical Link Control (LLC) : IEEE802.2
8
Spring 2001CS 5858 Framing Break sequence of bits into a frame Typically implemented by network adaptor Frames Bits Adaptor Node BNode A
9
Spring 2001CS 5859 Approaches Sentinel-based –delineate frame with special pattern: 01111110 –e.g., HDLC, SDLC, PPP –problem: special pattern appears in the payload –solution: bit stuffing sender: insert 0 after five consecutive 1s receiver: delete 0 that follows five consecutive 1s HeaderBody 816 8 CRC Beginning sequence Ending sequence
10
Spring 2001CS 58510 Approaches (cont) Counter-based –include payload length in header –e.g., DDCMP –problem: count field corrupted –solution: catch when CRC fails
11
Spring 2001CS 58511 Approaches (cont) Clock-based –each frame is 125us long –e.g., SONET: Synchronous Optical Network –STS-n (STS-1 = 51.84 Mbps)
12
Spring 2001CS 58512 Error Detection Parity Two-dimensional parity Internet Checksum CRC
13
Spring 2001CS 58513 Cyclic Redundancy Check (CRC) Add k bits of redundant data to an n-bit message –want k << n –e.g., k = 32 and n = 12,000 (1500 bytes) Represent n-bit message as n-1 degree polynomial –e.g., MSG=10011010 as M(x) = x 7 + x 4 + x 3 + x 1 Let k be the degree of some divisor polynomial –e.g., C(x) = x 3 + x 2 + 1 Modulo 2 operation (XOR)
14
Spring 2001CS 58514 CRC (cont) Transmit polynomial P(x) that is evenly divisible by C(x) –shift left k bits, i.e., M(x)x k –subtract remainder of M(x)x k / C(x) from M(x)x k Receiver polynomial P(x) + E(x) –E(x) = 0 implies no errors Divide (P(x) + E(x)) by C(x); remainder zero if: –E(x) was zero (no error), or –E(x) is exactly divisible by C(x)
15
Spring 2001CS 58515 Selecting C(x) All single-bit errors, as long as the x k and x 0 terms have non-zero coefficients. All double-bit errors, as long as C(x) contains 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 See Table 2.6 on page 102 for common C(x)
16
Spring 2001CS 58516 Sliding Window Stop and wait Selective repeat Go back N
17
Spring 2001CS 58517 Acknowledgements & Timeouts
18
Spring 2001CS 58518 Stop-and-Wait Two sequence numbers (0 and 1) Problem: keeping the pipe full Example –1.5Mbps link x 45ms RTT = 67.5Kb (8KB) –1KB frames imples 1/8th link utilization SenderReceiver
19
Spring 2001CS 58519 Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window SenderReceiver T ime … …
20
Spring 2001CS 58520 SW: Sender Assign sequence number to each frame ( SeqNum ) Maintain three state variables: –send window size ( SWS ) –last acknowledgment received ( LAR ) –last frame sent ( LFS ) Maintain invariant: LFS - LAR <= SWS Advance LAR when ACK arrives Buffer up to SWS frames SWS LARLFS ……
21
Spring 2001CS 58521 SW: Receiver Maintain three state variables –receive window size ( RWS ) –largest frame acceptable ( LFA ) –last frame received (LFR) Maintain invariant: LFA - LFR <= RWS Frame SeqNum arrives: –if LFR < SeqNum < = LFA accept –if SeqNum LFA discarded Send cumulative ACKs RWS LFR LFA ……
22
Spring 2001CS 58522 Sequence Number Space SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger then number of outstanding frames SWS <= MaxSeqNum-1 is not sufficient –suppose 3-bit SeqNum field (0..7) –SWS=RWS=7 –sender transmit frames 0..6 –arrive successfully, but ACKs lost –sender retransmits 0..6 –receiver expecting 7, 0..5, but receives second incarnation of 0..5 SWS < (MaxSeqNum+1)/2 is correct rule Intuitively, SeqNum “slides” between two halves of sequence number space
23
Spring 2001CS 58523 Selective Repeat At the receiver, it will send an ack for each frame received, even if the frame is out of order. The sender sets a timeout value for each frame sent out, and will resend the frame upon timeout. The timeout flag is cleared when an ack for the frame is received. Only those frames (or acks for them) are lost are retransmitted. The receiver may need a large buffer to hold out of order frames.
24
Spring 2001CS 58524 Go Back N At the receiver, it will send an ack for each frame received, only if the frame is out of order. Out of order frames are discarded. It also sends a NAK when it finds a frame is lost. The timer mechanism is the same. The acks are cumulative in the sense that an ack indicates that the receiver has got all the frames up to the frame acked. The sender will resend all the frames starting from the frame for which a NAK is received. The receiver does not need a large buffer to hold out of order frames.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.