0% found this document useful (0 votes)
17 views

HTTP_COAP_XMPP_UDP_notes

Uploaded by

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

HTTP_COAP_XMPP_UDP_notes

Uploaded by

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

HTTP Full Form

HTTP stands for HyperText Transfer Protocol. It is the main way web browsers and servers
communicate to share information on the internet. Tim Berner invents it. HyperText is the type of text
that is specially coded with the help of some standard coding language called HyperText Markup
Language (HTML). HTTP/2 is the new version of HTTP. HTTP/3 is the latest version of HTTP,
which is published in 2022.
When you visit a website, HTTP helps your browser request and receive the data needed to display
the web pages you see. It is a fundamental part of how the internet works, making it possible for us to
browse and interact with websites. In this article, we are going to discuss the Full form of HTTP along
with its working, advantages, and disadvantages.
What is the Full Form of HTTP?
HTTP stands for “Hypertext Transfer Protocol.” It is a set of rules for sharing data on the World Wide
Web (WWW). HTTP helps web browsers and servers communicate, allowing people to access and
share information over the internet.
Key Points
 Basic Structure: HTTP forms the foundation of the web, enabling data communication and file
sharing.
 Web Browsing: Most websites use HTTP, so when you click on a link or download a file, HTTP
is at work.
 Client-Server Model: HTTP works on a request-response system. Your browser (client) asks for
information, and the website’s server responds with the data.
 Application Layer Protocol: HTTP operates within the Internet Protocol Suite, managing how
data is transmitted and received.
What is HyperText?
The protocol used to transfer hypertext between two computers is known as HyperText Transfer
Protocol. HTTP provides a standard between a web browser and a web server to establish
communication. It is a set of rules for transferring data from one computer to another. Data such as
text, images, and other multimedia files are shared on the World Wide Web. Whenever a web user
opens their web browser, the user indirectly uses HTTP. It is an application protocol that is used for
distributed, collaborative, hypermedia information systems.
Working of HTTP [HyperText Transfer Protocol]
First of all, whenever we want to open any website we first open a web browser after that we will type
the URL of that website (e.g., www.facebook.com ). This URL is now sent to the Domain Name
Server (DNS). Then DNS first checks records for this URL in their database, and then DNS will
return the IP address to the web browser corresponding to this URL. Now the browser is able to send
requests to the actual server.
After the server sends data to the client, the connection will be closed. If we want something else from
the server we should have to re-establish the connection between the client and the server.

Working off HTTPs


What is an HTTP Request?
HTTP request is simply termed as the information or data that is needed by Internet browsers for
loading a website. This is simply known as HTTP Request.
There is some common information that is generally present in all HTTP requests. These are
mentioned below.
 HTTP Version
 URL
 HTTP Method
 HTTP Request Headers
 HTTP Body
HTTP Request Headers
HTTP Request Headers generally store information in the form of key-value and must be present in
each HTTP Request. The use of this Request Header is to provide core information about the client’s
information, etc.
HTTP Request Body
HTTP Request Body simply contains the information that has to be transferred. HTTP Request has
the information or data to be sent to these browsers.
HTTP Method
HTTP Methods are simply HTTP Verb. In spite of being present so many HTTP Methods, the most
common HTTP Methods are HTTP GET and HTTP POST. These two are generally used in HTTP
cases. In HTTP GET, the information is received in the form of a website.
What is HTTP Response?
HTTP Response is simply the answer to what a Server gets when the request is raised. There are
various things contained in HTTP Response, some of them are listed below.
 HTTP Status Code
 HTTP Headers
 HTTP Body

HTTP Response

HTTP Response Headers


