CS 194: Distributed Systems WWW and Web Services Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.

Slides:



Advertisements
Similar presentations
Overview Environment for Internet database connectivity
Advertisements

Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
PART 6 Application Layer
CS162 Operating Systems and Systems Programming Lecture 23 HTTP and Peer-to-Peer Networks April 20, 2011 Ion Stoica
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
The Internet Useful Definitions and Concepts About the Internet.
Grid Computing, B. Wilkinson, 20043a.1 WEB SERVICES Introduction.
CDNs & Replication Prof. Vern Paxson EE122 Fall 2007 TAs: Lisa Fowler, Daniel Killebrew, Jorge Ortiz.
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
1 The HyperText Transfer Protocol: HTTP Nick Smith Stuart Alley Tara Tjaden.
Definitions, Definitions, Definitions Lead to Understanding.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Hypertext Transport Protocol CS Dick Steflik.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
Web Client/Server Communication A290/A590, Fall /09/2014.
INTRODUCTION TO WEB DATABASE PROGRAMMING
The WWW and HTML CMPT 281. Outline Hypertext The Internet The World-Wide-Web How the WWW works Web pages Markup HTML.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
DATA COMMUNICATION DONE BY: ALVIN SAMPATH CARLVIN SAMPATH.
FTP (File Transfer Protocol) & Telnet
2013Dr. Ali Rodan 1 Handout 1 Fundamentals of the Internet.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
World Wide Web Hypertext model Use of hypertext in World Wide Web (WWW) WWW client-server model Use of TCP/IP protocols in WWW.
Web Services (SOAP, WSDL, and UDDI)
CIS 1310 – HTML & CSS 1 Introduction to the Internet.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
MySQL and PHP Internet and WWW. Computer Basics A Single Computer.
CS 6401 The World Wide Web Outline Background Structure Protocols.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
1 Seminar on Service Oriented Architecture Principles of REST.
1 Web Services Web and Database Management System.
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Web Technologies Lecture 1 The Internet and HTTP.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
EE 122: Lecture 21 (HyperText Transfer Protocol - HTTP) Ion Stoica Nov 20, 2001 (*)
CS 6401 The World Wide Web Outline Background Structure Protocols.
Web Services An Introduction Copyright © Curt Hill.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
SOAP, Web Service, WSDL Week 14 Web site:
National College of Science & Information Technology.
12. DISTRIBUTED WEB-BASED SYSTEMS Nov SUSMITHA KOTA KRANTHI KOYA LIANG YI.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Web fundamentals: Clients, Servers, and Communication
WWW and HTTP King Fahd University of Petroleum & Minerals
Web Development Web Servers.
Sabri Kızanlık Ural Emekçi
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
HyperText Transfer Protocol
EE 122: HyperText Transfer Protocol (HTTP)
PART 6 Application Layer
Introduction to World Wide Web
Presentation transcript:

CS 194: Distributed Systems WWW and Web Services Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, CA

