Networking and the Internet 6 - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Networking and the Internet 6

Description:

Compilers and linkers; interpreters (Willis, ch.7, sect 7.7) ... Other browsers climbed on to the bandwagon. HTML standards committee added the facility ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 27
Provided by: EricB114
Category:

less

Transcript and Presenter's Notes

Title: Networking and the Internet 6


1
Networking and the Internet (6)
  • Last Week
  • Compilers and linkers interpreters (Willis,
    ch.7, sect 7.7)
  • Interrupts and status processor modes (Coope,
    chapter 9)
  • Module assignment
  • HTML Frames and Practical
  • Checkpoint review of the module so far
  • Introduction to Glossary in topic 0 of Learning
    Network
  • Week 6 Focus
  • Data integrity in a networked environment (first
    part)
  • HTML Practical
  • Workshop for assignment due Thursday May 7th

2
Review of the Module
  • So far we have covered
  • Uses of networks in Business
  • Introduction to e-Business
  • What is the ideal B2C product?
  • Systems for Networks
  • Operating Systems and File organization
  • CPU design and Performance issues
  • Compilers and linkers interpreters
  • Interrupts and vectors processor modes
  • Online Computing (Interactive versus
    Transactional)
  • Time-sharing, multi-programming, transactions
  • HTML
  • basics, links, tables, Frames, practical
    exercises

3
The Rest of the Module
  • Still to Come
  • Data integrity in a networked environment
  • More on the seven-layer model of Computer
    Networks
  • LAN and WAN technologies, Network security
  • Data transmission
  • Network types
  • Relieving bottlenecks
  • Communication protocols and formats for
    transmission
  • Voice-Data integration
  • Anything else we should be covering?
  • What changes are needed?

4
The Glossary
  • The class of 2004 suggested having a single
    source for all the abbreviations and terms used
    on this module
  • My start was improved by input from Stephen White
  • And Ive added more as new topics have come up
    since
  • This Glossary is held on the Learning Network and
    at http//www2.winchester.ac.uk/bm/Courses/BS2911/
    BS2911-Glossary.doc
  • Please suggest any other entries needed
  • Ideally provide an entire entry term and
    definition
  • It doesnt have to be perfect, as I may be able
    to polish it
  • e-Mail is probably the best way to do
    this(though we could build it by a conference or
    a Wiki on the Learning Network)
  • We can print it when weve covered your key
    concerns

5
Goals of Distributed Systems
  • To get the best out of both servers and client
    systems
  • Fast response times to user
  • Data integrity in the system as a whole
  • High availability and reliability
  • Low maintenance costs
  • Server offers
  • Secure, fast access to data
  • Integrity and effective back-up
  • Access independent of workstation
  • Client workstation offers
  • User-friendly interface
  • Local processing where central data not needed
  • MIPS at lower cost than on mainframe systems
  • Meaningless Indicator of Processor Speed

6
Distributed Data Models
  • UNIX allows you to link data structures
  • the mount command attaches a directory hierarchy
    as part of another hierarchy
  • Can mount directories from other systems (a bit
    like mapping a network drive in Windows)
  • Requires message interchange to maintain data
    provided by the Network File System or
    equivalent
  • Many database systems provide automatic
    replication between systems
  • For example, Oracle, DB2, Lotus Notes
  • Locking is a serious problem with peer database
    engines
  • how do you stop 2 copies of a field being updated
    at once?
  • Coordinating adds network delay even to local
    updates

7
Distributing Function
  • Most systems contain a mixture of
  • Data Management
  • Business logic
  • Data presentation and user interface
  • This can be distributed asymmetrically, for
    example
  • Data Management on a server
  • Business logic on the server
  • Presentation logic on a workstation
  • or you could split business logic, e.g. to
    validate input before sending it to the server
  • Benefit of asymmetric distribution is that data
    integrity is under the control of a single system
  • Great until the server fails!

8
Programming Models
  • Function Shipping, as in NFS or CICS
  • Application issues data request to environment
    (or OS)
  • Environment generates messages to another system
    to request action on the data
  • Transaction Routing, as in CICS
  • Client system invokes a transaction thats not
    local
  • CICS routes the request to another system
    (usually a server) where associated program is
    run in its entirety
  • Remote Procedure Call (RPC)
  • Logic on workstation invokes procedure on the
    server
  • Procedure runs, and returns control (and results)
    to caller
  • Environment handles RPC messages
  • Permits complex structures of networked logic

