UPnP Device Architecture - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

UPnP Device Architecture

Description:

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, – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 41
Provided by: upnpOrgdo
Learn more at: https://www.upnp.org
Category:

less

Transcript and Presenter's Notes

Title: UPnP Device Architecture


1
UPnP Device Architecture
2
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

3
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

4
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

5
Goals
  • Describe the protocols for communication between
  • Control points
  • Controller, usually client
  • Device
  • Controlled,usually server
  • An actual devicemight containboth functions

6
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

7
UPnP Protocol Stack
  • Vendor-specific API above
  • Vendor-specific OS below

Vendor-specific physical net
8
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

5 Presentation
4 Eventing
3 Control
2 Description
1 Discovery
0 Addressing
9
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

10
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

5 Presentation
4 Eventing
3 Control
2 Description
1 Discovery
0 Addressing
11
1 Discovery
  • 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

12
1 Discovery Protocol Stack
13
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

14
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 upnprootdevice

NOTIFY HTTP/1.1HOST 239.255.255.2501900
CACHE-CONTROL max-age seconds until
advertisement expiresLOCATION URL for UPnP
description for root device
NT search targetNTS ssdpaliveUSN
advertisement UUID
15
1 Discovery Searching
  • Who? Control point multicasts
  • When? Looking for device or service
  • What?
  • ST one of
  • Service type
  • Device type
  • Device UUID
  • upnprootdevice
  • ssdpall

M-SEARCH HTTP/1.1HOST 239.255.255.2501900
MAN "ssdpdiscover"MX seconds to delay response
ST search target
16
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
17
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

5 Presentation
4 Eventing
3 Control
2 Description
1 Discovery
0 Addressing
18
2 Description
  • 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

19
2 Description
  • 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

20
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 ltangle bracketsgt
  • 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

21
2 Description Device (phys)
lt?xml version"1.0"?gtltroot xmlns"urnschemas-upn
p-orgdevice-1-0"gt   ltURLBasegtbase URL for all
relative URLslt/URLBasegt  ltdevicegt   
ltfriendlyNamegtshort user-friendly
titlelt/friendlyNamegt    ltmanufacturergtmanufacture
r namelt/manufacturergt    ltmanufacturerURLgtURL to
manufacturer sitelt/manufacturerURLgt   
ltmodelDescriptiongtlong user-friendly
titlelt/modelDescriptiongt    ltmodelNamegtmodel
namelt/modelNamegt    ltmodelNumbergtmodel
numberlt/modelNumbergt    ltmodelURLgtURL to model
sitelt/modelURLgt    ltserialNumbergtmanufacturer's
serial numberlt/serialNumbergt   
ltUDNgtuuidUUIDlt/UDNgt    ltUPCgtUniversal Product
Codelt/UPCgt    ltdeviceTypegturnschemas-upnp-orgde
vicedeviceTypelt/deviceTypegt   
ltserviceListgt      ltservicegt       
ltserviceTypegturnschemas-upnp-orgserviceserviceT
ypevlt/serviceTypegt        ltserviceIdgturnupnp-or
gserviceIdserviceIDlt/serviceIdgt       
ltSCPDURLgtURL to service descriptionlt/SCPDURLgt    
    ltcontrolURLgtURL for controllt/controlURLgt     
   lteventSubURLgtURL for eventinglt/eventSubURLgt   
   lt/servicegt      Declarations for other
services (if any) go here    lt/serviceListgt   
ltdeviceListgtDescription of embedded devices (if
any) go herelt/deviceListgt    lticonListgt     
lticongt        ltmimetypegtimage/formatlt/mimetypegt 
       ltwidthgthorizontal pixelslt/widthgt       
