Upnp device architecture
Download
1 / 40

UPnP Device Architecture - PowerPoint PPT Presentation


  • 310 Views
  • Updated On :

UPnP Device Architecture. Networking is easy, except…. Ad hoc networks don't have resources just for the sake of the network E.g., DHCP, DNS, directory, … Network is unreliable Nodes added / removed unpredictably Programs need to talk to programs But software is heterogeneous

Related searches for UPnP Device Architecture

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'UPnP Device Architecture' - siran


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Networking is easy except l.jpg
Networking is easy, except…

  • Ad hoc networks don't have resources just for the sake of the network

    • E.g., DHCP, DNS, directory, …

  • Network is unreliable

    • Nodes added / removed unpredictably

  • Programs need to talk to programs

    • But software is heterogeneous

    • One size doesn't fit all

  • Must upgrade system piece at a time


Upnp strategy l.jpg
UPnP Strategy

  • Just send data over the network

    • (No executables)

    • Minimize version issues

    • Minimize security issues

  • Keep implementation private

    • Be agnostic re: programming language, OS

    • Update implementation w/o affecting interop

      • Improve performance

      • Reduce footprint

      • Improve capabilities

  • Agree on meaning / format of data

    • Choose substrate of proven protocols

    • Define device (service) specific protocols in a Forum


Upnp tactics l.jpg
UPnP Tactics

  • Start simple

    • Build in only universal things that everybody needs (and can live with)

    • Add as needed

  • Minimize requirements

    • Basic IP network connectivity

    • Common HTTP protocol stack

  • Leverage existing standards

    • HTTP, XML


Goals l.jpg
Goals

Control Point

Device

Service

Control Point

Device

Service

  • Describe the protocols for communication between

    • Control points

      • Controller, usually client

    • Device

      • Controlled,usually server

    • An actual devicemight containboth functions


Steps to upnp networking l.jpg
Steps to UPnP Networking

3 Control

4 Eventing

5 Presentation

2 Description

1 Discovery

0 Addressing

0 Control point and device get addresses

1 Control point finds interesting device

2 Control point learns about device capabilities

3 Control point invokes actions on device

4 Control point listens to state changes of device

5 Control point controls device and/or views device status using HTML UI


Upnp protocol stack l.jpg
UPnP Protocol Stack

UPnP vendor

UPnP Forum

UPnP Device Architecture

HTTPU/MU

SOAP

HTTP

GENA

SSDP

GENA

HTTP

UDP

TCP

IP

Vendor-specific API above

Vendor-specific OS below

Vendor-specific physical net


Steps to upnp networking8 l.jpg
Steps to UPnP Networking

0* Control point and device get addresses

1 Control point finds interesting device

2 Control point learns about device capabilities

3 Control point invokes actions on device

4 Control point listens to state changes of device

5 Control point controls device and/or views device status using HTML UI

3 Control

4 Eventing

5 Presentation

2 Description

1 Discovery

0* Addressing


0 addressing l.jpg
0 Addressing

  • Control point and device get address

    • Use a DHCP server

    • Else use Auto IP

  • What is Auto IP?

    • IETF Draft Automatically Choosing an IP Address in an Ad-Hoc IPv4 Network

  • What steps does it take?

    • Pick an address in 169.254/16 range

    • Check to see if it is used (ARP)

    • Periodically check for DHCP server


Steps to upnp networking10 l.jpg
Steps to UPnP Networking

0 Control point and device get addresses

1* Control point finds interesting device

2 Control point learns about device capabilities

3 Control point invokes actions on device

4 Control point listens to state changes of device

5 Control point controls device and/or views device status using HTML UI

3 Control

4 Eventing

5 Presentation

2 Description

1* Discovery

0 Addressing


1 discovery l.jpg

Control point finds interesting device

0 get address

1 discover device

Advertise / find typed devices (services)

Guarantee of minimal capabilities

Simple

Devices

Advertise when added

Refresh advertisements (cf. lease)

Cancel advertisements when removed

Control points search as needed

Devices respond

Control points filter

1 Discovery


1 discovery protocol stack l.jpg
1 Discovery: Protocol Stack

UPnP vendor

UPnP Forum

UPnP Device Architecture

HTTPMU(multicast)

