LECT Websys - Lecture notes 1-10 PDF

Title LECT Websys - Lecture notes 1-10
Course Web Systems
Institution University of Technology Sydney
Pages 40
File Size 1.4 MB
File Type PDF
Total Downloads 81
Total Views 142

Summary

Online lecture...


Description

WebSys Lecture Notes Week 1 Contacting UTS You MUST put [31268] in the subject line Subject coordinator- [email protected] “ .... introduction to information technology using the web as a core case study. ... learn about the underlying hardware, software, networks and operating systems behind websites ... set up a functional website..." Tech and applications used Use Linux platform to practice using Unix Use HTML to develop web pages Use CSS (Cascading Style Sheets) to decorate these web pages Textbooks Fox, Richard., Information Technology: An Introduction for Today’s Digital World (2013), CRC Press, ISBN 978146656828 // avail on UTS online lib, search 31268

Week 2- Operating Systems Introduction - Web is a gigantic network of computers, networks of networks of routers, switches and devices as applications - Operating sys is a piece of software that sits between all programs and the computer’s hardware - What does it do? o It manages the computer runs programs o is the interface between users and the hardware o provides services to progs& users o protects users and programs from each other (ie it prevents users from deleting the OS, which would be terrible) Common Operating Systems - Large systems o Mainframes- pioneered OS in the 60s  IBM still run them, named z/OS which still runs old progs  sHandles 1000s of users simultaneously  IBM mainframes also run Linux as sub systems underneath it  Supercomputers now tend to run Linux (ie stock market sys)  Very exp o Minicomputers  Used by smaller scale companies  Open ran VMS and IBM ran OS/400 on it  Other companies ran Unix, typically ran on PDP 11 or VAX, or made by a DEC (digital equipment corporation)

-

-

Personal computers o Linux o MS windows, Mac OS/S (actually a version Unix) o BeOS, CP/M, Amiga Embedded sys o Very critical, safety and real time access systems o Eg military (missals run on VxWorks), o Could be low memory, slow processes and no storage eg the IoT (internet of Things) called Arduino or Raspberry Pi or sensor on the street o Telecommunications eg internet router runs an OS or heat telephone exchange o Other eg- in aerospace, satellites have an OS

“Onion Layer” model of OS - OS can be constructed in a set of layers - Hardware layer includes o CPU o Memory o Input/ output devices  Eg mouse, keyboard/ monitor, printer o Storage  Eg flash, hard drives etc - Kernel layer o Controls the hardware directly  Eg device drivers, firmware etc o Provides resources and services to applications  Eg an application needs some CPU to actually run and it needs some memory and storage and interact with the user o Also has security controls that manages access to privileged resources  Eg an application that u run is not allowed to override an OS or read contents from another user’s application  Virus- violate these access controls o Problems in the kernel affects the hardware, eg a bad device Java could result in a system crash (kernel pieces of software must be written absolutely correct) - Applications layer o Aka userland, user space o Applications  Designed to run programs that does “something” for the user o Services  Are programs that run “behind the scenes”  Usually provides system support eg security- antivirus scanning, networking- wifi - Interface layer o Shell



Aka command line interface (CLI) or interpreter, command prompt, terminal etc  A prog that makes a lot of commands available to the user  For systems that don’t have a graphical user interface o Graphical user interface (GUI)  A user friendly interface on top of the OS  Often runs the shell commands transparently  Sometimes a WEB interface

-

Interface Web pages are connected to servers on the internet Typically, servers serving the web have no keyboard and no display

Designing a user interface 1. Pick intended audience. eg  Novice user- end user/ non IT person  Expert user- system administrator  Gamer w special controls, or a remote control car system 2. Good workflow 3. “polish”- aesthetic 4. Consistency- should make sure any action we take is the same sort of action you would take anywhere within the operating system’s user interface 5. Psychology- understand human computer interaction  Cognitive scientist (specialised psychologist) analyse how people think  They predict how people will react to certain stimulus  You do many iterations (versions) of user interfaces to see how they use the comp, how they react and then feedback into the development of the user interface GUI vs CLI Command line interface (CLI) - interact through keyboard and a monitor which only prints text - were the first type of interfaces for computers - when unix came out in 69, the very first CLI was called shell (sh), which is the predecessor of the current bash or c-shell - CPM is the predecessor of MS-DOS - cmd.exe (command)- windows shell, still the current sys. Has been replaced in many ways by a system called Powershell in the latest iterations on windowns. Also available on many Linux systems Graphical user interface (GUI) - interact via windows, icons, menu, pointer devices (incl touch), called “WIMP” interface - 1983 Apple – Lisa, Mac OS - 1984 Unix- Gnome, KDE - 1985- MS- Windows 1.0 - 2001- Apple- Mac OS X& MS Windows XP

