Docstoc

EIT 310 Lecture 6

Document Sample
EIT 310 Lecture 6 Powered By Docstoc
					IT 210
WEB Architecture vs.
WEB SYSTEM Architecture
Admin
 Nearing end block A
 Due date for all block A materials
 Note HW for this week
Web System vs. Architecture
WEB Interface:
  What the user sees, hears etc.
     Documents, videos, audio etc.
  What the user interacts with
     Clicking, gesturing etc.
  The Web interface is managed by the
  web architecture
WEB Architecture:
  How one links together documents.
  How one presents document
  relationships.
  How one interfaces to dynamic content.
  How one keeps context in the network
  of documents.
WEB SYSTEM Architecture
  How one organizes the network of
  services to present the WEB
  architecture.
  How one allocates tasks between the
  browser, the web server, and other
  support servers to implement the
  network of services of the WEB
  Architecture.
Building Blocks
  Client – user of a service
  Server – provider of a service
     Recursive: Servers can be clients of other
      servers
  Each client/server interface is the
  boundary of a “tier”
     Single-tier – one client/server boundary
     Multi-tier -- Servers are clients of other services
Today’s overall lesson:
 To do a web task…
    There   may   be   an easier way
    There   may   be   a more elegant way
    There   may   be   a more scalable way
    There   may   be   a faster way
      Development time
      Page latency
 …but, there is no single way to do a task
What is CGI?
  Common Gateway Interface
  A specification, not a language
     RFC 3875
  Communicate between browser and
  server with external program (script)
  Depends on html and http
  A way to make web pages dynamic
Wikipedia Definition
  ―(A) method for web servers software
  to delegate the generation of web
  pages to executable files. Such files are
  known as CGI scripts; they are
  programs, often stand-alone
  applications, usually written in a
  scripting language.‖
      Wikipedia: ―Common Gateway Interface‖
  Invoke through
<A HREF="cgi-bin/stuff.py">Click me to run CGI program</A>
URL Reference Scenario with Query
                                 Server Computer




                                      DNS




                                                                       File Data
                                     Server        Network   Server Computer
                                                    Stack




                                                                                   File Read
                                                               Web server calculates
                                                               and does actions,
                                   Network                     manufactures dynamic

  User computer                     Cloud-                       Web
                                                               HTML page


                            TCP Open on port 80                 Server                         Network
                                      The Session ACK
                          HTTP file request ? Other data                                        Stack
    Browser Network            TCP Terminate Session
                                       TCP
                                      Dynamic HTML
                  Stack          InternetTerminate ACK
                                      TCP
Client Model
 socket()


             read()   write()   close()
  bind()


 connect()
Server Model
 socket()


                       read()
                       write()     read()
                                   write()
  bind()


 listen()
connect()



            accept()             close(client)   close(server)
Socket Model
                         Server Computer




                              DNS
                             Server        Network
                                                               Server Computer
                                            Stack




                                                                 Web      Thread
                                                                Server
                                      Network
 User computer
                                      Cloud-
                                                               Thread    accept
                                                                        write
                                                                                      80
                                                                                  Network
                                                                                   Stack

                                                     Connect
   Browser Network
           read
                                    The
                 Stack
                                  Internet
  Anatomy of HTTP request
• Data from the client -
    • Header starts with Method, document address, and HTTP version
    info:
    GET /index.html HTTP/1.1
        •   Note that CGI GET would result with more data in the /index.html field

    • More (optional) header info:
    User-Agent: Mozilla/4.05(WinNT; I)
    Accept: image/gif, image/x-xbitmap, image/jpeg,
    image/pjpeg, */*
    • Header ends with blank line
    •More Header fields
POST anatomy
• Client also sends:
  • Body data
     • mostly data for CGI programs using
     POST method
HTTP Response
• Server sends back:
  • version, status, and readable status
   HTTP/1.1 200 OK
  • Lots more data about server and the requested
  document:
  Date: Thu, 15 May 2003 13:30:01 MDT
  Server: APACHE/1.5.2
   Last-modified: Thu, 15 May 2003 11:35:11 MDT
More on HTTP response

 • More header fields
   Content-type: text/html
   Content-length: 2482
 • A blank line ends the header
   • The body is the file content, CGI
   output, or error data
MIME types
 Multipurpose Internet Mail Extensions
     Not restricted to mail—general Internet use
 Specifies how the message will be
 interpreted
     EG plain text or html?
     Audio or image
     Etc.
HTTP data   MIME
              Type
                          MIME
                              Subtype
            Application   msword
            Application   pdf
            Audio         aif
            Audio         mpeg
            Image         gif
            Image         jpeg
            Image         bmp
            Multipart     form-data
            Multipart     mixed
            Text          html
            Text          plain
This diagram is from
the Xtropia Website
Some parts out of
date
Intro to Wireshark
  Be careful of promiscuous mode.
  Download and install if necessary
     Should be included in lab 1
  Select interface
  Use filters (see examples)
Useful Wireshark Filters:
http://www.firstdigest.com/2009/05/wiresharks-most-
useful-display-filters/

Ten Examples of useful filters:
http://www.lovemytool.com/blog/2010/04/top-10-
wireshark-filters-by-chris-greer.html
Review:
  Computer concepts
  Network concepts
  WWW Architecture
  Web System Architecture
  Hands-on with Apache server
  Hands-on with HTTP Protocol
Questions
  Which of the following, all of which
  have been discussed in the class, are
  programming languages?
     http, html, URL, CGI, Python, Perl, AJAX,
      JavaScript, php, POST, LAMP, WWW,
      JSON, DOM

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:20
posted:12/11/2011
language:
pages:26