HTTPU(unicast)

GENA

SSDP

SSDP

UDP

IP


1 discovery ssdp sidebar l.jpg
1 Discovery: SSDP Sidebar

  • What is SSDP?

    • IETF Draft Simple Service Discovery Protocol

  • Key design principles

    • Administratively-scoped multicast

    • Unicast responses

    • UDP

    • Very simple advertisements

    • Very simple search


1 discovery advertising l.jpg
1 Discovery: Advertising

  • Who? Device multicasts

  • When? Added or refresh (cf. lease)

  • What?

    • 1 time / service type with NT == service type

    • 1 time / device type with NT == device type

    • 1 time / device with NT == device UUID

    • 1 time with NT == upnp:rootdevice

NOTIFY* HTTP/1.1HOST:239.255.255.250:1900

CACHE-CONTROL: max-age =seconds until advertisement expiresLOCATION:URL for UPnP description for root device

NT:search targetNTS:ssdp:aliveUSN:advertisement UUID


1 discovery searching l.jpg
1 Discovery: Searching

  • Who? Control point multicasts

  • When? Looking for device or service

  • What?

    • ST one of

      • Service type

      • Device type

      • Device UUID

      • upnp:rootdevice

      • ssdp:all

M-SEARCH * HTTP/1.1HOST:239.255.255.250:1900

MAN:"ssdp:discover"MX:seconds to delay response

ST:search target


1 discovery responding l.jpg
1 Discovery: Responding

  • Who? Device unicasts

  • When? If ST matches an NT

  • What?

    • 1 time for each NT that matches

    • Very simple matching

HTTP/1.1 200 OKCACHE-CONTROL: max-age =seconds until advertisement expires

LOCATION:URL for UPnP description for root deviceST: search targetUSN: advertisement UUID


Steps to upnp networking17 l.jpg
Steps to UPnP Networking

0 Control point and device get addresses

1 Control point finds interesting device

2* Control point learns about device capabilities

3 Control point invokes actions on device

4 Control point listens to state changes of device

5 Control point controls device and/or views device status using HTML UI

3 Control

4 Eventing

5 Presentation

2* Description

1 Discovery

0 Addressing


2 description l.jpg

Control point learns about device capabilities

0 get address

1 discover device

get URL for description

2 retrieve descr

get URL for service description

Declare capabilities

Protocol stack

2 Description

UPnP vendor

UPnP Forum

UPnP Device Architecture

HTTP

TCP

IP


2 description19 l.jpg

Device description

Type

Physical container

Logical container

For each service

Type

URL for description

URL for control

URL for eventing

UI

Icons

URL for presentation

Services

Functional units within devices

Service description

Actions

State variables

Actual (vs. designed) implementation

Expressed in XML

2 Description


2 description xml sidebar l.jpg
2 Description: XML Sidebar

  • What is XML?

    • W3C Recommendation Extensible Markup Language

    • "Universal format for structured documents and data on the Web."

      • Field names in <angle brackets>

      • Field values between names

    • Defines 24 data types

      • ui1, ui2, ui4, i1, i2, i4, int

      • r4, r8, number, fixed.14.4, float

      • char, string

      • date, dateTime, dateTime.tz, time, time.tz

      • boolean

      • bin.base64, bin.hex

      • uri

      • uuid


2 description device phys l.jpg
2 Description: Device (phys)

<?xml version="1.0"?><rootxmlns="urn:schemas-upnp-org:device-1-0"><URLBase>base URL for all relative URLs</URLBase><device><friendlyName>short user-friendly title</friendlyName><manufacturer>manufacturer name</manufacturer><manufacturerURL>URL to manufacturer site</manufacturerURL><modelDescription>long user-friendly title</modelDescription><modelName>model name</modelName><modelNumber>model number</modelNumber><modelURL>URL to model site</modelURL><serialNumber>manufacturer's serial number</serialNumber><UDN>uuid:UUID</UDN><UPC>Universal Product Code</UPC><deviceType>urn:schemas-upnp-org:device:deviceType</deviceType><serviceList><service><serviceType>urn:schemas-upnp-org:service:serviceType:v</serviceType><serviceId>urn:upnp-org:serviceId:serviceID</serviceId><SCPDURL>URL to service description</SCPDURL><controlURL>URL for control</controlURL><eventSubURL>URL for eventing</eventSubURL></service>Declarations for other services (if any) go here</serviceList><deviceList>Description of embedded devices (if any) go here</deviceList><iconList><icon><mimetype>image/format</mimetype><width>horizontal pixels</width><height>vertical pixels</height><depth>color depth</depth><url>URL to icon</url></icon>XML to declare other icons, if any, go here</iconList><presentationURL>URL for presentation</presentationURL>  </device><specVersion><major>1</major><minor>0</minor></specVersion></root>


