http http stands for hypertext transfer protocol. it is an tcp/ip based communication protocol which...

27
Course Title: Web Engineering Chapter No: 02 “HTTP and TCP/IP” Course Instructor: ILTAF MEHDI IT Lecturer, MIHE, Kart-i Parwan branch, Kabul

Upload: frank-pitts

Post on 12-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Course Title: Web Engineering Chapter No: 02

“HTTP and TCP/IP”

Course Instructor:ILTAF MEHDI

IT Lecturer, MIHE, Kart-i Parwan branch, Kabul

Page 2: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

HTTP

• HTTP stands for Hypertext Transfer Protocol.

• It is an TCP/IP based communication protocol which is

used to deliver virtually all files and other data,

collectively called resources, on the World Wide Web.

• These resources could be HTML files, image files,

query results, or anything else.

Page 3: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

HTTP

• A browser works as an HTTP client because it sends requests to an HTTP server which is called Web server.

• The Web Server then sends responses back to the client.

• The standard and default port for HTTP servers to listen on is 80 but it can be changed to any other port like 8080 etc.

Page 4: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

HTTP

• Like most network protocols, HTTP uses the client-server model: An HTTP client opens a connection and sends a request message to an HTTP server; the server then returns a response message, usually containing the resource that was requested.

• After delivering the response, the server closes the connection.

Page 5: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Completion of Request

1. HTTP is connectionless:

• After a request is made, the client disconnects

from the server and waits for a response.

• The server must re-establish the connection

after it process the request.

Page 6: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Completion of Request

2. HTTP is media independent:

• Any type of data can be sent by HTTP as long

as both the client and server know how to

handle the data content.

• How content is handled is determined by the

reflect specification.

Page 7: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Completion of Request

3. HTTP is stateless: • This is a direct result of HTTP's being

connectionless. • The server and client are aware of each other

only during a request. Afterwards, each forgets the other.

• For this reason neither the client nor the browser can retain information between different request across the web pages.

Page 8: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

HTTP Message Structure

The format of the request and responsemessages are similar and will have following

structure:• An initial line CRLF • Zero or more header lines CRLF • A blank line i.e. a CRLF • An optional message body like file, query data

or query output.

Page 9: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

HTTP Methods

• The set of common methods for HTTP/1.0 is defined below.

1. The GET Method2. The HEAD Method3. The POST Method

Page 10: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

1. The GET Method

• The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URL.

• The GET method can also be used to submit forms.

• The form data is URL-encoded and appended to the request URL.

Page 11: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

2. HEAD Method

• A HEAD request is just like a GET request.• The response to a HEAD request must never

contain a message body, just the status line and headers.

• This is useful to check characteristics of a resource without actually downloading it, thus saving bandwidth.

• Use HEAD when you don't actually need a file's contents.

Page 12: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

3. The POST Method• A POST request is used to send data to the

server to be processed in some way, like by a CGI script.

• A POST request is different from a GET request in the following ways:

1. There's a block of data sent with the request, in the message body. There are usually extra headers to describe this message body, like Content-Type: and Content-Length.

Page 13: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

3. The POST Method

2. The request URI is not a resource to retrieve;

it's usually a program to handle the data

you're sending.

3. The HTTP response is normally program

output, not a static file.

Page 14: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Server ErrorMessage: Description:

500 Internal Server Error The request was not completed. The server met an unexpected condition

501 Not Implemented The request was not completed. The server did not support the functionality required

502 Bad Gateway The request was not completed. The server received an invalid response from the upstream server

503 Service Unavailable The request was not completed. The server is temporarily overloading or down

504 Gateway Timeout The gateway has timed out

505 HTTP Version Not Supported The server does not support the "http protocol" version

HTTP Status Codes

Page 15: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

TCP/IP

Page 16: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Early TCP/IP History• The Internet is a primary reason why TCP/IP is

what it is today. • In fact, the Internet and TCP/IP are so closely

related in their history that it is difficult to discuss one without also talking about the other.

• They were developed together, with TCP/IP providing the mechanism for implementing the Internet.

Page 17: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Early TCP/IP History• TCP/IP has over the years continued to evolve

to meet the needs of the Internet.• The TCP/IP protocols were initially developed

as part of the research network developed by the United States Defense Advanced Research Projects Agency (DARPA or ARPA).

• Initially, this hatchling network, called the ARPAnet, was designed to use a number of protocols that had been adapted from existing technologies.

Page 18: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Internet Protocol (IP)• IP is responsible for several tasks, most

importantly determining a route to the description.

• In addition, IP is responsible for the packing of messages into small network-transportable packets, called data-grams.

• IP is used with almost all TCP protocols, sitting at the bottom of the TCP protocol stack just above the network-layers.

Page 19: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Internet Protocol (IP)

• IP has no control over whether messages sent and received are intact.

• All IP does is handle the sending and receiving, leaving it up to the next higher layer, usually TCP or UDP, to take care of any problems that occur with lost or damaged data.

Page 20: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Transmission Control Protocol (TCP)• TCP is used primarily to verify that whatever

was sent by the sending machine is received intact by the destination.

• TCP is called a reliable delivery protocol, meaning that it makes sure everything sent was received properly.

• TCP is a connection-based protocol, meaning that the sending and the destination machines communicate with each other by sending status messages back and forth.

Page 21: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Transmission Control Protocol (TCP)

• TCP adds a header to the front of each message that contains checksums, numbering, and other reliability information to ensure that every packet sent is received without modification. If there is a transmission problem, TCP takes care of resending the information.

Page 22: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Transmission Control Protocol (TCP)

• TCP sits between the application and the IP layer on each machine, acting as a packaging layer for application data and a delivery mechanism of sending packets to an application.

• TCP usually runs with IP, but it can work with other protocols.

Page 23: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

User Datagram Protocol (UDP)• UDP is an alternative to TCP.• It is a connection-less protocol, meaning that

the sending and receiving machine are not constantly connected to each other.

• They can send status messages back and forth to indicate reception of packets, but there is no constant connection maintained.

• UDP sits in the layer between the applications and IP. UDP usually uses IP to handle its packets.

Page 24: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Telnet• The Telnet service provides a remote login

capability. • This lets a user on one machine log into

another machine and act as if they are directly in front of the second machine.

• Telnet uses TCP to maintain a connection between two machines.

Page 25: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Telnet

• The connection can be anywhere on the local

network, or on another network anywhere in

the world, as long as the user has permission

to log into the remote system.

Page 26: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Simple Network Management Protocol (SNMP)

• SNMP is a network management protocol.• SNMP uses UDP as a transport mechanism.• SNMP relies on several terms from TCP/IP

standard specifications, working with managers and agents instead of clients and servers.

• An agent provides information about a device, whereas a manager communicates across the network.

Page 27: HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other

Domain Name System (DNS)

• DNS enables a device with a common name to be converted to a special network address.

• DNS provides the conversion from a common local name to the unique physical address of the device's network connection.