<<

Data Link Networks

Hardware Building Blocks

Nodes & Links

CS565 Data Link Networks 1 PROBLEM: Physically connecting Hosts 5 Issues 4 Technologies • Encoding • Point-to-point Links - encoding for physical medium • CSMA (Carrier Sense • Framing Multiple Access) - delineation of bit stream - • Error Detection Network Card - IEEE 802.3 - identify frame errors • Token Ring • Reliable Delivery - FDDI - link integrity despite errors - IEEE 802.5 • Media Access Control • - multiple host access - IEEE 802.11

CS565 Data Link Networks 2 Nodes

general-purpose computers; e.g., desktop workstations, special- purpose hardware, CPU PC

Network Cache (To network) adaptor

I/O • Finite memory Memory • Connects to network via a network adaptor • Fast processor, slow memory

CS565 Data Link Networks 3 Network Memory • Moore’s Law – Doubling processor speeds in 18 months • Memory Latency – Only 7% improvement each year • Network nodes run at memory speeds, not CPU speeds • Memory accesses needed to be considered carefully • Two scarce resources: and memory

CS565 Data Link Networks 4 Links

f (Hz) 100 102 104 106 108 1010 1012 1014 1016 1018 1020 1022 1024

RadioMicrowave Infrared UV X ray Gamma ray

104 105 106 107 108 109 1010 1011 1012 1013 1014 1015 1016

Satellite Fiber optics Coax

AMFM Terrestrial microwave TV

Electromagnetic Spectrum

CS565 Data Link Networks 5 Links Sometimes you install your own

Category 5 twisted pair 10-100Mbps, 1 50-ohm coax (ThinNet) 10-100Mbps, 2 75-ohm coax (ThickNet) 10-100Mbps, 5 Multimode fiber 100Mbps, 2km Single-mode fiber 100-2400Mbps Sometimes leased from the phone company

Service to ask for Bandwidth you get ISDN 64 Kbps T1 1.544 Mbps T3 44.736 Mbps STS-1 51.840 Mbps STS-3 155.250 Mbps STS-12 622.080 Mbps STS-24 1.244160 Gbps STS-48 2.488320 Gbps (Note: T1 also called DS1, STS-1 also called OC-1)

CS565 Data Link Networks 6 Last-Mile Links

• From home to the network service provider.

Service Bandwidth POTS 28.8-56 Kbps (Plain Old Telephone Service) ISDN 64-128 Kbps (Integrated Services Digital Network) xDSL 16 Kbps-55.2Mbps (Digital Subscriber Line) CATV 20-40 Mbps (CAble TV)

CS565 Data Link Networks 7 Point-to-Point Links • Encoding • Framing • Error Detection • Reliable Transmission

CS565 Data Link Networks 8 Encoding • Signals propagate over a physical medium – modulate electromagnetic waves by varying the voltage

• Network adaptor handles encoding – Encoded bits to signals (sending) – Decodes signals to bits (receiving)

CS565 Data Link Networks 9 Adaptors

Signalling component

Signal NodeAdaptor Adaptor Node

Bits

Signal travel between signalling components; Bits flow between adaptors

CS565 Data Link Networks 10 Modem and Codec

Modem = Modulator + Demodulator Codec = Encoder + Decoder

Encoder Modulator Demodulator Decoder

Media

CS565 Data Link Networks 11 NRZ Encoding • Encode binary data onto signals – e.g., 0 as low signal and 1 as high signal – known as Non-Return to zero (NRZ) Bits 0010111101000010

NRZ Problem: Consecutive 1s or 0s – Low signal (0) may be interpreted as no signal – High signal (1) leads to baseline wander – Unable to recover clock

CS565 Data Link Networks 12 Alternative Encodings • Non-return to Zero Inverted (NRZI) – make a transition from current signal to encode a one; stay at current signal to encode a zero – solves the problem of consecutive ones

• Manchester – transmit XOR of the NRZ encoded data and the clock – only 50% efficient.

CS565 Data Link Networks 13 4-Bit 5-bit Symbol Code Encodings (cont)

0000 11110 0001 01001 •4B/5B 0010 10100 0011 10101 – every 4 bits of data encoded in 0100 01010 a 5-bit code 0101 01011 0110 01110 – 5-bit codes selected to have no 0111 01111 1000 10010 more than one leading 0 and 1001 10011 no more than two trailing 0s 1010 10110 1011 10111 – thus, never get more than 1100 11010 three consecutive 0s 1101 11011 1110 11100 – resulting 5-bit codes are 1111 11101 transmitted using NRZI Others: 11111 – idle – achieves 80% efficiency 00000 – dead …

CS565 Data Link Networks 14 Encodings (cont)

Bits 0010111101000010

NRZ

Clock

Manchester

NRZI

CS565 Data Link Networks 15 Framing

Bits Node A Adaptor Adaptor Node B

Frames • Packet-switched networks – Break sequence of bits into frames (blocks of data) • What set of bits constitute a frame? – Where the frame begins? Central challenge – Where the frame ends? - Use different protocols • Typically implemented by network adaptor • Adaptor fetches (deposits) frames out of (into) host memory CS565 Data Link Networks 16 Framing Protocol • Byte-oriented – View each frame as a collection of bytes (characters) – Sentinel approach • BISYNC (Binary Synchronous Communication) protocol - IBM – Byte counting • DDCMP ( Digital Message Protocol) protocol - DEC • Bit-oriented – HDLC (High-Level Data Link Control) Protocol – IBM and then ISO • Clock-based – SONET (Synchronous Optical Network) – Bellcore and then ANSI

