Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Computer Networks Chapter 2: Direct Link Networks.

Similar presentations


Presentation on theme: "Advanced Computer Networks Chapter 2: Direct Link Networks."— Presentation transcript:

1 Advanced Computer Networks Chapter 2: Direct Link Networks

2 Direct Link (Point-to-Point) Networks Simplest network possible, consisting of two hosts and one link Look into different function at the link level – Encoding – Framing – Error detection/correction – Reliable delivery – Media access control Host A physical Link 2 Host B

3 2.1.1 Nodes 3 Figure 2.1: Example workstation architecture Figure 2.3: Memory bandwidth on a modern PC-class machine

4 2.1.2 Links Cables Leased Lines Last-Mile Links Wireless Links 4 Figure 2.4: Electromagnetic Spectrum

5 Physical Medium Signals travel through the medium and represent bits. Shannon’s Capacity Theorem C = B log 2 (1+S/N) Defines the upper bound on the link capacity C in Hz. Can be used to evaluate the “error-free” bandwidth of a line 5

6 Shannon’s Theorem: Example Voice-grade phone line: B =3,300 -300 Hz = 3 KHz Typical SNR = 30 dB, where dB = 10 x log 10 (S/N) For 30 dB  S/N =1,000 C = 3,000 x log 2 (1+1,000) ≈ 30 Kbps Higher bandwidth B (in Hz), higher capacity Higher S/N, higher capacity Can we have unlimited capacity? 6

7 Shannon’s Theorem: Example 2 Can the signal be weaker than the noise? Assume capacity of 50 KHz (approx 50Kbps) over 1MHz The required SNR would then be C = B log 2 (1+S/N) S/N = 2 C/B - 1 = 0.035 or -14.5 dB Think of spread spectrum communications Transmit a weak signal over a large bandwidth 7

8 2.2 Encoding Map binary bits into signals 8 Figure 2.8 Signals (electrical, electromagnetic) travel between signaling components; bit flow between adaptors

9 2.2 Encoding (Contd.) Example: Low signal represents a 0, high signal represents a 1 Non Return-to-Zero (NRZ) Problem: Long periods of silence (zero) or high signals are possible – Baseline wander (receiver loses track of reference sig) – Clock recovery (receiver loses clock synchronization) 9

10 Encoding: More Schemes NRZ Inverted (NRZI): Switch from current state to represent a 1 Manchester: XOR the bit stream with the clock 10

11 4B/5B Encoding Scheme Encode 4-bit symbols into 5-bit Codes 2 4 symbols must be mapped to 2 4 code-words out of the possible 2 5. Table 2.4, Page 83. Each codeword has no more than one starting zero, and no more than two trailing zeros No more than 3-consequtive zeros Then use NRZI to solve the consecutive 1s problem 80% efficiency (1 bit is overhead) 11

12 2.3 Framing The process of grouping bits into frames (messages or packets) Typically implemented by the network adaptor 12

13 Byte-Oriented Framing In such protocols, frame is collection of bytes Need to indicate the beginning and end of a frame Example: Point-to-Point (PPP) protocol, used by IP – Start of Text: Flag: 01111110 – Address and Control field usually carry default values – Protocol: IP or IPX Start of header – Payload: 1,500 bytes – Checksum: 2 or 4 bytes 13 Overhead: 8/1508 =0.5%

14 Byte-counting Framing Include the # of bytes in the frame as a field in the header Digital Data Communications Protocol (DDCMP) Count: Specifies # of bytes in the body CRC ensures that count field is not corrupted 14

15 Bit-oriented Framing High-Level Data Link Control (HDLC) Beginning/end of frame, flag: 01111110 Instead of inserting bytes do bit stuffing to avoid detection of flag in data. Sender adds a 0 after five consecutive 1s Receiver removes zero after five 1s 15

16 Example of Bit-stuffing Sender – 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 Receiver – 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 Length of frame – Variable, depends on the data – We can calculate and optimize the overhead of bit stuffing 16 00 0 0 x xx x

17 2.3.3 Clock-Based Framing (SONET) SONET: Synchronous Optical Network Ninety rows of nine bytes each First three bytes of each rare overhead Data XORed with known sequence to ensure synchronization 17 Figure 2.16: A SONET Synchronous Transport Signal (STS)-1: Frame (51.84 Mbps)

18 2.4 Error Detection Types of errors – Isolated errors: Bit errors that do not affect other bits – Burst errors: A cluster of bits in which a number of errors occur Burst errors increase with data rate – 1μs of impulse noise or fading effect will affect At most 2 bits when data rate is 1Mbps At most 101 bits when data rate is 100Mbps 18

