+ All Categories
Home > Documents > COMP1321 Digital Infrastructures Richard Henson November 2015.

COMP1321 Digital Infrastructures Richard Henson November 2015.

Date post: 29-Jan-2016
Category:
Upload: shavonne-caldwell
View: 216 times
Download: 0 times
Share this document with a friend
Popular Tags:
31
COMP1321 COMP1321 Digital Digital Infrastructures Infrastructures Richard Henson Richard Henson November November 2015 2015
Transcript
Page 1: COMP1321 Digital Infrastructures Richard Henson November 2015.

COMP1321COMP1321

Digital InfrastructuresDigital Infrastructures

Richard HensonRichard Henson

NovemberNovember 20152015

Page 2: COMP1321 Digital Infrastructures Richard Henson November 2015.

Week 6: Peripherals, Storage & Week 6: Peripherals, Storage & Device CommunicationDevice Communication

Objectives:Objectives:explain the difference in communication explain the difference in communication

involving peripheral and intelligent devicesinvolving peripheral and intelligent devicesproduce a simple algorithm describing point-produce a simple algorithm describing point-

point communication between intelligent point communication between intelligent devicesdevices

Page 3: COMP1321 Digital Infrastructures Richard Henson November 2015.

What is a “Peripheral” What is a “Peripheral” anyway?anyway?

Digital…Digital… Generally not “intelligent”Generally not “intelligent” Controlled from the CPU, via Controlled from the CPU, via

connection through motherboardconnection through motherboard CPU needs unique instructions for CPU needs unique instructions for

each peripheral…each peripheral…system software known a “driver”system software known a “driver”

Page 4: COMP1321 Digital Infrastructures Richard Henson November 2015.

Control of PeripheralsControl of Peripherals Input (e.g. keyboard):Input (e.g. keyboard):

communication between communication between motherboard and peripheral to motherboard and peripheral to establishestablish

» electrical connectionelectrical connection» logical connectionlogical connection

communication channel opened…communication channel opened…» operating system call (e.g. INT 21)operating system call (e.g. INT 21)» data received into RAM…data received into RAM…» flow rate & processing controlled by CPUflow rate & processing controlled by CPU» data passed on the requesting data passed on the requesting

applicationapplication

CPU

Motherboard

keyboard

ASCIIcode

Page 5: COMP1321 Digital Infrastructures Richard Henson November 2015.

Control of Peripherals Output (e.g. screen):

communication between motherboard and peripheral to establish

» electrical connection» logical connection

communication channel opened…» data sent into RAM… » operating system call (e.g. INT 21)» flow rate & processing controlled via

CPU» data passed from RAM to remote

peripheral

CPU

Motherboard

screen

Page 6: COMP1321 Digital Infrastructures Richard Henson November 2015.

Intelligent/Dumb Devices

Intelligentcan process data independently

communication channel with CPU more sophisticated

control software at each end of the communication

Dumb controlled from CPU

dependent on driver software installed on the computer…

Page 7: COMP1321 Digital Infrastructures Richard Henson November 2015.

Principle of “Handshaking”

First stage of communication:

makes sure devices in electrical & logical contact

if so… establishes an agreed common set of rules (protocol) for sending and receiving data

Page 8: COMP1321 Digital Infrastructures Richard Henson November 2015.

Why “handshaking”?

Replicates what humans do…equivalent of two multi-lingual people

walking up to one another, greeting each other, and deciding which language they will use to communicate:

» English, French, Chinese?» Smoke Signals, Semaphores, Morse Code?

Page 9: COMP1321 Digital Infrastructures Richard Henson November 2015.

Establishing a point-point Communications Channel

For any two computers to communicate digitally, they need to “understand” each other’s signals

