UPnP 순천향대학교 정보기술공학부 이상정 UPnP 개요 2002-2 컴퓨터공학응용 UPnP 란? UPnP(Universal Plug and Play) • PC와 정보가전들 간에 peer-to-peer 연결을 위한 미들웨어 • 이미 검증된 네트워크 프로토콜 및 웹 기술을 기반으로 홈 네트워 킹 기기간의 제어 모델 구현 특징 • 플랫폼에 독립적이어서 다양한 운영체제 및 프로그래밍 언어에 적 용 가능 • 로열티 및 특허 제약이 없음 • HTTP, XML 등을 사용하여 인터넷의 자연스러운 확장 • 비교적 단순하고 가벼운 프로토콜 구조 및 스택 순천향대학교 정보기술공학부 이 상 정 3 2002-2 컴퓨터공학응용 UPnP Forum http://upnp.org MS, 인텔, IBM, Sony, 삼성 등 460개사 회원 UIC(UPnP Implementer’s Corporation) • UPnP 제품 인증 기관으로, 검사에 합격되면 UPnP Logo 사용허가 UPnP Working Committee • Appliance Working Group • Home Automation and Security Working Group • Audio/Video Working Group • Internet Gateway Working Group • Image Working Group • Mobile Devices Working Group 순천향대학교 정보기술공학부 이 상 정 4 2002-2 컴퓨터공학응용 UPnP 네트워크 순천향대학교 정보기술공학부 이 상 정 5 2002-2 컴퓨터공학응용 UPnP 구성요소 장치(device) Control Point 서비스 컨트롤 포인트 (control point) Device Service Control Point Device Service 순천향대학교 정보기술공학부 이 상 정 6 2002-2 컴퓨터공학응용 장치와 서비스 UPnP 장치 • UPnP기능이 내장된 가전제품 서비스 • 가장 작은 제어 단위이며 장치가 사용자에게 제공 • 상태 테이블, 컨트롤 서버, 이벤트 서버로 구성 • 상태 테이블은 상태 변수를 통하여 서비스 상태를 모델링 • 컨트롤 서버는 액션 요청을 받아 이를 실행하며 상 태 테이블을 갱신 • 이벤트 서버는 자신의 상태가 바뀔 때, 컨트롤 포인 트에게 이를 이벤트로서 알리는 기능 수행 순천향대학교 정보기술공학부 이 상 정 7 2002-2 컴퓨터공학응용 컨트롤 포인트 홈 네트워크에 연결된 장치들을 감지하고 제어 장치를 검색하여 서비스 정의와 서비스 목록을 갖 는다. 서비스의 액션을 실행시키고 장치로부터 이벤트를 수신한다. 순천향대학교 정보기술공학부 이 상 정 8 2002-2 컴퓨터공학응용 UPnP Enabled Device Device Service 1 Service 2 UPnP Enabled Device Control Point Device Control Point Service UPnP Enabled Device Root Device Embedded Device Service Service 순천향대학교 정보기술공학부 이 상 정 State Table Service 1 Control Server 9 Event Server Service 2 UPnP 프로토콜 스택 2002-2 컴퓨터공학응용 프로토콜 스택 UPnP vendor UPnP Forum UPnP Device Architecture HTTPU/MU GENA SOAP SSDP HTTP HTTP UDP TCP IP 순천향대학교 정보기술공학부 이 상 정 11 GENA 2002-2 컴퓨터공학응용 HTTP 통신 UPnP는 TCP/IP기술을 바탕으로 HTTP 사용하여 통신 • HTTP • HTTPU(HTTP over UDP) • HTTPMU(HTTP Multicast over UDP) 순천향대학교 정보기술공학부 이 상 정 12 2002-2 컴퓨터공학응용 SSDP SSDP(Simple Service Discovery Protocol) 네트워크 서비스들을 발견하는 방식을 정의한 프로토 콜 HTTP또는 HTTPMU 상에서 동작하며 네트워크에서 특정 리소스를 찾기 위한 컨트롤 포인터와 네트워크에 서 서비스를 제공하는 장치에 대한 통신 방식을 정의 컨트롤 포인터가 홈 네트워크에서 SSDP검색 요청을 전송하면 자신이 제어 가능한 장치 및 서비스들을 검 색할 수 있다. 또한 장치들은 이 프로토콜을 이용하여 자신을 광고 할 수 있다. 순천향대학교 정보기술공학부 이 상 정 13 2002-2 컴퓨터공학응용 GENA GENA(General Event Notification Architecture)는 HTTP와 HTTPMU를 이용하여 장치에서 발생한 이 벤트 메시지를 전송한다. 또한 이벤트의 수신 요청과 수신 거부를 이 프로토 콜을 이용하여 전송할 수 있다. 순천향대학교 정보기술공학부 이 상 정 14 2002-2 컴퓨터공학응용 SOAP SOAP(Simple Object Access Protocol)은 원 격 프로시저 호출을 수행하기위한 XML문서와 HTTP프로토콜의 사용 방법을 정의한다. SOAP을 이용하여 원격의 장치에게 입력 인자 를 포함하여 제어 메시지를 전송할 수 있으며, 이에 대한 응답으로 출력 인자를 전송 받을 수 있다. 순천향대학교 정보기술공학부 이 상 정 15 UPnP 네트워크 동작 2002-2 컴퓨터공학응용 네트워크 연결 동작 단계 3 Control 4 Eventing 5 Presentation 2 Description 1 Discovery 0 Addressing 0 1 2 3 4 5 Control point and device get addresses Control point finds interesting device Control point learns about device capabilities Control point invokes actions on device Control point listens to state changes of device Control point controls device and/or views device status using HTML UI 순천향대학교 정보기술공학부 이 상 정 17 2002-2 컴퓨터공학응용 구성요소 동작순서 수동기기(Controlled Device) Presentation Server (HTML UI) 5 Presentation Event Client 4 Control point listens to state changes of device Control Server (실제 구동 제어) 3 Control: SOAP Control Client 3 Control point invokes actions on device 2 Description Description Server (Device, Service by XML) 2 Control point learns about device capabilities Gateway (internet sharing, Firewell, VPN…) Description Client 1 Discovery: GENA, SSDP Discovery Client 1 Control point finds interesting device 0 Addressing: (1) DHCP / AutoIP+ARP (2) DNS 0 Control point and device get addresses 순천향대학교 정보기술공학부 이 상 정 Gateway Web Browser 5 Control point controls device and/or views device status using HTML UI 4 Eventing: GENA Event Server Discovery Server (기본 제원 설명) 능동기기(Control Point) 18 외부망 모뎀 접속 Multi ISP Addressing 2002-2 컴퓨터공학응용 Addressing(1) 3 Control 4 Eventing 5 Presentation 2 Description 1 Discovery 0* Addressing 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 순천향대학교 정보기술공학부 이 상 정 20 2002-2 컴퓨터공학응용 Addressing(2) DHCP(Dynamic Host Configuration Protocol)를 사용하여 IP 주소 할당 DHCP로 주소할당을 할 수 없으면 Auto-IP 수행 Auto-IP 동작 • • • • Pick an address in 169.254.XXX.XXX Check its availability using ARP If in use, try another address Periodically try a DHCP Server 순천향대학교 정보기술공학부 이 상 정 21 2002-2 컴퓨터공학응용 Addressing(3):Use DHCP service Control points DHCP Server Control points search 169.254.XXX.XXX Device 순천향대학교 정보기술공학부 이 상 정 Device Device 22 2002-2 컴퓨터공학응용 Addressing(4):Use Auto-IP Control points DHCP Server Control points Use Auto-IP 169.254.XXX.XXX Device 순천향대학교 정보기술공학부 이 상 정 Device 23 Device Discovery 2002-2 컴퓨터공학응용 Discovery(1) 3 Control 4 Eventing 5 Presentation 2 Description 1* Discovery 0 Addressing 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 순천향대학교 정보기술공학부 이 상 정 25 2002-2 컴퓨터공학응용 Discovery(2):Protocol Stack UPnP vendor UPnP Forum UPnP Device Architecture HTTPMU (multicast) GENA HTTPU (unicast) SSDP UDP IP 순천향대학교 정보기술공학부 이 상 정 26 SSDP 2002-2 컴퓨터공학응용 Discovery(3):SSDP IETF Draft Simple Service Discovery Protocol 주요 동작 • Multicast 광고 • Unicast 응답 • UDP 순천향대학교 정보기술공학부 이 상 정 27 2002-2 컴퓨터공학응용 Discovery(4):Advertising 디바이스가 광고 메시지 송신 • 디바이스는 홈 네트워크의 접속되면, 일정한 시간 간격으로 디바 이스와 디바이스가 제공하는 서비스들에 대한 정보를 광고 • 미리 정해진 멀티캐스트 주소(239.255.255.250)와 포트번호 (1900)로 메시지를 송신 • 컨트롤 포인터도 항상 새로운 디바이스나 서비스가 홈 네트워크 상에 장착되었는지를 감지하기 위해 이를 청취한다. 광고 메시지 내용 • 이벤트 알림을 위한 ‘NOTIFY’메소드 • HTTP 헤더내 ‘NTS’필드의 값을 ‘ssdp:alive’로 하여 현재 디바이 스가 작동하고 있음을 나타내는 기본적인 정보를 광고 • 광고 메시지의 수명 • 보다 상세한 디바이스 정보를 포함하는 XML상세 문서에 대한 URL 을 포함 • 현재 디바이스의 운영체제 정보와 UPnP 프로토콜 버전 및 디바이 스의 제품 버전 및 UUID 순천향대학교 정보기술공학부 이 상 정 28 2002-2 컴퓨터공학응용 Discovery(5):Advertising Who? Device multicasts When? Added What? NOTIFY * HTTP/1.1 HOST: 239.255.255.250:1900 CACHE-CONTROL: max-age = seconds until advertisement expires LOCATION: URL for UPnP description for root device NT: search target NTS: ssdp:alive USN: advertisement UUID 순천향대학교 정보기술공학부 이 상 정 29 2002-2 컴퓨터공학응용 Discovery(6):Searching UPnP컨트롤 포인터는 홈 네트워크에 연결됨과 동시에 홈 네트워크 상에서 자신이 관심을 가지는 디바이스와 서비스의 검색을 수행 • 검색 메시지를 보낼 때에는 SSDP프로토콜에서 정의한 멀티 캐스트 채널을 이용 • 응답은 검색 메시지를 보낸 호스트로 직접 유니캐스트하여 메 시지를 송신 • 관심있는 디바이스나 서비스의 지시자(UUID)를 명시하여 검 색할 수 있으며, 디바이스나 서비스의 종류(type)을 명시하여 서도 검색 가능 • UPnP포럼에서는 이들 디바이스와 서비스종류를 정의하고, 지시자는 UPnP제조회사들에 의해 정의 • 검색 메시지에서는 SSDP에서 정의힌 ‘M-SEARCH’ 메소드를 사용하며, MAN필드에 “ssdp:discover”를 기입 순천향대학교 정보기술공학부 이 상 정 30 2002-2 컴퓨터공학응용 Discovery(7):Searching Who? Control point multicasts When? Looking for device or service What? M-SEARCH * HTTP/1.1 HOST: 239.255.255.250:1900 MAN: "ssdp:discover" MX: seconds to delay response ST: search target 순천향대학교 정보기술공학부 이 상 정 31 2002-2 컴퓨터공학응용 Discovery(8):Responding Who? Device unicasts When? If ST matches an NT What? HTTP/1.1 200 OK CACHE-CONTROL: max-age = seconds until advertisement expires LOCATION: URL for UPnP description for root device ST: search target USN: advertisement UUID 순천향대학교 정보기술공학부 이 상 정 32 2002-2 컴퓨터공학응용 Discovery(9) Control points DHCP Server Control points Searching Advertising Device 순천향대학교 정보기술공학부 이 상 정 Responding Device Device 33 Description 2002-2 컴퓨터공학응용 Description(1) 3 Control 4 Eventing 5 Presentation 2* Description 1 Discovery 0 Addressing 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 순천향대학교 정보기술공학부 이 상 정 35 2002-2 컴퓨터공학응용 Description(2) Description Documents Protocol stack expressed in XML UPnP vendor Device description • Physical / Logical / UI properties Service description • Available actions • State Information UPnP Forum UPnP Device Architecture HTTP TCP IP 순천향대학교 정보기술공학부 이 상 정 36 2002-2 컴퓨터공학응용 Description(3) 컨트롤 포인터가 디바이스 검색 응답에는 간략한 정보 • 디바이스나 서비스의 ID나 그 메시지의 Lifetime등 • 상세한 정보를 얻기 위해서는 메시지의 LOCATION필드의 URL 에 해당하는 XML 상세 문서를 다운로드 디바이스 상세 문서 • UPnP포럼에서 표준화한 XML문서 형식의 디바이스와 서비스에 대한 정보가 기술 • 기본 디바이스(root device)에 대하여 모델 이름과 제품번호, 제 조회사명, 관련URL등과 서비스 상세문서의 URL 및 서비스 제어 URL과 이벤트 URL등의 정보가 XML표기법으로 기술 서비스 상세 문서 • 서비스 형식(Type)별로 문서 제공 • 각 문서에는 서비스가 제공하는 명령(Action)들과 서비스의 상 태 정보를 나타내는 변수들의 변수형과 범위, 기본값 등이 정의 순천향대학교 정보기술공학부 이 상 정 37 2002-2 컴퓨터공학응용 Description(4):Device(phys) <?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> <URLBase>base URL for all relative URLs</URLBase> <deviceType>urn:schemas-upnp-org:device:deviceType</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> 순천향대학교 정보기술공학부 이 상 정 38 2002-2 컴퓨터공학응용 Description(5):Device(logical) <?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> 순천향대학교 정보기술공학부 이 상 정 39 2002-2 컴퓨터공학응용 Description(6):Device(other) <?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0"> <device> <URLBase>base URL for all relative URLs</URLBase> <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> <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> 순천향대학교 정보기술공학부 이 상 정 40 2002-2 컴퓨터공학응용 Description(7):Service(actns) <?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> 순천향대학교 정보기술공학부 이 상 정 41 2002-2 컴퓨터공학응용 Description(8):Service(vars) <?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> 순천향대학교 정보기술공학부 이 상 정 42 2002-2 컴퓨터공학응용 Description(9) Control points DHCP Server Control points Request Responding Device 순천향대학교 정보기술공학부 이 상 정 Device Device 43 Device, Service description Control 2002-2 컴퓨터공학응용 Control(1) 3* Control 4 Eventing 5 Presentation 2 Description 1 Discovery 0 Addressing 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 순천향대학교 정보기술공학부 이 상 정 45 2002-2 컴퓨터공학응용 Control(2) 컨트롤 포인트는 디바이스에 대한 상세 문서를 전송 받아온 후, 디바이스의 서비스들에 대해 명령들을 보 낼 수 있다. • 컨트롤 포인터는 디바이스 상세 문서에 나타나있는 서비스 제 어 URL에 대하여 명령 요청 메시지를 보냄으로써, 디바이스 의 제어를 행한다. 제어 메시지는 역시 XML로 표현되는 SOAP 프로토콜을 사용한다. • 이러한 메시지는 함수의 호출과 비슷하게, 명령에 관련된 값 들을 인자로 주고 결과를 전송 받을 수 있도록 구성되어 있다. 제어 명령 요청의 수행결과로 디바이스 상태 값이 변 한다면, 서비스 상세 문서에서 정의한 것에 따라 결과 를 응답 메시지 내에 인자로 넘겨 줄 수 있다. 순천향대학교 정보기술공학부 이 상 정 46 2002-2 컴퓨터공학응용 Control(3) Simple Object Access Protocol stack Protocol • XML format for information exchange • Delivers data using HTTP over TCP/IP • SOAP is a standard convention for remote procedure calls UPnP vendor UPnP Forum UPnP Device Architecture SOAP HTTP TCP IP 순천향대학교 정보기술공학부 이 상 정 47 2002-2 컴퓨터공학응용 Control(4):Invoke Action Who? Control point When? To invoke action on device What? POST path of control URL HTTP/1.1 HOST: host of control URL:port of control URL CONTENT-TYPE: text/xml; charset="utf-8" SOAPACTION: "urn:schemas-upnp-org:service:serviceType:v#actionName" <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body> <u:actionName xmlns:u="urn:schemas-upnp-org:service:serviceType:v"> <argumentName>in arg value</argumentName> other in args and their values (if any) go here </u:actionName> </s:Body> </s:Envelope> 순천향대학교 정보기술공학부 이 상 정 48 2002-2 컴퓨터공학응용 Control(5):Action Result Who? Device When? Action completes What? 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:serviceType:v"> <argumentName>out arg value</argumentName> other out args and their values (if any) go here </u:actionNameResponse> </s:Body> </s:Envelope> 순천향대학교 정보기술공학부 이 상 정 49 2002-2 컴퓨터공학응용 Control(6) Control points Control points DHCP Server Invoke Action Action Result Device 순천향대학교 정보기술공학부 이 상 정 Device Device 50 Eventing 2002-2 컴퓨터공학응용 Eventing(1) 3 Control 4* Eventing 5 Presentation 2 Description 1 Discovery 0 Addressing 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 순천향대학교 정보기술공학부 이 상 정 52 2002-2 컴퓨터공학응용 Eventing(2) 이벤트는 디바이스에 존재하는 서비스들의 변화 된 상태 값들을 컨트롤 포인트에게 알려주는 동작 • 컨트롤 포인트는 관심을 가지는 디바이스의 서비스에 대해 이벤트 구독(Subcription)신청을 하고, 디바이스 는 각 컨트롤 포인트마다 ID를 할당한다. • 등록된 구독신청에 대해 디바이스는 이벤트 발생시 해 당 컨트롤 포인터에게 상태 변수값들을 이벤트로 공지 순천향대학교 정보기술공학부 이 상 정 53 2002-2 컴퓨터공학응용 Eventing(3) General Event Protocol stack Notification Architecture • GENA is based on XML delivered via HTTP on TCP/IP • Eventing is a very simple push model UPnP vendor UPnP Forum UPnP Device Architecture HTTP GENA TCP IP 순천향대학교 정보기술공학부 이 상 정 54 2002-2 컴퓨터공학응용 Eventing(4):Subscribing Who? Control point When? Before receiving any events What? SUBSCRIBE publisher path HTTP/1.1 HOST: publisher host:publisher port CALLBACK: <delivery URL> NT: upnp:event TIMEOUT: Second-requested subscription duration 순천향대학교 정보기술공학부 이 상 정 55 2002-2 컴퓨터공학응용 Eventing(5):Subscription Who? Device When? Accepts subscription What? HTTP/1.1 200 OK SID: uuid:subscription-UUID TIMEOUT: Second-actual subscription duration 순천향대학교 정보기술공학부 이 상 정 56 2002-2 컴퓨터공학응용 Eventing(6):Notify Who? Device When? A state variable changes What? NOTIFY delivery path HTTP/1.1 HOST: delivery host:delivery port CONTENT-TYPE: text/xml NT: upnp:event NTS: upnp:propchange SID: uuid:subscription-UUID SEQ: event key <e:propertyset xmlns: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> 순천향대학교 정보기술공학부 이 상 정 57 2002-2 컴퓨터공학응용 Eventing(7) Control points DHCP Server Control points 1 Subscribing Subscription 2 Device Notify Device Device 3 순천향대학교 정보기술공학부 이 상 정 58 Presentation 2002-2 컴퓨터공학응용 Presentation(1) 3 Control 4 Eventing 5* Presentation 2 Description 1 Discovery 0 Addressing 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 순천향대학교 정보기술공학부 이 상 정 60 2002-2 컴퓨터공학응용 Presentation(2) 프리젠테이션의 URL은 디바이스 상세 문서의 ‘Presentation URL’요소에 기술 • 컨트롤 포인트는 디바이스로부터 이 문서를 브라우 저로 전송 받아, 장치의 상태 정보를 보고 받으며, 장치를 제어할 수 있도록 사용자에게 인터페이스를 제공한다. • 프리젠테이션 문서의 작성을 UPnP 포럼에서는 디 바이스나 서비스의 상세문서와 달리 전적으로 디바 이스 제작회사 측에 전담시키고 있다. 순천향대학교 정보기술공학부 이 상 정 61 2002-2 컴퓨터공학응용 Presentation(3) Presentation URL Protocol stack Presentation page can be used for control or setup by a standard browser UPnP vendor UPnP Device Architecture HTTP TCP IP 순천향대학교 정보기술공학부 이 상 정 62
© Copyright 2025 Paperzz