ltheightgtvertical pixelslt/heightgt       
ltdepthgtcolor depthlt/depthgt        lturlgtURL to
iconlt/urlgt      lt/icongt      XML to declare
other icons, if any, go here    lt/iconListgt   
ltpresentationURLgtURL for presentationlt/presentatio
nURLgt  lt/devicegt  ltspecVersiongt   
ltmajorgt1lt/majorgt ltminorgt0lt/minorgt 
lt/specVersiongtlt/rootgt
22
2 Description Device (logical)
lt?xml version"1.0"?gtltroot xmlns"urnschemas-upn
p-orgdevice-1-0"gt  ltURLBasegtbase URL for all
relative URLslt/URLBasegt  ltdevicegt   
ltfriendlyNamegtshort user-friendly
titlelt/friendlyNamegt    ltmanufacturergtmanufacture
r namelt/manufacturergt    ltmanufacturerURLgtURL to
manufacturer sitelt/manufacturerURLgt   
ltmodelDescriptiongtlong user-friendly
titlelt/modelDescriptiongt    ltmodelNamegtmodel
namelt/modelNamegt    ltmodelNumbergtmodel
numberlt/modelNumbergt    ltmodelURLgtURL to model
sitelt/modelURLgt    ltserialNumbergtmanufacturer's
serial numberlt/serialNumbergt   
ltUDNgtuuidUUIDlt/UDNgt    ltUPCgtUniversal Product
Codelt/UPCgt    ltdeviceTypegturnschemas-upnp-orgde
vicedeviceType vlt/deviceTypegt   
ltserviceListgt      ltservicegt       
ltserviceTypegturnschemas-upnp-orgserviceserviceT
ypevlt/serviceTypegt        ltserviceIdgturnupnp-or
gserviceIdserviceIDlt/serviceIdgt       
ltSCPDURLgtURL to service descriptionlt/SCPDURLgt    
    ltcontrolURLgtURL for controllt/controlURLgt     
   lteventSubURLgtURL for eventinglt/eventSubURLgt   
   lt/servicegt      Declarations for other
services (if any) go here    lt/serviceListgt   
ltdeviceListgtDescription of embedded devices (if
any) go herelt/deviceListgt    lticonListgt     
lticongt        ltmimetypegtimage/formatlt/mimetypegt 
       ltwidthgthorizontal pixelslt/widthgt       
ltheightgtvertical pixelslt/heightgt       
ltdepthgtcolor depthlt/depthgt        lturlgtURL to
iconlt/urlgt      lt/icongt      XML to declare
other icons, if any, go here    lt/iconListgt   
ltpresentationURLgtURL for presentationlt/presentatio
nURLgt  lt/devicegt  ltspecVersiongt   
ltmajorgt1lt/majorgt ltminorgt0lt/minorgt 
lt/specVersiongtlt/rootgt
23
2 Description Device (other)
lt?xml version"1.0"?gtltroot xmlns"urnschemas-upn
p-orgdevice-1-0"gt   ltURLBasegtbase URL for all
relative URLslt/URLBasegt  ltdevicegt   
ltfriendlyNamegtshort user-friendly
titlelt/friendlyNamegt    ltmanufacturergtmanufacture
r namelt/manufacturergt    ltmanufacturerURLgtURL to
manufacturer sitelt/manufacturerURLgt   
ltmodelDescriptiongtlong user-friendly
titlelt/modelDescriptiongt    ltmodelNamegtmodel
namelt/modelNamegt    ltmodelNumbergtmodel
numberlt/modelNumbergt    ltmodelURLgtURL to model
sitelt/modelURLgt    ltserialNumbergtmanufacturer's
serial numberlt/serialNumbergt   
ltUDNgtuuidUUIDlt/UDNgt    ltUPCgtUniversal Product
Codelt/UPCgt   ltdeviceTypegturnschemas-upnp-orgdev
icedeviceTypelt/deviceTypegt   
ltserviceListgt      ltservicegt       
ltserviceTypegturnschemas-upnp-orgserviceserviceT
ypevlt/serviceTypegt        ltserviceIdgturnupnp-or
gserviceIdserviceIDlt/serviceIdgt       
ltSCPDURLgtURL to service descriptionlt/SCPDURLgt    
    ltcontrolURLgtURL for controllt/controlURLgt     
   lteventSubURLgtURL for eventinglt/eventSubURLgt   
   lt/servicegt      Declarations for other
services (if any) go here    lt/serviceListgt   
ltdeviceListgtDescription of embedded devices (if
any) go herelt/deviceListgt    lticonListgt     
lticongt        ltmimetypegtimage/formatlt/mimetypegt 
       ltwidthgthorizontal pixelslt/widthgt       