or vice versa
Network File System
9
Integrity What makes it hard
  • In a single system, events can be synchronized
  • On uniprocessors, nothing is really simultaneous
  • Inter-process communication is affordable
  • The system can avoid concurrent updates by
    locking at record level, or by serializing update
    activities
  • On a distributed system, simultaneity is possible
  • Anything that can go wrong will eventually go
    wrong
  • So we usually have an owning site for any
    data,and ship all requests there
  • But theres still a problem when two separate
    bits of data are updated within a unit of work
  • Credit account A with X, and debit B with X (or
    do neither)
  • If accounts owned on different machines, one
    action might fail after the other has completed

10
Logic split between Systems
Inter-systemcommunication
  • B is effectively working for A in this example
  • During running of As program, code calls
    function on B
  • B does the required activity (e.g. debit), then
    returns
  • In this case, A waits until B returns
    control(but what if it ran on doing local
    things?)
  • What if link fails after B has changed its data?

11
Logic split between Systems
Inter-systemcommunication
Server
Client
  • A makes a request of server B
  • It then waits while B runs the program
  • When B returns the results, A continues working
  • In principle, A could have run on doing local
    things,but eventually its going to have to wait
    for Bs response
  • Integrity risk if link fails after B has changed
    its data

12
Data Integrity
  • Consider a banking transaction B pays A 100
  • System must decrement Bs account
  • AND increment As account
  • If it cant do both, it must do neither
  • In real life, the actions cant be atomic, so
    transaction monitor (such as CICS) groups them
    into a unit of work
  • Starts unit of work
  • decrements Bs account, logging previous state
  • Increments As account, logging previous state
  • Commits changes (or backs out if something fails)
    at end of unit of work

13
Two-phase Commit
  • One way to preserve data integrity is to back out
    any changes made if the unit of work aborts, e.g.
  • System A logs the before state of the account
    it owns, then credits the account (speed limited
    by disk and need to move data between systems)
  • System B logs the before state of the account
    it owns, then debits it, then notifies A that
    its ready to commit
  • System A reacts to Ready by confirming commit to
    B no delay for disk activity or volume data
    transmission
  • System B gets confirmation and purges its log
  • Similar logic applies however many nodes are
    involved (you effectively run along a chain of
    nodes)

14
Window of doubt
  • What if link goes down after A has received
    Ready to commit from B?
  • Could we end up with after state at A and
    before at B?
  • CICS deals with this by maintaining logs until
    the loop is closed, even if this is days later
  • If B comes back and NAKs the commit, A can
    back out the change
  • If B comes back and confirms, A can purge its log
  • What about other transactions that hit the same
    data in the meantime?
  • Can probably maintain integrity of values in the
    file
  • But some decisions taken might be based on values
    that will later be backed out

See glossary
15
Synchronous or Asynchronous
  • Everything so far has been synchronous
  • Client cant do anything until the server has
    responded
  • Thats important if youre taking decisions on
    the way
  • But business often includes activities that can
    run at their own speeds
  • We dont do everything by phone
  • If no conversation is needed, we write or leave a
    message
  • Even applies to payment we can send a cheque by
    mail
  • Distributed processing can also work through
    Messaging
  • We do need a way to guarantee that the message
    will arrive
  • And that it will arrive once only
  • Queuing is helpful to keep messages in sequence

16
Advantages of MQ Approach
  • Simple
  • Allows easy connection of heterogeneous systems
  • Asynchronous operation is built into the model
  • Coping with failure is inherent
  • You never know when the message will arrive,so
    you have to design around non-instant delivery
  • Network failure is simply an extended case of
    this
  • Depends on integrity of infrastructure
  • Since many customers and systems use same
    vehicle, problems will get ironed out quickly
  • Well cover Messaging and Queuing next time

17
Module Assignment
  • The Site (two-thirds of assignment marks, split
    equally between design and coding)
  • Pick a topic that interests you
  • Produce a site with 4-6 pages
  • Work in straight HTML no Dreamweaver, Front
    Page etc
  • Cascading style sheets good, but not required
  • Put the site on to an ISP if you like, but also
    hand it in on the USB stick this will prove
    that its portable
  • Write up your development process (one third)
  • Summary of what you set out to achieve
  • Review of what you discovered during development
  • Reflection on what you did