-

2006- MS Vista Aero (8) 2010- MS Metro (10 onwards)

GUI vs CLI, which is better? - Neither, each of them is appropriate and important - Both have strength and weaknesses - Quite often you will combine them both Why have multiple interfaces - Customisation- toolbox approach, you want to change the interface to suit your needs - Automation- automate mundane tasks - Understanding- you need different levels of understanding for different interfaces (eg commands to use CLI)

Strengths

-

GUI Little/ no experience requited Good for graphics eg artwork, desktop pub User friendly, intuitive Hides complexity from users

-

Weaknesses

-

-

Can’t do everything (CLI has more options than what’s exposed on GUI/ easier to just use the keyboard) Crash the system (eg mouse freezes) User is unsure of what the OS is really doing Uses a lot of computing power  slows comp down Needs better hardware Hides complexity from users

-

-

CLI Greater flexibility (eg combine commands) Fine tuning  parameters Essential for sys admin Faster, less overhead Runs on simple hardware Can run remotely (even if internet is v slow) Robust- diff to crash, you have the ability to interrupt and have full control of the command you execute Hard to learn- cryptic commands& parameters Multiple options to do one thing Output is often cryptic or non-existent Inconsistent commands across diff versions of CLI (diff versions of Unix& DOS) No graphics No safety net `

Scripting Batch files and scripting languages - You can automate CLI’s via a Batch file (eg /bin/bash or \windows\system32\cmd.exe) o Simply a sequence of commands in an executable file o CLI treats the file as a command

-

-

-

Most CLIs include programming features  logic, calculations, variables, user input… Some GUIs also have batch facilities (called macros) This type of prog lang is called a “scripting language” egs… o shell, Bash, K shell, C shell, Z shell… o Windows DOS/CMD Batch Language o WMI (Windows scripting language), VBScript o JCL (job control lang) used in mainframes o Applescript o Python Scripting language characteristics o Variables are usually untyped (called “loosely bound”) meaning the same variable can be used as a number or a string o Language syntax is often inconsistent- Often designed and created by one person to get a particular job done o Usually run through an interpreter, not a compiler  A program reads the actual operations in the file and the executes them These languages tend to gain extra features as they evolve o EG pearl  Started as a scripting lang, now almost a generic prog lang o Windows shell (classic command) replaced by powershell which has more “real” programming features o Bash (Linux default CLI) used to be very primitive, now includes arrays, data types etc (features of std prog lang)

Week 3 Unix - Has been used continually since 1969 - Is used on most of the computers running the internet (web servers, domain name servers, email servers, web hosting) - Unix is not only used by “geeks who run the internet” but also ordinary users as Mac OS/X is based on UNIX o The user interface is fancy but the underlying sys is UNIX called Darwin - Also used in netbooks and routers etc - There are many versions of Unix, most are based from 2 original versions o System V – the original version from AT&T o BSD – from the uni of California o Difference – commands with different options, diff structures of directories for sys administration - Ad Hoc development o Quite a lot of Unix, especially the various scripting languages and the individual commands grew up in an adhoc and unregulated haphazard fashion o While this resulted in a much more powerful and versatile OS, it also results being confusing at the user level - A standard for Unix commands was finalised in 2002 called SUS- single unix specification o If version meets specs  can be called Unix, otherwise called Unix-like o Technically Linux is Unix-like - Why has Unix survived? 1. No one owns these ideas o no one parented unix, they didn’t even copyright it (none of which are secret) o All the fights were a few source codes and headers 2. Any person or group is free to implement these ideas o Only a few lines of code are part of the “official” Unix (system V) which are copyrighted 3. Unix is based on simple concepts o Ie files, processes, permissions and users o Even hardware devices eg dev/ mouse are represented as files o This has simplified the conceptual pic of unix (if nit the internal code) o It has also allowed unix to incorporate new ideas and tech quite easily 4. Unix is portable o Unix is written in prog lang C i. Ie its not tied to any particular CPU ii. Any computer with a C complied can usually compile the source code 5. Unix (at least some varieties) is free o 1993 onwards had free versions of unix (eg Linux, FreeBSD)

o Esp available to cheap intel based PCs- lots of them around because of MS windows 6. Efficient, stable and relatively secure o Unix is fast and stable (sys crashes are rare) o Designed for security for multi user systems – files have owners, security for permissions are tight  therefore fewer viruses for Unix 7. Has a toolbox approach o The Unix CLI has some very powerful features i. Simple commands ii. Pipes- you can pipe output from one command to another to make a complex tool iii. I/O redirection File Systems How data is stored in the web? It is impossible (too much) for the whole web to be stored in a single file directory. The operating system manages resources eg File System -

A file system is a part of the operating system that manages data storage and access Classified into o Logical file system  User view of a file system (files, directories/ subdirectories, partitions) o Physical file system  How files are stored “internally” in computers  How these items are physically represented and stored

Logical file system - Files o Executable files (programs) o Data files (eg HTML, gifs, JPEGs, word docs) - Directories o Store files and usually subdirectories o Often hierarchical (“tree”) format o Eg \ or C:\ or C:\userdata - Partitions o Some directories may reside in different partitions from other directories o Represent the physical infrastructure in PCs o Eg drives, CDs, USBs - Directories vs Partitions o Directories- purely there for a logical division in the file sys (organisational purposes). Typically used for users of the system to see how files are organised o Partitions  More related to the physical insfra of the system  You can mount and unmount partitions eg insert or remove a USB



-

Independent of each other- unmounting one partition does not impact the OS, root directories or others partitions – eg back up one without impacting others, place disk quotas on one but not others  MS windows often calls these “drives” eg C: In some OS, eg Windows, you have multiple roots, so you wouldn’t have “/” but they are still structured logically just like every other file sys o The OS makes the “names” of these partitions you mount in for you

Theory of Trees - Definitions o a tree is a collection of nodes along with a relation (parenthood) o an edge is a branch of a tree (a  b means a is the parent of b) o every node in a tree (except the root) has exactly one parent, the root has no parent o a leaf is a node that has no children (eg a file/ directory w/o files) o siblings are nodes which have the same parent - Unix file system is a Tree o / means root of the file system o /[name] means a branch of the file sys o . means current directory o .. means parent of current directory File systems and file manipulation - How is data stored on computers of the internet? o Google- a lot of drives connected to lots of serves in 20+ data centres around the world  called a distributed file system o UTS- we have 2 data centres  We put our files into a central file sys called SAN (storage area network) + drives on various servers

-

Drives, disks stc Typically, PCs have 1 physical storage device ie hard disk, SSDs 1. Disk physical structure o Hard drive- a disk is a stack of magnetic platters, this stack is divided into cylinders, each cylinder contains circular tracks which are in turn divided into sectors o Read/ write operations are provided by the disk heads, these move concurrently along the fixed disk arm o The disk itself rotates with constant angular velocity to provide access to every sector o SSDs have no moving parts, but emulate a rotating hard disk o Disk formatting



-

-

Formatting is the operation which creates the physical disk structure (done at a hardware level)  Formatting is organising and marking the surface of a disk into tracks, sectors and cylinders  This term is sometimes misused in the MS windows world where it refers to a term used to signify the action of writing a file sys to a disk 2. Disk logical structure o Partitions – disks can be subdivided into partitions  Each is an independent storage device  Windows usually has 2, 100mb each divided into a boot partition and C:, main data o Blocks  The OS views all the disk space as an array of fixed size logical blocks  A logical block is the smallest unit of data to transfer (even if you have a file size of 1b, but the logical block is 4Mb, 4Mb will b transferred when you transfer that 1b) 3. File allocation methods o Block- space is allocated to a file as one or more blocks (ie if one block is 100mb, and a file is 120mb, the file will be split across 2 blocks) o Directory- is a table of information that the OS uses to locate blocks associated with files on a disk (index of files) o Three common types of file allocation  Contiguous allocation  Blocks are allocated to a file at the time of creation  Supports random access, since you know exactly where every block is after the starting block  Con- fragmentation of unused space (external fragmentation) will occur, needs compaction  Often used in magnetic tapes rather than disks  Chained or linked allocation  File is written as a collection of non-contiguous (not next to each other blocks)  File is implemented as a linked list of blocks  Each block contains a (pointer to) the address to the next block, last block contains an invalid (negative) number (end of file maker)  Directory entry contains the head (starting) block number and length of the file  Chained is good for sequential access (archival, eg backup), bad for random  Indexed allocation  “tree” based allocation sys  A special index data block will contain a list of data blocks for the file  If the file is too big, the index data block will point to the other index data blocks  Is the only reasonable option for large systems

o Indexed- UNIX  On unix, files are stored on blocks called an inode  Each file/ directory is referenced by an inode (all inodes are numbered)  Directories are special blocks on disk which contain the names of the files and the inode no for the file   Very efficient use of space and fast to read blocks  Inodes store:  File metadata- size, owner ID, permission, timestamps but it does not contain the name of the file  Pointers to the blocks that store the files data  (optionally) single indirect blocks (pointer to a disk block which contains an index pointed to data blocks), double indirect blocks, triple indirect block  You can have different names leading to the same file (fig) called “links” in Linux Complexity - Efficiency measured by the complexity theory “how much time is required to find a particular block of the file?” - Contiguous file sys o Only need one read O(1) o To find block no x used formula = starting block + x -1 - Chained/ Linked o O(n) – this is proportional directly to the number of blocks in a file o You have to read each block sequentially until you have reached the block# required o Ie it needs 6 reads to get to block 6 o On average, it takes n/2 reads to find a particular record - Indexed o O(log n)- proportional to the shortest path in a tree o Called logarithmic cause it is a binary search o egs-

O(1) It’s always going to be a constant number of reads for the file hence super-efficient O(log) has a very low riser hence also efficient

o EG laptop file system (400,000 files, 178Gb)  Contiguous- 1 read, but fragmented  Chained/ linked- 98 million reads  Indexed- log10(178x109) = 11 reads needed! Week 4- the web and human-computer interaction

-

The web and security Basic security principles o Confidentiality  Information is accessible only to authorised users  Ie can it be seen (encryption) by whom (authentication)/ when/ where (access controls)/ how (location, transmission path, protocols)? o Integrity  Safeguarding accuracy/ completeness of  – information  – processing methods 1.Only entered / altered by authorised users 2.Cannot be altered without detection • In storage or In transit (hasn’t been changed without you knowing)  Detection  Using audit trails  Mathematical means – hashes, checksums, message digests o Availability  Ensuring authorised users have access to information/processing when required



i.e.: 

-

1.Systems survive failures – Have hot/cold standby mechanisms  2.Systems resist attacks – Resistant to Denial of Service (DoS) attacks  Users can access from authorised locations Security service- makes use of one or more security mechanisms (designed to detect, prevent or recover from a security attack) Security attacks- Any action that compromises the security of information.

Types of security attacks Web browser

Web server

Eg someone makes a copy of your details

Typical security services - Confidentiality – privacy – encryption - Authentication - who created or sent it - Integrity - has not been altered - Non-repudiation - the order is final (eg pay by PayPal, you can’t reverse the order) - Access control - prevent misuse of resources (levels of acess) - Availability - permanence, non-erasure Security services - Confidentiality, integrity and non-repudiation use encryption techniques - Confidentiality- use encryption to protect the privacy of that information Security service: Encryption - Encryption – converting plaintext into ciphertext to prevent non-intended recipients from reading. o e.g. Using rot13 encryption, “The butler did it!" becomes "Gur ohgyre qvq vg!" This is done by scrambling (rot 13 shifts characters down by 13) - secret key cryptography o Most trivial crypto use Symmetric key encryption  E.g. Data Encryption Standard (DES)  E.g. You use a password to protect the file. o Problem is...


Similar Free PDFs