HTTP Response headers are simply like an HTTP Request where it has that work to send some
important files and data to the HTTP Response Body.
HTTP Response Body
HTTP Responses are the responses that are received successfully upon the request. Generally, it
comes under the requests generated by the web. In most cases, the request is to transfer the HTML
data into a webpage.
What is an HTTP Status Code?
HTTP Status Codes are the 3-digit codes that tell the message or simply tell us about the HTTP
Request whether it has been completed or not. There are simply 5 types of status codes.
 Informational
 Successful
 Re-directional
 Client-Error
 Server-Error
History of HTTP
Tim Berners Lee and his team at CERN get credit for inventing original HTTP and associated
technologies.
 HTTP version 0.9: This was the first version of HTTP which was introduced in 1991.
 HTTP version 1.0: In 1996, RFC 1945 (Request For Comments) was introduced in HTTP
version 1.0.
 HTTP version 1.1: In January 1997, RFC 2068 was introduced in HTTP version 1.1.
Improvements and updates to the HTTP version 1.1 standard were released under RFC 2616 in
June 1999.
 HTTP version 2.0: The HTTP version 2.0 specification was published as RFC 7540 on May 14,
2015.
 HTTP version 3.0: HTTP version 3.0 is based on the previous RFC draft. It is renamed as Hyper-
Text Transfer Protocol QUIC which is a transport layer network protocol developed by Google.
Characteristics of HTTP
HTTP is IP based communication protocol that is used to deliver data from server to client or vice-
versa.
 The server processes a request, which is raised by the client, and also server and client know each
other only during the current bid and response period.
 Any type of content can be exchanged as long as the server and client are compatible with it.
 Once data is exchanged, servers and clients are no longer connected.
 It is a request and response protocol based on client and server requirements.
 It is a connection-less protocol because after the connection is closed, the server does not
remember anything about the client and the client does not remember anything about the server.
 It is a stateless protocol because both client and server do not expect anything from each other but
they are still able to communicate.
Cookies in HTTP
An HTTP cookie (web cookie, browser cookie) is a little piece of data that a server transmits to a
user’s web browser. When making subsequent queries, the browser may keep the cookie and transmit
it back to the same server. An HTTP cookie is typically used, for example, to maintain a user’s login
state, and to determine whether two requests originate from the same browser. For the stateless HTTP
protocol, it retains stateful information.
HTTP status code
Three-digit codes known as HTTP status codes are most frequently used to show if an HTTP request
has been fulfilled successfully. The five blocks below represent the breakdown of status codes:
 1x Informative
 2xx Achievement
 3xx Reorientation
 4xx Client Mistake
 5xx Error on the Server
Different numbers between 00 and 99 are denoted by the “xx”. Status codes that begin with “2”
denote a successful outcome. For instance, the most typical answers sent after a client requests a
webpage have a status code of “200 OK,” which denotes that the request was successfully fulfilled.
Can DDoS attacks be launched over HTTP?
Remember that because HTTP is a “stateless” protocol, every command executed over it operates
independently of every other operation. Each HTTP request opened and terminated a TCP connection
according to the original specification. Multiple HTTP requests can now flow over a persistent TCP
connection in HTTP 1.1 and later versions of the protocol, which improves resource use. Large-scale
HTTP requests are regarded as application layer or layer 7 attacks in the context of DoS or
DDoS attacks, and they can be used to mount an attack on a target device.
Advantages of HTTP
 Memory usage and CPU usage are low because of fewer simultaneous connections.
 Since there are few TCP connections hence network congestion is less.
 Since handshaking is done at the initial connection stage, then latency is reduced because there is
no further need for handshaking for subsequent requests.
 The error can be reported without closing the connection.
 HTTP allows HTTP pipe-lining of requests or responses.
Disadvantages of HTTP
 HTTP requires high power to establish communication and transfer data.
 HTTP is less secure because it does not use any encryption method like HTTPS and uses TLS to
encrypt regular HTTP requests and responses.
 HTTP is not optimized for cellular phones and it is too gabby.
 HTTP does not offer a genuine exchange of data because it is less secure.
 The client does not close the connection until it receives complete data from the server; hence, the
