CSCI1412 Lecture 14

29
CSCI1412 Lecture 14 Hardware 8 Basic Communications Dr John Cowell phones off (please) 1

description

phones off (please). CSCI1412 Lecture 14. Hardware 8 Basic Communications Dr John Cowell. Overview. Communication issues speed (baud, bps, cps) direction (simplex, half-duplex and full-duplex) data bits and parity modes (asynchronous and synchronous) packets and frames - PowerPoint PPT Presentation

Transcript of CSCI1412 Lecture 14

Page 1: CSCI1412 Lecture  14

CSCI1412Lecture 14Hardware 8

Basic Communications

Dr John Cowell

phones off (please)

Page 2: CSCI1412 Lecture  14

2

OverviewCommunication issues

speed (baud, bps, cps)direction (simplex, half-duplex and full-duplex)data bits and paritymodes (asynchronous and synchronous)

packets and framesbandwidth and capacity

Communication protocolsserial and parallel communicationother communication methods

Data compression techniques

Page 3: CSCI1412 Lecture  14

Communication Issues

Page 4: CSCI1412 Lecture  14

4

SpeedMaximum speed of data transmission is limited by the

hardware. the type of cable / line / mediathe capabilities of the device controllers

Speed is measured in several (related) waysbits per second (bps)

The preferred way. The number of bits of information transmitted every second. A 2400 bps second modem may have a baud rate of 1200 sending symbols of 2 bits.

baud rate the rate at which ‘symbols’ can be sent. Each symbol may be 1 or

more bits.characters per second (cps)

the number of characters transmitted every second

Page 5: CSCI1412 Lecture  14

5

DirectionCommunication takes place in certain directionsSimplex transmission

allows data to flow in a single direction only, e.g. sending data to a basic printer sending display information to screens in airports / stations

Half-duplex transmissiondata can flow in both directions, but not at same time

e.g. CB radio or ‘walkie-talkies’

Full-duplex transmissiondata can flow in both directions at the same time, e.g.

a (voice) telephone line most network communications

Page 6: CSCI1412 Lecture  14

6

Data-bitsOriginal ASCII only uses 7 bits to code characters

most computers store a character in one byte (8 bits) 8th bit is always zero, so it does not have to be transmitted!

only 7 bits need to be transmittedOriginal ASCII encoded only limited characters and

so it has been extended, e.g.8th bit is used to code an extra 128 characters

quotes (‘ = 145), bullets (• = 149), pound-sign (£ = 163), etc.in this case 8 bits need to be transmitted

International character sets (UNICODE) now use 16 bits to encode each single character

Page 7: CSCI1412 Lecture  14

7

ParityParity is a technique where an extra bit is

included in each transmitted character to detect errorse.g. for 7 bit ASCII an eighth parity bit is added

• In even-parity, the eighth bit is set to ‘0’ or ‘1’ so that there are an even number of ‘1’s in the byte

• In odd-parity, the eighth bit is set to ‘0’ or ‘1’ so that there are an odd number of ‘1’s in the byte

ASCII ‘A’ 1 0 0 0 0 0 1 1 0 0 0 0 0 10

ASCII ‘C’ 1 0 0 0 0 1 1 1 0 0 0 0 1 11

ASCII ‘A’ 1 0 0 0 0 0 1 1 0 0 0 0 0 11

ASCII ‘C’ 1 0 0 0 0 1 1 1 0 0 0 0 1 10

Page 8: CSCI1412 Lecture  14

8

ModesTransmitting data only works if the receiving

device is ready for itThere are two aspects to being ready

availablein step

There are two communication modes used to ensure that the transmitting and receiving devices keep in step once transmission has begunasynchronous and synchronous modes

Page 9: CSCI1412 Lecture  14

9

Asynchronous ModeA special start signal is transmitted at the start of

each group of message bitsa group is usually just a single character

Another special stop signal is transmitted at the end of each group

When the receiving device gets the start signal, it sets up the timing mechanism to accept the group of message bits

Usually, start / stop signals are additional (fixed value) bits, e.g. start is a ‘0’ bit, stop is a ‘1’ bit’

Page 10: CSCI1412 Lecture  14

10

Synchronous ModeA larger group of message bits

usually many charactersare transmitted together in a continuous stream

There is a single start and stop signal at the beginning and end of each message groupthere are no start / stop signals for each characterthe transmitting and receiving devices must

synchronise their clocks at the start of transmission these must be accurate enough to keep time with each other

Usually, error-checking bits are transmitted at the end of each message to ensure accuracy

Page 11: CSCI1412 Lecture  14

11

Comparison

Synchronous mode is + faster (less start / stop signals)more complexmore expensive

start character stop

start message (many characters)error

checkingstop

start character stop start character stop

asynchronous

synchronous

Page 12: CSCI1412 Lecture  14

12

Frames - 1Frames or packets are a further extension used in

synchronous transmission a transmitted message is divided into a series of

message groups called frames (carrying packets)frames may arrive at any time, in any orderthe receiving device has to rebuild the message by

testing the received frames requesting the re-transmission of damaged/missing

frames

start packet 1error

checkingstop

controlinformation

start packet 2error

checkingstop

controlinformation

Page 13: CSCI1412 Lecture  14

13

Frames - 2Control information includes

source addressdestination address

important for routingactual number of data bytessequence number

important for when frames arrive out of orderframe type

start of message continuation of message end of message

