You are on page 1of 107

Web Development Technologies

Lecture 1

Cs.aiub.edu/~Jitu

INTRODUCTION

Lecture-1

Cs.aiub.edu/~jitu

Client/Server model
Distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients. Often clients and servers communicate over a computer network on separate hardware, but both client and server may reside in the same system. A server machine is a host that is running one or more server programs which share their resources with clients.

Lecture-1

Cs.aiub.edu/~jitu

Client/Server model (contd.)


A client does not share any of its resources, but requests a server's content or service function. The clientserver characteristic describes the relationship of cooperating programs in an application. The server component provides a function or service to one or many clients, which initiate requests for such services.

Lecture-1

Cs.aiub.edu/~jitu

Client/Server model

Lecture-1

Cs.aiub.edu/~jitu

Peer to Peer (P2P)


Distributed application architecture that partitions tasks or work loads between peers. Peers are equally privileged, equipotent participants in the application. They are said to form a peer-to-peer network of nodes.

Lecture-1

Cs.aiub.edu/~jitu

Peer to Peer (P2P)

Lecture-1

Cs.aiub.edu/~jitu

Client/server Advantages
Easy to maintain and upgrade only one machine. Data security implementation is easy. Servers can better control access and resources, to guarantee that only those clients with the appropriate permissions may access and change data. Since data storage is centralized, updates to that data are far easier to administer in comparison to a P2P paradigm. It functions with multiple different clients of different capabilities.

Lecture-1

Cs.aiub.edu/~jitu

Client/server Disadvantages
As the number of simultaneous client requests to a given server increases, the server can become overloaded. The clientserver paradigm lacks the robustness of a good P2P network.
In P2P networks, resources are usually distributed among many nodes. Even if one or more nodes depart and abandon a downloading file, for example, the remaining nodes should still have the data needed to complete the download.

Lecture-1

Cs.aiub.edu/~jitu

10

Question ???
What is the difference between internet and Web?

Lecture-1

Cs.aiub.edu/~jitu

11

Internet
Global system of interconnected computer networks .
Use the standard Internet Protocol Suite (TCP/IP). Serve billions of users worldwide. Network of networks that consists of millions of private, public, academic, business, and government networks. Carries a vast range of information resources and services, such as the inter-linked hypertext documents of the World Wide Web and the infrastructure to support electronic mail.

Lecture-1

Cs.aiub.edu/~jitu

12

World Wide Web


Abbreviated as WWW. Commonly known as the Web. A system of interlinked hypertext documents accessed via the Internet. With a web browser, any one can view web pages that may contain text, images, videos, and other multimedia and navigate between them via hyperlinks.

Lecture-1

Cs.aiub.edu/~jitu

13

Internet vs WWW
Internet Global system of interconnected computer networks. In short, the Web is an application running on the Internet. WWW One of the services that runs on the Internet. It is a collection of interconnected documents and other resources, linked by hyperlinks and URLs. An application running on the Internet.

Lecture-1

Cs.aiub.edu/~jitu

14

WWW function
Viewing a web page on the World Wide Web normally begins
typing the URL of the page into a web browser, following a hyperlink to that page or resource.

The web browser then initiates a series of communication messages, behind the scenes, in order to fetch and display it. First, the server-name portion of the URL is resolved into an IP address using the global, distributed Internet database known as the Domain Name System (DNS).

Lecture-1

Cs.aiub.edu/~jitu

15

WWW function (contd.)


The browser then requests the resource by sending an HTTP request to the Web server at that particular address.
In the case of a typical web page, the HTML text of the page is requested first and parsed immediately by the web browser, which then makes additional requests for images and any other files that complete the page image.

While receiving these files from the web server, browsers may progressively render the page onto the screen as specified by its HTML, Cascading Style Sheets (CSS), or other page composition languages.
Any images and other resources are incorporated to produce the on-screen web page that the user sees. Most web pages contain hyperlinks to other related pages and perhaps to downloadable files, source documents, definitions and other web resources.
Lecture-1
Cs.aiub.edu/~jitu