CS565 Data Link Networks 17 Byte-Oriented - Sentinel Approach – Frame begins at SYN (Synchronization) – Sentinel values between body • STX = Start of text • ETX = End of text – CRC (Cycle Redundancy Check) – checks for errors 888 8 816

Header Body CRC ETX STX SYN SYN SOH BISYNC frame format (Binary Synchronous Communication) – IBM

– problem: ETX character might appear in the data portion of the frame • solution: Character stuffing – Escape the ETX character with a DLE (data line escape) character in BISYNC

CS565 Data Link Networks 18 Byte-Oriented – Byte-Counting Approach

– COUNT field specifies how many bytes contained in a frame

888 14 42 16

Count Header Body CRC SYN SYN Class

DDCMP frame format ( Digital Data Communication Message Protocol) - DEC

CS565 Data Link Networks 19 Bit-Oriented

– Denote the beginning/end of a frame with the distinguished bit sequence 0111110

816 16 8 Beginning Ending Header Body CRC sequence sequence HDLC frame format (High-level Data Link Control) – IBM and then ISO – problem: the pattern 01111110 could appear anywhere in the body of the frame • solution: Bit Stuffing - When it is located in the body, it is preceded with an escape sequence of bits (like an escape character in C)

CS565 Data Link Networks 20 Clock-Based – each frame is 125s long  At STS-1 (= 51.84 Mbps) rate, 810B long – e.g., SONET: Synchronous Optical Network – ITU standard for transmission over fiber –STS-n (STS-1 = 51.84 Mbps) Overhead Payload STS-1 STS-1 STS-1 Hdr Hdr Hdr

9 rows

Hdr STS-3c 90 columns c - concatenated – Each frame is 810 bytes long

Data Link Networks 21 CS565 Error

• Long history of dealing with bit errors – Hamming – Reed/Solomon • Detecting Error is only one part of the problem, the other part is correcting errors • Two methods of error correction – Have the message retransmitted – Error-correcting codes ( that all the recipient to reconstruct the correct message)

CS565 Data Link Networks 22 Error Detection

• Basic idea – add extra (redundant) bits to a frame that can be used to determine if errors have been introduced. • Ethernet: 1500B data requires only 32-bits (CRC-32) • Sender applies to the message to come up with the extra bits • Receiver uses the same algorithm to check if the calculation comes up with the same result • Common error-detecting codes – Two-dimensional parity (ASCII) (link-level) – () (not link-level) – CRC, Cyclic Redundancy Check, (link-level)

CS565 Data Link Networks 23 Two-Dimensional Parity

0101001 1

• Catch all 1,2,3-bit 1101001 0 and most 4-bit errors 1011110 1 Used by BISYNC • In this example, use Data protocol (IBM) to 14 redundant bits for 0001110 1 transmitting ASCII characters a 42-bit message, 0110100 1 which is much better than the obvious way 1011111 0 of sending two Parity copies of the same 1111011 0 data byte Parity bits

CS565 Data Link Networks 24 Internet Checksum Algorithm • Not used in link-level (unlike parity and CRC) • Sender adds up all the word and then transmit the result of that sum (Checksum) • Received adds up all the words and compares its checksum to the sender’s checksum • Algorithm for the Internet 1. Treat the data as a sequence of 16-bit integers. Add the 16-bit integers using 16-bit ones complement arithmetic 2. take the ones complement of the result. That 16-bit number is the checksum.

CS565 Data Link Networks 25 CRC - Cyclic Redundancy Check

• Add k bits of redundant data to an n-bit message –want k << n – e.g., Ethernet: k = 32 and n = 12,000 (1500 bytes) •Represent n-bit message as n-1 degree – 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 when k = 3

CS565 Data Link Networks 26 CRC - Cyclic Redundancy Check

• 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) – error in the transmission) – 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)

CS565 Data Link Networks 27 CRC Example: k=3 Original Message M(x) 11111001 Generator 1101 10011010000 Message & k bits of 0 C(x) 1101 M(x)xk 1001 • Perform logical XOR 1101 • Once the reminder is obtained, 1000 subtract it from M(x)xk, this can 1101 be accomplished with the XOR 1011 10011010000 – 101 1101 = 10011010101 1100 • Send this message 1101 • Recipient divides received 1000 message by C(x), if the reminder 1101 is 0  no error (most likely) 101 Remainder M(x)xk / C(x)

CS565 Data Link Networks 28 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

CS565 Data Link Networks 29 Common CRC Divisor

CRC C(x) 8 2 1 CRC-8 (ATM) x +x +x +1 10 9 5 4 1 CRC-10 (ATM) x +x +x +x +x +1 CRC-12 x12+x11+x3+x2+x1+1 CRC-16 x16+x15+x2+1 CRC-CCITT x16+x12+x5+1 (HDLC) x32+x26+x23+x22+x16+x12+x11+x10+x CRC-32 8 7 5 4 2 (Ethernet) +x +x +x +x +x+1

CSC 550 Data Link Networks 30