1 / 48

Harris Lab Seminars Universal Plug and Play (UPnP) By Varun Verma

Harris Lab Seminars Universal Plug and Play (UPnP) By Varun Verma. Overview. Service Discovery Protocols Features of UPnP Networking in UPnP UPnP vs Jini. Service Discovery Protocols. Specialized information appliances (devices) require coordination. Provide to the devices :

wing-guy
Download Presentation

Harris Lab Seminars Universal Plug and Play (UPnP) By Varun Verma

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Harris Lab SeminarsUniversal Plug and Play(UPnP) ByVarun Verma

  2. Overview • Service Discovery Protocols • Features of UPnP • Networking in UPnP • UPnP vs Jini

  3. Service Discovery Protocols • Specialized information appliances (devices) require coordination. • Provide to the devices : • Ability to announce its presence to the network. • Automatic discovery of devices in the neighborhood and even those located remotely. • Ability to describe its capabilities as well as query/understand the capabilities of other devices. • Self configuration without administrative intervention • Seamless inter-operability with other devices wherever meaningful

  4. Motivation: Example Purchase a new digital camera: • it should just “plug in” to home network • it should “find” my printer and just “work” • it should NOT require a network administrator or a DNS address! • it should NOT require human intervention to load driver software, etc. Any digital camera should work with any printer

  5. UPnP Strategy • Just send data over the network • (No executables) • Minimize version issues • Minimize security issues • Keep implementation private • Agree on meaning / format of data

  6. UPnP Tactics • Minimize requirements • Basic IP network connectivity • Common HTTP protocol stack • Leverage existing standards • HTTP, XML

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

  8. Fundamental Principles • Open Protocols • Protocols defined by Internet Engineering and Task Force (IETF) • TCP/IP, HTTP • Flexible Platform for APIs and Tools • Language and OS independent • From an API perspective, individual platforms will implement APIs mapping to the protocols and data formats of Universal Plug and Play • Balanced protocol/API architecture

  9. Smooth Integration with Legacy Systems, non-IP Networks, and Peripheral Devices

  10. Universal Plug and Play and Legacy Integration in a Single Host

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

  12. 0 Addressing • Control point and device get address • Use a DHCP server • Else use Auto IP • Auto IP? • Pick an address in 169.254/16 range • Check to see if it is used (ARP) • Periodically check for DHCP server

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

  14. Devices Advertise when added Refresh advertisements Cancel advertisements when removed Control points search as needed Devices respond Control points filter 1 Discovery

  15. 1 Discovery

  16. 1 Discovery: Protocol Stack UPnP vendor UPnP Forum UPnP Device Architecture HTTPMU(multicast) HTTPU(unicast) GENA SSDP SSDP UDP IP

  17. 1 Discovery: SSDP • What is SSDP? • IETF Draft Simple Service Discovery Protocol • Key design principles • Administratively-scoped multicast • Unicast responses • UDP • Simple matches (e.g. Printer)

  18. 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 target (e.g. CDPlayer)NTS:ssdp:aliveUSN:advertisement UUID

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

  20. 1 Discovery: Responding • Who? Device unicasts • When? If ST matches an NT • What? • 1 time for each NT that matches HTTP/1.1 200 OKCACHE-CONTROL: max-age =seconds until advertisement expires LOCATION:URL for UPnP description for root deviceST: search targetUSN: advertisement UUID

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

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

  23. Device description Type Physical container Logical container For each service Type URL for description URL for control URL for eventing Services Functional units within devices Service description Actions State variables Actual (vs. designed) implementation Expressed in XML 2 Description

  24. 2 Description

  25. 2 Description: Device (phys) <?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <URLBase>base URL for all relative URLs</URLBase> <device> <deviceType> urn:schemas-upnp- org:device:CDPlayer:1</deviceType> <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>

  26. 2 Description: Device (logical) <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:SwitchPower:1</serviceType> <serviceId>urn:upnp-org:serviceId:SwitchPower</serviceId> <SCPDURL>URL to service description</SCPDURL> <controlURL>URL for control</controlURL> <eventSubURL>URL for eventing</eventSubURL> </service> <serviceType>urn:schemas-upnp-org:service:PlayCD:1</serviceType> <serviceId>urn:upnp-org:serviceId:PlayCD</serviceId> <SCPDURL>URL to service description</SCPDURL> <controlURL>URL for control</controlURL> <eventSubURL>URL for eventing</eventSubURL> </service> <serviceType>urn:schemas-upnp-org:service:Audio:1</serviceType> <serviceId>urn:upnp-org:serviceId:Audio</serviceId> <SCPDURL>URL to service description</SCPDURL> <controlURL>URL for control</controlURL> <eventSubURL>URL for eventing</eventSubURL> </service> Declarations for other services added by UPnP vendor (if any) go here </serviceList> <presentationURL>URL for presentation</presentationURL> </device> </root>

  27. 2 Description: Service (actns) <?xml version="1.0"?> <scpd xmlns="urn:schemas-upnp-org:service-1-0"> <specVersion> <!-- UPnP version 1.0 --> <major>1</major> <minor>0</minor> </specVersion> <actionList> <action> <!-- play the CD --> <name>Play</name> </action> <action> <!-- stop playing and reset --> <name>Stop</name> </action> <action> <!-- what track are we playing? --> <name>GetTrackInfo</name> <argumentList> <argument> <name>Number</name> <relatedStateVariable>TrackNumber</relatedStateVariable> <direction>out</direction> </argument> </argumentList> </action> </actionList>

  28. 2 Description: Service (vars) <serviceStateTable> <stateVariablesendEvents="yes"> <name>TrackNumber</name> <dataType>ui1</dataType> <allowedValueRange> <minimum>0</minimum> <!-- 0 means no CD in tray --> <maximum>255</maximum> <step>1</step> </allowedValueRange> </stateVariable> <stateVariablesendEvents="yes"> <name>TrackDuration</name> <dataType>time</dataType> <!-- 0:00 means no CD in tray --> </stateVariable> </scpd>

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

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

  31. 3 Control

  32. 3 Control: SOAP • 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.

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

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

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

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

  37. 4 Eventing: GENA • 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

  38. 4 Eventing

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

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

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

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

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

  44. 5. Presentation

  45. Examples……… • To add a CD, a control point must switch on the device and set up the disc changer to accept a new disc. //Switch on device Invoke SetTarget with TRUE on SwitchPower service //Set up disc changer to accept new disc Invoke AddDisc on ChangeDisc service • To randomly play all the tracks on a particular CD Subscribe to eventing from PlayCD //Select a random disc Invoke RandomDisc on ChangeDisc // Set play program to once in random order Invoke SetPlayProgram with ONCE_RANDOM on PlayCD //Start play Invoke Play on PlayCD //Receive event that play has stopped

  46. UPnP vs Jini • Jini - uses APIs as the sole contract between vendors. Universal Plug and Play - built around open protocols and data formats. • Jini – Involves ‘moving around’ of code. UPnP – Simple transfer of data. • Jini - pt. of failure, the lookup service UPnP – not dependent on a lookup service. • Jini - some inherent security from java/RMI UPnP - does not address security

  47. Summary of UPnP • 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? mailto:UPNPWORLD@FORUM.UPNP.ORG mailto:vverma@cise.ufl.edu

  48. Questions?

More Related