19 Dealing with Errors Receiver must be aware that an error occurred in a frame – Need to have an error detection mechanism Receiver must receive the correct frame Two possible strategies – Add information redundancy to correct errors (error correcting codes) – Ask sender to re-send frame (retransmission strategies). In practice both are employed 19

20 Error Detection Methods Single parity checks – Append a single parity bit at end of frame. Parity is 1 if # of ones is odd, and zero otherwise – Example: 0 1 1 0 1 0 1 0 1 1 0 0 ← parity – Single parity check can detect any odd # of errors – Cannot tell where the error took place or how many occurred – Not useful for burst errors 20

21 Two-dimensional Parity Arrange bits of a frame into a two dimensional array Can detect all 1-, 2-, and 3-bit errors, and most 4-bit errors but not all Can also correct 1-bit errors, if it is known that a one-bit error occurred 21 10010101 01110100 11100010 10001110 00110011 10111110

22 Checksum Treat data as 16-bit words Add all words complement one and then append the sum at the end of data Complement one arithmetic – Negative numbers are inverted positive ones – Carry from MSB is added to the result – Example : (-5) + (-3) = (-0101)+(-0011) = (1010) +(1100) = 0110 + 1 = 0111 = ones complement of 8 What type of errors can remain undedected? 22

23 Cyclic Redundancy Check (CRC) Add k redundant bits on a n-bit message – Design goal k<<n so that overhead is low – Example: 32-bit CRC adequate for 12,000 bits (1,500) bytes Represent (n+1)-bit messages as n degree polynomials Example: 10011010 maps to x 7 + x 4 + x 3 + x 1 The bits of the message to be transmitted become the coefficients of the polynomial 23

24 Polynomial Arithmetic Facts: – Any polynomial B(x) is divisible by a polynomial C(x) if deg(B) ≥ deg(C). C(x) is called the divisor – If C(x) and B(x) are of the same degree, the remainder is obtained by subtracting C(x) from B(x) – Modulo 2 arithmetic, subtraction is an XOR operation between coefficients Example B(x) = x 3 + 1, C(x) = x 3 + x 2 + 1 Remainder: R(x) = x 2 B(x) = 1001, C(x) =1101, R(x) = 0100 (XOR of B(x), C(x)) 24

25 CRC Calculation Goal: For message M(x), and divisor C(x), construct polynomial P(x) that is divisible by C(x) C(x) known to both sender and receiver Process – Step 1: multiply M(x) by x k (add k zeros at the end of message) and obtain T(x) – Step 2: Divide T(x) by C(x) – Step 3: Subtract the remainder R(x) from T(x). – Step 4: Obtain P(x) = M(x)|R(x) divisible by C(x) 25

26 Example: CRC Calculation M = 10011010, C(x) = x 3 + x 2 +1 T(x) = 10011010 | 0000 R(x) = 101 P(x) = 10011010 | 101 26

27 Selection of C(x) Bit errors can be seen as a polynomial E(x) added to P(x) Error remains undetected if E(x) not divisible by C(x) Single-bit errors: E(x) = x i, x k, x 0 coefficients are nonzero, all single-bit errors detected Double-bit errors: C(x) has a factor with at least 3 terms Odd number errors: C(x) contains the factor (x+1) Any burst error of less than k bits and most burst errors of larger than k bits 27

28 Commonly Used CRCs CRCC(x)C(x) CRC-8x 8 + x 2 + x + 1 CRC-10x 10 + x 9 + x 5 + x 4 + x + 1 CRC-12x 12 + x 11 + x 3 + x 2 + 1 CRC-16x 16 + x 15 + x 2 + 1 CRC-CCITTx 16 + x 12 + x 5 + 1 CRC-32x 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 28

29 Fundamentals of Coding Coding: Map an k-bit word to an n-bit word. – Notation: This code is usually referred to as (n,k)-code Weight of a word: The number of ones in the word. – Ex.: W(100011101)= 5 Hamming distance between x, y: d(x,y) = W(x  y) – Ex. x = 10011101, y = 11100110, d = 6 # words at a hamming distance d: # words at a distance up to d: Minimum distance: the minimum Hamming distance out of all distances in a code 29

30 Detecting and Correcting Errors An (n, k)-code can detect (n-k) / can detect up to n-k-1 errors and correct up to n-k/2 errors Example – Hamming (7,4)-code, can detect any single or two bit errors, and correct any single bit error Well known codes – Hamming codes – Reed-Solomon codes: used in DSL, WiMax, CD, DVD, Blue-Ray Discs 30


Download ppt "Advanced Computer Networks Chapter 2: Direct Link Networks."

Similar presentations


Ads by Google