2 description device logical l.jpg
2 Description: Device (logical)

<?xml version="1.0"?><rootxmlns="urn:schemas-upnp-org:device-1-0"><URLBase>base URL for all relative URLs</URLBase><device><friendlyName>short user-friendly title</friendlyName><manufacturer>manufacturer name</manufacturer><manufacturerURL>URL to manufacturer site</manufacturerURL><modelDescription>long user-friendly title</modelDescription><modelName>model name</modelName><modelNumber>model number</modelNumber><modelURL>URL to model site</modelURL><serialNumber>manufacturer's serial number</serialNumber><UDN>uuid:UUID</UDN><UPC>Universal Product Code</UPC><deviceType>urn:schemas-upnp-org:device:deviceType :v</deviceType><serviceList><service><serviceType>urn:schemas-upnp-org:service:serviceType:v</serviceType><serviceId>urn:upnp-org:serviceId:serviceID</serviceId><SCPDURL>URL to service description</SCPDURL><controlURL>URL for control</controlURL><eventSubURL>URL for eventing</eventSubURL></service>Declarations for other services (if any) go here</serviceList><deviceList>Description of embedded devices (if any) go here</deviceList><iconList><icon><mimetype>image/format</mimetype><width>horizontal pixels</width><height>vertical pixels</height><depth>color depth</depth><url>URL to icon</url></icon>XML to declare other icons, if any, go here</iconList><presentationURL>URL for presentation</presentationURL>  </device><specVersion><major>1</major><minor>0</minor></specVersion></root>


2 description device other l.jpg
2 Description: Device (other)

<?xml version="1.0"?><rootxmlns="urn:schemas-upnp-org:device-1-0"><URLBase>base URL for all relative URLs</URLBase><device><friendlyName>short user-friendly title</friendlyName><manufacturer>manufacturer name</manufacturer><manufacturerURL>URL to manufacturer site</manufacturerURL><modelDescription>long user-friendly title</modelDescription><modelName>model name</modelName><modelNumber>model number</modelNumber><modelURL>URL to model site</modelURL><serialNumber>manufacturer's serial number</serialNumber><UDN>uuid:UUID</UDN><UPC>Universal Product Code</UPC><deviceType>urn:schemas-upnp-org:device:deviceType</deviceType><serviceList><service><serviceType>urn:schemas-upnp-org:service:serviceType:v</serviceType><serviceId>urn:upnp-org:serviceId:serviceID</serviceId><SCPDURL>URL to service description</SCPDURL><controlURL>URL for control</controlURL><eventSubURL>URL for eventing</eventSubURL></service>Declarations for other services (if any) go here</serviceList><deviceList>Description of embedded devices (if any) go here</deviceList><iconList><icon><mimetype>image/format</mimetype><width>horizontal pixels</width><height>vertical pixels</height><depth>color depth</depth><url>URL to icon</url></icon>XML to declare other icons, if any, go here</iconList><presentationURL>URL for presentation</presentationURL>  </device><specVersion><major>1</major><minor>0</minor></specVersion></root>


2 description service actns l.jpg
2 Description: Service (actns)