Not all bits transmitted are useful datadata transfer rate is less than byte transfer rate

Page 14: CSCI1412 Lecture  14

14

BandwidthFor analogue media, bandwidth is the difference

between the highest and lowest frequencies at which a medium can transmitmeasured in Hertz (cycles per second)for example, telephone bandwidth is from

300 Hz to 3300 Hz = 3000 Hz but available bandwidth on copper wire 2 MHz ADSL technology exploits this gap

Page 15: CSCI1412 Lecture  14

15

CapacityFor digital media, bandwidth is the rate at which

data can be transmittedusually measured in bits-per-secondit is sometimes referred to as the capacity of the

linklimited by parameters of transmission medium

With all data transmission, not all data sent is useful e.g.start/stop characters, control info., error-checking,

etc. all slow down the effective data rate

Page 16: CSCI1412 Lecture  14

Communication Protocols

Page 17: CSCI1412 Lecture  14

17

Serial CommunicationIn serial communication, each bit is transmitted

one at a time over a single wire

01000100

D01000001

A01100011

T01000001

A

• Only a single wire (plus an earth) is needed for each direction of transmission, i.e.– simplex requires just one wire plus earth– full-duplex requires two wires plus earth

• this makes it very cheap

Page 18: CSCI1412 Lecture  14

18

Serial UsesBecause serial communication is so cheap, it is

widely used for slow speed peripheralsmodemsslow printersmiceother input devices

barcode readers, magnetic card readers, etc.

Unfortunately, there are a wide variety of cable standards and specifications e.g.RS232 , RS432

Page 19: CSCI1412 Lecture  14

19

Parallel CommunicationsIn parallel communication, all eight bits in one

byte (character) are send over eight different wires all at once

D00100010

A10000010

T11000110

A10000010

– faster than serial, but more expensive

Page 20: CSCI1412 Lecture  14

20

Parallel UsesPrinters

original PC parallel ports were simplex ports capable of transmitting information only

suitable for printers

modern printers are often half- or full-duplex so that they can send status information such as ‘out-of-paper’

Add-on peripheral devicesexternal hard disk drivesexternal CD-ROM drivestape backup devices

Page 21: CSCI1412 Lecture  14

21

Other ProtocolsParallel and serial connectors are point to point

need one port (connector) per deviceUSB (Universal Serial Bus) combines serial

communications with bus technologymultiple devices (up to 128) from one portis now the ‘standard’

Infra red technology is similar in conceptmultiple ‘serial’ devices from one port no physical connection (wires) required

Page 22: CSCI1412 Lecture  14

Data Compression

Page 23: CSCI1412 Lecture  14

23

Data Compression TechniquesThe effective data rate of a communications link

can usually be increased through the use of data compression (and decompression) techniquesas the communications link is the slowest link in the

chain, a processor at either end of the link can afford to spend time converting data into a compressed form

Data is examined prior to transmission and then recoded so that unnecessary redundant and duplicate bits are eliminatedtext can often be compressed by 75% or moregraphics (bitmaps) can often be compressed over 90%

Page 24: CSCI1412 Lecture  14

24

Text CompressionSome compression methods are used for all types of

information (but especially text)‘lossless’ compression / decompression

all information is preserved (perfectly) on decompression

Huffman codingdetermines how often each character occursThe more common the character, the shorter the code

that replaces it.Lempel-Ziv-Welch (LZW)

searches for repeated strings in a document e.g. ‘communications’, ‘compression’

replaces these with special short codes

Page 25: CSCI1412 Lecture  14

25

Graphics CompressionOther techniques can be used for graphics files

including ‘lossy’ compression / decompression decompressed image is an approximation of original

Run length encoding (RLE)many graphics files have long sections of identical value

bytes, e.g. 0’s for an area of black imagerepeated sequences are replaced by a code for

‘the next 2000 bytes are all zero’

JPEG (Joint Photographics Experts Group)a ‘lossy’ technique designed specially for photographic

images, taking into account capabilities of the human eye in distinguishing adjacent colours and pixels

Page 26: CSCI1412 Lecture  14

26

MPEGA set of standards for video and audio compression

developed by the Moving Picture Experts Group. Started in 1988.

Achieves video compression between 25:1 and 50:1

MPEG-1 - coding video at about 1.5MBits/s. The audio layer 3 is MP3.

MPEG-2 – coding for transmission rates above 4Mbits/s. Used for DVD and digital TV and HDTV.

MPEG-3 – never released – incorporated into MPEG-2.MPEG-4 – used for Blu-ray disk encoding.

Page 27: CSCI1412 Lecture  14

27

MPEG CompressionUses 5 different compression techniques:1. A frequency based transform – Discrete Cosine

Transform (DCT).2. Quantization, lossy compression, removes detail

which may not be too noticeable to the viewer.3. Huffman coding (lossless compression) using code

table based on encoded data.4. Motion compensated predictive coding – comparing

the differences between successive images.5. Bi-directional prediction – images are predicted

from images before and after the image.

Page 28: CSCI1412 Lecture  14

28

MPEG encoding

There are many references on the web giving great detail.

Page 29: CSCI1412 Lecture  14

29

SummaryCommunication issues

speed (baud, bps, cps)direction (simplex, half-duplex and full-duplex)data bits and paritymodes (asynchronous and synchronous)

packets and framesbandwidth and capacity

Communication protocolsserial communicationparallel communicationother communication methods

Data compression techniques