server needs to wait for data completion and cannot be available for other clients during this time.
Conclusion
In summary, HTTP stands for “Hypertext Transfer Protocol” and is essential for web communication.
It enables your browser to request and receive information from websites, making online browsing
possible. HTTP is the basic method used by web browsers and servers to communicate and share
information on the internet, making it possible for us to browse and interact with websites.
Frequently Asked Questions on HTTP – FAQs
What is the difference between HTTPS and HTTP?
HTTPS is the secure version of HTTP. It adds a security layer to the Hyper Text Tranfer Protocol.

Is HTTP is stateful or stateless protocol?


HTTP is the stateless protocol that means it does not maintain any state or store any information.

What is the port number of HTTP and HTTPS?


The default port number of Hyper Text Transfer Protocol(HTTP) is 80 and for Hyper Text Transfer
Protocol Secure(HTTPS) is 443.

What is the role of cookies in HTTP?


Cookies are the small units of data that are stored on client side rather than server side they are used
to maintain information.

Constrained Application Protocol (CoAP)


The Constrained Application Protocol (CoAP) is a special web transfer protocol that operates with
constrained nodes and networks. These networks are commonly used for applications such as the
Internet of Things (IoT), where devices may have limited processor, memory, and power resources.
CoAP is intended to be simple, low-overhead, and efficient, making it ideal for machine-to-machine
communication.
What is CoAP?
CoAP or Constrained Application Protocol, as the name suggests, is an application layer protocol that
was introduced by the Internet Engineering Task Force in the year 2014. CoAP is designed for the
constrained environment. It is a web-based protocol that resembles HTTP. It is also based on the
request-response model. Based on the REST-style architecture, this protocol considers the various
objects in the network as resources. These resources are uniquely assigned a URI or Uniform
Resource Identifier. The data from one resource to another resource is transferred in the form of
CoAP message packets whose format is briefly described later. The Client requests for some
resources and in response to that, the server sends some response over which the client sends an
acknowledgement. Although, some types of CoAP do not involve the receiver sending
acknowledgments for the information received.
How Does CoAP Works?
Constrained Application Protocol (CoAP) is an application layer protocol designed for resource-
constrained devices and networks, particularly in the context of the Internet of Things (IoT).
 Client-Server Model: CoAP model is essentially a client/server model enabling the client to
request for service from server as needed and the server responds to client's request.
 Resource-Oriented: CoAP treats various objects in the network as resources, each uniquely
identified by a URI (Uniform Resource Identifier). Clients can request information about these
resources, and servers provide responses2.
 Methods: CoAP supports several methods similar to HTTP:
o GET
o POST
o DELETE
o PUT
 Asynchronous Messaging: CoAP messages are asynchronous because it uses the User Datagram
Protocol (UDP). Unlike TCP-based protocols, CoAP does not require acknowledgments for every
message, which helps conserve energy in resource-constrained devices.
 Energy Efficiency: CoAP is designed to minimize energy consumption while simplifying
communication between clients and devices. It achieves this by managing resources, providing
device descriptions, and supporting mechanisms to determine if a device is powered on or off.
Methods in CoAP
 GET - The get method is used to retrieve resource information identified by the request URI. In
response to GET method success a 200(OK) response is sent.
 POST - The post method creates a new subordinate resource under the parent URI requested by it
to the server. On successful resource creation on the server, a 201 (Created) response is sent while
on failure a 200 (OK) response code is sent.
 DELETE - The delete method deletes the resource identified by the requested URI and a 200
(OK) response code is sent on successful operation.
 PUT - The PUT method updates or creates the resource identified by the request URI with the
