SSDP Simple Service Discovery Protocol

Source: Internet
Author: User

SSDP Simple Service Discovery Protocol is an application layer protocol and one of the core protocols that constitute UPnP (Universal Plug and Play) technology. It provides a network service discovery mechanism for network clients and implements Multicast Based on notification and discovery routes.

SSDP multicast address: 239.00000000250: 1900 (IPv4), ff0x: C (IPv6)

Two types of SSDP request messages are sent through the SSDP multicast address:

1. Request (Discovery request or query request ). The SSDP client sends an http udp Discovery request to this address to query certain types of services. The SSDP Service listens to service discovery requests at this address. When the http udp request monitored by the Service matches the service provided by the Service, it sends an http udp response in Unicast mode.

2. There is a notification ). The SSDP Service sends an http udp notification message to this multicast address to announce its existence.

 

The information provided by the discovery results and the presence of the notification message (presence announcements) includes:

Service type URI

Service name USN: uniquely identifies a service instance.

Location Information: The result and notification can contain one or more location Uris. The client can use location information to find the services it needs.

Term information: how long does the client Save the service in its own cache. If the service expires, the service information will be removed from the cache. When the discovery result received by the client or the USN contained in the notification matches one in the cache, it is updated.

The service cache of the client is as follows:

[SSDP Discovery request] SSDP: Discover

SSDP: the Discover must contain an ST header. The client uses the st header to indicate the type of service they want to discover. SSDP: Discover must contain a request URI.

M-SEARCH * HTTP/1.1

S: UUID: ijklmnop-7dec-11d0-a765-00a0c91e6bf6

HOST: 239.00000000250: 1900

MAN: "SSDP: Discover"

St: GE: fridge

MX: 3

Meanings of HTTP headers:

HOST: set as the protocol to retain the multicast address and port, which must be 239.00000000250: 1900 (IPv4) or ff0x: C (IPv6)

Man: Specifies the Protocol Query type, which must be SSDP: Discover.

MX: sets the maximum wait time for a device response. The device randomly selects the response latency value between 0 and this value to balance the network load for the control point response.

St: set the target of the Service Query. It must be of the following type:

-SSDP: All searches for all devices and services.

-UPNP: The rootdevice only searches for the root device in the network.

-UUID: Device-UUID

-Urn: Schemas-UPnP-org: Device-type: Version: query the device type specified by the device-type field. The device type and version are defined by UPnP.

-Urn: Schemas-UPnP-org: Service: service-type: Version queries the service type specified by the service-type field. The service type and version are defined by UPnP.

 

When the SSDP Service finds that its service type matches the service type specified in the St, it can respond to the SSDP: Discover IP Address/port. The response message should contain the location information (location or Al header), St, and USN headers of the service. The response message should contain the Cache Control Information (max-age or Expires header). If both are included, the Expires header takes priority. If both are missing, this service message cannot be cached.

HTTP/1.1 200 OK

S: UUID: ijklmnop-7dec-11d0-a765-00a0c91e6bf6

Ext:

Cache-control: No-Cache = "Ext", Max-age = 5000

St: GE: fridge

USN: UUID: abcdefgh-7dec-11d0-a765-00a0c91e6bf6

AL: <blender: ixl>

Descriptions of HTTP headers:

Cache-control: Max-age specifies the notification message survival time. If the interval is exceeded, the control point can be deemed that the device does not exist.

Date: specifies the time when the response is generated.

Ext: confirm to the control point that the man header field is understood by the device.

Location: URL address that contains the root device description

Server: contains the operating system name, version, product name, and product version information.

St: the content and meaning are the same as the corresponding fields of the query request.

USN: indicates the uniform service name of different services. It provides the capability to identify services of the same type.

 

[Notification Message for SSDP]

The SSDP Service uses a notification message to notify the client of its existence, update the period information, and update the location information.

SSDP: The alive message must set nt to its own service type, and the USN header to its own USN. SSDP: alive should include the location or Al header. If DNS is not supported, use the IP address of the SSDP Service to represent the location. SSDP: alive should also include the Cache control information, Max-age or Expires header.

Y * HTTP/1.1

HOST: 239.00000000250: reservedssdpport

NT: blenderassociation: Blender

CNT: SSDP: alive

USN: someunique: idscheme3

AL: <blender: ixl>

Cache-control: Max-age = 7393

SSDP: alive does not respond to messages.

 

The SSDP Service can send SSDP: Byebye to announce that it is offline. SSDP: Byebye must set nt to its own service type and USN header to its own USN. SSDP: Byebye does not respond to messages either. When the client receives the SSDP: Byebye message, it deletes the related entries in the cache.

Y * HTTP/1.1

HOST: 239.00000000250: reservedssdpport

NT: someunique: idscheme3

CNT: SSDP: Byebye

USN: someunique: idscheme3

 

[SSDP auto-Shut-off algorithm]

A mechanic is needed to ensure that SSDP does not cause such a high level of traffic that it overwhelms the network it is running on.

[SSDP: All]

A mechanic is needed to enable a client to enumerate all the services available on a participating SSDP multicast channel/port.

 

[Reference]

SSDP protocol (http://tools.ietf.org/html/draft-cai-ssdp-v1-03)

Http://www.cnblogs.com/debin/archive/2009/12/01/1614543.html

 

Turn: http://blog.csdn.net/lilypp/article/details/6631951

SSDP Simple Service Discovery Protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.