XMPP is the Extensible Messaging and Presence Protocol, a set of open technologies for instant messaging, presence, multi-party chat, voice and video calls, collaboration, lightweight middleware, content syndication, and generalized routing of XML data.
XMPP was originally developed in the Jabber open-source community to provide an open, decentralized alternative to the closed instant messaging services at that time
The Session Initiation Protocol is a signaling protocol that enables the Voice Over Internet Protocol (VoIP) by defining the messages sent between endpoints and managing the actual elements of a call. SIP supports voice calls, video conferencing, instant messaging, and media distribution.
2. XMPP
• The XMPP was originally named as Jabber and later known as XMPP.
• XMPP is originally developed by the open source Jabber community in 1999.
• The full form of XMPP is Extensible Messaging Presence Protocol.
• XMPP is a communication protocol used for faster data transfer between devices in a
network and It is designed for messaging, chat, video, voice calls and collaboration.
• The fundamental base of this protocol is XML and is used for messaging service such as
WhatsApp.
• As the model is decentralized, anyone can run their own XMPP server.
• It is open standard Protocol and it is well suited for Cloud Computing.
3. XMPP Denotation
The notation for XMPP can be given as following
X denotes Extensible
• It is considered extensible as it is designed to accept and accommodate any changes. It means, many new features can be
added/extended in the future.
M denotes Messaging
• XMPP supports sending messages (one to one , group) to the recipient in real time. It uses XML to exchange data between
client and server.
P denotes Presence
• It is helpful to identify the status such as “offline” or “Online” or “Busy”
• It also helps in understanding if the recipient is ready to receive the message or not.
P denotes Protocol
• The set of standards together acts as protocol.
4. XMPP
• XMPP is a set of open technologies for instant messaging, presence, voice, and video calls and is managed by
the Internet Engineering Task Force (IETF is an open standards organization, that develops and promotes
voluntary Internet standards). It is secure( Encryption, authenticate) and flexible(different system
communicate).
Applications
• Video, file transfer, gaming
• Real-Time Web Chat/Group Chat
• Social Networking Services
Weakness
• Quality of Service( QoS)
• Binary data must be encoded.
5. Messenger Requirement
Any messenger requires the following features inbuilt:
• Message sending and the receiving features.
• Understanding the presence and absence status.
• Managing subscription details.
• Maintaining the contact list.
• Message Blocking Service.
Note: all the listing features are built in XMPP.
6. XMPP Architecture
• The architecture of XMPP protocol is shown in the figure:
• The XMPP client communicate with XMPP server bidirectional.
• There can be any number of clients connected to XMPP architecture.
7. XMPP Architecture
• The XMPP server may be connected to the other clients or other XMPP servers.
8. XMPP Architecture(Contd.)
• The initial version of XMPP was with TCP using open-ended XML. After a certain period, the XMPP was
developed based on HTTP.
• The XMPP can work with HTTP through two different methods Polling and Binding.
Polling method
• In the Polling method, the messages stored in the server are pulled or fetched. The fetching is done by the
XMPP client through HTTP get and POST requests.
Binding method
• In the binding method, Bidirectional-streams Over Synchronous HTTP(BOSH) enables the server to push the
messages to the client when they are sent.
• BOSH is a transport protocol that creates bi-directional TCP connectivity between client and
server.
• Both method uses HTTP, hence the firewall allows the fetch and post activity without any difficulties.
9. XMPP Features
• Peer-to-Peer Sessions: XMPP support machine-to-machine or peer-to-peer across diverse
set of network.
• Multi-User Chat: XMPP supports group and conference chat.
• Encryption: point-to-point encryption is done by TLS(Transport Layer Security), that enables
encryption of messages and data.
• Connection to other Protocol: using XMPP gateway other protocols like SMS(Short
Messaging Service) and SMTP(Simple Mail Transfer Protocol) can also be connected with
XMPP servers for different services.
• Extensible: It can be used for variety of applications as it has which uses XML for delivering
services.
10. Where Does SIP Fit In?
• SIP is an application layer protocol. t is a simple network signaling protocol for creating
and terminating sessions with one or more participants. SIP applications can run on TCP,
UDP, or other lower-layer networking protocols.
• Typically, the SIP protocol is used for internet telephony and multimedia distribution
between two or more endpoints. For example, one person can initiate a telephone call
to another person using SIP, or someone may create a conference call with many
participants.
• The SIP protocol was designed to be very simple, with a limited set of commands. It is
also text-based, so anyone can read a SIP message passed between the endpoints in a
SIP session.
11. SIP – Overview
• SIP is a signaling protocol used to create, modify, and terminate a multimedia session over
the Internet Protocol. A session is nothing but a simple call between two endpoints. An
endpoint can be a smartphone, a laptop, or any device that can receive and send multimedia
content over the Internet.
• SIP can be used for two-party (unicast) or multiparty (multicast) sessions.
• SIP takes the help of SDP (Session Description Protocol) which describes a session and RTP
(Real-Time Transport Protocol) used for delivering voice and video over IP network.
• Other SIP applications include file transfer, instant messaging, video conferencing, online
games, and multimedia distribution.
12. Session Description Protocol(SDP)
• SDP is a general protocol used for describing a session.
It conveys the following information:
• The name and the purpose of the session
• Start and end times for the session
• The media type (audio, video) that comprises the session
• Detailed information needed to receive the session(the protocol to be used, the port
number, the encoding scheme, the address to which data will be sent, etc.)
• The Real-time Transport Protocol is a network protocol used to deliver streaming
audio and video media over the Internet, thereby enabling the Voice Over Internet
Protocol (VoIP).
13. SIP(Session Initiation Protocol)
Session Initiation Protocol (SIP) is one of the most common protocols used in VoIP technology. It is an
application layer protocol that works with other protocols to control multimedia communication sessions
over the Internet.
VoIP Technology
VOIP technology allows you to deliver voice and multimedia (videos, pictures) content over the Internet. It
is one of the cheapest ways to communicate anytime, anywhere with the Internet’s availability.
Some advantages of VOIP include
• Low cost
• No extra cables
• Video conferencing
14. SIP Protocol
• It is group of rules which control multimedia exchange on Internet.
• It is a control protocol which is responsible to maintain ,control and end the session
of one or more user’s .
• It is used to create , maintain, modify ,terminate the real time session. For e.g., video
calling & messaging, we can send them in real time.
• It works with VoIP and others protocols.
• It is standardized with IETF(Internet Engineering Task Force).
• It is application layer protocol which control multimedia sessions on internet.
15. SIP - Network Elements
There are some entities that help SIP in creating its network. In SIP, every network
element is identified by an SIP URI (Uniform Resource Identifier) which is like an
address. Following are the network elements.
• User Agent
• Proxy Server
• Registrar Server
• Redirect Server
• Location Server
16. User Agent
• It is the endpoint and one of the most important network elements of a
SIP network. An endpoint can initiate, modify, or terminate a session.
User agents are the most intelligent device or network element of a SIP
network. It could be a softphone, a mobile, or a laptop.
• User agents are logically divided into two parts −
• User Agent Client (UAC) − The entity that sends a request and receives a
response.
• User Agent Server (UAS) − The entity that receives a request and sends a
response.
17. Proxy Server
It is the network element that takes a request from a user agent and forwards it to another user.
When a request is generated, the exact address of the recipient is not known in advance, so the client sends the request to a
proxy server. The proxy server on behalf of the client forwards the request to another proxy server or the recipient itself.
• The role of a proxy server is much like a router.
• It has some intelligence to understand a SIP request and send it ahead with the help of URI.
• A proxy server sits in between two user agents.
• There can be a maximum of 70 proxy servers in between a source and a destination.
There are two types of proxy servers −
• Stateless Proxy Server − It simply forwards the message received. This type of server does not store any information about a
call or a transaction.
• Stateful Proxy Server − This type of proxy server keeps track of every request and response received and can be used it in the
future if required. It can retransmit the request, if there is no response from the other side in time.
18. Registrar Server
• As you might have guessed already, one of the prime jobs of the servers is to detect the location of a user in
the network. How do they know the location? If you are thinking that users have to register their location to a
Registrar server, you are right. Users from time to time refresh their location by registering(sending a special
type of message) to a registrar server.
• Here the caller wants to register with the TMC domain. So it sends a REGISTER request to the TMC’s Registrar
server and the server returns a 200 OK response as it authorized the client.
19. Redirect Server
• A redirect server redirects the request back to the client indicating that the
clients need to try a different route to get to the recipient. It generally happens
when a recipient has moved from its original position either temporarily or
permanently.
• The redirect server receives requests and looks up the intended recipient of
the request in the location database created by the registrar.
• The redirect server uses the database to get location information and responds
with to the user.
20. Location Server
• The addresses registered to a registrar are stored in a Location Server. The
following figure depicts the roles played by each of the network elements in
establishing a session.
21. SIP Messaging Core Methods
There are six core methods as discussed below
• INVITE is used to initiate a session with a user agent. In other words, an INVITE method
is used to establish a media session between the user agents.
• BYE is the method used to terminate an established session. This is a SIP request that
can be sent by either the caller or the callee to end a session.
• REGISTER request performs the registration of a user agent. This request is sent by a
user agent to a registrar server.
• CANCEL is used to terminate a session which is not established. User agents use this
request to cancel a pending call attempt initiated earlier.
• ACK is used to acknowledge the final responses to an INVITE method. An ACK always
goes in the direction of INVITE.
22. SIP - Response Codes
A SIP response is a message generated by a user agent server (UAS) or SIP
server to reply a request generated by a client. It could be a formal
acknowledgment to prevent the retransmission of requests by a UAC.
Successful 200 OK
Client Error 404 Not Found
Server Error 504 Server Timeout
Redirect 302 Moved Temporarily
Global Error 603 Decline