0% found this document useful (0 votes)
55 views35 pages

Hypertext Transfer Protocol (HTTP) : Gurjot Singh Ug201113013 Revti Raman Singh Ug201110026

HTTP is the application-level protocol for transmitting hypermedia documents (web pages) across the internet. It works by establishing a connection between a client, like a web browser, and a server, then transmitting data in messages. Common HTTP methods include GET to retrieve a resource and POST to submit data to a server. Responses include status codes like 200 for success and 404 for "not found". ICMP is a network-level protocol that provides error reporting and congestion control for IP. It reports issues like checksum errors, expired time-to-live values, and unreachable destinations.

Uploaded by

Sunitha Manam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views35 pages

Hypertext Transfer Protocol (HTTP) : Gurjot Singh Ug201113013 Revti Raman Singh Ug201110026

HTTP is the application-level protocol for transmitting hypermedia documents (web pages) across the internet. It works by establishing a connection between a client, like a web browser, and a server, then transmitting data in messages. Common HTTP methods include GET to retrieve a resource and POST to submit data to a server. Responses include status codes like 200 for success and 404 for "not found". ICMP is a network-level protocol that provides error reporting and congestion control for IP. It reports issues like checksum errors, expired time-to-live values, and unreachable destinations.

Uploaded by

Sunitha Manam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

HyperText Transfer

Protocol (HTTP)

GURJOT REVTI RAMAN


SINGH SINGH 1

UG201113013 UG201110026
WHAT IS A PROTOCOL AND
HTTP?
• Protocol: A Protocol is a standard procedure
for defining and regulating communication. For
example TCP, UDP, HTTP etc.
• HTTP is the foundation of data communication
for the World Wide Web.
• The HTTP is the Web’s application-layer
protocol for transferring various forms of data
between server and client like plaintext,
hypertext, image, videos and sounds .
2
TERMINOLOGY
• IP Address: An Internet Protocol address (IP address) is a numerical label assigned to
each device (e.g., computer, printer) participating in a computer network that uses the
Internet Protocol for communication.
• TCP :Transmission Control Protocol (TCP) is one of the two original core protocols of
the Internet Protocol Suite (IP), and is so common that the entire suite is often called
TCP/IP. TCP provides reliable, ordered, error-checked delivery of a stream of octets
between programs running on computers connected to an intranet or the public Internet.
• Port Number : A port number is a 16 bit number which when associated with IP
address , completes the destination address for a communications session.
• Socket : A socket is nothing but a combination of IP address and port number. It is
simply an
end while 3

communication.
HOW HTTP
WORKS?
• HTTP is implemented in two programs: a
client program and a server program,
executing on different end systems, talk to
each other by exchanging HTTP messages.
• The HTTP client first initiates a TCP
connection with the server. Once the
connection is established, the browser and
the server processes access TCP through
their socket interfaces.
4
HOW HTTP
WORKS?
Suppose client wants to visit www.yahoo.com

5
HOW HTTP WORKS? (CONT.)

6
HOW HTTP WORKS? (CONT.)

7
HOW HTTP WORKS? (CONT.)

8
HOW HTTP WORKS? (CONT.)

9
PERSISTENT AND NON-PERSISTENT
CONNECTIONS
• In non-persistent connection each request/response pair are sent over a
separate TCP connection.
• In persistent connections all of the requests and their corresponding
responses are sent over the same TCP connection.

10
HTTP REQUEST
MESSAGE
• The first line of an HTTP request message is
called the request line; the subsequent lines are
called the header lines. The request line has
three fields: the method field, the URL field,
and the HTTP version field. The method field
can take on several different values, including
GET, POST, HEAD, PUT, and DELETE etc.
The great majority of HTTP request messages
use the GET method. The GET method is used
when the browser requests an object, with the
requested object identified in the URL field.
11
REQUEST METHODS

• GET: Retrieve Document identified in URL


• HEAD: Retrieve meta information about document identified in
• DELETE: URL Delete specified URL
• OPTIONS Request information about available options
:
Store document under specified URL
• PUT: Give information to server
• POST: Loopback request
• TRACE: message For use by
• CONNEC Proxies 12

T:
HTTP RESPONSE
MESSAGES
• It has three sections: an initial status line,
header lines, and then the entity body.
The entity body contains the requested
object itself. The status line has three
fields: the protocol version field, a status
code, and a corresponding status message.

13
SOME COMMON STATUS CODES AND
ASSOCIATED PHRASES
• Some common status codes and associated
phrases include:
• 200 OK: Request succeeded and the information
is returned in the response.
• 301 Moved Permanently: Requested object has been
permanently moved; the new URL is specified in
Location: header of the response message. The client
software will automatically retrieve the new URL.
• 400 Bad Request: This is a generic error code indicating
that the request could not be understood by the server.
• 404 Not Found: The requested document does not
exist on this server.
• 505 HTTP Version Not Supported: The
requested HTTP protocol version is not supported by
the server. 14
Internet Control Message Protocol ICMP

The Internet Control Message Protocol (ICMP) is a control protocol that is


considered to be an integral part of IP, although it is architecturally layered upon IP
- it uses IP to carry its data end-to-end. ICMP provides error reporting, congestion
reporting, and first-hop router redirection.

1
Introduction
IP provides best-effort delivery Delivery
problems can be ignored;
datagrams can be "dropped on the floor"
Internet Control Message Protocol (ICMP) provides
error-reporting mechanism

1
IP and ICMP