16

WWW standards
Many of the documents are the work of the World Wide Web Consortium (W3C). Some of the documents are produced by the Internet Engineering Task Force (IETF) and other organizations. markup languages, especially HTML and XHTML, from the W3C
define the documents structure and interpretation of hypertext

stylesheets, especially CSS, from the W3C. ECMAScript (usually in the form of JavaScript), from Ecma International.
Lecture-1
Cs.aiub.edu/~jitu

17

WWW standards (contd.)


Document Object Model, from W3C. Uniform Resource Identifier (URI)
a universal system for referencing resources on the Internet, such as hypertext documents and images.

HyperText Transfer Protocol (HTTP)


how the browser and server authenticate each other.

Lecture-1

Cs.aiub.edu/~jitu

18

Uniform Resource Identifier (URI)


String of characters used to identify a name or a resource on the Internet.
enables interaction with representations of the resource over a network (typically the World Wide Web) using specific protocols. Schemes specifying a concrete syntax and associated protocols define each URI.

defined as consisting of four parts, as follows


<scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]

Lecture-1

Cs.aiub.edu/~jitu

19

Uniform Resource Identifier (Contd.)


The scheme name consists of a letter followed by any combination of letters, digits, and the plus ("+"), period ("."), or hyphen ("-") characters. It is followed by a colon (":"). The hierarchical part of the URI is intended to hold identification information hierarchical in nature.
Usually this part begins with a double forward slash ("//"), followed by an authority part and an optional path.

The authority part holds


an optional user information part terminated with "@ e.g. username:password@) a hostname (i.e. domain name or IP address) and an optional port number preceded by a colon ":".
Lecture-1
Cs.aiub.edu/~jitu

20

Uniform Resource Identifier (Contd.)


The path part is a sequence of segments separated by a forward slash ("/").
conceptually similar to directories. Each segment can contain parameters separated from it using a semicolon (";"), though this is rarely used in practice.

The query is an optional part separated with a question mark


which contains additional identification information which is not hierarchical in nature. commonly organized as a sequence of <key>=<value> pairs separated by a semicolon or by an ampersand e.g. Semicolon: key1=value1;key2=value2;key3=value3 Ampersand: key1=value1&key2=value2&key3=value3
Lecture-1
Cs.aiub.edu/~jitu

21

Uniform Resource Identifier (Contd.)


The fragment is an optional part separated from the front parts by a hash ("#").
holds additional identifying information that provides direction to a secondary resource e.g. a section heading in an article identified by the remainder of the URI. When the primary resource is an HTML document, the fragment is often an id attribute of a specific element and web browsers will make sure this element is visible.

Lecture-1

Cs.aiub.edu/~jitu

22

Uniform Resource Identifier (Example)


http://en.wikipedia.org/wiki/URI#Examples
"http" specifies the 'scheme' name "en.wikipedia.org" is the 'authority "/wiki/URI" the 'path' pointing to this article "#Examples" is a 'fragment' pointing to this section.

Lecture-1

Cs.aiub.edu/~jitu

23

Browsers
A web browser or Internet browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier (URI) and may be a web page, image, video, or other piece of content. e.g.
Internet Explorer Netscape Mozilla Firefox Opera Google Chrome Apple Safari
Lecture-1
Cs.aiub.edu/~jitu

24

XML

Lecture-1

Cs.aiub.edu/~jitu

25

What is XML?
XML stands for EXtensible Markup Language XML was designed to carry data, not to display data XML tags are not predefined. You must define your own tags XML is designed to be self-descriptive XML is a W3C Recommendation

Lecture-1

Cs.aiub.edu/~jitu

26

XML Does Not DO Anything


Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store, and transport information. The following example is a note to Tove, from Jani, stored as XML:
<note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>

Lecture-1

Cs.aiub.edu/~jitu

27

With XML You Invent Your Own Tags


The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document. That is because the XML language has no predefined tags. XML allows the author to define his/her own tags and his/her own document structure.

Lecture-1

Cs.aiub.edu/~jitu

