## 3 Key Building Blocks
### M2M Communication Overlay  
XMPP (Jabber has been developed to enable message oriented communication services applicable in the Internet context. It is an open standard based communication protocol for message-oriented middleware based on XML, which is executed on top of standard Internet TCP/IP protocols. Figure 9: An example Service Capability Layer (SCL) resource tree. An important feature of XMPP is smooth extensibility, which is seen by the big number of extensions defined by XMPP Standards Foundation (XSF) in XMPP extension XEPs. The XMPP communication architecture is based on distributed client-server model; however, also server-to-server communication is enabled. The core services of XMPP includes support for presence information, secure messaging (TLS), overlay communication over IP, near real-time messaging, authentication, contact list management, and service discovery. Each XMPP client has an account hosted by a XMPP server, and the client can be addressed by unique Jabber ID (JID). XMPP JID contains three parts: user, domain and resource as shown in Table 1, RFC 6122. In XMPP, network domain-part of JID must be a fully qualified domain name or IP address. Each domain presents one logical groups with one user account database. Each domain may present own user account policies. The device owner is usually considered to be also a user of the M2M domain and an owner of at least one XMPP user id. All devices share same user id (local-part and domain-part) with their owner. Separation of devices is done by examining the resource part of JID. A client connects to the server to send and receive messages. The procedure for M2M client establishing connection with the XMPP server is shown in Figure 10. Discovery can be done directly using a domain part as a server address or discovering server address with SRV lookup from DNS. All clients connect to only their own server specified by JID. Connections are persistent XML streams over TCP and optionally encrypted by Transport Layer Security (TLS) layer. Encryption of TCP stream is strongly recommended, but not required. An administrator of a domain may specify that encryption is mandatory and it is up to administrator or designer to choose whether TLS certificates should be checked. Most client libraries accepts self-signed certificates, this should be taken into account when considering security aspects of client-to-server connections. The availability of each client can be detected with the aid of presence messages. Presence information is shared only with XMPP user's that are in roster/address book of client sending the presence information. Server to server connection is an XML stream over a TCP connection, similar as to client to server connections. Most important difference is that server to server connections are not authenticated because they happen in between different domains that do not share a common user database. This is similar to how email systems work. XMPP servers may use XMPP Dial back, as defined in XEP-0220, to verify the domain of the connecting server. The domain administrator may require stronger identification verification by using TLS certificates and Simple Authentication and Security Layer (SASL). When M2M clients located in different domains would like to exchange messages, routing of messages will be done by the domain specific servers, Figure 11. Then communication link between servers of the domains are negotiated, to enable messaging between the referred M2M clients. \begin{table}
\begin{tabular}{c c c} \hline \multicolumn{3}{c}{**JID: [EMAIL_ADDRESS]/device12**} \\ \hline
**Local-part** & **Domain-part** & **Resource** \\ John & example.com & device12 \\ \hline \end{tabular}
\end{table} 
Table 1: An example of Extensible Messaging and Presence Protocol Jabber ID (XMPP JID). In practical M2M cases, several extensions XEPs to XMPP have proved to be useful. XMPP Service discovery is used in M2M system for discovering information about clients, servers and publish-subscribe nodes (XEP-0030).