enclosed message body. The message body is considered as modified version of a resource if it
already exists at the specified URI otherwise a new resource with that URI is created. A 200 (OK)
response is received in former case whereas a 201 (Created) response is received in later case. If
the resource is neither created nor modified then an error response code is sent.
The most fundamental difference between CoAP and HTTP is that CoAP defines a new method
which is not present in HTTP. This method is called Observe method. The observe method is very
similar to the GET method in addition with an observe option. This alerts the server, to send every
update about the resource to the client. Therefore, upon any change in the resource, the server sends a
response to the client. These responses could either be directly sent individually or they can be piggy-
backed.
Message Format of CoAP
CoAP messages are encoded in binary-format or 0/1 format. Like other message formats, CoAP
message has a header and a payload section along with an optional section. The size of CoAP header
is 4 bytes or 32 bits. This size is fixed for every CoAP message. Whereas the other part of message is
the optional part which includes payload and tokens of variable size ranging from 0-8 bytes. The
message format of CoAP contains the following fields:
 Version - The size of version field is 2 bits. It represents the version of the CoAP protocol.
 Type Code - The size of type field is 2 bits. There are four types of messages namely
confirmable, non-confirmable, acknowledgement and reset represented by the bit patterns 00, 01,
10, 11 respectively.
 Option Count - The size of option count field is 4 bits. These 4 bits, means there could be a total
of 16 possible options in header.
 Code - The size of code field is 8 bits. This indicates whether message is empty, request message
or response message.
 Message ID - The size of message ID field is 16 bits. It is used to detect the message duplication
and types of messages.
 Tokens [Optional] - The size of tokens field is variable which ranges from 0-8 bytes. It's used to
match a response with request.
 Options [Optional] - The options field in CoAP message has a variable size. It defines the type of
payload message.
 Payload [Optional] - Similar to options field, the payload field has a variable size. The payload of
requests or of responses is typically a representation of the requested resource or the result of the
requested action.

CoAP
Message Format
CoAP Features
 Lightweight and Simple
 RESTful Architecture
 UDP-Based
 Asynchronous Communication
 Low Header Overhead
 Multicast Communication
 Proxy and Caching
Applications of CoAP
 Real Time Monitoring in Grid - Smart cities can monitor the distribution and generation of
power remotely. The CoAP sensors could be embedded inside the transformers and the data could
be transferred over GPRS or 6LowPAN.
 Defense utilities - The armory and tanks are now-a-days fitted with sensors so that information
could be communicated remotely without any interference. The CoAP sensors could detect any
intrusion. This makes them capable to transfer more data even under low bandwidth network.
 Aircraft utilities - The Aircraft sensors and actuators could be connected with other sensors and
communication can take place using smart CoAP based sensors and actuators.
The difference between MQTT and CoAP protocols could be understood from the following article on
GFG: Difference between CoAP and MQTT

Conclusion
CoAP is a versatile and efficient protocol developed to meet the specific needs of restricted devices
and networks. Due to less overhead and capability to transfer data effectively even under low
bandwidth, CoAP has became a primarily choice for IoT and cloud computing system architecture.
CoAP messages have a fixed size header which is of 4 bytes. Alongside this, CoAP message format
have some optional fields which includes fields like token, options, and payload. This message format
of CoAP is binary encoded in 0/1 format. CoAP works on request response model which majorly
resembles HTTP methods like GET, POST, PUT, and DELETE along with its own unique method
Observe
Frequently Asked Questions on CoAP - FAQs
Is CoAP better than MQTT?
CoAP is meant to use UDP, making it better suitable for constrained networks and resources.

What is the use of CoAP?


The limited Application Protocol (CoAP) is a specialised web transfer protocol designed for usage
with limited nodes and networks in the Internet of Things.

Which layer is CoAP?


CoAP is an application layer protocol.

What is the maximum message size in CoAP?


CoAP messages should be limited to 1280 bytes.