1
ICMP Features
ICMP uses IP as if ICMP were a higher- level protocol
(that is, ICMP messages are encapsulated in IP
datagrams). However, ICMP is an integral part of IP and
must be implemented by every IP module.
ICMP is used to report some errors, not to make IP
reliable. Datagrams may still be undelivered without
any report on their loss. Reliability must be
implemented by the higher-level protocols that use IP.

1
ICMP Features
ICMP can report errors on any IP datagram with the exception of
ICMP messages, to avoid infinite repetitions.
For fragmented IP datagrams, ICMP messages are only sent
about errors on fragment zero. That is, ICMP messages never
refer to an IP datagram with a non- zero fragment offset field.

1
ICMP Features
ICMP has rules regarding error message generation to
prevent broadcast storms
ICMP messages are never sent in response to datagrams with a
destination IP address that is a broadcast or a multicast
address.
ICMP messages are never sent in response to a datagram
which does not have a source IP address which represents a
unique host. That is, the source address cannot be zero, a
loopback address, a broadcast address or a multicast address.

2
Error Message Generation Rules
ICMP errors messages are not generated in response
to
an ICMP error message
datagrams destined to an IP broadcast address
datagrams sent as a link-layer broadcast a fragment
other than the first
a datagram whose source address does not define a single
host

2
ICMP Features
ICMP messages are never sent in response to ICMP error
messages. They may be sent in response to ICMP query
messages (ICMP types 0, 8, 9, 10 and 13 through 18).
RFC 792 states that ICMP messages “may” be generated to
report IP datagram processing errors, not “must”. In practice,
routers will almost always generate ICMP messages for errors,
but for destination hosts, the number of ICMP messages
generated is implementation dependent.

2
ICMP Message Format

ICMP messages are described in RFC 792 and RFC 950, belong to STD 5
and are mandatory.
ICMP messages are sent in IP datagrams. The IP header will always have a
Protocol number of 1, indicating ICMP and a type of service of zero (routine).
The IP data field will contain the actual ICMP message in the format shown in
the figure below:

2
ICMP Message Transport
ICMP encapsulated in IP But ... how can
that work?
ICMP messages sent in response to incoming datagrams
with problems
ICMP message not sent for ICMP message

24
Error Detection
Internet layer can detect a variety of errors: Checksum
(header only!)
TTL expires
No route to destination network
Can't deliver to destination host (e.g., no ARP reply)
Internet layer discards datagrams with problems
Some - e.g., checksum error - can't trigger error messages

25
Types of Messages
ICMP defines two types of messages: error and
informational messages
Error messages: Source quench
Time exceeded
Destination unreachable Redirect
Fragmentation required
Informational messages:
Echo request/reply
Address mask request/reply

Router discovery 12
ICMP: Message Types
Type Message

0 Echo reply
3 Destination unreachable
4 Source quench
5 Redirect
8 Echo request
11 Time exceeded
12 Parameter unintelligible
13 Time-stamp request
14 Time-stamp reply
15 Information request
16 Information reply
17 Address mask request
18 Address mask reply 13
ICMP and Reachability
An internet host, A, is reachable from another
host, B, if datagrams can be delivered from A to B
ping program tests reachability - sends datagram from
B to A that A echoes back to B
Uses ICMP echo request and echo reply messages
Internet layer includes code to reply to incoming
ICMP echo request mes15sages
Destination Unreachable Codes
Code Meaning
0 Network unreachable Host unreachable
1 Protocol unreachable Port unreachable
2 Fragmentation need and don’t fragment bit set Source route
3 failed
4 Destination network unknown Destination host
5 unknown Source host isolated
6 Communication with dest net administratively prohibited Communication
7 with dest host administratively prohibited Network unreachable for type of
8 service
9
10
11
12 Host unreachable for type of service
16
ICMP Unreachable Error
Unreachable errors are generate for a number of
reasons
network unreachable host
unreachable

type (3) code (0-15) 16-bit checksum

unused (must be 0)

IP header (including options) + first 8 bytes of IP datagram data

30
ICMP Messages: Redirect
Default route may cause extra hop
Router that forwards datagram on same interface
sends ICMP redirect
Host installs new route with correct router
as next hop Host Y
Router A Host Y is reachable in
one hop through
Router A
IP Packet

Redirection: “Next time,


use Router A for this destination
Host X host”
Router B
ICMP Messages: Redirect
Redirect: Please send to router X instead of me.
0 = Redirect datagrams for the network 1 = Redirect
datagrams for the host
2 = Redirect datagrams for the type of service and
net
3 = Redirect datagrams for the type of service and
host

32
ICMP Timestamp Request & Reply
Used to return the current time from another host
Could be used for (primitive) time synchronization protocol, but
NTP and XNTP do a much better job

type (13 or 14) code (0) 16-bit checksum

identifier (can be set to anything) sequence (can be set to anything)

32-bit originate timestamp

32-bit receive timestamp


33
32-bit transmit timestamp
ICMP Timestamp Request & Reply
The recommended value to be returned is the number
of milliseconds since midnight, Coordinated Universal
Time (UTC).
A drawback is that only the time since midnight is
returned. The caller must know the date
form some other means

34
ICMP Summary
Internet layer provides best-effort delivery service May choose to
report errors for some problems ICMP provides error message
service
ICMP is the control sibling of IP
ICMP is used by IP and uses IP as network layer protocol -
Encapsulated in IP datagram - Not reliable
Feedback about problems
e.g. time to live expired
ICMP is used for ping, traceroute, and path MTU discovery
Transfer of (control) messages from routers and hosts to hosts
35

You might also like