ltheightgtvertical pixelslt/heightgt       
ltdepthgtcolor depthlt/depthgt        lturlgtURL to
iconlt/urlgt      lt/icongt      XML to declare
other icons, if any, go here    lt/iconListgt   
ltpresentationURLgtURL for presentationlt/presentatio
nURLgt  lt/devicegt  ltspecVersiongt   
ltmajorgt1lt/majorgt ltminorgt0lt/minorgt 
lt/specVersiongtlt/rootgt
24
2 Description Service (actns)
lt?xml version"1.0"?gtltscpd xmlns"urnschemas-upn
p-orgservice-1-0"gt  ltactionListgt   
ltactiongt      ltnamegtactionNamelt/namegt     
ltargumentListgt        ltargumentgt         
ltnamegtformalParameterNamelt/namegt         
ltdirectiongtin xor outlt/directiongt         
ltretval /gt          ltrelatedStateVariablegtstateVa
riableNamelt/relatedStateVariablegt       
lt/argumentgt       Declarations for other
arguments (if any) go here     
lt/argumentListgt    lt/actiongt    Declarations
for other actions (if any) go here 
lt/actionListgt  ltserviceStateTablegt   
ltstateVariable sendEventsyes xor nogt     
ltnamegtvariableNamelt/namegt     
ltdataTypegtvariable datatypelt/dataTypegt     
ltdefaultValuegtdefault valuelt/defaultValuegt     
ltallowedValueRangegt        ltminimumgtminimum
valuelt/minimumgt        ltmaximumgtmaximum
valuelt/maximumgt        ltstepgtincrement
valuelt/stepgt      lt/allowedValueRangegt   
lt/stateVariablegt    ltstateVariable
sendEventsyes xor nogt     
ltnamegtvariableNamelt/namegt     
ltdataTypegtvariable data typelt/dataTypegt     
ltdefaultValuegtdefault valuelt/defaultValuegt     
ltallowedValueListgt        ltallowedValuegtsome
valuelt/allowedValuegt        ltallowedValuegtsome
valuelt/allowedValuegt      lt/allowedValueListgt   
lt/stateVariablegt    Declarations for other
state variables (if any) go here 
lt/serviceStateTablegt  ltspecVersiongt   
ltmajorgt1lt/majorgt ltminorgt0lt/minorgt 
lt/specVersiongtlt/scpdgt
25
2 Description Service (vars)
lt?xml version"1.0"?gtltscpd xmlns"urnschemas-upn
p-orgservice-1-0"gt  ltactionListgt   
ltactiongt      ltnamegtactionNamelt/namegt     
ltargumentListgt        ltargumentgt         
ltnamegtformalParameterNamelt/namegt         
ltdirectiongtin xor outlt/directiongt         
ltretval /gt          ltrelatedStateVariablegtstateVa
riableNamelt/relatedStateVariablegt       
lt/argumentgt       Declarations for other
arguments (if any) go here     
lt/argumentListgt    lt/actiongt    Declarations
for other actions (if any) go here 
lt/actionListgt  ltserviceStateTablegt   
ltstateVariable sendEventsyes xor nogt     
ltnamegtvariableNamelt/namegt     
ltdataTypegtvariable datatypelt/dataTypegt     
ltdefaultValuegtdefault valuelt/defaultValuegt     
ltallowedValueRangegt        ltminimumgtminimum
valuelt/minimumgt        ltmaximumgtmaximum
valuelt/maximumgt        ltstepgtincrement
valuelt/stepgt      lt/allowedValueRangegt   
lt/stateVariablegt    ltstateVariable
sendEventsyes xor nogt     
ltnamegtvariableNamelt/namegt     
ltdataTypegtvariable data typelt/dataTypegt     
ltdefaultValuegtdefault valuelt/defaultValuegt     
ltallowedValueListgt        ltallowedValuegtsome
valuelt/allowedValuegt        ltallowedValuegtsome
valuelt/allowedValuegt      lt/allowedValueListgt   
lt/stateVariablegt    Declarations for other
state variables (if any) go here 
lt/serviceStateTablegt  ltspecVersiongt   
ltmajorgt1lt/majorgt ltminorgt0lt/minorgt 
lt/specVersiongtlt/scpdgt
26
2 Description Service (vars)
lt?xml version"1.0"?gtltscpd xmlns"urnschemas-upn
p-orgservice-1-0"gt  ltactionListgt   
ltactiongt      ltnamegtactionNamelt/namegt     
ltargumentListgt        ltargumentgt         
ltnamegtformalParameterNamelt/namegt         
ltdirectiongtin xor outlt/directiongt         
ltretval /gt          ltrelatedStateVariablegtstateVa
riableNamelt/relatedStateVariablegt       
lt/argumentgt       Declarations for other
arguments (if any) go here     
lt/argumentListgt    lt/actiongt    Declarations
for other actions (if any) go here 
lt/actionListgt  ltserviceStateTablegt   
ltstateVariable sendEventsyes xor nogt     
ltnamegtvariableNamelt/namegt     
ltdataTypegtvariable datatypelt/dataTypegt     
ltdefaultValuegtdefault valuelt/defaultValuegt     
ltallowedValueRangegt        ltminimumgtminimum
valuelt/minimumgt        ltmaximumgtmaximum
valuelt/maximumgt        ltstepgtincrement
valuelt/stepgt      lt/allowedValueRangegt   
lt/stateVariablegt    ltstateVariable
sendEventsyes xor nogt     
ltnamegtvariableNamelt/namegt     
ltdataTypegtvariable data typelt/dataTypegt     
ltdefaultValuegtdefault valuelt/defaultValuegt     
ltallowedValueListgt        ltallowedValuegtsome
valuelt/allowedValuegt        ltallowedValuegtsome
valuelt/allowedValuegt      lt/allowedValueListgt   
lt/stateVariablegt    Declarations for other
state variables (if any) go here 
lt/serviceStateTablegt  ltspecVersiongt   
ltmajorgt1lt/majorgt ltminorgt0lt/minorgt 
lt/specVersiongtlt/scpdgt
27
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