<?xml version="1.0"?><scpdxmlns="urn:schemas-upnp-org:service-1-0"><actionList><action><name>actionName</name><argumentList><argument><name>formalParameterName</name><direction>inxorout</direction><retval/><relatedStateVariable>stateVariableName</relatedStateVariable></argument>Declarations for other arguments (if any) go here</argumentList></action>    Declarations for other actions (if any) go here</actionList><serviceStateTable><stateVariablesendEvents=“yes” xor “no”><name>variableName</name><dataType>variable datatype</dataType><defaultValue>default value</defaultValue><allowedValueRange><minimum>minimum value</minimum> <maximum>maximum value</maximum><step>increment value</step></allowedValueRange></stateVariable><stateVariablesendEvents=“yes” xor “no”><name>variableName</name><dataType>variable data type</dataType><defaultValue>default value</defaultValue><allowedValueList><allowedValue>some value</allowedValue><allowedValue>some value</allowedValue></allowedValueList></stateVariable>Declarations for other state variables (if any) go here</serviceStateTable><specVersion><major>1</major><minor>0</minor></specVersion></scpd>


2 description service vars l.jpg
2 Description: Service (vars)

<?xml version="1.0"?><scpdxmlns="urn:schemas-upnp-org:service-1-0"><actionList><action><name>actionName</name><argumentList><argument><name>formalParameterName</name><direction>inxorout</direction><retval/><relatedStateVariable>stateVariableName</relatedStateVariable></argument>Declarations for other arguments (if any) go here</argumentList></action>    Declarations for other actions (if any) go here</actionList><serviceStateTable><stateVariablesendEvents=“yes” xor “no”><name>variableName</name><dataType>variable datatype</dataType><defaultValue>default value</defaultValue><allowedValueRange><minimum>minimum value</minimum> <maximum>maximum value</maximum><step>increment value</step></allowedValueRange></stateVariable><stateVariablesendEvents=“yes” xor “no”><name>variableName</name><dataType>variable data type</dataType><defaultValue>default value</defaultValue><allowedValueList><allowedValue>some value</allowedValue><allowedValue>some value</allowedValue></allowedValueList></stateVariable>Declarations for other state variables (if any) go here</serviceStateTable><specVersion><major>1</major><minor>0</minor></specVersion></scpd>


2 description service vars26 l.jpg
2 Description: Service (vars)

<?xml version="1.0"?><scpdxmlns="urn:schemas-upnp-org:service-1-0"><actionList><action><name>actionName</name><argumentList><argument><name>formalParameterName</name><direction>inxorout</direction><retval/><relatedStateVariable>stateVariableName</relatedStateVariable></argument>Declarations for other arguments (if any) go here</argumentList></action>    Declarations for other actions (if any) go here</actionList><serviceStateTable><stateVariablesendEvents=“yes” xor “no”><name>variableName</name><dataType>variable datatype</dataType><defaultValue>default value</defaultValue><allowedValueRange><minimum>minimum value</minimum> <maximum>maximum value</maximum><step>increment value</step></allowedValueRange></stateVariable><stateVariablesendEvents=“yes” xor “no”><name>variableName</name><dataType>variable data type</dataType><defaultValue>default value</defaultValue><allowedValueList><allowedValue>some value</allowedValue><allowedValue>some value</allowedValue></allowedValueList></stateVariable>Declarations for other state variables (if any) go here</serviceStateTable><specVersion><major>1</major><minor>0</minor></specVersion></scpd>


Steps to upnp networking27 l.jpg
Steps to UPnP Networking

0 Control point and device get addresses

1 Control point finds interesting device

2 Control point learns about device capabilities

3* Control point invokes actions on device

4 Control point listens to state changes of device

5 Control point controls device and/or views device status using HTML UI

3* Control

4 Eventing

5 Presentation

2 Description

1 Discovery

0 Addressing


3 control l.jpg

Control point invokes actions on device

0 get address

1 discover device

2 retrieve descr

get URL for control

3 send actions to device

Protocol stack

3 Control

UPnP vendor

UPnP Forum

UPnP Device Architecture

SOAP

HTTP

TCP

IP


3 control soap sidebar l.jpg
3 Control: SOAP Sidebar

  • What is SOAP?

    • IETF Draft Simple Object Access Protocol

    • "Lightweight, XML-based protocol for exchange of information in a decentralized, distributed environment."

      • Envelope: defines a framework for describing what is in a message and how to process it.

      • Convention: represent remote procedure calls and responses.


3 control invoke action l.jpg
3 Control: Invoke Action

  • Who? Control point

  • When? To invoke action on device

  • What?

POSTpath of control URLHTTP/1.1HOST:host of control URL:port of control URLCONTENT-TYPE: text/xml; charset="utf-8"SOAPACTION: "urn:schemas-upnp-org:service:serviceType:v#actionName"

