IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

20
IOT Communication Protocol Bluetooth An important short-range communications technology is of course Bluetooth, which has become very important in computing and many consumer product markets. It is expected to be key for wearable products in particular, again connecting to the IoT albeit probably via a smartphone in many cases. The new Bluetooth Low-Energy (BLE) or Bluetooth Smart, as it is now branded is a significant protocol for IoT applications. Importantly, while it offers similar range to Bluetooth it has been designed to offer significantly reduced power consumption. However, Smart/BLE is not really designed for file transfer and is more suitable for small chunks of data.. Standard: Bluetooth 4.2 core specification Frequency: 2.4GHz (ISM) Range: 50-150m (Smart/BLE) Data Rates: 1Mbps (Smart/BLE) Zigbee ZigBee, like Bluetooth, has a large installed base of operation, although perhaps traditionally more in industrial settings. ZigBee PRO and ZigBee Remote Control (RF4CE), among other available ZigBee profiles, are based on the IEEE802.15.4 protocol, which is an industry-standard wireless networking technology operating at 2.4GHz targeting applications that require relatively infrequent data exchanges at low data-rates over a restricted area and within a 100m range such as in a home or building. ZigBee/RF4CE has some significant advantages in complex systems offering low-power operation, high security, robustness and high scalability with high node counts and is well positioned to take advantage of wireless control and sensor networks in M2M and IoT applications. The latest version of ZigBee is the recently launched 3.0, which is essentially the unification of the various ZigBee wireless standards into a single standard. An example product and kit for ZigBee development are TI’s CC2538SF53RTQT ZigBee System-On-Chip IC and CC2538 ZigBee Development Kit. Standard: ZigBee 3.0 based on IEEE802.15.4 Frequency: 2.4GHz Range: 10-100m Data Rates: 250kbps Z-Wave

Transcript of IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

Page 1: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Bluetooth

An important short-range communications technology is of course Bluetooth, which has become very important in computing and many consumer product markets. It is expected to be key for wearable products in particular, again connecting to the IoT albeit probably via a smartphone in many cases. The new Bluetooth Low-Energy (BLE) – or Bluetooth Smart, as it is now branded – is a significant protocol for IoT applications. Importantly, while it offers similar range to Bluetooth it has been designed to offer significantly reduced power

consumption. However, Smart/BLE is not really designed for file transfer and is more suitable for small chunks of data..

Standard: Bluetooth 4.2 core specification

Frequency: 2.4GHz (ISM)

Range: 50-150m (Smart/BLE)

Data Rates: 1Mbps (Smart/BLE)

Zigbee

ZigBee, like Bluetooth, has a large installed base of operation, although perhaps traditionally more in industrial settings. ZigBee PRO and ZigBee Remote Control (RF4CE), among other available ZigBee profiles, are based on the IEEE802.15.4 protocol, which is an industry-standard wireless networking technology operating at 2.4GHz targeting applications that require relatively infrequent data exchanges at low data-rates over a restricted area and within a 100m range such as in a home or building.

ZigBee/RF4CE has some significant advantages in complex systems offering low-power operation, high security, robustness and high scalability with high node counts and is well positioned to take advantage of wireless control and sensor networks in M2M and IoT applications. The latest version of ZigBee is the recently launched 3.0, which is essentially the unification of the various ZigBee wireless standards into a single standard. An example product and kit for ZigBee development are TI’s CC2538SF53RTQT ZigBee System-On-Chip IC and CC2538 ZigBee Development Kit.

Standard: ZigBee 3.0 based on IEEE802.15.4

Frequency: 2.4GHz

Range: 10-100m

Data Rates: 250kbps

Z-Wave

