Direct Link Networks I Hardware Building Blocks nodes
Direct Link Networks (I) Hardware Building Blocks (nodes & links) n 5 Issues before Exchanging Packets n ¨ Encoding ¨ Framing ¨ Error Detection ¨ Reliable Transmission ¨ Medial Access Control EE 4272 Spring 2004
Hardware Building Blocks: Nodes § Assume general-purpose (programmable) computers; e. g. , . Sometimes replaced with specialpurpose hardware. n n n Finite memory (implies limited buffer space) Connects to network via a. Fast processor, slow memory (bottleneck of computer) EE 4272 Spring 2004
Hardware Building Blocks: Links n Sometimes you install your own n Sometimes leased from the phone company n Reading Assignment: P 67 -P 75 EE 4272 Spring 2004
Encoding propagate over a physical medium n ¨ modulate electromagnetic waves ¨ e. g. , vary voltage EE 4272 Spring 2004
Encoding (Cont): NRZ n Encode binary data onto signals ¨ e. g. , 0 as low signal and 1 as high signal ¨ known as Non-Return to zero (NRZ) n Problem of NRZ code: ¨ Low signal (0) may be interpreted as no signal ¨ High signal (1) leads to. ¨ Unable to recover. EE 4272 Spring 2004 .
Alternatives: NRZI and Manchester n Non-return to Zero Inverted (NRZI): ¨ n Make a transition from the current signal to encode a 1, and stay at the current signal to encode a 0; Manchester: ¨ Transmits the XOR of the encoded data and the clock; only 50% efficient (baud rate=modulation rate). EE 4272 Spring 2004 .
4 B/5 B Encoding § every 4 bits of data encoded in a code § 5 -bit codes selected to have no more than one leading 0 and no more than two trailing 0 s § thus, never get more than § resulting 5 -bit codes are transmitted using § achieves 80% efficiency EE 4272 Spring 2004 . .
Framing Break sequence of bits into a n Typically implemented by network n EE 4272 Spring 2004 . .
Framing Approaches: determine where the frame begins & ends n Sentinel-based ¨ delineate frame with special pattern: 01111110 ¨ e. g. , HDLC, SDLC, PPP 8 Beginning sequence 16 Header 16 Body CRC 8 Ending sequence ¨ problem: special pattern appears in the payload ¨ solution: . sender: insert 0 after five consecutive 1 s n receiver: delete 0 that follows five consecutive 1 s n if next bits are 10: end-of-frame marker ¨ if next bits are 11: error ¨ EE 4272 Spring 2004
Framing Approaches (cont) n Counter-based ¨ include payload length in header ¨ e. g. , DDCMP ¨ problem: ¨ solution: EE 4272 . catch when CRC fails Spring 2004
Framing Approaches (cont) n Clock-based ¨ each frame is long ¨ e. g. , SONET: Synchronous Optical Network ¨ STS-n (STS-1 = ) EE 4272 Spring 2004
Error Detection: Two-Dimensional Parity EE 4272 Spring 2004
Error Detection: Internet Checksum Algorithm n Basic Idea: ¨ Add up all the words that are transmitted and then transmit the result of that with the data. The receiver the same way and the result with the received data. n One of the implementations: ¨ view message as a. Add these integers together using 16 -bit , and then take the ones complement of the result. That 16 -bit number is the. EE 4272 Spring 2004
Cyclic Redundancy Check n Theoretical Foundation: a branch of mathematics called. n Add k bits of redundant data to an n-bit ¨ want k << n ¨ e. g. , k = 32 and n n n = 12, 000 (1500 bytes) Represent n-bit message as n-1 degree ¨ e. g. , EE 4272 . MSG=10011010 as M(x) = x 7 + x 4 + x 3 + x 1 Let k be the degree of some ¨ e. g. , . C(x) = x 3 + x 2 + 1 Spring 2004 .
CRC (cont) n Transmit polynomial P(x) that is C(x) by ¨ shift left k bits ( k is the degree of C(x) ), i. e. , M(x). k ¨ subtract remainder of M(x). k/C(x) from M(x). k n Receiver polynomial P(x) + ¨ E(x) n . = 0 implies no errors Divide (P(x) + E(x)) by C(x); remainder zero if: ¨ E(x) was ¨ E(x) is exactly EE 4272 , or by C(x) Spring 2004
Selecting C(x) n All single-bit errors, as long as the xk and x 0 terms have. n All with at least n Any factor (x + 1) n Any error (i. e. , sequence of consecutive error bits) for which the length of the burst is less than k bits. n Most burst errors of larger than k bits can also be detected n See Table 2. 5 on page 96 for common C(x) EE 4272 , as long as C(x) contains a factor. , as long as C(x) contains the Spring 2004
Reliable Transmission n Recover from Corrupt Frames ¨ ; also called Forward Error Correction (FEC) ¨ and Timeouts; also called Automatic Repeat Request (ARQ) EE 4272 Spring 2004
Stop-and-Wait Sender n n Receiver Problem: only one at a time (one frame per RTT) can not keep the pipe full Example 1. 5 Mbps link x 45 ms RTT = 67. 5 Kb (8 KB) (delay X bandwidth product) ¨ 1 KB frames implies 1/8 th link utilization ¨ EE 4272 Spring 2004
Sliding Window n Basic Idea: ¨ Allow sender to transmit before receiving an , thereby keeping the pipe full. There is an upper limit (called ) on the number of (un-ACKed) frames allowed. Sender Receiver … N … … Time 1 2 3 EE 4272 Spring 2004
SW: Sender n n Assign sequence number to each frame (Seq. Num) Maintain three state variables: send window size (SWS) ¨ sequence # of last acknowledgment received (LAR) ¨ sequence # of last frame sent (LFS) ¨ n Maintain invariant: LFS - LAR <= SWS at all time £ SWS … … LAR n n LFS Advance/update LAR when ACK arrives to allow a new frame be sent Buffer up to SWS frames for retransmission if needed EE 4272 Spring 2004
SW: Receiver n Maintain three state variables (RWS): upper bound on the # of out ¨ -of-order frames ¨ sequence # of n (LAF) (LFR) Maintain invariant: LAF - LFR <= RWS £ RWS … … LFR n Frame ¨ ¨ n LAF arrives: if LFR < Seq. Num < = LAF accept if Seq. Num < = LFR or Seq. Num > LFA Mechanism of Sending cumulative ¨ ¨ LFR = Seq. Numto. Ack LAF = LFR + RWS EE 4272 Spring 2004 discarded .
Sequence Number Space n Seq. Num field is n Sequence number space must be outstanding frames n SWS <= Max. Seq. Num-1 is not sufficient ¨ ¨ ¨ n ; sequence numbers wrap around (reuse) than number of suppose 3 -bit Seq. Num 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 < (Max. Seq. Num+1)/2 is correct rule when EE 4272 Spring 2004 .
- Slides: 22