J_UPnPCoreArchitecture-YasushiNagao

Download Report

Transcript J_UPnPCoreArchitecture-YasushiNagao

UPnP Core Architecture
Version 1
Yasushi Nagao
Windows Product Marketing
Microsoft Co., Ltd.
UPnP ビジョン

ユーザーへプラグアンドプレイの使い勝手を提供
○ インターネット接続を簡単に共有する
○ どこからでも自宅のコンテンツに安全にアクセス

あらゆるジャンルの機器が対応可能
UPnP Network
検索をリクエスト
デバイスが返事
UPnP ビジョン
複雑に絡み合ったネットワーク
強力&論理的&シンプルな
ネットワーク
Internet
Internet
HomePNA*
PowerLine
139
4
802.11
Bluetooth*
ベンダ固有のAPI (上側)
UPnP ベンダ
UPnP Forum
UPnP デバイス アーキテクチャ
HTTPMU
HTTPU
SOAP
HTTP
SSDP GENA
SSDP
HTTP
GENA
UDP
TCP
IP
ベンダ固有のOS (下側)
ベンダ固有の物理ネットワーク
UPnPを実現する標準プロトコル
UPnP の技術的な特長
1. 物理的なネットワークメディアに依存しない
2. ソフトウェアプラットフォームに依存しない
3. 標準インターネット技術の活用
デバイス と コントロール ポイント
コントロールポイン
ト
デバイス
サービス
ブリッジ
Non-UPnP
Device
PC
オーディオ
UPnPの動作ステップ
0 アドレッシング
3 コントロー
ル
2 ディスクリプション
4 イベンティング
5 プレゼンテーショ
ン
1 ディスカバリ
0 アドレッシング

可能であれば、DHCPを使用

可能でなければAuto-IPを使用

Auto-IPの動作?
 169.254/16内のアドレスを選択
 ARPによって上記アドレスが有効かチェック
 既に使用されていれば、他のアドレスでチェック
 定期的にDHCPサーバーが可能かチェック
UPnPの動作ステップ
1 ディスカバリ
3 コントロー
ル
2 ディスクリプション
4 イベンティング
5 プレゼンテーショ
ン
1 ディスカバリ
0 アドレッシング

ネットワーク上の機器を検出する段階
UPnPの動作ステップ
1 ディスカバリ
UPnP ベンダ
UPnP Forum
UPnP デバイス アーキテクチャ
HTTPMU
HTTPU
マルチキャスト
ユニキャスト
SSDP GENA
SSDP
UDP
SOAP
HTTPMU
HTTP
GENA
TCP
IP
UPnPの動作ステップ
1 ディスカバリ SSDP : コネクト
UPnP Network
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: time to live
LOCATION: description url
NT: {UDN | type:version}
NTS: ssdp:alive
USN: UDN::NT header value
告知
(アドバタイズ)
UPnPの動作ステップ
1 ディスカバリ SSDP : サーチ
UPnP Network
検索をリクエスト
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: “ssdp:discover”
MX: time to delay
ST: {ssdp:all | UDN | type:version}
<blank line>
UPnPの動作ステップ
1 ディスカバリ SSDP : サーチレスポンス
UPnP Network
Audio
検索をリクエスト
デバイスが返事
HTTP/1.1 200 OK
CACHE-CONTROL: time to live
DATE: date generated
LOCATION: description url
ST: same as NT header
USN: UDN::ST header value
UPnPの動作ステップ
2 ディスクリプション
3 コントロー
ル
2 ディスクリプション
4 イベンティング
5 プレゼンテーショ
ン
1 ディスカバリ
0 アドレッシング

検出したデバイスから詳細な情報を取る段階
UPnPの動作ステップ
2 ディスクリプション
UPnP Network
HTTP
検出
ディスクリプション
取得
XMLドキュメント
UPnPの動作ステップ
2 ディスクリプション

二つのXMLドキュメント



デバイス ディスクリプション
 物理プロパティ
 論理プロパティ
 UIプロパティ
サービス ディスクリプション
 有効なアクション
 ステート情報
標準規格に準拠
UPnPの動作ステップ
2 ディスクリプション : デバイスディスクリプション
<?xml version=“1.0”?>
<root xmlns=”urn:schemas-upnp-org:device-10”>
<device>
<serviceList>

<service>

</service>
</serviceList>
<deviceList>
</deviceList>
<iconList>

