Computer Networks and Internets

Download Report

Transcript Computer Networks and Internets

Ch 5 Local Asynchronous
Communication (RS-232)
1
Introduction
Two primary properties of a
network
Bandwidth
 Delay

Explain how current
can be used to transfer
digital information across short distances
2
Two Important Physical Limits
Of a Transmission System
Propagation delay
Time
required for signal to travel across media
Example: electromagnetic radiation travels
through space at the speed of light (c = 3x108
meters per second)
Bandwidth
Maximum
times per second the signal can change
3
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
4
Transmission 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
5
Example Digital Encoding
Medium
Copper
wire
Energy form

Electric current
Encoding
Negative voltage encodes 1
 Positive voltage encodes 0

6
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 (波形圖)
7
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 interoperable
 Several organizations produce networking standards
 IEEE
(Institute of Electrical and Electronic Engineers)
 電機電子工程師協會
 ITU
(International Telecommunication Union)
 國際電訊聯盟
 EIA (Electronic
Industries Association)
 電子工程協會
8
EIA 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 feet
 Voltage is +15 or –15 for transmission of characters
 Uses serial asynchronous communication
 Example use
Connection to keyboard / mouse
 Serial port on PC

9
EIA RS-232-C Standard
10
EIA RS-232-C Standard
 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

11
 Idle

Same as 1
 Start

Same as 0 (Not part of data)
 Stop

bit
bit
Same as 1 (Follows data)
 Totally
7+2 bits transmitted
12
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 (訊框錯誤)

13
Full Duplex Asynchronous Comm.
2-way
comm. desirable in practice
The 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

Outer cover
Metal shield
Insulator
Copper conductor
14
Full Duplex Asynchronous Comm.
Requires 2 TP
 Half-duplex?
 Simplex?

15
Illustration Of
Full-Duplex Communication
Computer
Computer
 Separate
wires needed to carry current in each direction
 Common ground wire
 DB-25 connector used (25 pins)
Pin 2 (wire 2) is transmit
 Pin 3 is receive

16
Illustration Of
Full-Duplex Communication
17
Illustration Of
Full-Duplex Communication
Pin 2 (T)
Pin 3 (R)
Computer (DCE)

Modem (DTE)
DCE connector


Pin 2 (R)
Pin 3 (T)
Data Communication Equipment
DTE connector

Data Terminal Equipment
18
Limitations of Real Hardware
It’s an
ugly world
Electrical
energy dissipates as it travels along
Wires have resistance, capacitance, and
inductance which distort signals
Magnetic or electrical interference distorts signals
Distortion can result in loss or misinterpretation
19
Illustration of Distorted
Signal for a Single Bit
In practice
Distortion
can be much worse than illustrated
20
Consequences
RS-232
hardware must handle minor distortions
Tolerate
less than full voltage
Take multiple samples per bit (rather than at the
middle of bit)
Cannot use electrical current
for long-distance
transmission
21