Direct Lik Networks - Ecodig Readig: Peterso ad Davie, Chapter 2 Sprig 2018 CS 438 Staff, Uiversity of Illiois 1
Where are we? Applicatio Layers BitTorret (P2P) HTTP (Web) Skype (VOIP) IPTV (streamig media) Trasport TCP UDP Network IP Today Data Lik Physical Etheret 4G DSL WiFi Sprig 2018 CS 438 Staff, Uiversity of Illiois 2
Direct Lik Networks All hosts are directly coected by a physical medium Key poits Ecodig ad Modulatio Framig Error Detectio Medium Access Cotrol Sprig 2018 CS 438 Staff, Uiversity of Illiois 3
Iteret Protocols Ecodig Framig, error detectio, medium access cotrol Applicatio Presetatio User-level software Sessio Trasport Network Kerel software (device driver) Data Lik Physical Hardware (etwork adapter) Sprig 2018 CS 438 Staff, Uiversity of Illiois 4
Direct Lik Networks - Outlie Hardware buildig blocks Ecodig Framig Error detectio Multiple access media (MAC examples) Network adapters Sprig 2018 CS 438 Staff, Uiversity of Illiois 5
Hardware Buildig Blocks Nodes Hosts: geeral purpose computers Switches: typically special purpose hardware Routers: varied Sprig 2018 CS 438 Staff, Uiversity of Illiois 6
Nodes: Workstatio Architecture Fiite memory Scarce resource Rus at memory speeds, NOT processor speeds Processor Cache memory bus (MBUS) Memory iput/output bus (I/O BUS) NETWORK Network Adaptor Sprig 2018 CS 438 Staff, Uiversity of Illiois 7
Hardware Buildig Blocks Liks Physical medium Copper wire with electroic sigalig Glass fiber with optical sigalig Wireless with electromagetic (radio, ifrared, microwave) sigalig Two cups ad a strig Sprig 2018 CS 438 Staff, Uiversity of Illiois 8
Liks - Copper Copper-based Media more twists, less crosstalk, better sigal over loger distaces Category 5/6 Twisted Pair 10-1Gbps 100m ThiNet Coaxial Cable 10-100Mbps 200m ThickNet Coaxial Cable 10-100Mbps 500m twisted pair coaxial cable (coax) copper core isulatio braided outer coductor outer isulatio More expesive tha twisted pair High badwidth ad excellet oise immuity Sprig 2018 CS 438 Staff, Uiversity of Illiois 9
Liks - Optical Optical Media Multimode Fiber 100Gbps 2km Sigle Mode Fiber 100-2400Mbps 40km optical fiber glass core (the fiber) glass claddig plastic jacket Sprig 2018 CS 438 Staff, Uiversity of Illiois 10
Liks - Optical Sigle mode fiber Expesive to drive (Lasers) Lower atteuatio (loger distaces) 0.5 db/km Lower dispersio (higher data rates) Multimode fiber Cheap to drive (LED s) Higher atteuatio Easier to termiate core of sigle mode fiber ~1 wavelegth thick = ~1 micro core of multimode fiber (same frequecy; colors for clarity) O(100 micros) thick Sprig 2018 CS 438 Staff, Uiversity of Illiois 11
Liks - Optical Advatages of optical commuicatio Higher badwidths Superior (lower) atteuatio properties Immue from electromagetic iterferece No crosstalk betwee fibers Thi, lightweight, ad cheap (the fiber, ot the optical-electrical iterfaces) Sprig 2018 CS 438 Staff, Uiversity of Illiois 12
Liks - Wireless Path loss Sigal atteuatio as a fuctio of distace Sigal-to-oise ratio (SNR Sigal Power/Noise Power) decreases, make sigal urecoverable Multipath propagatio Sigal reflects off surfaces, effectively causig self-iterferece Iteral iterferece (from other users) Hosts withi rage of each other collide with oe aother s trasmissio Exteral iterferece Microwave is tured o ad blocks your sigal Sprig 2018 CS 438 Staff, Uiversity of Illiois 13
Wireless Path Loss Sigal power atteuates by about ~r 2 factor for omi-directioal ateas i free space r is the distace betwee the seder ad the receiver The expoet i the factor is differet depedig o placemet of ateas Less tha 2 for directioal ateas Faster atteuatio Expoet > 2 whe ateas are placed o the groud Sigal bouces off the groud ad reduces the power of the sigal Sprig 2018 CS 438 Staff, Uiversity of Illiois 14
Wireless Multipath Effects Ceilig S Floor S Sigals bouce off surfaces ad iterfere with oe aother What if sigals are out of phase? Orthogoal sigals cacel each other ad othig is received! Sprig 2018 CS 438 Staff, Uiversity of Illiois 15
What is a Wireless Lik? Sprig 2018 CS 438 Staff, Uiversity of Illiois 16
What is a Wireless Lik? Sprig 2018 CS 438 Staff, Uiversity of Illiois 17
Wireless Bit Errors The lower the SNR (Sigal/Noise) the higher the Bit Error Rate (BER) How ca we deal with this? Make the sigal stroger Why is this ot always a good idea? Icreased sigal stregth requires more power Icreases the iterferece rage of the seder, so you iterfere with more odes aroud you Error correctio ca correct some problems Sprig 2018 CS 438 Staff, Uiversity of Illiois 18
Ecodig digital data (a strig of symbols) modulator a strig of sigals demodulator digital data (a strig of symbols) Problems with sigal trasmissio Atteuatio: Sigal power absorbed by medium Dispersio: A discrete sigal spreads i space Noise: Radom backgroud sigals Sprig 2018 CS 438 Staff, Uiversity of Illiois 19
How ca two hosts commuicate? 0.7 Volts -0.7 Volts Ecode iformatio o modulated Carrier sigal Phase, frequecy, ad/or amplitude modulatio Etheret: self-clockig Machester codig Techologies: copper, optical, wireless Sprig 2018 CS 438 Staff, Uiversity of Illiois 20
Ecodig Goal Uderstad how to coect odes i such a way that bits ca be trasmitted from oe ode to aother Idea The physical medium is used to propagate sigals Modulate electromagetic waves Vary voltage, frequecy, wavelegth Data is ecoded i the sigal Sprig 2018 CS 438 Staff, Uiversity of Illiois 21
Bauds ad Bits Baud rate Number of physical symbols trasmitted per secod Bit rate Actual umber of data bits trasmitted per secod Relatioship Depeds o the umber of bits ecoded i each symbol Sprig 2018 CS 438 Staff, Uiversity of Illiois 22
Aalog vs. Digital Trasmissio Aalog ad digital correspod roughly to cotiuous ad discrete Data: etities that covey meaig Aalog: cotiuously varyig patters of itesity (e.g., voice ad video) Digital: discrete values (e.g., itegers, ASCII text) Sigals: electric or electromagetic ecodig of data Aalog: cotiuously varyig electromagetic wave May be propagated over a variety of media Digital: sequece of voltage pulses May be trasmitted over a wire medium Sprig 2018 CS 438 Staff, Uiversity of Illiois 23
Aalog vs. Digital Trasmissio Advatages of digital trasmissio over aalog Cheaper Simpler for multiplexig distict data types (audio, video, e-mail, etc.) Easier to ecrypt Two examples based o modulator-demodulators (modems) Electroic Idustries Associatio (EIA) stadard: RS-232 Iteratioal Telecommuicatios Uio (ITU) V.32 9600 bps modem stadard Sprig 2018 CS 438 Staff, Uiversity of Illiois 24
RS-232 Commuicatio betwee computer ad modem Uses two voltage levels (+15V, -15V), a biary voltage ecodig Data rate limited to 19.2 kbps (RS-232-C); raised to 115,200 kbps i later stadards Characteristics Serial Oe sigalig wire, oe bit at a time Asychroous Lie ca be idle, clock geerated from data Character-based Sed data i 7- or 8-bit characters Sprig 2018 CS 438 Staff, Uiversity of Illiois 25
RS-232 Timig Diagram +15 Oe bit per clock tick Voltage + Voltage ever returs to 0V 0V is a dead/discoected lie -15 idle start 1 0 0 1 1 0 0 stop idle -15V is both idle ad 1 Time Sprig 2018 CS 438 Staff, Uiversity of Illiois 26
RS-232 Iitiate sed by Push to 15V for oe clock (start bit) Miimum delay betwee character trasmissios Idle for oe clock at -15V (stop bit) Oe character 0, 1 or 2 voltage trasitios Total Bits 9 bits for 7 bits of data (78% efficiet) Start ad stop bits also provide framig Sprig 2018 CS 438 Staff, Uiversity of Illiois 27
RS-232 Timig Diagram +15 Voltage + -15 idle start 1 0 0 1 1 0 0 stop idle Time Sprig 2018 CS 438 Staff, Uiversity of Illiois 28
Voltage Ecodig Biary voltage ecodig Doe with RS-232 example Geeralize before cotiuig with V.32 (ot a biary voltage ecodig) Commo biary voltage ecodigs No-retur to zero (NRZ) NRZ iverted (NRZI) Machester (used by IEEE 802.3 10 Mbps Etheret) 4B/5B Sprig 2018 CS 438 Staff, Uiversity of Illiois 29
No-Retur to Zero (NRZ) Sigal to Data High ð 1 Low ð 0 Commets Trasitios maitai clock sychroizatio Log strigs of 0s cofused with o sigal Log strigs of 1s causes baselie wader Both ihibit clock recovery Bits 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0 NRZ Sprig 2018 CS 438 Staff, Uiversity of Illiois 30
No-Retur to Zero Iverted (NRZI) Sigal to Data Trasitio ð 1 Maitai ð 0 Commets Solves series of 1s, but ot 0s Bits 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0 NRZ NRZI Sprig 2018 CS 438 Staff, Uiversity of Illiois 31
Machester Ecodig Sigal to Data XOR NRZ data with clock High to low trasitio ð 1 Low to high trasitio ð 0 Commets (used by IEEE 802.3 10 Mbps Etheret) Solves clock recovery problem Oly 50% efficiet ( ½ bit per trasitio) Bits 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0 NRZ Clock Machester Sprig 2018 CS 438 Staff, Uiversity of Illiois 32
4B/5B Sigal to Data Ecode every 4 cosecutive bits as a 5 bit symbol Symbols At most 1 leadig 0 At most 2 trailig 0s Never more tha 3 cosecutive 0s Trasmit with NRZI Commets 16 of 32 possible codes used for data At least two trasitios for each code 80% efficiet Sprig 2018 CS 438 Staff, Uiversity of Illiois 33
4B/5B Data Symbols At most 1 leadig 0 0000 Þ 11110 0001 Þ 01001 0010 Þ 10100 0011 Þ 10101 0100 Þ 01010 0101 Þ 01011 0110 Þ 01110 0111 Þ 01111 At most 2 trailig 0s 1000 Þ 10010 1001 Þ 10011 1010 Þ 10110 1011 Þ 10111 1100 Þ 11010 1101 Þ 11011 1110 Þ 11100 1111 Þ 11101 Sprig 2018 CS 438 Staff, Uiversity of Illiois 34
4B/5B Cotrol Symbols 11111 Þ idle 11000 Þ start of stream 1 10001 Þ start of stream 2 01101 Þ ed of stream 1 00111 Þ ed of stream 2 00100 Þ trasmit error Other Þ ivalid Sprig 2018 CS 438 Staff, Uiversity of Illiois 35
Biary Voltage Ecodigs Problem with biary voltage (square wave) ecodigs Very wide (Ifiite) frequecy rage required, implyig Sigificat dispersio Ueve atteuatio Prefer to use a arrower frequecy bad 20 10 Voltage 0-10 -20-30 start 1 1 0 0 0 0 1 stop Sprig 2018 CS 438 Staff, Uiversity of Illiois 36
Biary Voltage Ecodigs Problem with biary voltage (square wave) ecodigs Very wide (Ifiite) frequecy rage required, implyig Sigificat dispersio Ueve atteuatio Prefer to use a arrower frequecy bad Types of modulatio Amplitude (AM) Frequecy (FM) Phase/phase shift Combiatios of these Sprig 2018 CS 438 Staff, Uiversity of Illiois 37
Example: AM/FM for cotiuous sigal Origial sigal Amplitude modulatio Frequecy modulatio Sprig 2018 CS 438 Staff, Uiversity of Illiois 38
Amplitude Modulatio idle 1 0 Sprig 2018 CS 438 Staff, Uiversity of Illiois 39
Frequecy Modulatio idle 1 0 Sprig 2018 CS 438 Staff, Uiversity of Illiois 40
Phase Modulatio idle 1 0 Sprig 2018 CS 438 Staff, Uiversity of Illiois 41
Phase Modulatio phase shift i carrier frequecy 108º differece i phase collapse for 108º shift Sprig 2018 CS 438 Staff, Uiversity of Illiois 42
Phase Modulatio Algorithm Sed carrier frequecy for oe period Perform phase shift Shift value ecodes symbol 135º 8-symbol example 90º 45º Value i rage [0, 360º) Multiple values for multiple symbols Represet as circle 180º 225º 270º 0º 315º Sprig 2018 CS 438 Staff, Uiversity of Illiois 43
V.32 9600 bps Commuicatio betwee modems Aalog phoe lie Uses a combiatio of amplitude ad phase modulatio Kow as Quadrature Amplitude Modulatio (QAM) Seds oe of 16 sigals each clock cycle Sprig 2018 CS 438 Staff, Uiversity of Illiois 44
Costellatio Patter for V.32 QAM 15º 45º Same algorithm as phase modulatio Ca also chage sigal amplitude 2-dimesioal represetatio Agle is phase shift 16-symbol example Radial distace is ew amplitude Sprig 2018 CS 438 Staff, Uiversity of Illiois 45
Example costellatio Sprig 2018 CS 438 Staff, Uiversity of Illiois 46
Commets o V.32 V.32 trasmits at 2400 baud i.e., 2,400 symbols per secod Each symbol cotais log 2 16 = 4 bits Data rate 4 x 2400 = 9600 bps Poits i costellatio diagram Chose to maximize error detectio Process called trellis codig Sprig 2018 CS 438 Staff, Uiversity of Illiois 47
Modulatio (Baud) Rate 5 bits = 5µsec A stream of biary 1s at 1 Mbps NRZI 1 1 1 1 1 What is a bit? Machester 1 bit = 1µsec 1 sigal elemet = 1µsec What is a sigal elemet? 1 bit = 1µsec 1 sigal elemet = 0.5µsec Sprig 2018 CS 438 Staff, Uiversity of Illiois 48
Modulatio (Baud) Rate 5 bits = 5µsec A stream of biary 1s at 1 Mbps NRZI What is the data rate? Data Rate (R) = bits/sec = 1 Mbps for both Machester 1 1 1 1 1 1 bit = 1µsec 1 bit = 1µsec 1 sigal elemet = 1µsec 1 sigal elemet = 0.5µsec What is the modulatio rate? Modulatio Rate = Baud Rate = Rate at which sigal elemets are geerated = R (NRZI) = 2R (Machester) Sprig 2018 CS 438 Staff, Uiversity of Illiois 49
Samplig Suppose you have the followig 1Hz sigal beig received How fast to sample, to capture the sigal? Sprig 2018 CS 438 Staff, Uiversity of Illiois 50
Samplig Samplig a 1 Hz sigal at 2 Hz is eough Captures every peak ad trough Sprig 2018 CS 438 Staff, Uiversity of Illiois 51
Samplig Samplig a 1 Hz sigal at 3 Hz is also eough I fact, more tha eough samples to capture variatio i sigal Sprig 2018 CS 438 Staff, Uiversity of Illiois 52
Samplig Samplig a 1 Hz sigal at 1.5 Hz is ot eough Why? Sprig 2018 CS 438 Staff, Uiversity of Illiois 53
Samplig Samplig a 1 Hz sigal at 1.5 Hz is ot eough Cat distiguish betwee multiple possible sigals Problem kow as aliasig Sprig 2018 CS 438 Staff, Uiversity of Illiois 54
What about more complex sigals? Fourier s theorem Ay cotiuous sigal ca be decomposed ito a sum of sies ad cosies at differet frequecies Example: Sum of 1 Hz, 2 Hz, ad 3 Hz sies How fast to sample? Sprig 2018 CS 438 Staff, Uiversity of Illiois 55
What about more complex sigals? Fourier s theorem Ay cotiuous sigal ca be decomposed ito a sum of sies ad cosies at differet frequecies Example: Sum of 1 Hz, 2 Hz, ad 3 Hz sies How fast to sample? --> aswer: 6 Hz Sprig 2018 CS 438 Staff, Uiversity of Illiois 56
Geeralizig the Examples What limits baud rate? What data rate ca a chael sustai? How is data rate related to badwidth? How does oise affect these bouds? What else ca limit maximum data rate? Sprig 2018 CS 438 Staff, Uiversity of Illiois 57
What Limits Baud Rate? Baud rate Typically limited by electrical sigalig properties Chagig voltages takes time No matter how small the voltage or how short the wire Electroics Slow compared to optics Baud rate Ca be as high as twice the badwidth of commuicatio Sprig 2018 CS 438 Staff, Uiversity of Illiois 58
What Data Rate ca a Chael Sustai? How is Data Rate Related to Badwidth? Trasmittig N distict sigals over a oiseless chael with badwidth B, we ca achieve at most a data rate of Number of sigals per secod 2B log 2 N Number of bits per sigal Nyquist s Samplig Theorem (H. Nyquist, 1920 s) Sprig 2018 CS 438 Staff, Uiversity of Illiois 59
What Data Rate ca a Chael Sustai? How is Data Rate Related to Badwidth? Trasmittig N distict sigals over a oiseless chael with badwidth B, we ca achieve at most a data rate of Number of sigals per secod Baud rate 2B log 2 N Number of physical symbols trasmitted per secod Bit rate Number of bits per sigal Nyquist s Samplig Theorem (H. Nyquist, 1920 s) Actual umber of data bits trasmitted per secod Relatioship Depeds o the umber of bits ecoded i each symbol Sprig 2018 CS 438 Staff, Uiversity of Illiois 60
Noiseless Capacity Nyquist s theorem: 2B log 2 N Example 1: samplig rate of a phoe lie B = 4000 Hz 2B = 8000 samples/sec. sample every 125 microsecods Sprig 2018 CS 438 Staff, Uiversity of Illiois 61
Noiseless Capacity Nyquist s theorem: 2B log 2 N Example 2: oiseless capacity B = 1200 Hz N = each pulse ecodes 16 symbols C = Sprig 2018 CS 438 Staff, Uiversity of Illiois 62
Noiseless Capacity Nyquist s theorem: 2B log 2 N Example 2: oiseless capacity B = 1200 Hz N = each pulse ecodes 16 symbols C = 2B log 2 (N) = D x log 2 (N) = 2400 x 4 = 9600 bps Sprig 2018 CS 438 Staff, Uiversity of Illiois 63
How does Noise affect these Bouds? Noise Blurs the symbols, reducig the umber of symbols that ca be reliably distiguished Claude Shao (1948) Exteded Nyquist s work to chaels with additive white Gaussia oise (a good model for thermal oise) chael capacity C = B log 2 (1 + S/N) where C is the maximum supportable bit rate B is the chael badwidth S/N is the ratio betwee sigal power ad i-bad oise power This N is oise ot umber of symbols Sprig 2018 CS 438 Staff, Uiversity of Illiois 64
How does Noise affect these Bouds? Noise Blurs the symbols, reducig the umber of symbols that ca be reliably distiguished Claude Shao (1948) Exteded Nyquist s work to chaels with additive white Gaussia oise (a good model for thermal oise) chael capacity C = B log 2 (1 + S/N) Represets error free capacity also used to calculate the oise that ca be tolerated to achieve a certai rate through a chael Result is based o may assumptios Formula assumes white oise (thermal oise) Impulse oise is ot accouted for Various types of distortio are also ot accouted for Sprig 2018 CS 438 Staff, Uiversity of Illiois 65
Noisy Capacity Telephoe chael 3400 Hz at 40 db SNR decibels (db) is a logarithmic uit of measuremet that expresses the magitude of a physical quatity (usually power or itesity) relative to a specified or implied referece level Sprig 2018 CS 438 Staff, Uiversity of Illiois 66
Decibels A ratio betwee sigal powers is expressed i decibels decibels (db) = 10log 10 (P 1 / P 2 ) Used i may cotexts The loss of a wireless chael The gai of a amplifier Note that db is a relative value Ca be made absolute by pickig a referece poit Decibel-Watt power relative to 1W Decibel-milliwatt power relative to 1 milliwatt Sprig 2018 CS 438 Staff, Uiversity of Illiois 67
Sigal-to-Noise Ratio Sigal-to-oise ratio (SNR, or S/N) Ratio of the power i a sigal to the power cotaied i the oise Typically measured at a receiver ( SNR ) = db 10log10 sigal power oise power A high SNR High-quality sigal Low SNR May be hard to extract the sigal from the oise SNR sets upper boud o achievable data rate Sprig 2018 CS 438 Staff, Uiversity of Illiois 68
Noisy Capacity Telephoe chael 3400 Hz at 40 db SNR C = B log 2 (1+S/N) bits/s SNR = 40 db 40 =10 log 10 (S/N) S/N =10,000 C = 3400 log 2 (10001) = 44.8 kbps Sprig 2018 CS 438 Staff, Uiversity of Illiois 69
More examples of Nyquist ad Shao Formulas Spectrum of a chael betwee 3 MHz ad 4 MHz ; SNR db = 24 db B = SNR = Usig Shao s formula C = B log 2 (1 + S/N) Sprig 2018 CS 438 Staff, Uiversity of Illiois 70
More examples of Nyquist ad Shao Formulas Spectrum of a chael betwee 3 MHz ad 4 MHz ; SNR db = 24 db B = 4 MHz - 3 MHz = 1MHz SNR SNR db = = 24 db = 10log 251 Usig Shao s formula C = 10 C = B log 2 (1 + S/N) 6 log 2 10 ( SNR) ( ) 6 1+ 251» 10 8 = 8Mbps Sprig 2018 CS 438 Staff, Uiversity of Illiois 71
More examples of Nyquist ad Shao Formulas How may sigalig levels are required? C = 2B log2m Sprig 2018 CS 438 Staff, Uiversity of Illiois 72
More examples of Nyquist ad Shao Formulas How may sigalig levels are required? C 8 10 4 = M = 2B 6 log 2 = 16 log = 2 2 M M ( 6 10 ) log 2 M Look out for: db versus liear values, log 2 versus log 10 Sprig 2018 CS 438 Staff, Uiversity of Illiois 73
Summary of Ecodig Problems: atteuatio, dispersio, oise Digital trasmissio allows periodic regeeratio Variety of biary voltage ecodigs High frequecy compoets limit to short rage More voltage levels provide higher data rate Modulatio schemes Amplitude, frequecy, phase, ad combiatios Quadrature amplitude modulatio: amplitude ad phase, may sigals Nyquist (oiseless) ad Shao (oisy) limits o data rates Sprig 2018 CS 438 Staff, Uiversity of Illiois 74