1 / 27

Networking and the Internet (6)

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

aurek
Télécharger la présentation

Networking and the Internet (6)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 6th

  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 for 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 I’ve 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 doesn’t 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 we’ve 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 information 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 that’s 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. Data Logic split for a CICS System Client TOR Network Interface System code – Routes work to applications Terminal owning region User InterfaceUsually on PCCICS has “thick client” Transaction routing ” Transaction routing Applications Not system code AOR • User asks to run transaction • TOR routes it to an AOR • Application ships data request • FOR owns, reads, writes files application owning Function shipping Data Server System code to read files/DB FOR file owning

  10. 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 • That’s why we usually have an “owning” site for any data,and ship all requests there • But there’s 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

  11. B A Programstatementscall sysB prg Xwrite data AReturn Program Xstatements…...write data BReturn Data of B Data of A Logic split between Systems with RPC • B is effectively working for A in this example • During running of A’s 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? Inter-systemcommunication

  12. B A Programstatementscall sysB prg Xwrite data AReturn Program Xstatements…...write data BReturn Data of B Data of A Logic split between Systems with RPC • 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 it’s going to have to wait for B’s response • Integrity risk if link fails after B has changed its data Inter-systemcommunication Server Client

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

  14. 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 it’s 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)

  15. 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 *NAK =Negative Acknowledgement See glossary

  16. Synchronous or Asynchronous • Everything described so far has been synchronous • Client can’t do anything until the server has responded • That’s important if you’re taking decisions on the way • But business often includes activities that can run at their own speeds • We don’t 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

  17. 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 • We’ll cover Messaging and Queuing next time

  18. 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 it’s 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

  19. 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 <HTML> <HEAD> etc

  20. Using Graphics Never use BMP • Pictures inserted with image tag:<imgsrc=“url” alt=“alternative text” /> • 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 can’t be displayed, browser will reserve space using these attributes, and show value of alt= attribute • Better to scale down than up, but file size isn’t affected – large images will still be delivered very slowly

  21. 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 • <A href="http://www.pdq.edu/freds.htm">Quick Univ</A> • <A href="freds.htm">Local reference</A> • 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 <A href=“./subdir/fred2.htm">relative reference</A>

  22. Some HTML Primers on the Web • The original NCSA primer has been removed, but there’s 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 Drewry’s 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?

  23. Remaining slides are revision Frames topic from Week 5

  24. 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

  25. 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/tutorials/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 Frames

  26. Learning about Frames • As usual, the best thing is to try it with a simple example • Download http://www.winchester.ac.uk/bm/courses/BS2911/frames.zip • Extract everything in it into a folder on your machine • Edit the file framed.html using Notepad • Can you work out what it’s 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 what’s happening

  27. 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 70:30 • 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!

More Related