28

XML is Everywhere
XML is now as important for the Web as HTML was to the foundation of the Web. XML is the most common tool for data transmissions between all sorts of applications.

Lecture-1

Cs.aiub.edu/~jitu

29

XML Documents Form a Tree Structure


XML Documents Form a Tree Structure XML documents must contain a root element. This element is "the parent" of all other elements. The elements in an XML document form a document tree.
The tree starts at the root and branches to the lowest level of the tree.

All elements can have sub elements (child elements):

Lecture-1

Cs.aiub.edu/~jitu

30

XML Example

Lecture-1

Cs.aiub.edu/~jitu

31

What is an XML Element?


An XML element is everything from (including) the element's start tag to (including) the element's end tag. An element can contain:
other elements text attributes or a mix of all of the above...

Lecture-1

Cs.aiub.edu/~jitu

32

XML Attributes
Attributes often provide information that is not a part of the data. In the example below, the file type is irrelevant to the data, but can be important to the software that wants to manipulate the element:
<file type="gif">computer.gif</file>

XML Attributes Must be Quoted

Lecture-1

Cs.aiub.edu/~jitu

33

XML Naming Rules


XML elements must follow these naming rules:
Names can contain letters, numbers, and other characters Names cannot start with a number or punctuation character Names cannot start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces

Any name can be used, no words are reserved.

Lecture-1

Cs.aiub.edu/~jitu

34

XML Syntax
All XML Elements Must Have a Closing Tag XML Tags are Case Sensitive XML Elements Must be Properly Nested XML Documents Must Have a Root Element XML Attribute Values Must be Quoted

Lecture-1

Cs.aiub.edu/~jitu

35

HTML

Lecture-1

Cs.aiub.edu/~jitu

36

What is HTML?
HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language A markup language is a set of markup tags HTML uses markup tags to describe web pages

Lecture-1

Cs.aiub.edu/~jitu

37

HTML Tags
HTML markup tags are usually called HTML tags
HTML tags are keywords surrounded by angle brackets like <html> HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag, the second tag is the end tag Start and end tags are also called opening tags and closing tags

Lecture-1

Cs.aiub.edu/~jitu

38

HTML Documents = Web Pages


HTML documents describe web pages HTML documents contain HTML tags and plain text HTML documents are also called web pages e.g.
<html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>

Lecture-1

Cs.aiub.edu/~jitu

39

XML vs HTML
XML is not a replacement for HTML. XML and HTML were designed with different goals:
XML was designed to transport and store data, with focus on what data is HTML was designed to display data, with focus on how data looks

HTML is about displaying information, while XML is about carrying information.

Lecture-1

Cs.aiub.edu/~jitu

40

HTML 5.0

Lecture-1

Cs.aiub.edu/~jitu

41

What is HTML5?
HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML came in 1999. The web has changed a lot since then. HTML5 is still a work in progress. However, most modern browsers have some HTML5 support.

Lecture-1

Cs.aiub.edu/~jitu

42

How Did HTML5 Get Started?


HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG). Some rules for HTML5 were established:
New features should be based on HTML, CSS, DOM, and JavaScript Reduce the need for external plugins (like Flash) Better error handling More markup to replace scripting HTML5 should be device independent

Lecture-1

Cs.aiub.edu/~jitu

43

New Features
Some of the most interesting new features in HTML5:
The canvas element for drawing The video and audio elements for media playback Better support for local offline storage New content specific elements, like article, footer, header, section etc. New form controls, like calendar, date, time, email, url, search

Browser Support
The latest versions of Safari, Chrome, Firefox, and Opera support some HTML5 features. Internet Explorer 9 will support some HTML5 features.

Lecture-1

Cs.aiub.edu/~jitu

44

XHTML

Lecture-1

Cs.aiub.edu/~jitu

45

What Is XHTML?
XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version of HTML XHTML is HTML defined as an XML application XHTML is a W3C Recommendation

Lecture-1

Cs.aiub.edu/~jitu

46

