Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMP1321 Digital Infrastructures

Similar presentations


Presentation on theme: "COMP1321 Digital Infrastructures"— Presentation transcript:

1 COMP1321 Digital Infrastructures
Richard Henson November 2017

2 Week 8: Peripherals, Storage & Device Communication
Objectives: explain the difference in communication involving peripheral and intelligent devices produce one simple algorithm describing point-point communication between intelligent devices

3 What is a “Peripheral” anyway?
Digitally controlled… could be intelligent (own CPU) could be dumb (no CPU) controlled from the CPU, via connection through motherboard CPU needs unique instruction(s) system software known as a “driver”

4 CPU/control of “dumb” devices (1)
Input (e.g. keyboard): communication between motherboard and peripheral to establish electrical connection logical connection communication channel opened… operating system call (e.g. INT 21) data received into RAM… flow rate & processing controlled by CPU data passed on the requesting application CPU Motherboard ASCII code keyboard

5 CPU/control of dumb devices (2)
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

6 CPU-peripheral Communications Protocol?
Centrally all the instructions for the CPU to organize the sending/receiving of data… ways to manage that data in electronic format (i.e. 1= higher voltage, 0= lower voltage) Both communication endpoints… synchronizing data sending/receiving speed error checking data encryption/compression & vice versa

7 Essentials for a Peripheral control Communications Protocol
Agree a standard set of codes between CPU and peripheral… First standard… ASCII, early 1960s ASCII – American Standard Code for Information Interchange set of control codes built into ASCII characters used for input (keyboard) and output (printer) still used today!

8 Instructions, ASCII characters and control codes
Stage 1: establish rules and procedures for effective and reliable communication between devices known as ASCII control codes Stage 2: ASCII control codes trigger programs wrritten in assembly language for CPU being used data and control codes can be shared between CPU and peripheral

9 Evolution of ASCII codes
Originally control set 7-bit (128 codes) ASCII control codes (0-31) for communications between devices ASCII character codes (32-127) to carry data Extended ASCII codes 8-bit (256 codes) codes used for other languages and graphics elements Unicode: includes 16-bits to cover a wider range of language symbols

10 Intelligent Devices Can process data independently
communication channel with CPU more sophisticated control software at each end of the communication Establishment of such inter-device communication known as “handshaking”

11 Principle of Handshaking
First stage of communication… makes sure devices in electrical & logical contact… if this is true… establishes an agreed common set of rules (protocol) for sending and receiving data

12 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? Overview:

13 Establishing a point-point Communications Channel
$%^&£(? eh? For any two intelligent devices to communicate digitally, they need to “understand” each other’s signals

14 Establishing a point-point Communications Channel
$%^&£(? eh? Need a common “language”: i.e. a programmed set of rules and procedures Incorporated into software known as a “communications “protocol”

15 Establishing a point-point Communications Channel
$%^&£(? eh? Each computer needs a copy of the protocol rules: to send valid data to understand what the other computer is sending

16 Peripherals and Bandwidth
Data transfer needs to be as fast as possible Protocol code will slow the data down “KISS”? With “dumb” peripherals, protocol used in USB v3 enables very fast communication

17 Communications between intelligent devices
Device A Device B Both ends have a CPU both can process instructions protocol needs to be more sophisticated…

18 Development of inter-CPU Communication Protocols
OK… but… BIG Problem!!! different manufacturers produced their own unique protocols serve their own specific purposes Thankfully, some common ground… most used ASCII for control codes IBM used a system called EBCDIC (!) Gradually, “universal” protocols became available… e.g. the Internet produced TCP/IP, released in 1972

19 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 devices Half duplex transmission Data sent in “blocks” or “packets” Programs written in “C”

20 Point-Point Protocol (PPP)
Protocol for Comms mgt Protocol for Comms mgt Device A Electrical signals Device B Electrical signals conversions conversions

21 Writing a 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 SYN ASCII code 16 (hex) (binary) A B 16

22 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 ) OR replies with a negative acknowledgement NAK, “Not ready!” ASCII code 15 (binary ) 6 or 15… A B

23 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 acknowledgement OR 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… &(£^:~ A B

24 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 $£!* A B

25 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

26 Point-to-point - Stage 6
Purpose: sending data & error checking info in blocks/packets according to the format agreed in the preamble would take much too long to send and receive data one byte at a time! Action: Sender - block/packet followed by error check Hello… CRC

27 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 CRC OK! A B

28 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/resending which will slow down communications… BUT the data will still get through…

29 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 this terminates the communications channel!

30 Techniques for Detecting/Managing Errors
Many error detection and correcting techniques are available process 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 must be appropriate for speed, cabling, protocol type, etc

31 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

32 Buffering Also used in flow control (FIFO)
data to CPU Also used in flow control (FIFO) Receiver saves incoming data to a “buffer” (area of memory for temporary storage) If receiver CPU can’t process the data yet, it sits there, and other data piles up Eventually, buffer overflow occurs and data is lost data in

33 Further point-point issues
Programming code could enhance the basic algorithm so it could (e.g.): test a series of protocols between sender and receiver during handshaking allow packets to travel through analogue as well as digital media convert packets from one format to another before/after transmission provide extra processing to check for virus footprints

34 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 computers addressing (e.g. IP address) And also….

35 More factors for a network protocol?
Logging on/off and access rights Packet switching or circuit switching Navigation: type of routing algorithm if circuit switching creation of packets if packet switching mopping up lost packets Packet reassembling at destination… CONCLUSION: A NETWORK PROTOCOL IS A COMPLEX PIECE OF PROGRAMMING!


Download ppt "COMP1321 Digital Infrastructures"

Similar presentations


Ads by Google