COMP1321 Digital InfrastructuresRichard HensonNovember 2013
Week 7: Peripherals, Storage & Device CommunicationObjectives:explain the organisation of data on a hard diskexplain the difference in communication involving peripheral and intelligent devicesproduce a simple algorithm describing point-point communication between intelligent devices
Hard Disk Cataloguing and IndexingCatalogue essential for saving and locating files on the diskDisk divided into cylinderssectors through all the platter surfaces (typically four)disks have very many cylindersWhen data saved, filename (label) starting address (location) essential
Addressing and the Hard Disk I cylinders as addresses for file data..
Linked Lists and Files on DiskPointers provide next (cylinder) address on disk
What is a Peripheral anyway?Digital deviceGenerally not intelligentControlled from the CPU, via connection through motherboardCPU needs unique instructions for each peripheralsystem software known a driver
Control of PeripheralsInput (e.g. keyboard):communication between motherboard and peripheral to establishelectrical connectionlogical connectionCommunication channel openedoperating system call (e.g. INT 21)data received into RAMflow rate & processing controlled via CPUdata passed on the requesting applicationCPUMotherboardkeyboard
Control of PeripheralsOutput (e.g. screen):communication between motherboard and peripheral to establishelectrical connectionlogical connectioncommunication channel openeddata sent into RAM operating system call (e.g. INT 21)flow rate & processing controlled via CPUdata passed from RAM to remote peripheralCPUMotherboardscreen
Intelligent DevicesCan process data independentlycommunication channel with CPU more sophisticatedcontrol software at each end of the communicationDumb peripherals controlled from CPUdependent on driver software installed on the computer
The principle of HandshakingFirst communication process:makes sure devices in electrical & logical contactIf so establishes an agreed common set of rules (protocol) for sending and receiving data
Why handshaking?Replicates what humans doequivalent 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?
Establishing a point-point Communications ChannelFor any two computers to communicate digitally, they need to understand each others signals$%^&(?eh?
Establishing a point-point Communications ChannelNeed a common language:i.e. a programmed set of rules and proceduresIncorporated into softwareknown as a communications protocol$%^&(?eh?
Establishing a point-point Communications ChannelEach computer needs a copy of the protocol rules:to send valid datato understand what the other computer is sending$%^&(?eh?
What is needed for a Communications Protocol?All the instructions for the CPU to organize the sending/receiving of dataand ways to manage that data even when in electronic format (i.e. 1= higher voltage, 0= lower voltage)At communication endpointssynchronizing speed of sending/receivingerror checkingdata compression
Essentials for Communications Protocols Need to agree a standard set of codesFirst standard goes back to early 1960s set of control codes built into ASCII charactersNextthe rules and procedures needed for effective and reliable communication between devices need to be converted into a computer language - something a CPU can understandThe ASCII control codes then need to be incorporated into a computer program written in that language, which can be shared between the sender and receiver
Point-Point ProtocolDevice ADevice BconversionsconversionsElectrical signalsProtocol for Comms mgtProtocol for Comms mgt
Development of Communication ProtocolsProblemDifferent manufacturers have historically produced their own unique protocols, serve their own specific purposessome common ground mostly used ASCII for control codesIBM used a system called EBCDIC (!)Gradually, attempts at universal protocols started to emergee.g. the people creating the Internet produced TCP/IP in 1972
A simple point-to-point communications protocolBasis 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 dataData sent in blocks or packetsAssumes half duplex transmissionSuch a program would normally be written in C
Point-to-point algorithm - Stage 1Purpose: 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)
Point-to-point - Stage 2Purpose: Receiver needs (if it can!) to reply to the senders ACK signalActionEITHER replies with a positive acknowledgment ACK, Im ready! ASCII code 6 (binary 00000110)OR replies with a negative acknowledgement NAK, Not ready! ASCII code 21 (binary 00010101)
Point-to-Point: Stage 3Purposethe sender reacts to the reply (or not) from the receiver by either closing down or sending a preambleActionIF the sender EITHER does not receive acknowledgementOR receives a NAK responseTHEN it closes down the communication, with an error messageELSE, it sends out a further set of data, known as a preamble
Point-to-point - Stage 4Purposesynchronise protocolsAction: the receiver:1. processes the preamble (containing data telling the receiver what comms protocol, error control, flow rate, encryption method, etc. the sender would like to use) 2. passes a short message back to the sender indicating whether it will be able to understand and handle such data
Point-to-point Stage 5Purpose: establish or close down the communications channelAction: If the response received by the sender is negative (ie cant handle the data):THEN the communication is closed down with an error message (e.g. NAK)ELSE, a communications channel is established
Point-to-point - Stage 6Purpose: sending data & error checking info in blocks/packets according to the format agreed in the preambleit would 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
Point-to-point - Stage 7Purpose: 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/packetif an error is detected request to resend block/packetelse request to send NEXT packet
Point-to-point - Stage 8Purpose: sending the rest of data Action: process or sending/resending continues (loops) until all the data is satisfactorily receivedNote: a poor communications environment will result in a lot of errors/resendingwhich will slow down communications BUT the data will still get through
Point-to-point - Stage 9Purpose: close down the communications channelAction: when no further data is available to send and the final packet/block has been acknowledgedthe sender sends an EOT (end of transmission) byte ASCII 4 binary 00000010this terminates the communications channel!
Techniques for Detecting/Managing ErrorsMany error detection and correcting techniques are availableprocess normally involvessending of the main blockSending of further informationcalculation based on recreating the additional information from the main blockcomparison of the twochoice must be appropriate for speed, cabling, protocol type, etc
Flow ControlA feedback mechanism between sender and receiver so that the receiver can inform the sender if it is not keeping upUsually achieved by synchronization bits or byte (ASCII SYN)a pause in the communication can occur if necessarye.g. if buffer becomes fullgives time for buffer to emptysender will not send any more data until it gets the all clear from the receiver
Further point-point issuesProgramming 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
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)
More factors for a network protocol?Logging on/off and access rightsPacket switching or circuit switchingNavigation:type of routing algorithm if circuit switchingcreation of packets if packet switchingmopping up lost packetsPacket reassembling at destinationCONCLUSION: A NETWORK PROTOCOL IS A COMPLEX PIECE OF PROGRAMMING