<icon>

</icon>
</iconList>
</device>
</root>
UPnPの動作ステップ
2 ディスクリプション:物理プロパティ
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<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>
<URLBase>base URL for all relative URLs</URLBase>
<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>
UPnPの動作ステップ
2 ディスクリプション : 論理プロパティ
<?xml version="1.0"?>
<root xmlns="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>
UPnPの動作ステップ
2 ディスクリプション : サービスディスクリプション
<?xml version=“1.0”?>
<scpd xmlns=”urn:schemas-upnp-org:service1-0”>
<actionList>
<action>
</action>
<actionlist>
<serviceStateTable>
<stateVariable>
</stateVariable>
</serviceStateTable>
</scpd>
UPnPの動作ステップ
2 ディスクリプション : サービスアクション
<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<actionList>
<action>
<name>actionName</name>
<argumentList>
<argument>
<name>formalParameterName</name>
<direction>in xor out</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>
<stateVariable sendEvents=“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>
<stateVariable sendEvents=“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>
UPnPの動作ステップ
2 ディスクリプション : ステートバリアブル (変化)
<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<actionList>
<action>
<name>actionName</name>
<argumentList>
<argument>
<name>formalParameterName</name>
<direction>in xor out</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>
<stateVariable sendEvents=“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>
<stateVariable sendEvents=“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>
UPnPの動作ステップ
3 コントロール
3 コントロー
ル
2 ディスクリプション
4 イベンティング
5 プレゼンテーショ
ン
1 ディスカバリ
0 アドレッシング

実際にデバイスをコントロールする段階
UPnPの動作ステップ
3 コントロール
UPnP Network
SOAP
Simple Object Access Protocol
アクション
結果
電源ON
アクション
<電源ON>
UPnPの動作ステップ
3 コントロール : アクション
POST: control url HTTP/1.1
HOST: address:port
CONTENT-TYPE:text/xml; charset=“utf-8”
SOAPACTION:”urn:schemas-upnp-org:service:type:version#action
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope”
s:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”
<s:Body>
<u:actionName xmlns:u=“http://schemas-upnporg:service:type:version”
<argumentName>in argument value</argumentName>
…
</u:actionName>
</s:Body>
</s:Envelope>
UPnPの動作ステップ
3 コントロール : アクションの結果
HTTP/1.1 200 OK
CONTENT-TYPE: text/xml; charset=“utf-8”
<s:Envelope xmlns:s=“http://schemas.xmlsoap.org/soap/envelope”
s:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”
<s:Body>
<u:actionNameResponse>
xmlns:u=“urn:schemas-upnp-org:service:type:version”
<argumentName>out argument value</argumentName>
UPnPの動作ステップ
4 イベンティング
3 コントロー
ル
2 ディスクリプション
4 イベンティング
1 ディスカバリ
0 アドレッシング

デバイスの状態変化を検知する
5 プレゼンテーショ
ン
UPnPの動作ステップ
4 イベンティング
UPnP Network
GENA
Generic Event
Notification Architecture
登録
<サブスクライブ>
障害
通知
<パブリッシュ>
UPnPの動作ステップ
4 イベンティング : サブスクライブ

サブスクライブ メッセージはサービスへ送信

クライアントは通知にためURLを指定

クライアントはサブスクライブをリフレッシュしな
ければならない
SUBSCRIBE eventing url HTTP/1.1
HOST: address:port
CALLBACK: client notification url
NT: upnp:event
TIMEOUT: time to live
UPnPの動作ステップ
4 イベンティング : ノティフィケーション
NOTIFY client notification url HTTP/1.1
HOST: address:port
CONTENT-TYPE: text/xml
NT: upnp:event
NTS: upnp:propchange
SID: UDN:subscription UUID
SEQ: sequence number
<e:propertyset xmlns:e=“urn:schemas-upnp-org:event-1-0”
<e:property>
<variableName>new value</variableName>
</e:property>
…
</e:propertyset>
UPnPの動作ステップ
5 プレゼンテーション
3 コントロー
ル
2 ディスクリプション
4 イベンティング
5 プレゼンテーショ
ン
1 ディスカバリ
0 アドレッシング

Webブラウザを使ってデバイスの操作・設定が可能
UPnPの動作ステップ
5 プレゼンテーション
UPnP Network
Web
ブラウザ
Get
Presentation
HTML UI
For the interconnected lifestyle