30
UPnP Introduction 教教 : 教教教 教教 : 教教教 教教教 教教教 教教教 教教教 教教教

UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Embed Size (px)

Citation preview

Page 1: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

UPnP Introduction

教授 : 逄愛君組員 : 資訊三 張弘霖

資訊四 陳錦翰 資訊四 蔡旻諧

Page 2: 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

Page 3: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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.

Page 4: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 5: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 6: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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.

Page 7: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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.

Page 8: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 9: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧
Page 10: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Steps Involved in UPnP Networking Addressing

Discovery

Description

Control

Eventing

Presentation

Page 11: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 12: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧
Page 13: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 14: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 15: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 16: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 17: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 18: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 19: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 20: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 21: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 22: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Action request

resultQuery variable

Variable value

AddressingDiscoveryDescriptionPresentationControlEvent

Page 23: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Event

Subscription request

Subscription(uuid:1)

AddressingDiscoveryDescriptionPresentationControlEvent

Page 24: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Some question of msn

Behind nat ?Upnp enable gateway?Message or voice

Without upnp messaging can work Why ?

Page 25: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 26: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

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

Page 27: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Instant Message route

msn login

msn login

InternetIp routin

g

Page 28: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Voice route

InternetIp routi

ngUpnp enable

Upnp enable

Public ipport

Private ipmapping

Public ipport

Private ipmapping

Page 29: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Compare msn with skype

Supernode vs. msn serverVoice forwarding ?CountFunctionality

Something interesting of msn In the same nat

AV v.s instant messaging

Page 30: UPnP Introduction 教授 : 逄愛君 組員 : 資訊三 張弘霖 資訊四 陳錦翰 資訊四 蔡旻諧

Thank for your listenning

Q&A