XHTML - Why?
XHTML is a combination of HTML and XML (EXtensible Markup Language). XHTML consists of all the elements in HTML 4.01, combined with the strict syntax of XML. The following HTML code will work just fine if you view it in a browser (even if it does NOT follow the HTML rules):
<html> <head> <title>This is bad HTML</title> <body> <h1>Bad HTML <p>This is a paragraph </body>
Lecture-1
Cs.aiub.edu/~jitu

47

XHTML - Why? (contd.)


XML is a markup language where everything must be marked up correctly, which results in "well-formed" documents. XML is designed to describe data, and HTML is designed to display data. Today's market consists of different browser technologies, some browsers run on computers, and some browsers run on mobile phones or other small devices. The last-mentioned do not have the resources or power to interpret a "bad" markup language. Combining the strengths of HTML and XML, W3C recommended a markup language i.e XHTML.
Lecture-1
Cs.aiub.edu/~jitu

48

HTML vs XHTML
XHTML elements must be properly nested XHTML elements must always be closed XHTML elements must be in lowercase XHTML documents must have one root element

Lecture-1

Cs.aiub.edu/~jitu

49

More XHTML Syntax Rules


Attribute names must be in lower case Attribute values must be quoted Attribute minimization is forbidden The XHTML DTD defines mandatory elements

Lecture-1

Cs.aiub.edu/~jitu

50

DOM

Lecture-1

Cs.aiub.edu/~jitu

51

What is the DOM?


a standard for accessing documents like XML and HTML
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."

The DOM is separated into 3 different parts / levels:


Core DOM - standard model for any structured document XML DOM - standard model for XML documents HTML DOM - standard model for HTML documents

The DOM defines the objects and properties of all document elements, and the methods (interface) to access them.
Lecture-1
Cs.aiub.edu/~jitu

52

CSS

Lecture-1

Cs.aiub.edu/~jitu

53

What is CSS?
CSS stands for Cascading Style Sheets A style language that defines layout of HTML documents.
For example, CSS covers fonts, colors, margins, lines, height, width, background images, advanced positions and many other things. Just wait and see!

HTML can be (mis-)used to add layout to websites. But CSS offers more options and is more accurate and sophisticated. CSS is supported by all browsers today.

Lecture-1

Cs.aiub.edu/~jitu

54

Benefits of CSS
control layout of many documents from one single style sheet; more precise control of layout; apply different layout to different media-types (screen, print, etc.); numerous advanced and sophisticated techniques.

Lecture-1

Cs.aiub.edu/~jitu

55

Applying CSS
Three ways you can apply CSS to an HTML document Method 1: In-line (the attribute style)
using the HTML attribute style

Method 2: Internal (the tag style)


using the HTML tag <style>

Method 3: External (link to a style sheet)


recommended method simply a text file with the extension .css using the HTML tag <link> in head section

Lecture-1

Cs.aiub.edu/~jitu

56

Priority
We also have another two types of styles at the client end.
One is user defined style Other is browser default style.

Priority
User defined style Embedded or inline style sheet Internal style sheet External style sheet Browser default style

Lecture-1

Cs.aiub.edu/~jitu

57

JAVASCRIPT

Lecture-1

Cs.aiub.edu/~jitu

58

What is JavaScript?
JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) The Real Name is ECMAScript

Lecture-1

Cs.aiub.edu/~jitu

59

VBSCRIPT

Lecture-1

Cs.aiub.edu/~jitu

60

What is VBScript?
VBScript is a scripting language A scripting language is a lightweight programming language VBScript is a light version of Microsoft's programming language Visual Basic VBScript is only supported by Microsoft's browsers (Internet Explorer)

Lecture-1

Cs.aiub.edu/~jitu

61

DHTML

Lecture-1

Cs.aiub.edu/~jitu

62

DHTML
DHTML stands for Dynamic HTML. DHTML is NOT a language or a web standard. To most people DHTML means the combination of HTML, JavaScript, DOM and CSS. According to the World Wide Web Consortium (W3C)
"Dynamic HTML is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated."