Page 2: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Z-Wave is a low-power RF communications technology that is primarily designed for home automation for products such as lamp controllers and sensors among many others. Optimized for reliable and low-latency communication of small data packets with data rates up to 100kbit/s, it operates in the sub-1GHz band and is impervious to interference from WiFi and other wireless technologies in the 2.4-GHz range such as Bluetooth or ZigBee. It supports full mesh networks without the need for a coordinator node and is very scalable, enabling control of up to 232 devices. Z-Wave uses a simpler protocol than some others, which can enable faster and simpler development, but the only maker of chips is Sigma Designs compared to multiple sources for other wireless technologies such as ZigBee and others.

Standard: Z-Wave Alliance ZAD12837 / ITU-T G.9959

Frequency: 900MHz (ISM)

Range: 30m

Data Rates: 9.6/40/100kbit/s

6LowPAN

A key IP (Internet Protocol)-based technology is 6LowPAN (IPv6 Low-power wireless Personal Area Network). Rather than being an IoT application protocols technology like Bluetooth or ZigBee, 6LowPAN is a network protocol that defines encapsulation and header compression mechanisms. The standard has the freedom of frequency band and physical layer and can also be used across multiple communications platforms, including Ethernet, Wi-Fi, 802.15.4 and sub-1GHz ISM. A key attribute is the IPv6 (Internet Protocol version 6) stack, which has been a very important introduction in recent years to enable the IoT. IPv6 is the successor to IPv4 and offers approximately 5 x 1028addresses for every person in the world, enabling any embedded object or device in the world to have its own unique IP address and connect to the Internet. Especially designed for home or building automation, for example, IPv6 provides a basic transport mechanism to produce complex control systems and to communicate with devices in a cost-effective manner via a low-power wireless network.

Designed to send IPv6 packets over IEEE802.15.4-based networks and implementing open IP standards including TCP, UDP, HTTP, COAP, MQTT, and websockets, the standard offers end-to-end addressable nodes, allowing a router to connect the network to IP. 6LowPAN is a mesh network that is robust, scalable and self-healing. Mesh router devices can route data destined for other devices, while hosts are able to sleep for long periods of time. An explanation of 6LowPAN is available here, courtesy of TI.

Standard: RFC6282