2 The Web – History (I)  1945: Vannevar Bush, Memex:  "a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility" Vannevar Bush ( ) Memex (See

3 The Web – History (II)  1967, Ted Nelson, Xanadu: -A world-wide publishing network that would allow information to be stored not as separate files but as connected literature -Owners of documents would be automatically paid via electronic means for the virtual copying of their documents  Coined the term “Hypertext” Ted Nelson

4 The Web – History (III)  World Wide Web (WWW): a distributed database of “pages” linked through Hypertext Transport Protocol (HTTP) -First HTTP implementation Tim Berners-Lee at CERN -HTTP/0.9 – 1991 Simple GET command for the Web -HTTP/1.0 –1992 Client/Server information, simple caching -HTTP/ Tim Berners-Lee

5 The Web  Core components: -Servers: store files and execute remote commands -Browsers: retrieve and display “pages” -Uniform Resource Locators (URLs): way to refer to pages  A protocol to transfer information between clients and servers -HTTP

6 Uniform Record Locator (URL) protocol://host-name:port/directory-path/resource  Extend the idea of hierarchical namespaces to include anything in a file system -ftp://  Extend to program executions as well… - sgId=2604_ _29699_1123_1261_0_28917_3552_ &Search=&Nhead=f&YY=31454&order=down&sort=date&pos=0&vie w=a&head=bhttp://us.f413.mail.yahoo.com/ym/ShowLetter?box=%40B%40Bulk&M sgId=2604_ _29699_1123_1261_0_28917_3552_ &Search=&Nhead=f&YY=31454&order=down&sort=date&pos=0&vie w=a&head=b -Server side processing can be incorporated in the name

7 Web and DNS  URLs use hostnames  Thus, content names are tied to specific hosts  This is bad!  Uniform Resource Names (URNs) are one proposal to achieve persistence -Not discussed in this lecture

8 Hyper Text Transfer Protocol (HTTP)  Client-server architecture  Synchronous request/reply protocol -Runs over TCP, Port 80  Stateless

9 Big Picture Client Server TCP Syn TCP syn + ack TCP ack + HTTP GET... Establish connection Request response Client request Close connection

10 Hyper Text Transfer Protocol Commands  GET – transfer resource from given URL  HEAD – GET resource metadata (headers) only  PUT – store/modify resource under given URL  DELETE – remove resource  POST – provide input for a process identified by the given URL (usually used to post CGI parameters)

11 Response Codes  1x informational  2x success  3x redirection  4x client error in request  5x server error; can’t satisfy the request

12 Client Request  Steps to get the resource: Use DNS to obtain the IP address of Send to an HTTP request: GET /index.html HTTP/1.0

13 Server Response HTTP/ OK Content-Type: text/html Content-Length: 1234 Last-Modified: Mon, 19 Nov :31:20 GMT EECS Home Page …

14 HTTP/1.0 Example Client Server Request image 1 Transfer image 1 Request image 2 Transfer image 2 Request text Transfer text Finish display page

15 HHTP/1.0 Performance  Create a new TCP connection for each resource -Large number of embedded objects in a web page -Many short lived connections  TCP transfer -Too slow for small object -May never exit slow-start phase  Connections may be set up in parallel (5 is default in most browsers)

16 HTTP/1.0 Caching Support  Exploit locality of reference  A modifier to the GET request: -If-modified-since – return a “not modified” response if resource was not modified since specified time  A response header: -Expires – specify to the client for how long it is safe to cache the resource  A request directive: -No-cache – ignore all caches and get resource directly from server  These features can be best taken advantage of with HTTP proxies -Locality of reference increases if many clients share a proxy

17 HTTP/1.1 (1996)  Performance: -Persistent connections -Pipelined requests/responses -…  Efficient caching support -Network Cache assumed more explicitly in the design -Gives more control to the server on how it wants data cached  Support for virtual hosting -Allows to run multiple web servers on the same machine

18 Persistent Connections  Allow multiple transfers over one connection  Avoid multiple TCP connection setups  Avoid multiple TCP slow starts

19 Pipelined Requests/Responses  Buffer requests and responses to reduce the number of packets  Multiple requests can be contained in one TCP segment  Note: order of responses has to be maintained Client Server Request 1 Request 2 Request 3 Transfer 1 Transfer 2 Transfer 3

20 Caching and Replication  Problem: You are a web content provider -How do you handle millions of web clients? -How do you ensure that all clients experience good performance? -How do you maintain availability in the presence of server and network failures?  Solutions: -Add more servers at different locations  If you are CNN this might work! -Caching -Content Distribution Networks (Replication)

21 “Base-line”  Many clients transfer same information -Generate unnecessary server and network load -Clients experience unnecessary latency Server Clients Backbone ISP ISP-1 ISP-2

22 Reverse Caches  Cache documents close to server  decrease server load  Typically done by content providers Clients Backbone ISP ISP-1 ISP-2 Server Reverse caches

23 Forward Proxies  Cache documents close to clients  reduce network traffic and decrease latency  Typically done by ISPs or corporate LANs Clients Backbone ISP ISP-1 ISP-2 Server Reverse caches Forward caches

24 Content Distribution Networks (CDNs)  Integrate forward and reverse caching functionalities into one overlay network (usually) administrated by one entity -Example: Akamai  Documents are cached both -As a result of clients’ requests (pull) -Pushed in the expectation of a high access rate  Beside caching do processing, e.g., -Handle dynamic web pages -Transcoding

25 CDNs (cont’d) Clients ISP-1 Server Forward caches Backbone ISP ISP-2 CDN

26 Example: Akamai  Akamai creates new domain names for each client content provider. -e.g., a128.g.akamai.net  The CDN’s DNS servers are authoritative for the new domains  The client content provider modifies its content so that embedded URLs reference the new domains. -“Akamaize” content, e.g.: day.gif becomes

27 Example: Akamai get a DNS server for nhc.noaa.gov b c local DNS server “Akamaizes” its content. “Akamaized” response object has inline URLs for secondary content at a128.g.akamai.net and other Akamai-managed DNS names. akamai.net DNS servers lookup a128.g.akamai.net Akamai servers store/cache secondary content for “Akamaized” services.

28 Core Web Technologies  HTML  CGI  XML

29 What is HTML?  HTML is the lingua franca for web publishing.  Hyper Text Markup Language is based on SGML (Standard Generalized Markup Language) -HTML 4.0:  Initial version invented by Tim Berners-Lee  Originally developed for sharing scientific documents on the web

30 What is HTML?  HTML documents are plain text files  Contain text and HTML mark-up tags  Markup tags describe elements representing the style and structure of the visual document

31 Markup Tags  An HTML element may include a name, some attributes and some text or hypertext, and will appear in an HTML document as text text, or just  Examples: My Document Berkeley CS Web page

32 A trivial HTML document My web page Welcome to my webpage! This is on the same line. HTML HEAD BODY Welcome to my webpage! This is on the same line. TITLE My web page Nesting structure

33 Common Gateway Interface (CGI)  CGI – general standard specifying how programs can be run on server, from the WWW  Any program in any language can be a CGI program - it just has to follow the CGI rules  These rules define how programs get data (e.g., HTML form data) and how to make sure web server knows it’s a CGI program  Call of a CGI program (like any HTML page): Run my CGI program

34 Client-Server CGI Architecture

35 CGI Examples  Any programming language can be used for CGI (e.g., shell script)  Every CGI program must write out data to send back to web browser.  The first thing they must write out is MIME type of file (e.g., text/plain, text/html) #!/bin/sh echo “Content-type: text/plain” echo echo “Hello World”

36 CGI and Forms  CGI programs can process data from forms:  If method=“get” then the form data gets put in variable QUERY_STRING available to CGI programs <form method="get" action= " Name: Age:

37 GET vs POST  Using “get” method: -Data added to URL as..prog?var=val etc. -This data is put in QUERY_STRING variable available to CGI programs -E.g.: %40B%40Bulk&MsgId=2604_ _29699_112 3_1261_0_28917_3552_ &Search=&Nh ead=f&YY=31454&order=down&sort=date&pos=0& view=a&head=b %40B%40Bulk&MsgId=2604_ _29699_112 3_1261_0_28917_3552_ &Search=&Nh ead=f&YY=31454&order=down&sort=date&pos=0& view=a&head=b  Alternative is to use “post” method: -Data is sent separately to URL. -CGI program reads this data from its standard input.

38 CGI Security  CGI programs let anyone in the world run a program on your system  Special wrapper programs may be used to do some security checks

39 XML: eXtensible Markup Language  A simple, very flexible text format derived from SGML  Rapidly emerging as the language of choice for data sharing on the Internet

40 XML Example  An XML definition for referring to a journal article. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12)

