Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.
-
Upload
bethanie-small -
Category
Documents
-
view
218 -
download
0
Transcript of Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.
![Page 1: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/1.jpg)
Spring 2001 CS 585 1
OutlineBuilding BlocksShannon’s TheoremEncoding
11. Physical Layer
![Page 2: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/2.jpg)
Spring 2001 CS 585 2
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
![Page 3: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/3.jpg)
Spring 2001 CS 585 3
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
![Page 4: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/4.jpg)
Spring 2001 CS 585 4
Shannon’s Theorem
• Example:– B : 300 Hz to 3300 Hz
– N/S = 30 dB
– C = 3000 log (1001) = 30 Kbps2
![Page 5: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/5.jpg)
Spring 2001 CS 585 5
Encoding
• Signals propagate over a physical medium– modulate electromagnetic waves
– e.g., vary voltage
• Schemes– NRZ
– NRZI
– Manchester
– 4B/5B
![Page 6: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/6.jpg)
Spring 2001 CS 585 6
OutlineFramingError DetectionSliding Window AlgorithmToken rings (FDDI)Wireless
12. Data Link Layer
![Page 7: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/7.jpg)
Spring 2001 CS 585 7
Data Link Layer
• 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
![Page 8: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/8.jpg)
Spring 2001 CS 585 8
Framing
• Break sequence of bits into a frame• Typically implemented by network adaptor
Frames
BitsAdaptor Adaptor Node BNode A
![Page 9: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/9.jpg)
Spring 2001 CS 585 9
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
Header Body
8 16 16 8
CRCBeginningsequence
Endingsequence
![Page 10: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/10.jpg)
Spring 2001 CS 585 10
Approaches (cont)
• Counter-based– include payload length in header– e.g., DDCMP
– problem: count field corrupted– solution: catch when CRC fails
SY
N
Header Body
8 8 4214 168
SY
N
Cla
ss CRCCount
![Page 11: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/11.jpg)
Spring 2001 CS 585 11
Approaches (cont)
• Clock-based– each frame is 125us long– e.g., SONET: Synchronous Optical Network– STS-n (STS-1 = 51.84 Mbps)
Overhead Payload
90 columns
9 rows
STS-1Hdr STS-1Hdr STS-1Hdr
STS-3cHdr
![Page 12: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/12.jpg)
Spring 2001 CS 585 12
Error Detection
• Parity• Two-dimensional parity• Internet Checksum• CRC
![Page 13: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/13.jpg)
Spring 2001 CS 585 13
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) = x7 + x4 + x3 + x1
• Let k be the degree of some divisor polynomial– e.g., C(x) = x3 + x2 + 1
• Modulo 2 operation (XOR)
![Page 14: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/14.jpg)
Spring 2001 CS 585 14
CRC (cont)
• Transmit polynomial P(x) that is evenly divisible by C(x) – shift left k bits, i.e., M(x)xk
– subtract remainder of M(x)xk / C(x) from M(x)xk
• 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)
![Page 15: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/15.jpg)
Spring 2001 CS 585 15
Selecting C(x)
• All single-bit errors, as long as the xk and x0 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)
![Page 16: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/16.jpg)
Spring 2001 CS 585 16
Sliding Window
• Stop and wait• Selective repeat• Go back N
![Page 17: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/17.jpg)
Spring 2001 CS 585 17
Acknowledgements & TimeoutsSender Receiver
Frame
ACK
Tim
eout
Tim
e
Sender Receiver
Frame
ACK
Tim
eout
Frame
ACKTim
eout
Sender Receiver
Frame
ACKTim
eout
Frame
ACKTim
eout
Sender Receiver
Frame
Tim
eout
Frame
ACKTim
eout
(a) (c)
(b) (d)
![Page 18: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/18.jpg)
Spring 2001 CS 585 18
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
Sender Receiver
![Page 19: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/19.jpg)
Spring 2001 CS 585 19
Sliding Window• Allow multiple outstanding (un-ACKed) frames• Upper bound on un-ACKed frames, called window
Sender Receiver
Tim
e
……
![Page 20: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/20.jpg)
Spring 2001 CS 585 20
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
LAR LFS
… …
![Page 21: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/21.jpg)
Spring 2001 CS 585 21
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 < = LFR or SeqNum > LFA discarded
• Send cumulative ACKs
RWS
LFR LFA
… …
![Page 22: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/22.jpg)
Spring 2001 CS 585 22
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
![Page 23: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/23.jpg)
Spring 2001 CS 585 23
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.
![Page 24: Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.](https://reader033.fdocument.org/reader033/viewer/2022051215/5697bf891a28abf838c8a2fa/html5/thumbnails/24.jpg)
Spring 2001 CS 585 24
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.