21
1 Ch 5 Local Asynchronous Communication (RS-232)

1 Ch 5 Local Asynchronous Communication (RS-232)

Embed Size (px)

Citation preview

1

Ch 5 Local Asynchronous Communication (RS-232)

2

IntroductionIntroduction

Two primary properties of a network Bandwidth Delay

Explain how current can be used to transfer digital information across short distances

3

Two Important Physical Limits

Of a Transmission System

Two Important Physical Limits

Of a Transmission SystemPropagation delay

Time required for signal to travel across mediaExample: electromagnetic radiation travels

through space at the speed of light (c = 3x108 meters per second)

BandwidthMaximum times per second the signal can

change

4

Asynchronous Comm.Asynchronous Comm.

A comm. is called asynchronous if a sender and receiver do not need to coordinate before data can be transmitted

A sender can transmit whenever data becomes ready (e.g., keyboard)

The transmitted signal does not contain information that the receiver can use to determine where individual bits begin and end

5

Transmission of DataTransmission of Data

Network hardware encodes information for transmission

Two types of encoding Analog (amount of energy proportional to value

of item) Digital (two forms of energy to encode 0 and 1)

Computer networks use the latter

6

Example Digital EncodingExample Digital Encoding

MediumCopper wire

Energy form Electric current

Encoding Negative voltage encodes 1 Positive voltage encodes 0

7

Illustration Of Digital Encoding

Illustration Of Digital Encoding

To transmit a 0 bit, the sender places a positive voltage on the wire for a short time, and then returns the wire to zero volts

Known as waveform diagram (波形圖 )

8

Standards for Comm.Standards for Comm.Questions?

What’s the electrical details of voltage? How long a voltage on the wire should be hold? What’s the max. data rate?

Hardware that adheres to standard interoperableSeveral organizations produce networking standards

IEEE (Institute of Electrical and Electronic Engineers)電機電子工程師協會

ITU (International Telecommunication Union)國際電訊聯盟

EIA (Electronic Industries Association)電子工程協會

9

EIA RS-232-C StandardEIA RS-232-C Standard

Latest EIA standard is RS-422 (ITU standard is V.24)Specified the physical connection & electrical details Cable limited to ~50 feetVoltage is +15 or –15 for transmission of charactersUses serial asynchronous communicationExample use

Connection to keyboard / mouse Serial port on PC

10

EIA RS-232-C StandardEIA RS-232-C Standard

11

Sender and receiver must agree on Number of bits per character Duration of each bit

Receiver Does not know when a character will arrive May wait forever, inter-char delay is arbitrary

To ensure meaningful exchange send Start bit before character Bits of a char are transmitted one after another with no

delay One or more stop bits after character

EIA RS-232-C StandardEIA RS-232-C Standard

12

Idle Same as 1

Start bit Same as 0 (Not part of data)

Stop bit Same as 1 (Follows data)

Totally 7+2 bits transmitted

13

Duration of a Bit in RS-232C

Duration of a Bit in RS-232C

Determined by baud rate Number of changes in the signal per second

(Here, baud rate is equal to bit rate) Typical baud rates

9.6 Kbaud, 14.4 Kbaud, 28.8 Kbaud Duration of bit is 1 / baud rate Sender and receiver must agree a priori Receiver samples signal Disagreement (e.g., stop bit disappear) results in

framing error (訊框錯誤 )

14

Full Duplex Asynchronous Comm.

Full Duplex Asynchronous Comm.

2-way comm. desirable in practiceThe current flows out on one wire and back

on another (1-way comm.) twisted pair: one for signal, the other for ground coaxial: center conductor for signal, shield for G

Copper conductor

Insulator

Metal shieldOuter cover

15

Full Duplex Asynchronous Comm.

Full Duplex Asynchronous Comm.

Requires 2 TP Half-duplex? Simplex?

16

Illustration Of Full-Duplex

Communication

Illustration Of Full-Duplex

Communication

Separate wires needed to carry current in each directionCommon ground wireDB-25 connector used (25 pins)

Pin 2 (wire 2) is transmit Pin 3 is receive

ComputerComputer

17

Illustration Of Full-Duplex CommunicationIllustration Of Full-Duplex Communication

18

Illustration Of Full-Duplex

Communication

Illustration Of Full-Duplex

CommunicationPin 2 (T)Pin 3 (R)

Pin 2 (R)Pin 3 (T)

Computer (DCE) Modem (DTE)

DCE connectorData Communication Equipment

DTE connectorData Terminal Equipment

19

Limitations of Real Hardware

Limitations of Real Hardware

It’s an ugly worldElectrical energy dissipates as it travels alongWires have resistance, capacitance, and

inductance which distort signalsMagnetic or electrical interference distorts signalsDistortion can result in loss or misinterpretation

20

Illustration of DistortedSignal for a Single Bit

Illustration of DistortedSignal for a Single Bit

In practiceDistortion can be much worse than illustrated

21

ConsequencesConsequences

RS-232 hardware must handle minor distortionsTolerate less than full voltageTake multiple samples per bit (rather than at the

middle of bit)Cannot use electrical current for long-distance

transmission