Lecture-1

Cs.aiub.edu/~jitu

63

DTD

Lecture-1

Cs.aiub.edu/~jitu

64

What is DTD?
A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes. A DTD can be declared inline inside an XML document, or as an external reference.

Lecture-1

Cs.aiub.edu/~jitu

65

XSD

Lecture-1

Cs.aiub.edu/~jitu

66

What is an XSD?
XML Schema is an XML-based alternative to DTD. An XML schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD). XML Schemas are the Successors of DTDs Also written in a XML file(not like DTD)

Lecture-1

Cs.aiub.edu/~jitu

67

XSLT

Lecture-1

Cs.aiub.edu/~jitu

68

What is XSLT
XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.

Lecture-1

Cs.aiub.edu/~jitu

69

XSL Languages
It started with XSL and ended up with XSLT, XPath, and XSL-FO. It Started with XSL
XSL stands for EXtensible Stylesheet Language. The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML-based Stylesheet Language.

CSS = Style Sheets for HTML


HTML uses predefined tags, and the meaning of each tag is well understood.

XSL = Style Sheets for XML


XML does not use predefined tags (we can use any tagnames we like), and therefore the meaning of each tag is not will understood.
Lecture-1
Cs.aiub.edu/~jitu

70

XSL - More Than a Style Sheet Language


XSL consists of three parts:
XSLT - a language for transforming XML documents XPath - a language for navigating in XML documents XSL-FO - a language for formatting XML documents

Lecture-1

Cs.aiub.edu/~jitu

71

XPATH

Lecture-1

Cs.aiub.edu/~jitu

72

What is XPath?
XPath is a syntax for defining parts of an XML document XPath uses path expressions to navigate in XML documents XPath contains a library of standard functions XPath is a major element in XSLT XPath is a W3C recommendation

Lecture-1

Cs.aiub.edu/~jitu

73

XQUERY

Lecture-1

Cs.aiub.edu/~jitu

74

What is XQuery?
XQuery is the language for querying XML data XQuery for XML is like SQL for databases XQuery is built on XPath expressions XQuery is supported by all major databases XQuery is a W3C Recommendation

Lecture-1

Cs.aiub.edu/~jitu

75

XLINK & XPOINTER

Lecture-1

Cs.aiub.edu/~jitu

76

What is XLink?
XLink defines a standard way of creating hyperlinks in XML documents. XLink is short for XML Linking Language XLink is used to create hyperlinks in XML documents Any element in an XML document can behave as a link XLink supports simple links (like HTML) and extended links (for linking multiple resources together) With XLink, the links can be defined outside the linked files XLink is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu

77

What is XPointer?
XPointer allows the hyperlinks to point to more specific parts (fragments) in the XML document. XPointer is short for XML Pointer Language XPointer allows the links to point to specific parts of an XML document XPointer uses XPath expressions to navigate in the XML document XPointer is a W3C Recommendation

Lecture-1

Cs.aiub.edu/~jitu

78

XSL-FO

Lecture-1

Cs.aiub.edu/~jitu

79

What is XSL-FO?
XSL-FO stands for Extensible Stylesheet Language Formatting Objects. XSL-FO is a language for formatting XML data for output to screen, paper or other media. XSL-FO is based on XML XSL-FO is a W3C Recommendation XSL-FO is now formally named XSL

Lecture-1

Cs.aiub.edu/~jitu

80

XFORMS

Lecture-1

Cs.aiub.edu/~jitu

81

What Is XForms?
XForms is the next generation of HTML forms XForms is richer and more flexible than HTML forms XForms will be the forms standard in XHTML 2.0 XForms is platform and device independent XForms separates data and logic from presentation XForms uses XML to define form data XForms stores and transports data in XML documents XForms contains features like calculations and validations of forms XForms reduces or eliminates the need for scripting XForms is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu

82

XML NAMESPACES

Lecture-1

Cs.aiub.edu/~jitu

83

