Computer Communication, Networks, & Protocolscsweb.cs.wfu.edu/~pauca/csc332/8-Communication.pdf ·...
Transcript of Computer Communication, Networks, & Protocolscsweb.cs.wfu.edu/~pauca/csc332/8-Communication.pdf ·...
Mobile & Pervasive ComputingCSC 332 - Fall 2019
Computer Communication, Networks, & Protocols
Computer Communications• Computer-to-computer communications
• Process in which two or more computers/devices transfer data or instructions
• Elements
• Sending computer/device
• Initiates instruction to transmit data
• Communication hardware
• Connects sending device to a transmission media
• Transmission media
• Link between the devices
• Communication hardware
• Connects the transmission media to the receiving device
• Receiving computer/device
• Accepts transmission of data
• Protocols
• Established rules specifying how communication takes place
Computer Communications• Scale
• Embedded communication
• E.g. between devices and peripherals
• Network communication
• Between computers in a wired or wireless network
Embedded Communication Protocols• Dictate communication between embedded devices
• E.g. microcontroller and sensor, Arduino and computer
• Generally over a physical wire
• Devices must share same protocol to swap data
• Lots of protocols exist, but generally classified as
• Parallel
• Transfer multiple bits at same time
• Require many I/O lines (e.g. wires)
• E.g. transfer 1 byte at the time
• Serial
• Transfer one bit at the time
• Operate on one I/O line
• E.g. stream byte (little endian or big endian) one bit at the time
• Also classified as• Asynchronous, e.g. RS-232, TTL
• Synchronous, e.g. SPI, I2C, 1-Wire
Serial Communication• Asynchronous serial communication
• No signal clock (uses fixed baud rate instead)
• E.g. RS-232 protocol and transistor-transistor logic (TTL)
• Two data lines, Rx and Tx
• RS-232 uses positive and negative voltage (+/- 13V)
• TTL uses 0 to 3V or 5V and ground wire
• Data transmitted in frames
• Start bit, data bits, parity bit, stop bits
• Handled typically by UART hardware
• E.g. FTDI tool
• Serial peripheral interface (SPI)
• Clock signal tells receiver when to sample the data line
• Master generates clock signs
• MOSI: Data sent from master to slave
• MISO: Data sent from slave to master
• SS: slave select
• SS tells receiver to wake up
• Also used with multiple slaves
• Doesn’t require UART
• Programming in Arduino
• Using shiftln() and shiftOut()
• Using the SPI library
Synchronous Serial Communication
Synchronous Serial Communication
• Inter-Integrated Circuit (I2C)
• Also called Two Wire Interface (TWI)
• Allows multiple masters and slaves connected using just two wires
• SPI requires additional pin per slave
• Can support up to 1008 devices
• Hardware a bit more complex than SPI
• Used by
• EEPROM memory
• RAM memory
• Temp, gas, air pollution sensors
• Displays
•
Network Communication• Computer Network
• Collection of nodes and links between nodes
• Nodes
• Computer/devices sending/receiving data
• Links
• Transmission media, e.g. electrical cable, optical fiber, radio waves
• Network topologies
• Layout or organizational hierarchy between connected nodes
• Communication models
• E.g. client/server, point-to-point
• Governed typically by some communications protocol
Examples
• Our Ubicomp network will have a star topology
Geographic Scale• Wide Area Network (WAN)
• Long distances using leased lines, frame relay, SONET/SDH, cellular networks, microwave
• IEEE 802.16 “WiMAX” is an emerging standard for wireless broadband communication
• Local Area Network (LAN)
• Relative shorter distances, confined to buildings, organizations, etc.
• IEEE 802.11 “WiFi” is a common standard
Geographic Scale• Personal Area Network (PAN)
• Network of devices around a person
• mobile phones, wireless headphone, printers
• IEEE 802.15 family - Bluetooth (802.15.1) and ZigBee (802.15.4 - 10:100 meters)
• Body Area Networks (BAN)
• Devices worn or embedded in the body
• Medical applications
Transmission Media• Transmission media types
• Wired technologies: physical media, e.g.
• Electric cables
• Twisted pair (e.g. ethernet cable), speed 2 Mbits/s - 10 Gbits/s
• Coaxial cable (e.g. cable tv), speed 200 - 500 Mbits/s
• Optical fiber (e.g. undersea cable), speed 100 Mbits/s - 100 Gbits/s
• Wireless technologies: radio or other electromagnetic means, e.g.
• Radio waves, 30 Hz to 300 GHz, long distances
• infrared (300 GHz to 430 THz), short range, requires line-of-sight
• targeted lasers, free-space optical communication
• LiFi (LED), infrared and visible spectra
Radio Bands• Data transmission through radio waves
• Alter the frequency, amplitude or phase
• Frequency or phase modulation are most common
• Radio frequency properties
• signal propagates over the horizon (low frequency)
• Antenna size
• Electronics and shielding requirements
• Susceptibility to reflection
• The radio frequency spectrum is highly controlled
• Different frequency bands are separately allocated, e.g.
• licensed allocations
• unlicensed allocations, e.g. amateur radio for public use
Frequency Bands• VLF, LF 3 - 300 kHz
• Maritime, time signals, beacons, RFID
• MF 300kHz - 3 MHz
• AM, coax, twisted pair
• HF 3 - 30 MHz
• Lowest over horizon radio, short-wave radio, over-horizon radar, RFID, radio-telephones
• VHF 30 - 300 MHz
• FM radio, twisted pair wired use ends
• UHF 300 MHz - 3 GHz
• TV, writes coax use ends, ZigBee, GPS, Bluetooth, microwave oven
• Several other bands in this range, i.e. ISM Bands, GSM-900, GSM-1800
• SHF 3 - 30 GHz
• Satellite, radar, wireless LAN
• 5.8 GHz IEEE 802.11 wireless LANS
• EHF 30 - 300 GHz
• Microwave links
http://theconversation.com/wireless-spectrum-is-for-sale-but-what-is-it-11794
Key Physical Characteristics• Channels
• Bandwidth determined by demand and complexity of signal
• Multiple channels per band for various usages (e.g. up/down links)
• Signal often spread across the full channel width for communication efficiency.
• E.g. direct sequence spread spectrum (DSSS) and frequency hopping
• Propagation of signal
• Inversely proportional to frequency
• Affected also by:
• environment
• transmitted power
• antenna design
• Spatial capacity
• IEEE 802.11 g has capacity <400 kb/s/m2 at 54 Mb/s, communication overhead, max 4 independent networks within a 100 m range
• Bluetooth has capacity <25 kb/s/m2 at 1Mb/s data rate, less overhead, max 20 independent networks within a 10 m range
Communication Challenges• Range
• Reception range
• Detection range
• Interference range, affects spatial capacity and density of transmitters
• Error
• Detecting and correcting error
• Backward error correction (check sum), forward error correction (redundancy), graceful degradation
• Wireless networks
• Overhead of error detection is large
• Interference creates bursty errors, ACK may increase collision opportunities, more messages mean more power usage
• Security
• Physical access control
• Difficult in wireless networks, eavesdropping
• Security requirements
• Limited signal propagation
• Access control for joining networks
• Data encryption
• Privacy/identity patterns
• Identity
• People share devices, equipment, move between networks, multiple identities, etc.