XMPP的简介和基本概念

简介: XMPP是一个标准,定义了很多的规范(起源于Jabber),不同的产品都基于这些标准实现 xmpp.org http://xmpp.org/about-xmpp/technology-overview/ XMPP is the Extensible Messaging and Presence...

XMPP是一个标准,定义了很多的规范(起源于Jabber),不同的产品都基于这些标准实现

xmpp.org

http://xmpp.org/about-xmpp/technology-overview/

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.

  • Core — information about the core XMPP technologies for XML streaming
  • BOSH — an HTTP binding for XMPP (and other) traffic
  • Jingle — SIP-compatible multimedia signalling for voice, video, file transfer, and other applications
  • Multi-User Chat — flexible, multi-party communication
  • PubSub — alerts and notifications for data syndication, rich presence, and more

BOSH is “Bidirectional-streams Over Synchronous HTTP”, a technology for two-way communication over the Hypertext Transfer Protocol (HTTP). BOSH emulates many of the transport primitives that are familiar from the Transmission Control Protocol (TCP). For applications that require both “push” and “pull” communications, BOSH is significantly more bandwidth-efficient and responsive than most other bidirectional HTTP-based transport protocols and the techniques known as AJAX.

The XMPP Network组成

Any XMPP network is composed of a number of actors. These actors can be categorized as servers,

clients, components, and server plug-ins.

XMPP servers, or more accurately, XMPP entities speaking the server-to-server protocol or the server end of the client-to-server protocol, are the circulatory system of any XMPP network.

The majority of XMPP entities are clients, which connect to XMPP servers via the client-to-server protocol.

server components. These components augment the behavior of the server by adding some new

service. These components have their own identity and address within the server, but run externally and communicate over a component protocol. component protocol XEP-0114

Many XMPP servers can also be extended via plug-ins. These plug-ins are usually written in the same programming language as the server itself and run inside the server’s processes. Their purpose overlaps to a large degree with external components, but plug-ins may also access internal server data structures and change core server behavior.

关键名词
JID

JIDs (short for jabber identifiers) elizabeth@longbourn.lit

FQDN

Domain fully qualified domain name (FQDN) jabber.org

User JabberID stpeter@jabber.org

Stanzas

Stanzas Work is accomplished in XMPP by the sending and receiving of XMPP stanzas over an XMPP stream.

3 stanzas in the main XMPP vocabulary: <message>, <presence>, and <iq>

Resources

When you connect your client to an XMPP server, you choose (or the server assigns to you) a resource identifier for that particular connection. This resource is used for routing traffic to that connection instead of any other connections you might have open at the moment. The resource is added to the end of your account address, such as stpeter@jabber.org/roundabout or remko@el-tramo.be/home.

The resource is often the name of your computer, your location, or the client software you are using

XMPP URI scheme that can be used to identify JabberIDs as URIs, such as xmpp:jabber.org or xmpp:stpeter@jabber.org [RFC 5122].

Info/Query (or IQ)

life cycle

Every XMPP session has a life cycle consisting of several phases: connection, stream set up, authentication, the session body, and disconnection.

 

XMPP优缺点

Advantages of XMPP

XMPP has the following advantages over HTTP, each of which are explored in detail:

Enables pushing data, not just pulling

Firewall friendly

Strong authentication and security

Provides many out-of-the-box tools for solving a wide range of problems

Disadvantages of XMPP

Every protocol is a bag of both features and problems. In many cases XMPP is not the best tool for

the job or suffers from some limitation. XMPP’s drawbacks include:

Stateful protocol

Community and deployments are not as broad as HTTP

More overhead than HTTP for simple chores

Specialized implementations still needed

相关文章
|
11月前
|
定位技术 UED
卫星电话的工作原理简介
卫星电话的工作原理简介
|
4月前
|
缓存 自然语言处理 前端开发
第一章 引言-HTTP协议基础概念和前后端分离架构请求交互概述
第一章 引言-HTTP协议基础概念和前后端分离架构请求交互概述
121 0
|
3月前
|
网络协议 Java 开发者
网络编程概述
网络编程
55 8
EMQ
|
传感器 缓存 安全
MQTT 协议入门:基础知识和快速教程
本文将通过讲解与演示向读者展示 MQTT 协议的入门使用流程,开发者可以通过本文以更简单的方式理解 MQTT 相关概念,快速开始 MQTT 服务及应用的开发。
EMQ
3008 0
MQTT 协议入门:基础知识和快速教程
|
XML Linux PHP
Powerlink协议使用极简入门教程
Powerlink协议使用极简入门教程
|
Web App开发 编解码 安全
零基础快速入门WebRTC:基本概念、关键技术、与WebSocket的区别等
本文主要分享了WebRTC的基本概念、关键技术术语(包括NAT、STUN、TURN、ICE、SDP 和信令),着重讲解了WebRTC是如何实现P2P通信以及WebRTC信令的作用,同时讨论了WebRTC在技术上的优势和劣势,最后还提供了一个简单的WebRTC Demo代码。
840 0
零基础快速入门WebRTC:基本概念、关键技术、与WebSocket的区别等
|
Dubbo 程序员 应用服务中间件
RPC 简介|学习笔记
快速学习 RPC 简介
161 0
RPC 简介|学习笔记
|
网络协议 数据库 网络架构