Name Conflicts
In XML, element names are defined by the developer. This often results in a conflict when trying to mix XML documents from different XML applications. This XML carries HTML table information:
<table> <tr> <td>Apples</td> <td>Bananas</td> </tr> </table>

Lecture-1

Cs.aiub.edu/~jitu

84

Name Conflicts
This XML carries information about a table (a piece of furniture):
<table> <name>African Coffee Table</name> <width>80</width> <length>120</length> </table>

If these XML fragments were added together, there would be a name conflict. Both contain a <table> element, but the elements have different content and meaning. An XML parser will not know how to handle these differences.
Lecture-1
Cs.aiub.edu/~jitu

85

Solving the Name Conflict Using a Prefix


Name conflicts in XML can easily be avoided using a name prefix. This XML carries information about an HTML table, and a piece of furniture:
<h:table> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> <f:table> <f:name>African Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length> </f:table>
Lecture-1
Cs.aiub.edu/~jitu

86

E4X

Lecture-1

Cs.aiub.edu/~jitu

87

What is E4X?
E4X is a new extension to JavaScript. E4X adds direct support for XML to JavaScript. E4X is official in the JavaScript 1.6 standard. JavaScript = ECMAScript
ECMAScript is the official name for JavaScript. ECMAScript is the same as JavaScript. ECMA (The European Computer Manufacturers Association) is the organization standardizing JavaScript.

E4X = JavaScript for XML


E4X means "ECMAScript For XML". It is a standard extension to ECMAScript. So in real life E4X means "JavaScript for XML".
Lecture-1
Cs.aiub.edu/~jitu

88

XML As a JavaScript Object


E4X is an official JavaScript standard that adds direct support for XML. With E4X, you can declare an XML object variable E4X is Much Simpler
If you have ever tried to use JavaScript to parse and manipulate XML, you will find that E4X is much simpler to use. Without E4X you have to use an XML library (or an XML component) to work with XML. These libraries or components have different syntax and work differently in different browsers.

Lecture-1

Cs.aiub.edu/~jitu

89

JQUERY

Lecture-1

Cs.aiub.edu/~jitu

90

What is jQuery?
jQuery is a library of JavaScript Functions. jQuery is a lightweight "write less, do more" JavaScript library. The jQuery library contains the following features:

Lecture-1

HTML element selections HTML element manipulation CSS manipulation HTML event functions JavaScript Effects and animations HTML DOM traversal and modification AJAX Utilities
Cs.aiub.edu/~jitu

91

TCP/IP

Lecture-1

Cs.aiub.edu/~jitu

92

What is TCP/IP?
TCP/IP is the communication protocol for communication between computers on the Internet. TCP/IP stands for Transmission Control Protocol / Internet Protocol. TCP/IP defines how electronic devices (like computers) should be connected to the Internet, and how data should be transmitted between them.

Lecture-1

Cs.aiub.edu/~jitu

93

Inside TCP/IP
Inside the TCP/IP standard there are several protocols for handling data communication:
TCP (Transmission Control Protocol) communication between applications UDP (User Datagram Protocol) simple communication between applications IP (Internet Protocol) communication between computers ICMP (Internet Control Message Protocol) for errors and statistics DHCP (Dynamic Host Configuration Protocol) for dynamic addressing

Lecture-1

Cs.aiub.edu/~jitu

94

TCP Uses a Fixed Connection


TCP is for communication between applications.
If one application wants to communicate with another via TCP, it sends a communication request. This request must be sent to an exact address. After a "handshake" between the two applications, TCP will set up a "full-duplex" communication between the two applications. The "full-duplex" communication will occupy the communication line between the two computers until it is closed by one of the two applications. UDP is very similar to TCP, but simpler and less reliable.

Lecture-1

Cs.aiub.edu/~jitu

95

IP is Connection-Less
IP is for communication between computers. IP is a "connection-less" communication protocol. IP does not occupy the communication line between two computers. IP reduces the need for network lines. Each line can be used for communication between many different computers at the same time. With IP, messages (or other data) are broken up into small independent "packets" and sent between computers via the Internet. IP is responsible for "routing" each packet to the correct destination.