<s:Envelopexmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>

</s:Body></s:Envelope>

<u:actionNamexmlns:u="urn:schemas-upnp-org:service:serviceType:v"><argumentName>in arg value</argumentName>other in argsand their values (if any) go here</u:actionName>


3 control action result l.jpg
3 Control: Action Result

  • Who? Device

  • When? Action completes

  • What?

HTTP/1.1 200 OKCONTENT-TYPE: text/xml; charset="utf-8"

<s:Envelopexmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">  <s:Body>

  </s:Body></s:Envelope>

    <u:actionNameResponsexmlns:u="urn:schemas-upnp-org:service:serviceType:v">      <argumentName>out arg value</argumentName>other out argsand their values (if any) go here</u:actionNameResponse>


Steps to upnp networking32 l.jpg
Steps to UPnP Networking

0 Control point and device get addresses

1 Control point finds interesting device

2 Control point learns about device capabilities

3 Control point invokes actions on device

4* Control point listens to state changes of device

5 Control point controls device and/or views device status using HTML UI

3 Control

4* Eventing

5 Presentation

2 Description

1 Discovery

0 Addressing


4 eventing l.jpg

Control point listens to state changes of device

0 get address

1 discover device

2 retrieve descr

get URL for eventing

4 subscribe to events from device

Basic push model

Simple

Protocol stack

4 Eventing

UPnP vendor

UPnP Forum

UPnP Device Architecture

HTTP

GENA

TCP

IP


4 eventing gena sidebar l.jpg
4 Eventing: GENA Sidebar

  • What is GENA?

    • IETF Draft General Event Notification Architecture

    • "Send and receive notifications using HTTP over TCP/IP and administratively-scoped multicast UDP."

      • SUBSCRIBE to notifications

      • UNSUBSCRIBE

      • NOTIFY

        • Of device availability

        • Of state variable changes


4 eventing subscribing l.jpg
4 Eventing: Subscribing

  • Who? Control point

  • When? Before receiving any events

  • What?

SUBSCRIBEpublisher pathHTTP/1.1HOST:publisher host:publisher port

CALLBACK: <delivery URL>NT:upnp:eventTIMEOUT: Second-requested subscription duration


4 eventing subscription l.jpg
4 Eventing: Subscription

  • Who? Device

  • When? Accepts subscription

  • What?

    • Device immediately sends a special, initial event to control point with the value of all evented variables

HTTP/1.1 200 OKSID: uuid:subscription-UUID TIMEOUT: Second-actual subscription duration


4 eventing notify l.jpg
4 Eventing: Notify

  • Who? Device

  • When? A state variable changes

  • What?

NOTIFYdelivery path HTTP/1.1HOST:delivery host:delivery portCONTENT-TYPE: text/xml

NT:upnp:eventNTS:upnp:propchange

SID: uuid:subscription-UUIDSEQ: event key

<e:propertysetxmlns:e="urn:schemas-upnp-org:event-1-0">  <e:property>    <variableName>new value</variableName>  </e:property>Other variable names and values (if any) go here</e:propertyset>


Steps to upnp networking38 l.jpg
Steps to UPnP Networking

0 Control point and device get addresses

1 Control point finds interesting device

2 Control point learns about device capabilities

3 Control point invokes actions on device

4 Control point listens to state changes of device

5* Control point controls device and/or views device status using HTML UI

3 Control

4 Eventing

5* Presentation

2 Description

1 Discovery

0 Addressing


5 presentation l.jpg

Control point controls device and/or views device status using HTML UI

0 get address

1 discover device

2 retrieve descr

get URL for presentation

5 load presentation page

(Don't constrain implementation)

Protocol stack

5 Presentation

UPnP vendor

UPnP Device Architecture

HTTP

TCP

IP


Summary l.jpg
Summary using HTML UI

  • UPnP says

    • Just send data

    • Keep implementation private

    • Agree on content / format of data

  • UPnP is

    • Web-based protocols

    • Tailored by a Forum for device (service) types

    • That are API, OS, physical network neutral

    • For discovery, description, control, eventing

    • (And simple HTML UI too)

  • For more information


ad