Overview of Computer Science CSC 101 — Summer 2011 Data Communications LAN and LANs d WANs WAN Lecture 19 — August 1, 2011 Announcements • Final Exam next Tuesday (8/9/11). – This Room – 2pm – 5pm • Final Review on Mondayy – 8/8/11 • Quiz #3 (?) on Friday – Lectures 19 – 22 • Lab #7 Tomorrow – Prelab and Lab-Report is online • WA#7 due Tomorrow @ 5pm • WA#8 due Thursday 8/4/11 @ 5pm 2 Objectives • • • • • Data communications systems Data encoding, transmission and error checking Interconnection of computers: data networks Classification of data networks LAN Topologies 3 1 Information Exchange • Two ways to think about exchanging information – Broadcasting – one-to-many, one-way communication (asymmetric) • • • • Radio and television Print media – magazines, newspapers, etc. Bulk messages (e.g. spam email) The Web (published Web pages) – Networking – one-to-one, two-way communication (symmetric) • • • • • Telephone Postal mail Email, IM, texting Computer resource sharing (disks, printers, P2P file sharing, etc.) The Web (interactive or dynamic Web pages), Gchat, Facebook Chat 4 Information Exchange • Data communication systems exist to exchange information between two agents • Claude Shannon developed p a general model for information exchange (1948) – A simple yet fundamental way of looking at data communication – Six basic components of all communications systems 5 Shannon’s Data Communication Model • The six components of a data communications system: 6 2 Shannon’s Data Communication Model 1. An information source generates a message 2. A transmitter encodes the message as some kind of signal g 3. The signal is transmitted over a communications channel – Some medium that bridges the distance between transmitter and receiver 4. A receiver extracts the signal from the communications channel and decodes it back into a message 5. The destination receives the message 6. Some noise source is usually present in the channel – A random element that affects the signal in unpredictable ways 7 Shannon’s Data Communication Model • The six components of information transfer apply, even to very low-tech messages… • …as well as messages that use advanced, digital technologies 8 Data Encoding • Messages in digital communications systems are encoded as a stream of bits (0s and 1s) – Computer files already exist as binary data – Other information can be digitized as it is being sent • These bits can be transmitted as some type of energy – – – – – Sound (modem) Electricity (Ethernet) Light (fiber-optic cables) Radio waves (wireless) Etc. • All of these forms of energy are analog phenomena – Yet they can carry digital information • The physical properties of the communications channel determine 9 the maximum data transfer rate (maximum bandwidth) 3 Transmitting the Signal • Digital data may be transmitted as analog signals • Analog signals are composed of waves – Repeating waveforms are modulated (altered) to encode information – Amplitude modulation (AM) and frequency modulation (FM) are common • Digital data must be translated into modulated analog signals for transmission over many types of media – Sound, electrical signals, radio waves are analog phenomena – Even so, they can carry digital data as an analog signal • The analog signal must be translated back into digital data at the receiver • A modem (modulator/demodulator) is a device that performs these translations 10 Modulating Digital Data • With amplitude modulation (AM), the amplitude (“loudness”) of the signal is increased to represent a binary “1” 11 Modulating Digital Data • With frequency modulation (FM), the frequency (“pitch”) of the signal is increased to represent a binary “1” 12 4 Data Encoding and Error Checking • ASCII (American Standard Code for Information Interchange) was designed for text communications – A way to digitize text data using a binary code for each letter or character – Need to ensure that the correct character is received • Error checking can accommodate communication noise – Minor errors in transmission can change the message • To be able to identify errors in ASCII data: – 8 binary bits used to represent each text character – An extra parity bit is often used to detect transmission errors – 8 data bits + 1 parity bit = 9 bits (1 byte + 1 extra bit) per character 13 Parity Bit Error Detection • Sending system sets the parity bit – Two types of parity error detection – Odd parity error detection • Transmitter sets the parity bit so that the total number of “1” bits in the bbyte te is an odd number n mber – Even parity error detection • The parity bit is set to make the total number of “1” bits an even number • Receiver checks the parity – If the total number of “1” bits in the byte is not correct (odd or even), this indicates an error, and the byte is discarded 14 Parity Bit Error Detection • Data in an 8-bit byte with parity – Eight bits of encoded data – Ninth bit (the parity bit) provides error checking Parity Bit 8-bit ASCII code 15 5 Parity Bit Error Detection • Example: • The ASCII code for “N” is “01001110 01001110” • In odd parity, what should the parity bit be? – It should be set to “1 1” to make an odd number of 1s 1 0 1 0 0 1 1 1 0 Parity Bit 8-bit ASCII code 16 Parity Bit Error Detection • If one bit is in error, the parity bit disagrees and the error is detected – Odd parity, but an even number of “1” bits • This byte must be in error! • (But, this does not provide a way to correct the error) 1 0 1 0 0 1 0 1 1 0 Discard this byte! Parity Bit 8-bit ASCII code 17 Parity Bit Error Detection • If there are two single-bit errors, the parity bit cannot detect the error – Odd parity, but still an odd number of “1” bits Æ data appears to be valid, even though it is not 1 0 1 1 0 0 1 0 1 1 0 Parity Bit 8-bit ASCII code 18 6 Checksum • Parity works well to find single-bit errors – Parity can’t detect two-bit errors, but these are very uncommon – Almost all errors are single-bit errors, so parity works well as a ‘first-line’ error detection method • Higher-level error detection methods include calculating the checksum of a data packet – Sender: Add together the numerical values of all the bytes in the packet and include that checksum with the packet when it’s sent – Receiver: Add together the numerical values of all the bytes in the received packet and compare it to the checksum sent by the sender – If they are different, there was an error; receiver requests a resend 19 Bandwidth • The bandwidth of a communication channel is its capacity to transmit data – Analogous to pipe sizes in plumbing • A An analog l signal i l may simultaneously i lt l contain t i different diff t waveforms of various frequencies – Each waveform carries some information • The number of frequencies simultaneously supported by a channel determines its overall bandwidth – Similar to the radio dial – many stations simultaneously broadcasting, each at a different frequency 20 Types of Data Networks • There are many ways to connect devices – The word network implies many different connections and types of connections • Data communication networks can be classified by their various properties – Scope or expanse covered by the network – Type of medium used for transmission of signals – Type of switching performed to route the signal 21 7 Networks Classified by Scope • LAN (Local-Area Network) – Small geographical area – from a room up to a few buildings • WAN (Wide-Area Network) – May span across states, nationwide, even worldwide – Often serves a single organization, organization acting like a single network • MAN (Metropolitan-Area Network) – Medium-sized, such as a city, campus, or multiple sites of a single institution • PAN (Personal-Area Network) – Up to a few meters in size, usually one person’s devices • An internet – An interconnection of autonomous networks – The largest of all internets is the Internet 22 Basic Characteristics of LANs • A local area network (LAN) provides: – Computer connectivity with 2-way communication • Between servers and nodes or between individual nodes – Resource sharing h i • Servers provide resources to other nodes – Files, backups, software licenses, security validation, printing, etc. – A server might be a computer or just a stand-alone peripheral – Transparency of use • LANs are designed to be almost plug-and-play • Remotely shared resources often appear as virtual local resources 23 Networks Classified by Medium • Wired media – Specific, physical connections • Copper wire • Coaxial cable • Optical fiber cable • Wireless networking – Connections can come and go • Infrared waves (IR) • Radio frequency waves (RF) – Sometimes called “Wi-Fi” – Includes wireless now deployed on campus 24 8 Transmission Media • Wired media – “Twisted-pair” cable (copper wires) • Limited to about 100 meters max – Optical fiber cable • Pulses of laser light over very thin glass strands • One cable can connect up to 25 miles or more • Low error rates and very high data bandwidth (up to Tbps) 25 Transmission Media • Wireless networking – Wi-Fi – Radio frequency (RF) connection to an access point • Speeds of up to 54 Mbps are common (“802.11g”) (“802 11g”) – 100 Mbps is becoming widely available (“802.11n”) • Limited range – Tens to hundreds of feet – Reduced by walls or other obstructions – Possible interference from portable phones, microwave ovens, etc. Transmission Media • Wireless networking – Wi-Fi – Public “hotspots” are common • All WFU buildings and some outdoor areas (‘WFUvisitor’) St in downtown Winston-Salem Winston Salem • Public areas such as 4th St. (free) • Other public or commercial locations (free or pay) – Private access points • • • • All buildings and some outdoor campus areas (‘WFUstudent’) Businesses, etc., that use wireless networking Personal (in-home) wireless Security issues must be considered 9 Transmission Media • Wireless networking – cellular – Blackberry; cellular modem; “3G” and “4G” phones • Long range Wireless connectivity – Good coverage in most populated areas areas, depending on provider • Currently ~1–10 Mbps Transmission Media • Wireless networking – Bluetooth • Short range “personal area network” – – – – – Computer peripherals C ll phone Cell h andd music i player l headsets h d t Automobile dashboards Home networking (gaming and entertainment) Etc. • 1-2 Mbps 29 Transmission Media • Wireless networking – IR (infrared) • Like television remote controls • Requires q line-of-sight g – Works well only within enclosed spaces • Sometimes used for simple networking tasks (“beaming”) – – – – Laptop-to-PDA (e.g. Palm Pilot) PDA-to-printer Digital camera uploads Etc. • 115 Kbps (slow!) 30 10