Download 1 - CS Technion

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Internet protocol suite wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

IEEE 1355 wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Universal Plug and Play wikipedia , lookup

Transcript
3/30/2005
The Computer Communication Lab (236340)
Spring 2005
Universal Plug and Play on Mobile Phone
With Qualcomm
- Client (Device) -
First Report
Submitted by:
1
Einav Bar-Ner
036302966
seinavba@t2
Gal Zach
037493491
sgalzach@t2
1.
1.1.
1.1.1.
1.1.2.
1.1.3.
1.1.4.
1.1.5.
1.1.6.
1.2.
2.
2.1.
2.2.
2.3.
2.4.
2.5.
2.6.
2.7.
2.8.
2.9.
3.
4.
4.1.
4.2.
4.3.
4.4.
5.
2
Introduction: .............................................................................................. 3
Steps in UPnP Networking ........................................................ 3
Step 0 – Addressing ....................................................... 3
Step 1 – Discovery ......................................................... 3
Step 2 – Description ....................................................... 3
Step 3 – Control ............................................................. 4
Step 4 – Eventing ........................................................... 4
Step 5 – Presentation ...................................................... 4
UPnP Protocol Stack .................................................................. 4
Modules..................................................................................................... 5
Upnp Sockets Module ................................................................ 5
Utilities....................................................................................... 5
Main ........................................................................................... 5
Addressing Module .................................................................... 6
Discovery Module ...................................................................... 6
Description Module ................................................................... 6
Control Module .......................................................................... 6
Eventing Module ........................................................................ 6
Presentation Module .................................................................. 7
Modules Relations .................................................................................... 7
Protocols ................................................................................................... 7
Simple Object Access Protocol (SOAP) .................................... 7
Auto-IP ....................................................................................... 8
GENA ........................................................................................ 8
SSDP .......................................................................................... 8
Time Schedule .......................................................................................... 8
1. Introduction:
UPnP is an architecture for pervasive peer-to-peer network connectivity of intelligent
appliances, wireless devices, and PCs of all form factors. It is designed to bring easyto-use, flexible, standards-based connectivity to ad-hoc or unmanaged networks
whether in the home, a small business, public spaces, or devices attached to the
Internet.
The UPnP Device Architecture defines the protocols for communication between
control points and devices. In order to establish a UPnP connection the following
steps have to be performed: discovery, description, control, eventing, and
presentation. These steps will be discusses in detail later. UPnP uses an extended
protocol stack to execute those steps.
1.1. Steps in UPnP Networking
1.1.1. Step 0 – Addressing
Each device must search for a DHCP server when the device is first
connected to the network. If a DHCP server is available, the device must
use the IP addressed assigned to it. If no DHCP server is available, the
device must use automatic IP addressing (Auto-IP) to obtain an address.
Auto-IP defines how a device: (a) determines if DHCP is unavailable,
and (b) intelligently chooses an IP address from a set of link-local IP
addresses.
1.1.2. Step 1 – Discovery
When a device is added to the network, the UPnP discovery protocol
allows that device to advertise its services to control points on the
network. Similarly, when a control point is added to the network, the
UPnP discovery protocol allows that control point to search for devices
of interest on the network. The fundamental exchange in both cases is a
discovery message containing a few essential specifics about the device
or one of its services, e.g., its type, identifier, and a pointer to more
detailed information.
1.1.3. Step 2 – Description
The information supplied in the discovery step is not enough for the
control point to learn about the device and its capabilities, or to interact
with it. The control point uses the URL, provided in the discovery step,
to retrieve the required information. The UPnP description for a device is
partitioned into two: a device description describing the physical and
logical containers, and one or more service descriptions describing the
capabilities exposed by the device. In order to retrieve the
service/device's description, the control point issues an HTTP GET
3
request to the URL in the discovery message, and the device returns its
description in the body of an HTTP response.
1.1.4. Step 3 – Control
After getting the information about the device and its services, the
control point can ask those services to invoke actions. When an action is
completed (or failed), the service returns the action's results or errors. In
case of a non-evented variable (will be explained in step 4 – eventing),
the control point can poll the service for the variable's value.
1.1.5. Step 4 – Eventing
A UPnP service description includes a list of actions the service responds
to and a list of variables that model the state of the service at run time. If
one or more of these state variables are changed during the service's run
time, the service publishes updates, and a control point may subscribe to
receive this information.
Some state variables may change value too rapidly or may contain very
large values. For this, or other reasons, a service may designate one or
more state variables as non-evented and never send event messages to
subscribers. To determine the current value for such non-evented
variables, control points must poll the service explicitly.
1.1.6. Step 5 – Presentation
If a device has a URL for presentation, then the control point can retrieve
a page from this URL, load the page into a browser and, depending on
the capabilities of the page, allow a user to control the device and/or view
device status.
1.2. UPnP Protocol Stack
UPnP uses the following protocol stack:
UPnP
HTTPMU
(multicast)
[black]
UDP [black]
GENA
[navy]
SSDP
[blue]
HTTPU
(unicast)
[black]
SSDP
[blue]
SOAP
[blue]
HTTP
[black]
HTTP GENA
[black] [navy]
TCP [black]
IP [black]
In our implementation we add one layer for the UPnP protocol. The UPnP layer
contains:
 UPnP specific information about the device:
o Discovery: URL for the device description, device identifier
o Description: List of services and embedded devices including types
and specific URLs.
o Control: action names, argument names and values, variable names.
o Eventing: state variables names and values.
4
o Presentation: URL for presentation page.
 Devices/services type and version.
 URLs for the devices and services schemas.
 UPnP version.
The messages are formatted using one of the following protocols according to the step
in the UPnP protocol:
 Simple Service Discovery Protocol (SSDP), used on discovery step.
 General Event Notification Architecture (GENA), used on eventing step.
 Simple Object Access Protocol (SOAP), used on control step.
See further explanations in the algorithms section.
The messages are delivered via HTTP, either a multicast or unicast transmission.
HTTP messages are running over UDP or TCP. Ultimately, all messages above are
delivered over IP.
2. Modules
2.1. Upnp Sockets Module
This module contains all sockets issues.
2.2. Utilities
Contains:
1. Xml file with the UPnP device description.
2. Definitions of the following data types:
 Service data type:
.1. List of actions the service responds to
.2. List of state variables that model the state of the service at run
time
 Device data type:
.1. List of embedded devices.
.2. List of services.
 Subscriber data type:
.1. Identifier of the subscriber.
 Subscription data type:
o Unique subscription identifier
o Delivery URL for event messages
o Event key - Key is 0 for initial event message. Key must be
sequentially numbered for each subsequent event message.
o Subscription duration
 Action data type.
 State variable
2.3. Main
Main functions:
1. Initializing a global device variable.
2. Activating the UPnP steps:
a. Addressing.
b. Discovery + initializing a new thread for listening on a port.
5
c. Eventing – call the initialization function
3. Parsing a request from control points and executing the appropriate
function. Requests can be:
 Control point search
 Description request
 Subscribing request
 Control (action) request
 Query a state variable
 Presentation query.
2.4. Addressing Module
Main functions:
1. Determining whether to use Auto-IP.
2. Choosing an address – if we use Auto-IP.
3. Testing the address.
4. Checking for dynamic address availability.
2.5. Discovery Module
Main Functions:
1. Multicast transmission to advertise embedded device.
2. Multicast transmission to advertise service.
3. Multicast transmission to revoke advertisement of embedded device.
4. Multicast transmission to revoke advertisement of service.
5. Response for search transmission of control point
2.6. Description Module
Main functions:
1. Responding for a control point description request.
2.7. Control Module
Main functions:
1. Executing a requested action – Create a new thread to execute the
action.
2. Returning an action's results or errors to the control point asked for this
action.
3. Responding for a control point query for the value of the state
variable.
2.8. Eventing Module
Global variables:
1. List of subscriptions.
Main functions:
2. Initialization function of the subscriptions’ list and a timer thread to
check the subscriptions’ expiration.
3. Sending an accept response for a subscription.
4. Sending initial event message when a subscriber first subscribes; this
event message contains the names and values for all evented variables.
6
5. Updating the list of subscribers when a subscription expires.
6. Sending a reject message if a subscriber that his subscription expires
tries to send a message other than subscription message.
2.9. Presentation Module
Main functions:
1. Returning the presentation page to the control point.
3. Modules Relations
Utilities
Addressing
Control
Discovery
Eventing
Presentation
Description
Main
Upnp
Socket
Explanation:
Each module uses the utilities module and the main module uses all other modules.
4. Protocols
4.1.
Simple Object Access Protocol (SOAP)
Defines the use of XML and HTTP for remote procedure calls. UPnP uses
SOAP to deliver control messages to devices and return results or errors back
to control points.
7
4.2.
Auto-IP
Auto-IP defines how a device: (a) determines if DHCP is unavailable, and (b)
intelligently chooses an IP address from a set of link-local IP addresses.
4.3.
GENA
General Event Notification Architecture.
4.4.
SSDP
Simple Service Discovery Protocol. A multicast discovery and search
mechanism that uses a multicast variant of HTTP over UDP.
5. Time Schedule






8
31.4.05 - 7.4.05: Main and Utilities modules.
8.4.05 - 14.4.05: Socket and Addressing modules.
15.4.05 - 21.4.05: Discovery and description modules.
22.4.0 - 28.4.05: Control module.
29.4.05 - 5.5.05: Eventing and Presentation modules.
6.5.05 - 16.4.05: Final tests and finalization of all of the above.