41 XML Example (cont’d)  XML document using XML definitions from previous slide (1) (2) (3) (4) Prudent Engineering Practice for Cryptographic Protocols (5) M. Abadi (6) R. Needham (7) (8) IEEE Transactions on Software Engineering (9) 22 (10) 12 (11) January (12) 6 – 15 (13) 1996 (14) (15)

42 XML vs HTML?  HTML combines structure and display, while XML separates them -HTML – presentation markup language: it describes the look, feel, and actions of web pages -XML describes document structure: what words in documents are  Flexibility: -HTML – only one standard definition of all of the tags -XML – custom documents defining the meaning of tags  XML may replace HTML in the future

43 Web Services WS are applications that communicate using internet-based middleware WS are network-based software applications developed to interact with other applications using Internet standard technologies and connections to seamlessly perform business process

44 Web Services Architecture Stacks

45 WS Components 1. A standard way for communication (SOAP) 2. A uniform data representation and exchange mechanism (XML) 3. A standard meta language to describe the services offered (WSDL) 4. A mechanism to register and locate WS based applications (UDDI)

46 What is SOAP?  Lightweight protocol used for exchange of messages in a decentralized, distributed environment  Platform-independent  Used for Remote Procedure Calls  W3C note defines the use of SOAP with XML as payload and HTTP as transport

47 SOAP Elements  Envelope (mandatory) -Top element of the XML document representing the message  Header (optional) -Determines how a recipient of a SOAP message should process the message -Adds features to the SOAP message such as authentication, transaction management, payment, message routes, etc…  Body (mandatory) -Exchanges information intended for the recipient of the message -Typical use is for RPC calls and error reporting

48 SOAP Elements  SOAP Encoding  Envelope package  Header/Body pattern -Similar to how HTTP works Header Body

49 Simple Example c = Add(n1, n2)

50 SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“ SOAP-ENV:encodingStyle="

51 SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“ SOAP-ENV:encodingStyle=" Scopes the message to the SOAP namespace describing the SOAP envelope Establishes the type of encoding that is used within the message (different data types supported)

52 SOAP Request <SOAP-ENV:Envelope xmlns:SOAP-ENV=“ SOAP-ENV:encodingStyle=" Defines the method Qualifies transaction Id

53 SOAP Response <SOAP-ENV:Envelope xmlns:SOAP-ENV=“ SOAP-ENV:encodingStyle=" Response typically uses method name with “Response” appended

54 XML-RPC vs SOAP  XML-RPC: lower common denominator form of communication -Simple, easy to understand (only 7 pages specification)  SOAP: can transfer more sophisticated information (could define virtually any data structure) -Flexible, but complex -Supported by industry

55 WSDL  Web Services Description Language is an XML document  Describes WS functionality  How WS communicate & where it is accessible (What, Where & How)

56 UDDI  Universal Description Definition Interface  A standard discovery mechanism for WS  Users can query a UDDI registry (company name, service type, Industry category or other criteria)  Provides pointers to WSDL document  UDDI is also based on XML