User Datagram Protocol (UDP ) is a Transport Layer protocol. UDP is a part of the Internet
Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless
protocol. So, there is no need to establish a connection before data transfer. The UDP helps to
establish low-latency and loss-tolerating connections over the network. The UDP enables process-
to-process communication.
What is User Datagram Protocol?
User Datagram Protocol (UDP) is one of the core protocols of the Internet Protocol (IP) suite. It is a
communication protocol used across the internet for time-sensitive transmissions such as video
playback or DNS lookups . Unlike Transmission Control Protocol (TCP), UDP is connectionless
and does not guarantee delivery, order, or error checking, making it a lightweight and efficient
option for certain types of data transmission.

UDP is a connectionless protocol that offers minimal error recovery services. For more insights into
network protocols like UDP, consider the GATE CS Self-Paced Course .
UDP Header
UDP header is an 8-byte fixed and simple header, while for TCP it may vary from 20 bytes to 60
bytes. The first 8 Bytes contain all necessary header information and the remaining part consists of
data. UDP port number fields are each 16 bits long, therefore the range for port numbers is defined
from 0 to 65535; port number 0 is reserved. Port numbers help to distinguish different user requests
or processes.
UDP Header

 Source Port: Source Port is a 2 Byte long field used to identify the port number of the source.
 Destination Port: It is a 2 Byte long field, used to identify the port of the destined packet.
 Length: Length is the length of UDP including the header and the data. It is a 16-bits field.
 Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of the one’s
complement sum of the UDP header, the pseudo-header of information from the IP header, and
the data, padded with zero octets at the end (if necessary) to make a multiple of two octets.
Notes – Unlike TCP, the Checksum calculation is not mandatory in UDP. No Error control or flow
control is provided by UDP. Hence UDP depends on IP and ICMP for error reporting. Also UDP
provides port numbers so that is can differentiate between users requests.
Applications of UDP
 Used for simple request-response communication when the size of data is less and hence there
is lesser concern about flow and error control.
 It is a suitable protocol for multicasting as UDP supports packet switching.
 UDP is used for some routing update protocols like RIP(Routing Information Protocol).
 Normally used for real-time applications which can not tolerate uneven delays between sections
of a received message.
 VoIP (Voice over Internet Protocol) services, such as Skype and WhatsApp, use UDP for real-
time voice communication. The delay in voice communication can be noticeable if packets are
delayed due to congestion control, so UDP is used to ensure fast and efficient data transmission.
 DNS (Domain Name System) also uses UDP for its query/response messages. DNS queries are
typically small and require a quick response time, making UDP a suitable protocol for this
application.
 DHCP (Dynamic Host Configuration Protocol) uses UDP to dynamically assign IP addresses to
devices on a network. DHCP messages are typically small, and the delay caused by packet loss
or retransmission is generally not critical for this application.
 Following implementations uses UDP as a transport layer protocol:
o NTP (Network Time Protocol)
o DNS (Domain Name Service)
o BOOTP, DHCP.
o NNP (Network News Protocol)
o Quote of the day protocol
o TFTP, RTSP, RIP.
 The application layer can do some of the tasks through UDP-
o Trace Route
o Record Route
o Timestamp
 UDP takes a datagram from Network Layer , attaches its header, and sends it to the user. So, it
works fast.
TCP vs UDP
User Datagram Protocol
Basis Transmission Control Protocol (TCP) (UDP)

UDP is the Datagram-oriented


TCP is a connection-oriented protocol. protocol. This is because there
Connection orientation means that the is no overhead for opening a
communicating devices should establish a connection, maintaining a
connection before transmitting data and connection, or terminating a
should close the connection after connection. UDP is efficient for
transmitting the data. broadcast and multicast types
Type of Service of network transmission.

The delivery of data to the


TCP is reliable as it guarantees the delivery
destination cannot be
of data to the destination router.
Reliability guaranteed in UDP.

TCP provides extensive error-checking UDP has only the basic error-
Error checking mechanisms. It is because it provides flow checking mechanism using
mechanism control and acknowledgment of data. checksums.