Lecture-1

Cs.aiub.edu/~jitu

96

TCP/IP
TCP/IP is TCP and IP working together. TCP takes care of the communication between your application software (i.e. your browser) and your network software. IP takes care of the communication with other computers. TCP is responsible for breaking data down into IP packets before they are sent, and for assembling the packets when they arrive. IP is responsible for sending the packets to the correct destination.

Lecture-1

Cs.aiub.edu/~jitu

97

HTTP

Lecture-1

Cs.aiub.edu/~jitu

98

What is HTTP?
The Hypertext Transfer Protocol (HTTP) is a networking protocol for distributed, collaborative, hypermedia information systems.
HTTP is the foundation of data communication for the World Wide Web. The standards development of HTTP has been coordinated by the Internet Engineering Task Force (IETF) and the World Wide Web Consortium

Lecture-1

Cs.aiub.edu/~jitu

99

Technical overview
Functions as a request-response protocol in the client-server computing model. a web browser, for example, acts as a client, while an application running on a computer hosting a web site functions as a server. The client submits an HTTP request message to the server. The server, which stores content, or provides resources, such as HTML files, or performs other functions on behalf of the client, returns a response message to the client.

Lecture-1

Cs.aiub.edu/~jitu

100

Technical overview
A response contains completion status information about the request and may contain any content requested by the client in its message body.
A client is often referred to as a user agent (UA). A web crawler (spider) is another example of a common type of client or user agent

The HTTP protocol is designed to permit intermediate network elements to improve or enable communications between clients and servers. HTTP is an Application Layer protocol designed within the framework of the Internet Protocol Suite

Lecture-1

Cs.aiub.edu/~jitu

101

Technical overview
HTTP Resources are identified and located on the network by Uniform Resource Identifiers (URIs)or, more specifically, Uniform Resource Locators (URLs)
Covered earlier

Lecture-1

Cs.aiub.edu/~jitu

102

Technical overview

Lecture-1

Cs.aiub.edu/~jitu

103

Request methods
HTTP defines nine methods (sometimes referred to as "verbs") indicating the desired action to be performed on the identified resource.
What this resource represents, whether pre-existing data or data that is generated dynamically, depends on the implementation of the server. Often, the resource corresponds to a file or the output of an executable residing on the server.

HEAD
Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.
Lecture-1
Cs.aiub.edu/~jitu

104

Request methods
GET
Requests a representation of the specified resource.

POST
Submits data to be processed (e.g., from an HTML form) to the identified resource

PUT
Uploads a representation of the specified resource.

DELETE
Deletes the specified resource.

TRACE
Echoes back the received request, so that a client can see what (if any) changes or additions have been made by intermediate servers.
Lecture-1
Cs.aiub.edu/~jitu

105

Request methods
OPTIONS
Returns the HTTP methods that the server supports for specified URL

CONNECT
Converts the request connection to a transparent TCP/IP tunnel usually to facilitate SSL-encrypted communication (HTTPS)

PATCH
Is used to apply partial modifications to a resource

HTTP servers are required to implement at least the GET and HEAD methods and, whenever possible, also the OPTIONS method.
Lecture-1
Cs.aiub.edu/~jitu

106

Persistent connections
In HTTP/0.9 and 1.0, the connection is closed after a single request/response pair. In HTTP/1.1 a keep-alive-mechanism was introduced, where a connection could be reused for more than one request.
the client does not need to re-negotiate the TCP connection after the first request has been sent.

Lecture-1

Cs.aiub.edu/~jitu

107

HTTP session state


HTTP is a stateless protocol.
A stateless protocol does not require the server to retain information or status about each user for the duration of multiple requests. For example, when a web server is required to customize the content of a web page for a user, the web application may have to track the user's progress from page to page. A common solution is the use of HTTP cookies. Other methods include server side sessions hidden variables (when the current page is a form), and URL-rewriting using URI-encoded parameters, e.g., /index.php?session_id=some_unique_session_code.

Lecture-1

Cs.aiub.edu/~jitu

You might also like