18
The Mechanics of Writing HTML
  • Need at least two windows open
  • A browser to test your page in e.g. Internet
    Explorer
  • An editor to update it in Notepad is fine
  • Internet Explorer View Source opens file in
    Notepad
  • Can then modify the file, Save it,
  • Then check the effects in IE
  • If you use frames, View Source on menu ?
    right-click View
  • Reality is that most pages are based on existing
    ones
  • Get file into Notepad
  • Save As with new name (make sure extension is
    right )
  • Modify the content as you wish including the
    Title
  • You never have to bother typing ltHTMLgt ltHEADgt etc

19
Using Graphics
Never use BMP
  • Pictures inserted with image tagltimg srcurl
    altalternative textgt
  • Use JPEG format for photos, GIF for line drawings
  • Ideally manipulate the image to the size you need
  • Most systems have Microsoft Photo Editor lets
    you crop and resize images
  • Can also resize with width or height attributes
  • Dangerous to use both, as you can distort the
    image
  • Use one or the other, or take care to preserve
    aspect ratio
  • If image cant be displayed, browser will reserve
    space using these attributes, and show value of
    alt attribute
  • Better to scale down than up, but file size isnt
    affected large images will still be delivered
    very slowly

20
Reminder Creating 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

21
Some HTML Primers on the Web
  • The original NCSA primer has been removed, but
    theres a printable archive on our web-site
  • Two good primers are available on-line at
  • http//www.w3schools.com/html/html_intro.asp
  • http//www.web-nation.com/lessons/html-pri.htm
  • This is Tony Drewrys clear exposition of HTML
    tagshttp//www.cems.uwe.ac.uk/tdrewry/html/index
    .htm
  • A very wide-ranging site, covering everything
    from simple HTML to XML and databases
    http//www.w3schools.com/
  • Any more favourites?

22
Remaining slides are revision
  • Frames topic from Week 5

23
Netscape Frames
  • Typical Example of how HTML has grown
  • Netscape extended HTML to address a navigation
    issue
  • Other browsers climbed on to the bandwagon
  • HTML standards committee added the facility
  • Idea is that we can attach pages within logical
    frames inside our page
  • Gives common look and feel to site
  • Makes navigation information permanently
    available
  • Lets you include alien material in your website
  • BUT
  • Burns up valuable screen real-estate

24
Frames
  • Frames are a useful way to organize content of
    screen
  • You can have a fixed bit, perhaps for navigation
  • and what the user does there can control what
    appears in another frame
  • E.g. we might have choice of what appears in the
    RH pane
  • Normal way to organize modern web-sites
  • Details on the web at http// sharkysoft.com/tutor
    ials/frames/
  • Summary in your notes
  • Basic structure is a page that defines
  • how it is split into frames,
  • hyperlinks to the resources that go into each
    frame
  • Awkward shapes can be produced by binary chopping
  • Each frame can be named
  • You can control which named frame gets updated
    with next resource
  • or even create a new browser window
  • Best way forward is to try it

25
Learning about Frames
  • As usual, the best thing is to try it with a
    simple example
  • Download http//www.winchester.ac.uk/bm/courses/BS
    2911/frames.zip
  • Extract everything in it into a folder on your
    machine
  • Edit the file framed.html using Notepad
  • Can you work out what its meant to do?
  • You may need to look inside the components it
    links to
  • Open framed.html
  • Does it behave as you expected?
  • What happens when you resize the window?
  • Try to understand exactly whats happening

26
Frames Exercise
  • Create a page called xxx.htm (you choose the xxx)
  • Divide it into three frames
  • Split the page vertically into two equal parts
  • Left initially displays a trivial page you create
    call xxxL.htm
  • Split the Right-hand half horizontally 7030
  • Top 70 of the RH, displays a trivial page called
    xxxTR.htm
  • Bottom 30 of the RH is for navigation store as
    xxxBR.htm
  • In Bottom-right frame
  • Provide hyperlinks to load target pages into the
    left-hand and top-right frames
  • And heavier-duty hyperlinks to replace whole page
  • Associate graphics with each hyperlink, e.g.
    arrows
  • You can base all future frame-sets on this!
Write a Comment
User Comments (0)
About PowerShow.com