Post on 05-Apr-2015
transcript
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Spontane Vernetzung
Guido Badertscher
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Facts
Entwickelt vom UPnP-Forum (seit Juni 1999), einer Organisation unterFührung von Microsoft aus zur Zeit 638 Firmen
Offene Service-Architektur auf Basis von bewährten Technologien
Ziel: Automatische Vernetzung verschiedener elektronischer Geräte
Dienste können Angeboten und gesucht werden
OS-, Hardware- und Netzwerkunabhängig
Adhoc Netzwerke möglich
Low Level
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Anwendungsbereiche
Referenzimplementation von Intel für Linux
Implementiert in Windows XP und Windows ME
Bürogeräte
Multimedia
Heimautomation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Strategie
DatenversandKein ProgrammcodeSomit keine Sicherheitsrisiken mit verfälschtem Code
Keep it simple
Baut auf vorhandenen weit verbreiteten Protokollen aufIP, TCP, UDP, HTTP, DHCP, XML, ARP
Minimale Anforderungen an UPnP-Netzwerk UmgebungIP basiertes NetzwerkKein zentraler Dienst nötig
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Protokoll Stapel
Vendor-specific API above
Vendor-specific OS below
UPnP Protocol StackUPnP Protocol Stack
Ve
nd
or
-sp
ec
ific
ph
ysic
al
ne
t
UPnP Device ArchitectureUPnP Device ArchitectureUPnP Device Architecture
UDPUDPUDP
IPIPIP
HTTPU/MUHTTPU/MUHTTPU/MUGENAGENAGENA SSDPSSDPSSDP SOAPSOAPSOAP
HTTPHTTPHTTP
HTTPHTTPHTTPGENAGENAGENA
TCPTCPTCP
UPnP ForumUPnP ForumUPnP Forum
UPnP vendorUPnP vendorUPnP vendor
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Device/Service Struktur
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Ablauf einer Anfrage
1. Addressing 2. Discovery 3. Description 4. Control 5. Eventing 6. Presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
1. Addressing
IP-Konfiguration durch DHCP Server
Automatische IP-KonfigurationGerät gib sich selbst eine IP Adresse im privaten BereichÜberprüfung der Adresse durch ARPPeriodische Suche nach DHCP Server
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Ablauf einer Anfrage
1. Addressing 2. Discovery 3. Description 4. Control 5. Eventing 6. Presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
2. Discovery
SSDP Simple Service Discovery Protocol
Baut auf UDP-Multicast auf
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
2. Discovery: Beschreibung
Multicast Nachricht über HTTPMU Wer? Wann? Was?
NOTIFY * HTTP/1.1HOST: 239.255.255.250:1900
NOTIFY * HTTP/1.1HOST: 239.255.255.250:1900CACHE-CONTROL: max-age = seconds until advertisement expiresLOCATION: URL for UPnP description for root deviceNT: search targetNTS: ssdp:aliveUSN: advertisement UUID
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
2. Discovery: Suche
Multicast Nachricht über HTTPMU ST:
– Service type, Device type, Device UUID
– upnp:rootdeviceupnp:rootdevice
– ssdp:allssdp:all
M-SEARCH * HTTP/1.1HOST: 239.255.255.250:1900
M-SEARCH * HTTP/1.1HOST: 239.255.255.250:1900MAN: "ssdp:discover"MX: seconds to delay responseST: search target
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
2. Discovery: Antwort
Unicast Nachricht über HTTPU
HTTP/1.1 200 OKCACHE-CONTROL: max-age = seconds until advertisement expires
HTTP/1.1 200 OKCACHE-CONTROL: max-age = seconds until advertisement expiresLOCATION: URL for UPnP description for root deviceST: search targetUSN: advertisement UUID
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Ablauf einer Anfrage
1. Addressing 2. Discovery 3. Description 4. Control 5. Eventing 6. Presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
3. Description: Gerät
Geräte BeschreibungTypPhysische ContainerLogische Container
– Für jeden Service Type URL for description URL for control URL for eventing
UI
– Icons
– URL for presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Ablauf einer Anfrage
1. Addressing 2. Discovery 3. Description 4. Control 5. Eventing 6. Presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
4. Control: SOAP
Simple Object Access Protocol
Nachrichtenbasiertes Kommunikationsprotokoll in XML
Verpackt Nachrichten in Envelopes und schickt sie über HTTP
Spezifiziert von w3c
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
4. Control: Anfrage
POST path of control URL HTTP/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"
POST path of control URL HTTP/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:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <s:Body>
</s:Body></s:Envelope>
<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>
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
4. Control: Antwort
HTTP/1.1 200 OKCONTENT-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>
</s:Body></s:Envelope>
HTTP/1.1 200 OKCONTENT-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>
</s:Body></s:Envelope>
<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>
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Ablauf einer Anfrage
1. Addressing 2. Discovery 3. Description 4. Control 5. Eventing 6. Presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
5. Eventing: GENA
General Event Notification Architecture
HTTP/TCP oder HTTP/UDP
Bietet Mechanismen für Un-/Subscribe, Notify
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Ablauf einer Anfrage
1. Addressing 2. Discovery 3. Description 4. Control 5. Eventing 6. Presentation
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
6. Presentation
HTML UI für Status Anzeige oder Bedienung
Presentation URL wird in der Description gesendet
© 2003 Guido BadertscherSpontane Vernetzung - UPnP
9. Jänner 2004
Fazit
Keep it Simple
Nur Datenversand
Web-basierte Protokolle
http://www.upnp.org