Академический Документы
Профессиональный Документы
Культура Документы
Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada
Devices
Devices
A geographic region is divided into cells each with a base station. A cellular phone is a two-way radio twocapable of communicating with the base station The cell phone may be within more than one boundary, however it communicates with the base station from where the signal is stronger Base stations communicate with a MTSO (Mobile Telephone Switching Office), which connects to the regular telephone network Receiving a cell call is more complex
3
Devices
Devices
A paper sheet is divided into a dot matrix; each dot (Pixel) is so tiny (200 dots per inch, 40,000 dots per square inch) Each dot is a bit: 1 if dot is white, 0 if black 8.5x11 inches paper would produce 3,740,000 dots, and it takes 2 minutes (approx.) at the rate of 33.6 bps Fax machines use Data Compression schemes; instead of sending dot by dot, the fax groups the dots and defines binary representation of them using fewer bits
6
T ransmission Modes
Defines the way in which a bit group travels from device to another Also defines whether bits travel in both directions simultaneously or must take turns Different transmission modes exist:
Serial & Parallel Asynchronous, Synchronous & Isochronous Simplex, Half-Duplex & Full-Duplex HalfFull7
T ransmission Modes
(continue...)
Serial & Parallel Transmission Parallel transmission sends bits of a byte simultaneously on separate wires; used between PC and printer Only recommended for short distances due to sync problems Serial transmission uses one wire, and can be used for long distance communication; cheaper, more reliable but slower
Figure 4.7 Parallel & Serial transmission
8
T ransmission Modes
(continue...)
Asynchronous, Synchronous & Isochronous Transmission These are ways to provide serial communication Asynchronous transmission:
Bits are divided into small groups, usually bytes, and sent independently The receiver never knows when the bits will arrive For example, typing keyboard characters Typical byte-oriented input-output; that is data is transmitted one byte at byteinput-output; a time A start bit is needed to alert the receive that some data is coming; otherwise the first few bit may get lost by the time the receiver detect and reacts to data reception Similarly, a stop bit is needed
T ransmission Modes
Asynchronous, Synchronous & Isochronous Transmission
(continue...)
Figure 4.9 Asynchronous Transmission of ASCII Digits 321 using NRZ Coding
10
T ransmission Modes
Asynchronous, Synchronous & Isochronous Transmission Synchronous transmission:
(continue...)
Allows transmission of larger bit groups Characters are grouped into a Data Frame (simply Frame) them be transmitted Frame) as a whole A generic data frame has the following pieces:
SYN: SYN: unique bit pattern that alert the receiver of frame arrival
Also used to ensure the receivers sampling rate and the consistency of the arrival rate The receiver can then synchronize itself to the rate at which bits arrive
Data: Data: Actual number of data bytes Sequence Number: Used to assemble frames at the destination in case they arrive out Number: of order Frame Type: Distinguished by some protocols Type: Error: Error: Error checking bits End: End-ofEnd: End-of-frame bits
11
T ransmission Modes
(continue...)
T ransmission Modes
(continue...)
Asynchronous, Synchronous & Isochronous Transmission Isochronous transmission: With asynchronous & synchronous data do not necessarily arrive at a fixed rate Time between different synchronous frames may vary (asynchronous nature!) Errors may force the frame to be reset, which affects the transfer rate further For some applications, such as file transfer, that is fine since correct information is more important than delays Isochronous transmission is used to ensure a fixed transmission rate without gaps in between
13
T ransmission Modes
(continue...)
I nterface Standard
Communication may not occur even if both parties are using the same mechanisms! For example, if both send at the same time, no information may reach any of them if one is not ready to listen then information is also lost Hence, communication must be guided by protocols Data Terminal Equipment (DTE), such as PCs, do not communicate directly; rather DTE), they communicate to Data Communication Equipment (DCE), such as a modem, DCE), which connect to the network The connection between DTE & DCE is called DTE-DCE Interface DTE-
I nterface Standard
EIAEIA-232 Interface (RS-25 Serial (RSPort)
(continue...)
RS232: 25-line cable with 252525-pin connector (DB25). Every line has a function; for example:
Pin 1: protective ground Pin 2: Transmit date DTE DCE Pin 22: Ring Indicator; indicates DCE is receiving a ringing signal (when modem receives a call)
RS-232 Connector
16
I nterface Standard
EIAEIA-232 Interface (RS-232 Serial Port) (RS-
(continue...)
17
I nterface Standard
EIAEIA-232 Subset
(continue...)
Driven by economics and actual user needs, some vendors only implemented a part of the interface using only 9 circuits instead of 25 (9-bin (9connectors)
I nterface Standard
Null Modem
(continue...)
Sometimes, it is needed to connect two computers directly A first attempt to establish connection is plug in the wire to both ends This however wont work; Why? Same circuit in each end is expected to perform the same functionality; for example send/send or receive/receive One solution in such case is to use a null modem The null modem can be simply a cable
19
I nterface Standard
X.21 Interface
(continue...)
Uses 15-bin interface 15Defined as a digital signaling interface Control information are changed in a different way than RS-25 RSThe standard requires more logic circuits (intelligence) in the DTE & DCE that can interpret control sequence & reduce the number of connecting circuits C (control) & I (indication) state info T (transmit) & R (receive) data or control info
20
I nterface Standard
X.21 Interface
(continue...)
21
I nterface Standard
(continue...)
Universal Serial Bus (USB) Not long ago, we had to deal with Serial ports, Parallel ports, Special connections for Game controllers, Key-boards, Mice, Keyetc.
USB was the proper replacements to those many connectors Very flexible in connecting many different devices Has 7-bit addressing schemes to reference the devices, which 7enables connections to 127 (excluding the DTE host itself)
22
I nterface Standard
Universal Serial Bus (USB)
(continue...)
23
I nterface Standard
Universal Serial Bus (USB) USB cable contains 4 wires: 2 wires for data carrying signal in modified NRZ (0 changing, 1 same) The other two wires provide lowlow-amplitude power source to USB devices USB 1.1 at 12 Mbps, USB 2.0 at 480 Mbps. Limited to 4.5 meters; if longer, there is no guarantee of electrical signal integrity
(continue...)
I nterface Standard
(continue...)
Universal Serial Bus (USB) Operates on Master/Slave mode, where the host is the master USB Frame: 1-milisecond slice of time. Frame: 1During this 1-ms time frame, packets are sent (packet is a group 1of bits) All devices are clock synchronized in respect to a frame The synchronization is not done by a common clock; rather by the host sending a special packet at the beginning of each frame This special packet indicates that a new frame is beginning
25
I nterface Standard
Universal Serial Bus (USB) USB defines 4 different transmission types:
(continue...)
Control Transfer Bulk Transfer Interrupt Transfer Isochronous Transfer USB devices are hot pluggable Once plugged, the host queries the device to determine its type & bit rate The devices responds the host assigns an address to that device Once this is done, the device is connected and can receive commands from the host such as requesting their status or initiating data exchange
26
I nterface Standard
Universal Serial Bus (USB) Bulk Transfer: Transfer:
(continue...)
Some USB devices, such as scanners & digital cameras, transfer large amount of data (bulk transfer) Error detection is performed and the packet may have to be resent Reliable transfer, but no guarantee of timely transfer Many devices might be doing bulk transfer at the same time, which may result in errors/retransmission hence, no guarantee on delivery time
27
I nterface Standard
Universal Serial Bus (USB) Interrupt Transfer: Transfer:
The world interrupt here is not that proper!
(continue...)
USB devices hold the information until the host asks for them, which is literally Polling The major advantage here is avoiding the complexity involved with the interrupt system/protocol For example, if the host sets its polling time to the keyboard at 50 frames (each 50 ms), then it can get up to 20 characters each second
28
I nterface Standard
Universal Serial Bus (USB) Isochronous Transfer: Transfer:
(continue...)
For some real-time devices, such as microphones and realspeakers, steady transfer rate is significant The host can guarantee data rate for those devices by reserving a part of each frame for them As with most real-time systems, error detections do not occur realhere; it is simply not needed
29
I nterface Standard
Universal Serial Bus (USB) USB Packets
(continue...)
Several exchange of packets could take place during a single frame Packet types: Token, Data, Handshake Token, Data, All packets have SYN and PID (packet ID) SYN is a bit pattern that forces the receiving device to synchronize its clock with the sender and adjust their receiving bit rate PID identifies the packet type SOF indicates the Start o Frame
30
I nterface Standard
Universal Serial Bus (USB) USB Packets
(continue...)
IN & OUT packets represent a request from the host to initiate data transfer Address is a 7-bit address that identifies the device to be used 7 CRC (Cyclic Redundancy Check) is used for error detection If errors occur, a NAK is sent to the host Some devices may have more than one address; for example a game controller with multiple buttons would have multiple addresses associated with them. The endpoint is needed to identify the exact source or destination of the data within the device. For example, a game controller may have many buttons sending or receiving different information. Each of these buttons will be indicated by an endpoint
31
I nterface Standard
Universal Serial Bus (USB) USB Packets
(continue...)
32
I nterface Standard
(continue...)
FireWire FireWire (Apple), i.Link (Sony) Share common characteristics with USB Provide a speed of 400Mbps (USB provides 12Mbps, USB 2.0 provides 480 Mbps Can be used with many devices, but the main focus is on multimedia devices, especially with digital video application Connects multiple devices using Daisy Chain, which means Chain, many devices can be connected in sequence and there is no need for a hub Devices have one or more FireWire port, so they can also act as regenerators/repeaters
33
I nterface Standard
FireWire
(continue...)
I nterface Standard
(continue...)
FireWire Uses 6 wires (2 twisted pairs TPA & TPB + 2 wires for power source) Uses Data Strobe Encoding
TPA uses some form of NRZ, where 1 is high, 0 is low This is however error-prone due to mis-synchronization with the sender errormisclock The sender sends a strobe signal over TPB, which stays constant whenever the data change from 1 to 0 and vise versa The receiver gets both TPA & TPB signals and by XORing them, it can create the exact sender clock This is a bit like Manchester Encoding, with one great difference; the baud rate is the same as the bit rate, so there is no double BW utilization The only cost here is one additional twisted pair
35
I nterface Standard
FireWire
(continue...)
36
I nterface Standard
(continue...)
Multiple FireWire Buses USB uses Master/Slave protocol whereas FireWire uses peer-topeer-topeer protocol Devices may be daisy chained together to form a bus group
37
I nterface Standard
(continue...)
Multiple FireWire Buses FireWire supports two communication modes: Asynchronous, Isochronous
Asynchronous Communication:
Involves exchange & acknowledgment Send a packet Wait for a ACK or NACK
Isochronous Transfer:
With this mode, FireWire guarantee that data is sent at a steady rate; there is no waiting for ACKs or resending of packets
38
I nterface Standard
(continue...)
FireWire Arbitration Since there is no master host, what happens if two devices attempt to send at the same time Devices are configured in a tree hierarchy, with one device at the root; each device selects an ID based on its location in the tree The root device acts an arbiter; when devices under it wish to transfer, the root decides which one gets the bus based on some form of priority This process is only part of the arbitration, and it works with some arbitration methods:
Fairness Arbitration, and Urgent Arbitration
39
I nterface Standard
(continue...)
FireWire Arbitration Fairness arbitration: Fairness interval allows all competing devices to access the bus once. No device monopolizes the bus; the fairness interval starts again after all devices that wish to send use the bus once Urgent arbitration allows the devices to be prioritized within a fairness interval (asynchronous packets interval) Root device has the highest priority among all in the group To guarantee Isochronous transmission, the root device acts as a Cycle master. Each cycle starts with a cycle-start-packet, which master. cycle-start-packet, marks the start of an Isochronous cycle Starting the Isochronous cycle regularly guarantees Isochronous transmission
40
I nterface Standard
FireWire Arbitration
(continue...)
41
M ultiplexing
It is possible to connect each device of a network directly to that network, however each of these connection carries its cost Alternatively, multiplexing can be used A multiplexer, or mux, routes transmission from mux, multiple sources to a single destination
Multiplexer
42
M ultiplexing
(continue...)
FrequencyFrequency-Division Multiplexing (FDM) Used with analog signals; a common uses are TV & radio The available BW is divided into separate ranges or channels Each device shares a part of the available BW, a channel, and keeps that portion at all times
M ultiplexing
(continue...)
FrequencyFrequency-Division Multiplexing The modulated signals from all inputs are combined into as a single, more complex analog signal The channels themselves are separated by a guard band
M ultiplexing
(continue...)
TimeTime-Division Multiplexing (TDM) Used with digital signals TDM keeps the signals physically distinct but logically packages them together The optimal performance is achieved when the combined input rate is equal to the output rate A faster combined input rate would result in signals being dropped and a slower input rate would results in frames that are partially full so the channels are underused
M ultiplexing
(continue...)
Statistical Time-Division Multiplexing Time In practice, it may not be possible to keep input & output rates the same Keeping the frame size fixed would simply the protocol but underutilize the channels An alternative is to use Statistical Multiplexer, sometimes called Concentrator Since the order in one frame is not the guaranteed, a more complex logic is there to resolve the frame correctly
M ultiplexing
WaveWave-Division Multiplexing Similar to FDM, but based on optics Potential bit rate is 1000 Gbps (Tera bps) Light consists of several wavelengths (refer to spectrum of frequencies) Prism spreads the light into different colors (to different wavelengths) Each source can operate at a specific wavelength All signals are combined before transmission, and separated at the receiver
(continue...)
D igital Carriers
T1 A standard used for long-distance communication long Uses TDM to combine many voice channels into one DS1 frame T1 refers to the circuit, DS1 refers to the signal DS1 frame has 24 channels of 8 bits each, and one framing bit for synchronization
48
D igital Carriers
(continue...)
T1 8-bit voice samples are taken from each of the 24 channels at a rate of 8000 samples per second Each sample occupies one slot in the DS1 frame The receiving mux extract the bits from each slot and route them to the appropriate destination (the voice is heard at the other side)
D igital Carriers
T1
(continue...)
T1 rate: 8-bit sample * 8000 samples/second 64 Kbps To support this rate, T1 must transmit a DS1 frame each 1/8000 seconds must transmit 8000 * 193 bits each second Date rate of 1.544 Mbps This rate is considered slow compared to optical fiber capabilities That is the reason there are other carriers with more channels and faster bit rate T1 is not only used for voice communication; other companies lease phone lines to transfer digital information between computers
Carrier T1 T2 T3 T4 Digital Signal No. DS1 DS2 DS3 DS4 No. of Channels 24 96 672 4,032 Bit Rate, Mbps 1.544 6.312 44.736 274.176
50
C ontention Protocols
Access to the medium from many entry points is called contention Unless controlled, contention may lead to fatal problems Contention protocols are used to avoid such problems
51
C ontention Protocols
(continue...)
Aloha Protocols Earliest contention protocol in 1970s by Univ. of Hawaii, called Pure ALOHA Several stations to central station (Menehune) by radio communication f1 for broadcast, f2 (different frequency than f1) for ACK Any station can transmit; if collision then wait random time
52
C ontention Protocols
(continue...)
Slotted Aloha Protocols Any overlap in signals, even a small one, would force retransmission Hence, a minimal safe period to transmit two signals is 2T (T is time period) So, to allow a device to transmit, you should reserve 2T for that Not to waste such time, Slotted Aloha is used Devices can only send at the beginning of each slot
53
C ontention Protocols
(continue...)
Slotted Aloha Protocols Slotted Aloha has a higher success rate than Pure Aloha However, with increased traffic, the different may not be that significant
Figure 4.43 Success Rate for Pure Aloha & Slotted Aloha
54
C ontention Protocols
Continue to sense the active medium If free, send with a probability p (0 < p e 1)
(continue...)
Carrier Sense Multiple Access Protocols (CSMA) Sense the medium at the beginning of a slot, send if the medium is free, else wait for next slot p-persistent CSMA: p=0 never transmits (wait again) ; p=1 always transmits (collision chances are higher)
Nonpersistent CSMA: check periodically, if free send else wait for one time slot and CSMA: check again
55
C ontention Protocols
(continue...)
Collision Detection (CD) Instead of sending entire frame then discover that collision has occurred when no ack is received, sense the medium for collision and stop transmitting if occurs This will avoid the medium from being unusable during collision Commonly used with CSMA called CSMA/CD
56
C ontention Protocols
Collision Detection (CD) Two issues worth considering:
Frame size Distance
(continue...)
Frame Size:
The frame has to be of a minimum size so the device can detect collision before it finishes If too large, a device can monopolize the medium So, how small should a frame be?
57
C ontention Protocols
Collision Detection (CD)
(continue...)
Example: Assume: 10 Mbps bit rate, Largest distance between two devices is 2 KM Signal propagate at a rate of 200 meter/sec meter/ To propagate 2 KM it takes 10 sec To propagate 4 KM (worst case, go & come back), we need 20 sec Rate of 10 Mbps is the same as 10 bits each sec In 20 sec we have 200 bits or 200/8 = 25 bytes This is the minimum size a frame can be so CD can be made
58
C ontention Protocols
(continue...)
Collision Detection (CD) The other issue with CD is distance For example CD does not work well with satellite since the time needed to travel back and forth between ground and satellite is too big due to the large distance Binary exponential back-off algorithm back Varies the waiting time before sending again if collision occurred If first collision then wait 0, or 1 slots Second collision then wait randomly for 0, 1, 2, or 3 slots .......................... .. If n successive collisions then wait for random # of slots between 0 and 2n-1, when n > 16 give-up and signal to higher layer! give59
C ontention Protocols
(continue...)
Token Passing Instead of sending whenever it wishes, a device will take turns in sending with the other ones Capture token to send data frame If data then remove token and transmit data frame; else pass token to neighbor Only sender can put the token back on ring after receiving it back One frame per token Advantage: contention is much controlled than the previous protocols Disadvantages:
All devices must be known Complexity (what happen if the token is lost or if the device that has control over it fails)
60
C ontention Protocols
Token Passing
(continue...)
61