$%^&£(?

eh?

Page 10: COMP1321 Digital Infrastructures Richard Henson November 2015.

Establishing a point-point Communications Channel

Need a common “language”: i.e. a programmed set of rules and

procedures Incorporated into software

known as a “communications “protocol”

$%^&£(?

eh?

Page 11: COMP1321 Digital Infrastructures Richard Henson November 2015.

Establishing a point-point Communications Channel

Each computer needs a copy of the protocol rules: to send valid data to understand what the other computer is

sending

$%^&£(?

eh?

Page 12: COMP1321 Digital Infrastructures Richard Henson November 2015.

What is needed for a Communications Protocol? All the instructions for the CPU to organize

the sending/receiving of data…and ways to manage that data even when in

electronic format (i.e. 1= higher voltage, 0= lower voltage)

At communication endpoints…synchronizing speed of sending/receivingerror checkingdata encryption/compression & vice versa

Page 13: COMP1321 Digital Infrastructures Richard Henson November 2015.

Essentials for aCommunications Protocol

Agree a standard set of codes First standard… ASCII, early 1960s

set of control codes built into ASCII characters

Page 14: COMP1321 Digital Infrastructures Richard Henson November 2015.

Instructions, ASCII characters and control codes

Rules and procedures for effective and reliable communication between devices converted into a language the CPU can understand…The ASCII control codes then need to be

incorporated into code written in that languagecode can be shared between the sender and

receiver

Page 15: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-Point ProtocolPoint-Point Protocol

Device A

Device B

conversions conversions

Electrical signals

Protocol for Comms mgt

Protocol for Comms mgt

Page 16: COMP1321 Digital Infrastructures Richard Henson November 2015.

Development of Communication Protocols

Problem…Different manufacturers have historically

produced their own unique protocols, serve their own specific purposessome common ground…

» mostly used ASCII for control codes» IBM used a system called EBCDIC (!)

Gradually, attempts at universal protocols started to emerge…e.g. the people creating the Internet produced

TCP/IP in 1972

Page 17: COMP1321 Digital Infrastructures Richard Henson November 2015.

A simple point-to-point communications protocol

Basis of a very simple algorithm that could be translated into a program for managing communications between individual devicesASCII control codes (0-31) for communications

between devicesASCII character codes (32-127) to carry data

Half duplex transmission Data sent in “blocks” or “packets” Programs written in “C”

Page 18: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point algorithm - Stage 1

Purpose: Sender needs to make sure that the receiver is actually “there” (i.e. switched on and working properly)

Action: sends a small amount of “standard” data - usually one byte, known in ASCII terms as SYNASCII code 22 (binary 00010110)

Page 19: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point - Stage 2 Purpose: Receiver needs (if it can!) to

reply to the senders ACK signal Action

EITHER replies with a positive acknowledgement ACK, “I’m ready!” ASCII code 6 (binary 00000110)

OR replies with a negative acknowledgement NAK, “Not ready!” ASCII code 21 (binary 00010101)

Page 20: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-Point: Stage 3 Purpose

sender reacts to the reply (or not) from the receiver by either closing down or sending a “preamble”

Action IF sender

EITHER does not receive acknowledgementOR receives a NAK response… THEN it closes down the communication, with an error message

ELSE, it sends out a further set of data, known as a preamble…

Page 21: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point - Stage 4 Purpose

synchronise protocols (receiver)1. processes the preamble

contains data telling the it which comms protocol, error control, flow rate, encrypt, etc. the sender would like to use

2. passes short message back to the sender indicates whether it will be able to

understand and handle data in that form

Page 22: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point – Stage 5

Purpose: (sender) establish or close down the communications channel

if response received is negative (ie receiver can’t handle data in that format):THEN the communication is closed down

with an error message (e.g. NAK)ELSE, a communications “channel” is

established

Page 23: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point - Stage 6 Purpose:

sending data & error checking info in blocks/packets according to the format agreed in the preamblewould take much too long to send and

receive data one byte at a time!

Action: Sender sends one block/packet followed by

error checking info

Page 24: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point - Stage 7

Purpose: using results of processing the error checking info to request next packet or resending of same packet

Action:Receiver compares error checking info with

that already obtained in the block/packet» if an error is detected request to resend

block/packet» else request to send NEXT packet

Page 25: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point - Stage 8 Purpose: sending the rest of data… Action: process or sending/resending

continues (loops…) until all the data is satisfactorily received

Note: a poor communications environment will result in a lot of errors/resendingwhich will slow down communications… BUT the data will still get through…

Page 26: COMP1321 Digital Infrastructures Richard Henson November 2015.

Point-to-point - Stage 9

Purpose: close down the communications channel

Action: when no further data is available to send and the

final packet/block has been acknowledged… the sender sends an EOT (end of transmission)

byte ASCII 4 binary 00000010 this terminates the communications channel!

Page 27: COMP1321 Digital Infrastructures Richard Henson November 2015.

Techniques for Detecting/Managing Errors

Many error detection and correcting techniques are availableprocess normally involves

» sending of the main block» Sending of further information» calculation based on recreating the additional

information from the main block» comparison of the two

choice must be appropriate for speed, cabling, protocol type, etc

Page 28: COMP1321 Digital Infrastructures Richard Henson November 2015.

Flow Control A feedback mechanism between sender and

receiver so that the receiver can inform the sender if it is not keeping up

Usually achieved by “synchronization” bits or byte (ASCII SYN)a pause in the communication can occur if necessary

» e.g. if buffer becomes full» gives time for buffer to empty…

sender will not send any more data until it gets the “all clear” from the receiver

Page 29: COMP1321 Digital Infrastructures Richard Henson November 2015.

Further point-point issues Programming code could be added to the

basic algorithm which would enable:a series of protocols to be tested during

handshakingpackets to travel through analogue as well as

digital mediapackets to be converted from one format to

another before/after transmissionextra processing to check for virus footprints

Page 30: COMP1321 Digital Infrastructures Richard Henson November 2015.

So what about networks?

All this is needed just to send data from one computer to another, without any routing!

If the computer is on a network, the following additional factors immediately need to be taken into consideration:naming of computersaddressing (if on a different network or segment)

Page 31: COMP1321 Digital Infrastructures Richard Henson November 2015.

More factors for a network protocol?

Logging on/off and access rights Packet switching or circuit switching Navigation:

type of routing algorithm if circuit switchingcreation of packets if packet switchingmopping up lost packets

Packet reassembling at destination… CONCLUSION: A NETWORK PROTOCOL IS A

COMPLEX PIECE OF PROGRAMMING


Recommended