Page 3: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol Frequency: (adapted and used over a variety of other networking media including Bluetooth

Smart (2.4GHz) or ZigBee or low-power RF (sub-1GHz)

Range: N/A

Data Rates: N/A

Thread

A very new IP-based IPv6 networking protocol aimed at the home automation environment is Thread. Based on 6LowPAN, and also like it, it is not an IoT applications protocol like Bluetooth or ZigBee. However, from an application point of view, it is primarily designed as a complement to WiFi as it recognises that while WiFi is good for many consumer devices that it has limitations for use in a home automation setup.

Launched in mid-2014 by the Thread Group, the royalty-free protocol is based on various standards including IEEE802.15.4 (as the wireless air-interface protocol), IPv6 and 6LoWPAN, and offers a resilient IP-based solution for the IoT. Designed to work on existing IEEE802.15.4 wireless silicon from chip vendors such as Freescale and Silicon Labs, Thread supports a mesh network using IEEE802.15.4 radio transceivers and is capable of handling up to 250 nodes with high levels of authentication and encryption. A relatively simple software upgrade should allow users to run thread on existing IEEE802.15.4-enabled devices.

Standard: Thread, based on IEEE802.15.4 and 6LowPAN

Frequency: 2.4GHz (ISM)

Range: N/A

Data Rates: N/A

WiFi

WiFi connectivity is often an obvious choice for many developers, especially given the pervasiveness of WiFi within the home environment within LANs. It requires little further explanation except to state the obvious that clearly there is a wide existing infrastructure as well as offering fast data transfer and the ability to handle high quantities of data.

Page 4: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol Currently, the most common WiFi standard used in homes and many businesses is 802.11n, which offers serious throughput in the range of hundreds of megabit per second, which is fine for file transfers, but may be too power-consuming for many IoT applications. A series of RF development kits designed for building WiFi-based applications are available from RS.

Standard: Based on 802.11n (most common usage in homes today)

Frequencies: 2.4GHz and 5GHz bands

Range: Approximately 50m

Data Rates: 600 Mbps maximum, but 150-200Mbps is more typical, depending on channel frequency used and number of antennas (latest 802.11-ac standard should offer 500Mbps to 1Gbps)

Cellular

< Any IoT application that requires operation over longer distances can take advantage of GSM/3G/4G cellular communication capabilities. While cellular is clearly capable of sending high quantities of data, especially for 4G, the expense and also power consumption will be too high for many applications, but it can be ideal for sensor-based low-bandwidth-data projects that will send very low amounts of data over the Internet. A key product in this area is the SparqEE range of products, including the original tiny CELLv1.0 low-cost development board and a series of shield connecting boards for use with the Raspberry Pi and Arduino platforms.

Standard: GSM/GPRS/EDGE (2G), UMTS/HSPA (3G), LTE (4G)

Frequencies: 900/1800/1900/2100MHz

Range: 35km max for GSM; 200km max for HSPA

Data Rates (typical download): 35-170kps (GPRS), 120-384kbps (EDGE), 384Kbps-2Mbps (UMTS), 600kbps-10Mbps (HSPA), 3-10Mbps (LTE)

NFC

NFC (Near Field Communication) is a technology that enables simple and safe two-way interactions between electronic devices, and especially applicable for smartphones, allowing consumers to perform contactless payment transactions, access digital content and connect electronic devices. Essentially it extends the capability of contactless card technology and enables

Page 5: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol devices to share information at a distance that is less than 4cm. Further information is available here.

Standard: ISO/IEC 18000-3

Frequency: 13.56MHz (ISM)

Range: 10cm

Data Rates: 100–420kbps

Sigfox

An alternative wide-range technology is Sigfox, which in terms of range comes between WiFi and cellular. It uses the ISM bands, which are free to use without the need to acquire licenses, to transmit data over a very narrow spectrum to and from connected objects. The idea for Sigfox is that for many M2M applications that run on a small battery and only require low levels of data transfer, then WiFi’s range is too short while cellular is too expensive and also consumes too much power. Sigfox uses a technology called Ultra Narrow Band (UNB) and is only designed to handle low data-transfer speeds of 10 to 1,000 bits per second. It consumes only 50 microwatts compared to 5000 microwatts for cellular communication, or can deliver a typical stand-by time 20 years with a 2.5Ah battery while it is only 0.2 years for cellular.

Already deployed in tens of thousands of connected objects, the network is currently being rolled out in major cities across Europe, including ten cities in the UK for example. The network offers a robust, power-efficient and scalable network that can communicate with millions of battery-operated devices across areas of several square kilometres, making it suitable for various M2M applications that are expected to include smart meters, patient monitors, security devices, street lighting and environmental sensors. The Sigfox system uses silicon such as the EZRadioPro wireless transceivers from Silicon Labs, which deliver industry-leading wireless performance, extended range and ultra-low power consumption for wireless networking applications operating in the sub-1GHz band.

Standard: Sigfox

Frequency: 900MHz

Range: 30-50km (rural environments), 3-10km (urban environments)

Data Rates: 10-1000bps

Neul

Page 6: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Similar in concept to Sigfox and operating in the sub-1GHz band, Neul leverages very small slices of the TV White Space spectrum to deliver high scalability, high coverage, low power and low-cost wireless networks. Systems are based on the Iceni chip, which communicates using the white space radio to access the high-quality UHF spectrum, now available due to the analogue to digital TV transition. The communications technology is called Weightless, which is a new wide-area wireless networking technology designed for the IoT that largely competes against existing GPRS, 3G, CDMA and LTE WAN solutions. Data rates can be anything from a few bits per second up to 100kbps over the same single link; and devices can consume as little as 20 to 30mA from 2xAA batteries, meaning 10 to 15 years in the field.

Standard: Neul

Frequency: 900MHz (ISM), 458MHz (UK), 470-790MHz (White Space)

Range: 10km

Data Rates: Few bps up to 100kbps

LoRaWAN

Again, similar in some respects to Sigfox and Neul, LoRaWAN targets wide-area network (WAN) applications and is designed to provide low-power WANs with features specifically needed to support low-cost mobile secure bi-directional communication in IoT, M2M and smart city and industrial applications. Optimized for low-power consumption and supporting large networks with millions and millions of devices, data rates range from 0.3 kbps to 50 kbps.

Standard: LoRaWAN

Frequency: Various

Range: 2-5km (urban environment), 15km (suburban environment)

Data Rates: 0.3-50 kbps.

Page 7: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Difference between TCP and UDP

TCP UDP

Reliability: TCP is connection-oriented

protocol. When a file or message send it will

get delivered unless connections fails. If

connection lost, the server will request the lost

part. There is no corruption while transferring

a message.

Reliability: UDP is connectionless protocol.

When you a send a data or message, you

don’t know if it’ll get there, it could get lost on

the way. There may be corruption while

transferring a message.

Ordered: If you send two messages along a

connection, one after the other, you know the

first message will get there first. You don’t

have to worry about data arriving in the wrong

order.

Ordered: If you send two messages out, you

don’t know what order they’ll arrive in i.e. no

ordered

Heavyweight: – when the low level parts of the

TCP “stream” arrive in the wrong order,

resend requests have to be sent, and all the

out of sequence parts have to be put back

together, so requires a bit of work to piece

together.

Lightweight: No ordering of messages, no

tracking connections, etc. It’s just fire and

forget! This means it’s a lot quicker, and the

network card / OS have to do very little work

to translate the data back from the packets.

Streaming: Data is read as a “stream,” with

nothing distinguishing where one packet ends

and another begins. There may be multiple

packets per read call.

Datagrams: Packets are sent individually and

are guaranteed to be whole if they arrive.

One packet per one read call.

Examples: World Wide Web (Apache TCP

port 80), e-mail (SMTP TCP port 25 Postfix

MTA), File Transfer Protocol (FTP port 21)

and Secure Shell (OpenSSH port 22) etc.

Examples: Domain Name System (DNS UDP

port 53), streaming media applications such

as IPTV or movies, Voice over IP (VoIP),

Trivial File Transfer Protocol (TFTP) and

online multiplayer games etc

Page 8: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol Networking - Socket Programming

What is Sockets? Sockets are the endpoints of a bidirectional communications channel. Sockets

may communicate within a process, between processes on the same

machine, or between processes on different continents.

Sockets may be implemented over a number of different channel types: Unix

domain sockets, TCP, UDP, and so on. The socket library provides specific

classes for handling the common transports as well as a generic interface for

handling the rest.

Sockets have their own vocabulary −

S.No. Term & Description

1

domain

The family of protocols that is used as the transport mechanism. These

values are constants such as AF_INET, PF_INET, PF_UNIX, PF_X25, and so

on.

2

type

The type of communications between the two endpoints, typically

SOCK_STREAM for connection-oriented protocols and SOCK_DGRAM for

connectionless protocols.

3

protocol

Typically zero, this may be used to identify a variant of a protocol within a

domain and type.

4 hostname

Page 9: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

The identifier of a network interface −

A string, which can be a host name, a dotted-quad address, or an

IPV6 address in colon (and possibly dot) notation

A string "<broadcast>", which specifies an INADDR_BROADCAST

address.

A zero-length string, which specifies INADDR_ANY, or

An Integer, interpreted as a binary address in host byte order.

5

port

Each server listens for clients calling on one or more ports. A port may be

a Fixnum port number, a string containing a port number, or the name of

a service.

The socket Module To create a socket, you must use the socket.socket() function available in the

socket module, which has the general syntax −

s = socket.socket (socket_family, socket_type, protocol = 0)

Here is the description of the parameters −

socket_family − This is either AF_UNIX or AF_INET, as explained earlier.

socket_type − This is either SOCK_STREAM or SOCK_DGRAM.

protocol − This is usually left out, defaulting to 0.

Once you have socket object, then you can use the required functions to

create your client or server program. Following is the list of functions required

Server Socket Methods S.No. Method & Description

Page 10: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

1 s.bind()

This method binds address (hostname, port number pair) to socket.

2

s.listen()

This method sets up and start TCP listener.

3

s.accept()

This passively accept TCP client connection, waiting until connection arrives

(blocking).

Client Socket Methods S.No. Method & Description

1 s.connect()

This method actively initiates TCP server connection.

General Socket Methods S.No. Method & Description

1 s.recv()

This method receives TCP message

2

s.send()

This method transmits TCP message

3 s.recvfrom()

Page 11: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

This method receives UDP message

4

s.sendto()

This method transmits UDP message

5

s.close()

This method closes socket

6

socket.gethostname()

Returns the hostname.

A Simple Server

import socket

# create a socket object

serversocket = socket.socket(

socket.AF_INET, socket.SOCK_STREAM)

# get local machine name

host = socket.gethostname()

port = 9999

# bind to the port

serversocket.bind((host, port))

Page 12: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Client side

# queue up to 5 requests

serversocket.listen(5)

while True:

# establish a connection

clientsocket,addr = serversocket.accept()

print("Got a connection from %s" % str(addr))

msg='Thank you for connecting'+ "\r\n"

clientsocket.send(msg.encode('ascii'))

clientsocket.close()

import socket

# create a socket object

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# get local machine name

host = socket.gethostname()

port = 9999

# connection to hostname on the port.

s.connect((host, port))

# Receive no more than 1024 bytes

msg = s.recv(1024)

s.close()

print (msg.decode('ascii'))

Page 13: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol Output

# Following would start a server in background.

$ python server.py &

# Once server is started run client as follows:

$ python client.py

You will get this type of output

on server terminal Got a connection from ('192.168.1.10', 3747) On client terminal Thank you for connecting

Networking (Socket programming) using UDP

Server side

Client side

>>> import socket

>>> sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

>>> address=("192.168.1.3",5002)

>>> sock.bind(address)

>>> while True:

data,addr=sock.recvfrom(1024)

print(data)

print(addr)

Page 14: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Now run both program you will get output.

>>> import socket

>>> sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

Sock.sendto(“IOT Training”,(“192.168.3.1”,5002))

Page 15: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

HTTP application layer protocol

The Hypertext Transfer Protocol (HTTP) is an application-level protocol for

distributed, collaborative, hypermedia information systems.

This is the foundation for data communication for the World Wide Web (i.e.

internet) since 1990.

HTTP is a generic and stateless protocol which can be used for other purposes

as well using extensions of its request methods, error codes, and headers.

Basically, HTTP is a TCP/IP based communication protocol, that is used to

deliver data (HTML files, image files, query results, etc.) on the World Wide

Web.

The default port is TCP 80, but other ports can be used as well. It provides a

standardized way for computers to communicate with each other.

HTTP specification specifies how clients' request data will be constructed and

sent to the server, and how the servers respond to these requests.

Basic Features There are three basic features that make HTTP a simple but powerful

protocol:

HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP

request and after a request is made, the client disconnects from the server and

waits for a response. The server processes the request and re-establishes the

connection with the client to send a response back.

HTTP is media independent: It means, any type of data can be sent by HTTP

as long as both the client and the server know how to handle the data content. It

is required for the client as well as the server to specify the content type using

appropriate MIME-type.

Page 16: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

HTTP is stateless: As mentioned above, HTTP is connectionless and it is a direct

result of HTTP being a stateless protocol. The server and client are aware of each

other only during a current request. Afterwards, both of them forget about each

other. Due to this nature of the protocol, neither the client nor the browser can

retain information between different requests across the web pages.

Basic Architecture The following diagram shows a very basic architecture of a web application

and depicts where HTTP sits:

The HTTP protocol is a request/response protocol based on the client/server

based architecture where web browsers, robots and search engines, etc. act

like HTTP clients, and the Web server acts as a server.

Client

Page 17: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

The HTTP client sends a request to the server in the form of a request method,

URI, and protocol version, followed by a MIME-like message containing

request modifiers, client information, and possible body content over a

TCP/IP connection.

Server

The HTTP server responds with a status line, including the message's protocol

version and a success or error code, followed by a MIME-like message

containing server information, entity meta information, and possible entity-

body content.

MQTT protocol

MQTT is a Client Server publish/subscribe messaging transport protocol. It is light

weight, open, simple, and designed so as to be easy to implement. These

characteristics make it ideal for use in many situations, including constrained

environments such as for communication in Machine to Machine (M2M) and

Internet of Things (IoT).

Two aspects of MQTT:

Client

MQTT client includes publisher or subscribers. A MQTT client is any device from a

micro controller up to a full fledged server, that has a MQTT library running and is

connecting to an MQTT broker over any kind of network

Broker

MQTT broker is the heart of any publish/subscribe protocol. A broker can handle

up to thousands of concurrently connected MQTT clients. The broker is primarily

responsible for receiving all messages, filtering them, decide who is interested in

it and then sending the message to all subscribed clients. It also holds the session

of all persisted clients including subscriptions and missed messages. Another

responsibility of the broker is the authentication and authorization of clients.

Page 18: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

How MQTT Works?

The MQTT protocol is based on top of TCP/IP and both client and broker need to

have a TCP/IP stack.

The protocol uses a publish/subscribe architecture in contrast to HTTP with its

request/response paradigm.

Publish/Subscribe is event-driven and enables messages to be pushed to clients.

The central communication point is the MQTT broker, it is in charge of dispatching

all messages between the senders and the rightful receivers.

Each client that publishes a message to the broker, includes a topic into the

message. The topic is the routing information for the broker.

Page 19: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

Each client that wants to receive messages subscribes to a certain topic and the

broker delivers all messages with the matching topic to the client. Therefore the

clients don’t have to know each other, they only communicate over the topic.

This architecture enables highly scalable solutions without dependencies between

the data producers and the data consumers.

Quality of Service

MQTT defines three levels of Quality of Service (QoS).

The QoS defines how hard the broker/client will try to ensure that a message is received.

Messages may be sent at any QoS level, and clients may attempt to subscribe to topics at any QoS level. This means that the client chooses the maximum QoS it will receive.

For example, if a message is published at QoS 2 and a client is subscribed with QoS 0, the message will be delivered to that client with QoS 0.

If a second client is also subscribed to the same topic, but with QoS 2, then it will receive the same message but with QoS 2.

For a second example, if a client is subscribed with QoS 2 and a message is published on QoS 0, the client will receive it on QoS 0.

Higher levels of QoS are more reliable, but involve higher latency and have higher bandwidth requirements.

0: The broker/client will deliver the message once, with no confirmation. 1: The broker/client will deliver the message at least once, with confirmation

required. 2: The broker/client will deliver the message exactly once by using a four step

handshake.

MQTT Security Fundamentals: TLS / SSL

MQTT provide TLS and SSL unable secure communication.

Page 20: IoT Communication Protocols, Socket Programming with Python, MQTT & HTTP

IOT Communication Protocol

TLS (Transport Layer Security) and SSL (Secure Sockets Layer) provide a

secure communication channel between a client and a server.

At its core, TLS and SSL are cryptographic protocols which use a handshake

mechanism to negotiate various parameters to create a secure connection

between the client and the server. After the handshake is completed, an

encrypted communication between client and server is established and no

attacker can eavesdrop any part of the communication. Servers provide a X509

certificate, typically issued by a trusted authority, which clients use to verify the

identity of the server.