Acknowledgme
An acknowledgment segment is present. No acknowledgment segment.
nt

Sequencing of data is a feature of There is no sequencing of data


Transmission Control Protocol (TCP). this in UDP. If the order is required,
means that packets arrive in order at the it has to be managed by the
Sequence receiver. application layer.

UDP is faster, simpler, and


TCP is comparatively slower than UDP.
Speed more efficient than TCP.

There is no retransmission of
Retransmission of lost packets is possible in
lost packets in the User
TCP, but not in UDP.
Retransmission Datagram Protocol (UDP).

TCP has a (20-60) bytes variable length UDP has an 8 bytes fixed-
Header Length header. length header.

Weight TCP is heavy-weight. UDP is lightweight.

Handshaking Uses handshakes such as SYN, ACK, SYN- It’s a connectionless protocol
Techniques ACK i.e. No handshake

Broadcasting TCP doesn’t support Broadcasting. UDP supports Broadcasting.

TCP is used by HTTP, UDP is used by DNS, DHCP,


Protocols HTTPs , FTP , SMTP and Telnet . TFTP, SNMP , RIP, and VoIP.
User Datagram Protocol
Basis Transmission Control Protocol (TCP) (UDP)

UDP connection is a message


The TCP connection is a byte stream.
Stream Type stream.

Overhead Low but higher than UDP. Very low.

This protocol is used in


This protocol is primarily utilized in situations where quick
situations when a safe and trustworthy communication is necessary but
communication procedure is necessary, where dependability is not a
such as in email, on the web surfing, and concern, such as VoIP, game
in military services. streaming, video, and music
Applications streaming, etc.

Advantages of UDP
 Speed: UDP is faster than TCP because it does not have the overhead of establishing
a connection and ensuring reliable data delivery.
 Lower latency: Since there is no connection establishment, there is lower latency and
faster response time.
 Simplicity: UDP has a simpler protocol design than TCP, making it easier to
implement and manage.
 Broadcast support: UDP supports broadcasting to multiple recipients, making it useful
for applications such as video streaming and online gaming.
 Smaller packet size: UDP uses smaller packet sizes than TCP, which can reduce
network congestion and improve overall network performance.
 User Datagram Protocol (UDP) is more efficient in terms of both latency and
bandwidth.
Disadvantages of UDP
 No reliability: UDP does not guarantee delivery of packets or order of delivery, which
can lead to missing or duplicate data.
 No congestion control: UDP does not have congestion control, which means that it
can send packets at a rate that can cause network congestion.
 Vulnerable to attacks: UDP is vulnerable to denial-of-service attacks , where an
attacker can flood a network with UDP packets, overwhelming the network and causing
it to crash.
 Limited use cases: UDP is not suitable for applications that require reliable data
delivery, such as email or file transfers, and is better suited for applications that can
tolerate some data loss, such as video streaming or online gaming.
How is UDP used in DDoS attacks?
A UDP flood attack is a type of Distributed Denial of Service (DDoS) attack where an
attacker sends a large number of User Datagram Protocol (UDP) packets to a target port.
 UDP Protocol : Unlike TCP, UDP is connectionless and doesn’t require a handshake
before data transfer. When a UDP packet arrives at a server, it checks the specified
port for listening applications. If no app is found, the server sends
an ICMP “destination unreachable” packet to the supposed sender (usually a
random bystander due to spoofed IP addresses).
 Attack Process :
o The attacker sends UDP packets with spoofed IP sender addresses to
random ports on the target system.
o The server checks each incoming packet’s port for a listening application
(usually not found due to random port selection).
o The server sends ICMP “destination unreachable” packets to the spoofed
sender (random bystanders).
o The attacker floods the victim with UDP data packets, overwhelming its
resources.
 Mitigation : To protect against UDP flood attacks, monitoring network traffic for sudden
