Upload
eric-chapman
View
293
Download
4
Embed Size (px)
Citation preview
UPnP Introduction
教授 : 逄愛君組員 : 資訊三 張弘霖
資訊四 陳錦翰 資訊四 蔡旻諧
UPnP Universal Plug and Play Discovery and control of networked devices and services
Zero-configuration, "invisible" networking, automatic discovery devices from wide range vendors
Intelligent appliances, wireless devices, and PCs of all form factors
Standard TCP/IP and Internet protocols
Independent of particular operating system, programming language, or physical medium
UPnP Forum http://upnp.org/ Formed on October 18, 1999
Group of companies and individuals, more than 340 vendors across the industry
Defining and publishing UPnP Device and Service Descriptions built on open, Internet-based communication standards
Enable the emergence of easily connected devices and to simplify the implementation of networks in the home and corporate environments.
UPnP Enabled Scenarios Internet Connection Sharing
Baby Monitoring and Surveillance Camera
Synchronize Your Clocks
The New Printer
Out of Storage Space Again
The Master Switch
Components of a UPnP Network Device Container of services and nested devices
ex. VCR device may consist of a tape transport service, a tuner service, and a clock service.
Different categories of UPnP devices associated with different sets of services and embedded devices.
captured in an XML (eXtensible Markup Language) device description document that the device must host
In addition to the set of services, the device description also lists the properties associated with the device.
ex. such as device name and icons
Service (1/2)
The smallest unit of control in a UPnP network
Exposes actions and models its state with state variablesex. a clock service could be modeled as having a state variable: current_time : defines the state of the clock,
set_time and get_time : allow you to control the service.
Information is part of an XML service description standardized by the UPnP forum. similar to the device description
A pointer (URL) to these service descriptions is contained within the device description document. devices may contain multiple services.
Service (2/2)
A service in a UPnP device consists of a state table, a control server and an event server
state table : models the state of the service through state variables and updates them when the state changes.
control server : receives action requests (such as set_time), executes them, updates the state table and returns responses
event server : publishes events to interested subscribers anytime the state of the service changes.
Control Points
A controller capable of discovering and controlling other devices
After discovery, a control point could:
1. Retrieve the device description and get a list of associated services.
2. Retrieve service descriptions for interesting services.
3. Invoke actions to control the service.
4. Subscribe to the service's event source. Anytime the state of the service changes, the event server will send an event to the control point.
Peer-to-peer networking
Steps Involved in UPnP Networking Addressing
Discovery
Description
Control
Eventing
Presentation
UPnP Specific Protocols TCP/IP
HTTP, HTTPU, HTTPMUHTTP Multicast over UDP, HTTP Unicast over UDP. IETF Draft.
SSDP Simple Service Discovery Protocol. IETF Draft.
GENA General Event Notification Architecture. IETF Draft.
SOAP Simple Object Access Protocol. IETF draft and W3C Technical Report.
XML Extensible Markup Language. W3C recommendation
HTTP, HTTPU, HTTPMU
All aspects of UPnP build on top of HTTP or its variants
HTTPU HTTPMU :
◆ HTTP Multicast over UDP, HTTP Unicast over UDP
◆ variants of HTTP, IETF Draft
◆ deliver messages on top of UDP/IP
◆ used by SSDP , does not require the overhead associated with
reliability
SSDP
Simple Service Discovery Protocol ◆ defines how network services can be discovered on the network
◆ IETF Draft built on HTTPU and HTTPMU
◆ SSDP search request (over HTTPMU) :
for a control point to locate resources of interest on the network
◆ SSDP response (over HTTPU) :
for devices to announce their availability on the network
◆ SSDP presence announcements (over HTTPMU) :
for devices to advertise the services it supports
GENA
General Event Notification Architecture◆ provide the ability to send and receive notifications using HTTP over TCP/IP and multicast UDP
◆ defines the concepts of subscribers and publishers of
notifications to enable events ◆ IETF Draft
In UPnP
◆ create the presence announcements to be sent using SSDP
◆ provide the ability to signal changes in service state for UPnP eventing
◆ control point subscribe to event sources by sending a request that includes the service of interest, a location to send the events to
and a subscription time for the event notification
SOAP
Simple Object Access Protocol ◆ defines the use of Extensible Markup Language (XML) and
HTTP to execute remote procedure calls ◆ IETF draft and W3C Technical Report
In UPnP
◆ deliver control messages to devices and return results or errors
back to control points ◆ Each UPnP control request is a SOAP message that contains the
action to invoke along with a set of parameters
◆ The response is a soap message as well and contains the status,
return value and any return parameters
XML
Extensible Markup Language
◆ use the W3C definition, is the universal format for structured
data on the Web
◆ XML is a way to place nearly any kind of structured data into a
text file ◆ uses tags and attributes like HTML, actually quite different in that these tags and attributes are not globally defined as to their meaning, but are interpreted within the context of their use
Core part of UPnP used in device and service descriptions, control
messages and eventing
A family want to see a DVD movie, but they don’t have a DVD player.So the father purchases a new UPnP enabled DVD player.
Addressing
Get address
An Internet Gateway
AddressingDiscoveryDescriptionPresentationControlEvent
Discovery-advertising
mu
ltica
st
advertising
Dad wants to start his favorite DVD movie playing.He starts a video control application on his laptop
Discovery-search
sea
rch
Response (unicast)
multicast
AddressingDiscoveryDescriptionPresentationControlEvent
A control point needs more information on a device
The control point only knowsthe device’s UPnP type, a URL to the device’s UPnP description
Issues a HTTP GET request on the URL from the discovery message
UPnP description for root deviceAddressingDiscoveryDescriptionPresentationControlEvent
Presentation request
Presentation page
Control and status
The capabilities of the presentation page are completely specified by the UPnP vendor
Issue an HTTP GET request to the presentation URL
AddressingDiscoveryDescriptionPresentationControlEvent
Action request
resultQuery variable
Variable value
AddressingDiscoveryDescriptionPresentationControlEvent
Event
Subscription request
Subscription(uuid:1)
AddressingDiscoveryDescriptionPresentationControlEvent
Some question of msn
Behind nat ?Upnp enable gateway?Message or voice
Without upnp messaging can work Why ?
Nat problems for msn
Instant messaging Follow the same path of client to MSN server MSN server forwarding
Audio and Video Sip signaling (sdp) Private address (invalid)
Static ports for particular feature Only one user behind nat can work
Msn solution for Nat traversal
Using UPnP API Detect Msn client behind Nat retrieve address Obtain port-mapping for dynamic allocated ports Detect whether msn peer is behind same nat
How did msn use UPnP architecture Cd -- UPnP enable Nat gateway Cp – msn client
Instant Message route
msn login
msn login
InternetIp routin
g
Voice route
InternetIp routi
ngUpnp enable
Upnp enable
Public ipport
Private ipmapping
Public ipport
Private ipmapping
Compare msn with skype
Supernode vs. msn serverVoice forwarding ?CountFunctionality
Something interesting of msn In the same nat
AV v.s instant messaging
Thank for your listenning
Q&A