Peripherals and Communication (syllabus 6.5)

notes by Dave Mulkey, 2015, Germany

Port

= physical connection to the outside world, e.g. peripheral devices

Bus

= set of wires (usually parallel) connecting MANY devices

 

Handshaking

= using a PROTOCOL  to AGREE on the way data will be transmitted

      Hear it when you dial-up to an ISP

      See it when you install a PLUG-AND-PLAY device

      - Device talks to the OS (computer)
      - Device sends an INTERRUPT - a signal saying "I need attention"

      -  OS asks "What are you?"

      -  Device says "I am a USB memory device, with the following specification:"
         -  64 MB
         -   Transfer speed -  USB 1 or USB 2 (how fast is USB 2 = 480 Mbits/sec,  USB 1 = 12 Mbits/sec )

         -  R/W device (not Read only)

 

Virtual ports

= Now, we don't have strictly physical ports, we assign "pretend" numbers

-  Worm attacked port 135,  http uses port 8080 - these are virtual
 

Memory Mapped I/O   

=  Port "address" is like a memory location for the computer

  Numbering everything is convenient for programmers

-         if (packetaddress.equals("http://"))        

-         if (packetaddress = = 8080)

 

Virtual port numbers are assigned specific tasks

e.g.   Interrupt Request 12  (IRQ) is assigned to a mouse (on one computer)

 

Mapping

=  assigning devices to specific IDENTIFIERS
-  drive S: ==  \\hscscience\students

 

-  Blaster worm would send lots of messages (packets) to MS

-         Denial of Service attack - overload the servers

-   Microsoft avoided this by remapping their web-address (URL)
so the packets went nowhere

 

------------------

 

DMA

= Direct Memory Access
A periph device can read/write DIRECTLY to the memory
Faster (?) not really - the network is running at 100 Mbits per sec, this is the limit, not the memory
Advantage = bypass the CPU, saving the CPU time for something more useful
                    Parallel processing - two things happening at the same time

Memory (RAM = random access memory) - how fast?  Discuss this tomorrow
Disadvantage - causes errors because the device could conflict with something else using memory

Alternative = everything goes through the CPU (Central Processing Unit)
Usually involves a BUFFER

Buffer

= Temporary storage, until the data is actually processed
A buffer can collect data quickly, to be used slowly, evening out differences in speed
Printer buffer = stores up a whole page (or whole document) before printing
Alternative :  print one character at a time (one pixel at a time)
Advantage = PC sends the whole print job
4 KByte page gets sent over the network in   100 Mb * 1 000 000  = 100 000 000 bits / sec
100 million / 8 = 12.5 million Bytes per sec
/ 1000 =  12.5 thousand KiloBytes per sec
??? How long to transmit 4 KByte page to printer at 100 Mbits per sec ???

Interrupt

= a signal requesting immediate attention or action

Printer can send "Out of paper" interrupt - that is not so urgent, some other interrupts are urgent, like
Computer sends "Stop printing" interrupt
Different ints have different PRIORITIES

Keyboard sends a keystroke - high priority
Mouse interrupts - high priority
 

Once the transmission finishes, the PC is free to do something else

 

Data vs Control

= 2 kinds of signals: data and control

Printer :    data = page of stuff to print
                control = interrupt to signal "finished printing", "out of paper", "cancel print job"

Acknowledge - very common control signal , lots of these all the time


Disk Drives

Cylinders = the circles (tracks) on a disk   1024
Heads = read/write heads                           256
Sectors = each track is chopped up into sectors   64

This is all a big lie - it is NOT the physical truth - this is REMAPPED (virtual)

The sectors are ALLOCATED to hold maybe 512 bytes each (blocking factor)

Small blocking factor = needs LOTS of blocks to make a big file

e.g. 100 KB picture at 512 bytes per sector = need 200 sectors

If the file is fragmented (stored all over the place with space between),
this might cause 200 seek operations, at 12.5 msec each = 2.5 sec, too slow

Defragment

=  shuffles sectors around until all the ones belonging together (those 200) are next to each other
    in the same track or neighboring tracks, reprogram the File Allocation Table

FAT

= File Allocation Table , keeps track of where all the files are stored
      MyPicture.jpg => Head #25, Cyl #48, Sec #1 (1st sector) => Head #25, Cyl #48, Sec #2 =>....

In MS-DOS, this was a LINKED-LIST.
That continued through FAT16 (floppy diskette), FAT32

Now we have NTFS (NT 2000, XP) .... I don't know (Mr Mulkey's HW)


Internet

How many "hosts" in the Internet?
-  Max is 4 billion, because each has an IP address, those are 32-bits = 2^32 (some are not used)
-  There are not 4 billion, it's not full
-  500 million PCs attached (clients), maybe 10 million servers = 1/2 billion hosts

Discussion of bigger domain, with 64 bit addresses (IP ver 2)
-  2^32 * 2^32 = 2^64 -  that is a 4 billion times bigger expansion
-  Why do that?   Worry about handies, toasters (control), refrigerators attaching "smart appliances"

Moore's law = every 18 months the power and density and size of chips doubles

Packet Switching - IP packets travel any various routes, using the IP Address to control delivery
    They arrive out of order, and must be reassembled
    Check that it is okay, not damaged, not CORRUPTED
    -  if it is bad, ask to RESEND, the modem should not be the only judge


Finish section 6.5

Modem

= Modulator/Demodulator = changes Digital signals to Analog (audio) signals
     Phones are POTS (Plain Old Telephone Service)


Operating System

= software containing

Windows is a WIMP =  Windows, Icons, Menues, Pointers = GUI Graphical User Interface

Text mode = Command Line Interface

DNS = Domain Name Server


Security

Privacy vs Safety

(secrets)    (no damage/loss)

 

Privacy = 

    physical security - keep people away with locked doors (deny access)

    Encryption = the best

 

Safety =

    physical security

    best method = backups

   

Backups =

   Strategy

    -  regular intervals (e.g. weekly)
         Max data loss = size of interval

    -  where?  Not in the same physical place as the original files

                     Another hard-disk inside same machine = mirroring (sensible for applications)

-         HOW ?  floppy diskettes, CD-R, Tapes =  removable media, media must be big enough

               to a server somewhere in the Intranet or Internet

Grandfather-Father-Son strategy (generational)

-         strategy for reusing expensive media

 

Incremental

   -    only backup CHANGES after backing up the originals
         bad because it is very difficult to restore properly

 

Complete backup

- modern version because HDD and Tapes are cheap now, CD-R

 

Restore

Making backups is NOT ENOUGH

-  Must test that it is possible to RESTORE them