spikes and implementing security measures are crucial. Organizations often use
specialized tools and services to detect and mitigate such attacks effectively.
UDP Pseudo Header
 The purpose of using a pseudo-header is to verify that the UDP packet has reached its
correct destination
 The correct destination consist of a specific machine and a specific protocol port
number within that machine

UDP pseudo header

UDP Pseudo Header Details


 The UDP header itself specify only protocol port number.thus , to verify the destination
UDP on the sending machine computes a checksum that covers the destination IP
address as well as the UDP packet.
 At the ultimate destination, UDP software verifies the checksum using the destination
IP address obtained from the header of the IP packet that carried the UDP message.
 If the checksum agrees, then it must be true that the packet has reached the intended
destination host as well as the correct protocol port within that host.
User Interface
A user interface should allow the creation of new receive ports, receive operations on the
receive ports that returns the data octets and an indication of source port and source
address, and an operation that allows a datagram to be sent, specifying the data, source
and destination ports and address to be sent.
IP Interface
 The UDP module must be able to determine the source and destination internet
address and the protocol field from internet header
 One possible UDP/IP interface would return the whole internet datagram including the
entire internet header in response to a receive operation
 Such an interface would also allow the UDP to pass a full internet datagram complete
with header to the IP to send. the IP would verify certain fields for consistency and
compute the internet header checksum.
 The IP interface allows the UDP module to interact with the network layer of the
protocol stack, which is responsible for routing and delivering data across the network.
 The IP interface provides a mechanism for the UDP module to communicate with other
hosts on the network by providing access to the underlying IP protocol.
 The IP interface can be used by the UDP module to send and receive data packets
over the network, with the help of IP routing and addressing mechanisms.



XMPP is a short form for Extensible Messaging Presence Protocol. It’s protocol
for streaming XML elements over a network in order to exchange messages and
present information in close to real-time.
Let’s dive into each character of word XMPP:
 X : It means eXtensible. XMPP is an open-source project which can be
changed or extended according to the need.
 M : XMPP is designed for sending messages in real time. It has very efficient
push mechanism compared to other protocols.
 P : It determines whether you are online/offline/busy. It indicates the state.
 P : XMPP is a protocol, that is, a set of standards that allow systems to
communicate with each other.
These are the basic requirements of any Instant Messenger which are fulfilled by
XMPP:
1. Send and receive messages with other users.
2. Check and share presence status
3. Manage subscriptions to and from other users.
4. Manage contact list
5. Block communications(receive message, sharing presence status, etc) to
specific users.
Other XMPP features:
Decentralised:
XMPP is based on client-server architecture, i.e. clients don’t communicate
directly, they do it with the help of server as intermediary. It is decentralised
means there is no centralised XMPP server just like email, anyone can run their
own XMPP server. Each XMPP client is identified by JID (Jabber ID).
#JID
{
user,
server,
resource
}
For example, I’m a whatsApp user and I’m identified by my mobile number, so
user = "8767898790"
server = "whatsapp.com"
resource = "mobile"

JID : "[email protected]/mobile"
resource is used in case the application support mobile as well as desktop or
web application, so it can be optional in case a Instant Messenger Application
support only single kind of resource.
XMPP implementation:
The original protocol for XMPP is Transmission Control Protocol using open ended
XML streams over long lived TCP connections. In some cases, there are restricted
firewalls, XMPP(port 5222) is blocked, so it can’t be used for web applications
and users behind restricted firewalls, to overcome this, XMPP community also
developed a HTTP transport. And as the client uses HTTP, most firewalls allow
clients to fetch and post messages without any problem. Thus, in scenarios
where the TCP port used by XMPP is blocked, a server can listen on the normal
HTTP port and the traffic should pass without problems.
XMPP Applications:
While vanilla XMPP is very less used, but it’s modified and customised versions is
highly used by applications for managing contact list, online presence in
applications like WhatsApp, Kik Messenger, Zoom, etc.

You might also like