5 Presentation
4 Eventing
3 Control
2 Description
1 Discovery
0 Addressing
28
3 Control
  • 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

29
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.

30
3 Control Invoke Action
  • Who? Control point
  • When? To invoke action on device
  • What?

POST path of control URL HTTP/1.1HOST host of
control URLport of control URLCONTENT-TYPE
text/xml charset"utf-8"SOAPACTION
"urnschemas-upnp-orgserviceserviceTypevaction
Name"
ltsEnvelope xmlnss"http//schemas.xmlsoap.org/so
ap/envelope/"    sencodingStyle"http//schemas.
xmlsoap.org/soap/encoding/"gt  ltsBodygt  
lt/sBodygtlt/sEnvelopegt
    ltuactionName xmlnsu"urnschemas-upnp-orgse
rviceserviceTypev"gt      ltargumentNamegtin arg
valuelt/argumentNamegt      other in args and
their values (if any) go here    lt/uactionNamegt
31
3 Control Action Result
  • Who? Device
  • When? Action completes
  • What?

HTTP/1.1 200 OKCONTENT-TYPE text/xml
charset"utf-8" ltsEnvelope xmlnss"http//schem
as.xmlsoap.org/soap/envelope/"   
sencodingStyle"http//schemas.xmlsoap.org/soap/e
ncoding/"gt  ltsBodygt   lt/sBodygtlt/sEnvelop
egt
    ltuactionNameResponse
xmlnsu"urnschemas-upnp-orgserviceserviceType
v"gt      ltargumentNamegtout arg
valuelt/argumentNamegt      other out args and
their values (if any) go here   
lt/uactionNameResponsegt
32
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

5 Presentation
4 Eventing
3 Control
2 Description
1 Discovery
0 Addressing
33
4 Eventing
  • 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

34
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

35
4 Eventing Subscribing
  • Who? Control point
  • When? Before receiving any events
  • What?

SUBSCRIBE publisher path HTTP/1.1HOST publisher
hostpublisher port
CALLBACK ltdelivery URLgtNT upnpeventTIMEOUT
Second-requested subscription duration
36
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 uuidsubscription-UUID
TIMEOUT Second-actual subscription duration
37
4 Eventing Notify
  • Who? Device
  • When? A state variable changes
  • What?

NOTIFY delivery path HTTP/1.1HOST delivery
hostdelivery portCONTENT-TYPE
text/xml
NT upnpeventNTS upnppropchange
SID uuidsubscription-UUIDSEQ event key
ltepropertyset xmlnse"urnschemas-upnp-orgevent
-1-0"gt  ltepropertygt    ltvariableNamegtnew
valuelt/variableNamegt  lt/epropertygt  Other
variable names and values (if any) go
herelt/epropertysetgt
38
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

5 Presentation
4 Eventing
3 Control
2 Description
1 Discovery
0 Addressing
39
5 Presentation
  • 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

40
Summary
  • 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
  • Resources http//www.upnp.org
  • Questions? mailtoUPNPWORLD_at_FORUM.UPNP.ORG
Write a Comment
User Comments (0)
About PowerShow.com