Title: Networking and the Internet 3
1Networking and the Internet (3)
- Last Week
- Computer Architecture
- Operating System concepts and examples
- Week 3 Focus
- Views of a network (Coope, chapters 12 14)
- Electrical transmission management addressing
contents - Data formats (the codes that flow) (Coope,
chapter 2) - More on systems for Online Computing
- e-commerce issues what do we need for B2C?
- Introduction to Writing HTML
2Revision of Task Dispatching
- Remember that every action involves an interrupt
that returns control to the Operating System - The queues are OS control blocks
3Dispatching Tasks
- Lets assume a Ready Queue of tasks waiting to
run - Add tasks to queue according to a priority
pattern (cheapest is FIFO, but we may want to
improve on that) - Dispatch the task at the head of the queue
- When it gives up control, dispatch new head of
queue - May want to maintain queue of blocked tasks too
- What if task doesnt give up control?
- Need to interrupt it at end of time slice to let
others run(Windows 3.x didnt do this except for
DOS tasks) - Can return it directly to Ready Queue (with risk
that itll consume too much CPU time) - Maybe we should favour short interactions over
long
4Life Cycle of an Interaction
But how do we know when its finished?
5Working On-line
- On a PC, you start a program
- Feed it with data e.g. edit your document
- Produce some results saved or printed document
- Quit the program
- While youre editing, you expect the computer..
- To keep the program running, even if you walk
away - and Maintain all the information youve entered
- This involves keeping program and data in memory
- Very hard for an Internet Server to match this
- How long should it hold stuff in memory for you?
- What if there are 5,000 users like you?
- Chosen solution is to treat interactions as
atomic
6Keeping the Process Alive
User hits ENTER
Maintain page tables to access processs memory,
though itll get paged out
On idle queue
Task Created
User hits ENTER
Nothing to do
Executable Task
Dispatched
Running
Finishes
On Ready Queue
Terminated
Time expires
Enters WAIT
Requeued on Event
Blocked
7 Transactional Interactive Computing
- Lynn Brooks (IBM Poughkeepsie) recognized and
described two distinct kinds of on-line
computing - Transactional
- Composed of separate, atomic actions
- Take an order, handle a billing query
- Very little state to carry between transactions
- Each transaction may use a different program
- Interactive
- Usually lots of interactions with a single
program, as in editing a document - Copious state information processs whole
memory - Typically heavy on memory, light on processing
8The Internet is Transactional
- In general
- Every time you interact, browser sends message to
server - Server responds by sending you something
- Then it forgets you
- Presents a problem if you want a session
- For example, you sign on to authenticate yourself
- Server then treats you as a privileged user,for
a whole series of interactions - Server usually maintains minimum status
information - Table of whos signed on, with IP address and
privilege - On each request, you send a token for server to
look up - How long must it keep your entry in the table?
9Impact on B2C e-commerce
- Successful Business to Consumer e-commerce needs
friendly service to the end-user - Server should recognize the user
- Authenticate when needed, but do it only once per
session - Not grind to a halt because servers run out of
memory - Example amazon.co.uk
- Stores cookie on your disk when you sign up
- Retrieves it each time you connect in future
- Asks you to confirm that its really you
- Requires user name and password for secure area
(anything to do with account status or payment) - Times out if you dont sign out of the secure area
10Other e-commerce Considerations
- Server performance
- Users need to be able to rely on availability
- With adequate response time
- Not usually a problem for delivering HTML pages
- http daemons in server are tuned to be
efficient - Much more serious for transactional work
- Server may have to start a new process for each
message - Heavy-duty activity involving address-space
creationunless it can exploit a pool of
processes - Database activity may involve multiple accesses
- User may interact multiple times per business
activity - Unless we can send a Java applet for the user to
run
11Networking and Communications
- Resolving confusion with concept of layers
12Networking and Communications
- An area made confusing by range of different
activities that fit under this heading - Electrical (or equivalent) signals actually
transmitted(down twisted-pair, coaxial cable, or
by radio) - How the transmission medium is managed(modem,
network card, hub) - How we address data to make sure it gets to
destination - How we code the information so receiver
understands it - How we package information to send it to other
application(email, screen-shots, file transfer) - Can resolve confusion by the concept of layers
- Convention is to show electrical signals at bottom
13Communication Layers
- Seven layer model of SNA and OSI aims to let us
think about one element of the network at a time
- Application layer Services for applications
- Presentation layer Maps data to what is
displayed - Session layer Ties multiple flows into logical
call - Transport layer Hides network details from above
- Network layer Routing and sequencing of packets
- Data Link layer Flow control and error handling
- Physical layer Point-to-point flows of bits
- Interfaces between layers are well-defined
protocols
14Seven Layer Model
- Simplify programming by encapsulating lower levels
Purpose/Examples File transfer show screen
image manage sign-on manage connections route
over several links V.34 , HDLC LAN, digital-,
analogue-circuit
Application Presentation Session Transport Network
Data Link Physical
OSI terms
Internet terms
15Data Formats
- Computers work on numbers, but human
communications involve more than numbers - Need letters, signals, pictures, sounds
- Computer must be able to handle these formats
- Popular character format is ASCII
- 7-bit code representing characters (now 8-bit)
- Each letter or number or punctuation mark is
coded - to represent a character, need to know the right
code - Network needs to perform conversational actions
- Acknowledgement, slow down, what was that?
- Extra ASCII codes were added to handle these
- Also needs to check integrity of data
16ASCII (examples)
- 32 ltspacegt 48 0 64 _at_
- 33 ! 49 1 65 A
- 34 50 2 66 B
- 35 51 3 67 C
- 36 52 4 68 D
- 37 53 5 69 E
- 38 54 6 70 F
17Other forms of coding
- Can store integers in two or four bytes
- 2 (half-word) can go from -215 to 215-1 (-32,768
to 32,767) - Full-word from -2,147,483,648 to 2,147,483,647
- How about floating point?
- Can also code pure numeric decimal data with
half a byte per decimal digit - Main implementation is Packed decimal, for
example597 would pack as 59 7CX -12345 as
12 34 5DX - zSeries (System/390) still uses EBCDIC for
characters - Conversion overhead on Mainframe/PC transmissions
- Different collating sequences can cause problems
- Double-byte character sets such as Unicode
18Double-byte character sets
- Some orthographies use more than 256 characters,
usually ideograms - Examples Japanese Kanji, Korean Hangul, Chinese
- May also need room for syllabic characters (e.g.
Kana) - and for a range of alphabets
- Problem solved by coding each character in
2-bytes - 64K values are enough
- Fortunately, you need fewer characters per
message - DBCS can be pure or SISO
- Pure DBCS uses two bytes even for Latin letters
- An example is Unicode
- Alternatively you could Switch In and Switch Out
of DBCS
19Other SBCS Encodings
- Even Single-byte coding isnt trivial
- Currency symbols
- Latin alphabet extensions
- National characters (æ ð þ ø )
- diacritical marks (Turkish beats even Czech)
- Greek
- Cyrillic
- Thai
- Some run Right to Left (with L-gtR insertions!)
- Hebrew
- Arabic
20Non-conforming Data
- What if the data were sending isnt just
characters? - Pictures and sounds are a stream of bytes that
can be close to a random selection of binary
values - Binary data might well contain bytes that match
the ASCII code to terminate the transmission - One way is to take seven bytes in and write eight
out - That way you can avoid the values that give
trouble - done in MIME encoding, and in 3270 emulator
downloads - This is why e-mail attachments are sometimes
gibberish - We may also be sending data coded in a different
way - Such as EBCDIC, used on mainframes
21World Wide Web Publishing
- How to write HTML
- (see references for more detail)
22Publishing to a Diverse Audience
- Some users have 14 VGA screens
- Others have 21 high-resolution displays
- Users run many different browsers
- Multiple versions of Internet Explorer, FireFox,
Netscape - or something youve never heard of!
- Some users have character-based terminals, or
dont have bandwidth to spare for graphics - Others have high bandwidth via LAN to server
- How can we make content attractive and yet still
comprehensible to all these users? - The trick is to describe the content, not the
intended layout
23Resources on the Internet
- Internet is a network of networks, sharing a
common 4-byte addressing scheme (e.g.
194.66.202.100) - Computer resources are collected into Domains,
which are usually named, e.g. www.winchester.ac.u
k - Domain Name Servers map domain to 4-byte address
- Uniform Resource locator (URL) made up of three
parts - Service ID (such as http, ftp, mailto, gopher)
terminated with - Domain nameport, terminated with /
- Resource within domain
- Most URLs written service//domain/resource(mail
to does not need the //)
24The http Service
- HyperText Transfer Protocol is the keystone of
the World Wide Web. - Browser transmits request to target domain, where
http daemon the server responds by sending
back the requested resource (usually a file) - Browser then reads file and formats it for
display - While doing so, browser will find mark-up
requesting other resources, and forward them to
the appropriate server usual example is for
embedded graphics - If browser cant handle the resource alone, it
can - Use a helper application such as Excel or media
player - Offer to save the file to disk for future use
25Overall Document Structure
- ltHTMLgt
- ltHEADgt
- ltTITLEgtSimple HTML documentlt/TITLEgt
- lt/HEADgt
- ltBODY text"000060"gt (heres hexadecimal again)
- ltH1gtChapter 1lt/H1gt
- ltPgtThere isnt much in this document.
- This sentence will flow after the previous one.
- ltPgtBut this will be a new paragraph.
- lt/BODYgt
- lt/HTMLgt
26Other Common Tags
- ltHR /gt Produces a horizontal rule on the column
- ltBR /gt Break a empty text element that is
at the start of a line (you can misuse it to
be like a paragraph, but more compact ) - ltULgt Starts an unordered list (with bullets)
- ltOLgt Starts an ordered list (usually numbered)
- ltLIgt List item in either sort of list
- (Lists can be nested, so its important to close
them in reverse sequence) - ltEMgt Emphasised text (usually italic)
- ltSTRONGgt Strong text (usually bold)
27Advanced Text-descriptor Tags
- ltDIRgt Starts a Directory list (multi-column)
- ltMENUgt Starts an unordered list without bullets
- ltDLgt Starts a Definition (or Glossary) List This
contains two kinds of list item - ltDTgt The Term being defined
- ltDDgt The Description defining that term
- ltPREgt Pre-formatted text (as in an example)
- ltTABLEgt Well build tables later
- Exercise
- Experiment with the various list types. Try
nesting them.
28Creating Hyperlinks
- Any hyperlink reference needs to say what it is
linking to - In HTML, we use an Anchor tag with the HREF
attribute - ltA href"http//www.pdq.edu/freds.htm"gtQuick
Univlt/Agt - ltA href./freds.htm"gtLocal referencelt/Agt
- You can reference any resource on the Internet
Just give its URL - Any lack of specificity means look locally, so
missing out the domain means it is in the local
file system - Always leave out as much as you can
- Makes it much easier to move the site
- Can also use relative references, e.g. to a
sub-folder ltA href./subdir/fred2.htm"gtrelative
referencelt/Agt
29Internal Bookmarks
- You can also name a target inside a resource
- Like a bookmark in Word
- Also coded on Anchor tag, this time as NAME
attribute - ltA name"phred"gttarget of the linklt/Agt
- ltA href"phred"gtClick here to get to targetlt/Agt
- or if the link may be from a different
document...ltA href"http//www.pdq.edu/freds.htm
phred"gtClicklt/Agt - So the full form of the HREF attribute is a URL
followed by and a named anchor inside the URL - Missing out the resource means its in this
document - If the name is omitted, it refers to the top of a
resource
30Graphical Images
- Easy to imbed with the IMG tag
- Need to define the source of the image
- Example ltimg src"fred.jpeg" alt"fred/gt
- Text of alt attribute appears on non-graphical
displays You can also use attributes to modify
the image - ltimg src"/mh.jpg" width"80" alt"Picture of
Mike"gt - Image will be 80 dots wide, in original aspect
ratio(dont set width and height, it can distort
the image) - Use align attribute to place it right left or
center(HTML uses US spelling even though it
was originally written by an Englishman working
in Switzerland!) - Use images in JPEG or GIF format (never BMP!)
- GIF better for line drawings, JPEG better for
pictures
31Stick to Relative Addressing
- At some point, well want to move pages and
images on to a real Web Server - Can test most things on local disks, providing
we address directories relative to the current
page, for example - lta href"next.htmlgtforward to next pagelt/agt
- meaning switch to next.html in the current
directory - ltimg src"../graphics/freddo.jpeg" alt"fred"gt
- meaning go to next directory up, then look in its
graphics subdirectory - CGI scripts and Image maps do require a server,
so cant usually be tested purely from disk
32HTML Covered So Far
- Overall Document Structure
- ltHTMLgt, ltHEADgt, ltBODYgt tags
- Headings and other text tags
- ltH1gt, ltH2gt..ltH6gt tags ltPgt, ltBRgt, ltEMgt, ltSTRONGgt
- Lists and the items within them
- ltOLgt, ltULgt with ltLIgt
- ltDLgt with ltDTgt and ltDDgt
- Anchors and Hyperlinks
- ltA name"target"gt Text labelled (if any)lt/Agt
- ltA href"where_to_link_to"gt Explanatory textlt/Agt
- In-line graphics
- ltIMG src"path to image" alt"dont forget
non-graphic user"gt
33HTML Reference Materials
- Library has some OReilly pocket reference books
about HTML and the Web (see module handbook for
references) - Or you can use one of the primers on the WWW
- Tom Drewrys Guide to HTML tags at
http//www.cems.uwe.ac.uk/tdrewry/html/index.htm - Marc Andreessens athttp//www.web-nation.com/les
sons/html-pri.htm - http//www.mcli.dist.maricopa.edu/tut/index.html
- http//www.telacommunications.com/nutshell/primer.
htm - Web design guidance http//www.winchester.ac.uk/de
signproject/ - HTMLcard.html local copy (archive of NCSA primer)
34Writing your own HTML
- See separate document for simple exercises (Week
3 on the Learning Network) - Exercise 1 gets you in there looking at the HTML
source - Pretty easy to do, providing you think about what
each element of the document is, rather than what
it should look like on the screen - Normal process is to have a Notepad window for
sourceand a browser window to view the results - Update source in Notepad and Save
- Flip to browser and Reload to see the effect
- Exercise 2 has you writing your own HTML
- You can re-use stuff from the other files if you
wish
35Backing Up
- Reasons for Back-up
- Protect against loss of medium containing main
data - Protect against destruction of data itself (e.g.
Erase file) - Disaster recovery reconstruction of entire
system - Full, Incremental or Journal Strategy
- Full backup is greedy on backup medium (and time)
- Incremental backups have to be restored in order
- Data since last backup will be lost
- Journal approach saves missing any change
- RAID can minimize risk from hardware failure
- Doesnt help you recover a deleted file
- Can avoid need to journal
36RAID
- Redundant Array of Inexpensive Disks
- Principle is to store the data more than
once,then if you lose a bit in one place, you
can use the copy - Mirroring is a simple approach
- Two copies of data, each with checking
- When one copy fails its check, refresh from other
- If the checks are more complex, you can fix a
lost bit, even without full duplication (32
example last week) - RAID-5 is the most common implementation
- 5 disks holding data that would fit on four of
them - RAID controller rebuilds data when you hot-swap a
disk - Still wise to back up to tape
37Tape Back-up
- Head gap limits how small magnetic domain can be
- Small gaps are sensitive to dust and give low
output - Fast movement increases output as well as data
rate - Two tape types in common use
- Linear (like cassette, DCC) QIC or Travan
technology - Helical scan (like video tape) 4mm DAT and 8mm
- Linear machines are cheap, but need expensive
tape to cope with the low speed of the tape - DAT tapes are cheap (lt5 for 2GB) but drives are
pricey