Presentation is loading. Please wait.

Presentation is loading. Please wait.

Universal Plug and Play (UPnP) Presented by: Kamal Kamal Kamal Kamal Mohammad Atieh Mohammad Atieh.

Similar presentations


Presentation on theme: "Universal Plug and Play (UPnP) Presented by: Kamal Kamal Kamal Kamal Mohammad Atieh Mohammad Atieh."— Presentation transcript:

1 Universal Plug and Play (UPnP) Presented by: Kamal Kamal Kamal Kamal Mohammad Atieh Mohammad Atieh

2 Contents Introduction Introduction UPnP Protocol UPnP Protocol Development Levels Development Levels Control Point: Data structures and Modules Control Point: Data structures and Modules Control Point User Interface Control Point User Interface

3 Introduction to UPnP The UPnP is a technology that provides a peer-to-peer connectivity of intelligent appliance, wireless devices, and PCs of all factors, and creates a distributed network such that each device that is connected to the network offers its services to all the other connected devices. The UPnP is a technology that provides a peer-to-peer connectivity of intelligent appliance, wireless devices, and PCs of all factors, and creates a distributed network such that each device that is connected to the network offers its services to all the other connected devices. In this project a UPnP on mobile phone is implemented, such that the devices of the distributed network are mobile phones of Qualcomm (Brew), So the project is part of the development of the Brew mobile phone. In this project a UPnP on mobile phone is implemented, such that the devices of the distributed network are mobile phones of Qualcomm (Brew), So the project is part of the development of the Brew mobile phone.

4 Introduction (Cont.) The nodes of the created network are classified into two parts: Devices that offer the services, and a Control Point that uses these services. The nodes of the created network are classified into two parts: Devices that offer the services, and a Control Point that uses these services. Two teams are working on this project: our team has to implement the Control Point, the other should implement the Device. Two teams are working on this project: our team has to implement the Control Point, the other should implement the Device. The implementation will be tested by a Brew simulator. The implementation will be tested by a Brew simulator.

5 UPnP Steps Discovery Discovery advertisements by the devices advertisements by the devices search requests from the control points search requests from the control points Description Description Requested information about the device is sent to control point Requested information about the device is sent to control point Control Control requests for actions from the control points to the devices requests for actions from the control points to the devices Eventing Eventing subscription for events by the control points subscription for events by the control points notification of events by the device notification of events by the device Presentation (control point) Presentation (control point) GUI to the user by the control point GUI to the user by the control point

6 UPnP Protocol Stack The UPnP discovery protocol is based on the Simple Service Discovery Protocol (SSDP). The UPnP discovery protocol is based on the Simple Service Discovery Protocol (SSDP). Control messages are expressed in XML using the Simple Object Access Protocol (SOAP). Control messages are expressed in XML using the Simple Object Access Protocol (SOAP). Event messages are also expressed in XML and formatted using the General Event Notification Architecture (GENA). Event messages are also expressed in XML and formatted using the General Event Notification Architecture (GENA). SSDP works over UDP, SOAP and GENA works over TCP. SSDP works over UDP, SOAP and GENA works over TCP.

7 Control Point side of the UPnP Subsystem Network Discovery Search Discovery Response Discovery Description Request Description Response Control Request Control Response Eventing Event subscription Events notification Presentation Control point user

8 Discovery The control point sends msearch: The control point sends msearch: M-SEARCH * HTTP/1.1 HOST: 239.255.255.250:1900 MAN: "ssdp:discover" MX: seconds to delay response ST: ssdp:all M-SEARCH * HTTP/1.1 HOST: 239.255.255.250:1900 MAN: "ssdp:discover" MX: seconds to delay response ST: ssdp:all

9 Discovery Cont. Discovery Cont. The device responds with: The device responds with: HTTP/1.1 200 OK HTTP/1.1 200 OK CACHE-CONTROL: max-age = seconds until advertisement expires CACHE-CONTROL: max-age = seconds until advertisement expires DATE: when response was generated LOCATION: URL for UPnP description for device SERVER: OS/version UPnP/1.0 product/version ST: device type : device version USN: device UUID :: device type : device version DATE: when response was generated LOCATION: URL for UPnP description for device SERVER: OS/version UPnP/1.0 product/version ST: device type : device version USN: device UUID :: device type : device version

10 Description Device Description Device Description defines logical devices defines logical devices contains URLs for service description, control, eventing. contains URLs for service description, control, eventing. Service Description Service Description tells how to form a request for a service tells how to form a request for a service events that can be subscribed to by control points events that can be subscribed to by control points fetched using HTTP GET fetched using HTTP GET

11 XML in UPnP: Device Description 1 0 urn:schemas-upnp-org:service:serviceType:v urn:upnp-org:serviceId:serviceID URL to service description URL for control URL for eventing Declarations for other services defined by a UPnP Forum (if any) go here Declarations for other services added by UPnP vendor (if any) go here Description of embedded devices defined by a UPnP Forum (if any) go here Description of embedded devices added by UPnP vendor (if any) go here URL for presentation

12 XML in UPnP: Service Description actionName formalParameterName in or out stateVariableName variableName variable data type default value enumerated value

13 Control Uses Simple Object Access Protocol (SOAP) Uses Simple Object Access Protocol (SOAP) Control points Control points fetch the URL for control fetch the URL for control construct requests using SOAP construct requests using SOAP send the requests over HTTP send the requests over HTTP wait for the SOAP responses from devices wait for the SOAP responses from devices Devices Devices parse the SOAP requests parse the SOAP requests carry out the required action and return responses in SOAP messages carry out the required action and return responses in SOAP messages

14 XML in UPnP: SOAP Uses XML and HTTP for control calls Uses XML and HTTP for control calls SOAP request POST path of control URL HTTP/1.1 HOST: host of control URL:port of control URL CONTENT-LENGTH: bytes in body CONTENT-TYPE: text/xml; charset="utf-8" SOAPACTION: "urn:schemas-upnp-org:service:serviceType:v#actionName” in arg value other in args and their values go here, if any SOAP request POST path of control URL HTTP/1.1 HOST: host of control URL:port of control URL CONTENT-LENGTH: bytes in body CONTENT-TYPE: text/xml; charset="utf-8" SOAPACTION: "urn:schemas-upnp-org:service:serviceType:v#actionName” in arg value other in args and their values go here, if any

15 Eventing Device publishes a list of events for which control points can subscribe and get notifications Device publishes a list of events for which control points can subscribe and get notifications Control points subscribe with the devices for the events published Control points subscribe with the devices for the events published Event notifications by the devices over TCP to control points Event notifications by the devices over TCP to control points

16 XML in UPnP: Event Notification NOTIFY delivery path HTTP/1.1 HOST: delivery host:delivery port CONTENT-TYPE: text/xml CONTENT-LENGTH: Bytes in body NT: upnp:event NTS: upnp:propchange SID: uuid:subscription-UUID SEQ: event key new value Other variable names and values (if any) go here.

17 Development Levels

18 Project Steps Reading and understanding the UPnP. Reading and understanding the UPnP. Installation of the BREW SDK v.3.1.3. Installation of the BREW SDK v.3.1.3. Reading relevant information from the BREW API reference,and making the necessary steps in order to develop on the BREW SDK. Reading relevant information from the BREW API reference,and making the necessary steps in order to develop on the BREW SDK. Writing a first simple program on the simulator, and running it. Writing a first simple program on the simulator, and running it. Building the infrastructure of the connection between two devices, by sockets, and understanding how connection works. Building the infrastructure of the connection between two devices, by sockets, and understanding how connection works.

19 Project Steps (Cont.) Implementation of each protocol step: the implementation is based on sending special messages to the device according to the protocol of each step via a socket which listens on a selected port, then receiving messages from the device,via the same socket, parsing the message, getting needed information from it, and updating the control point data structure according to this information. Implementation of each protocol step: the implementation is based on sending special messages to the device according to the protocol of each step via a socket which listens on a selected port, then receiving messages from the device,via the same socket, parsing the message, getting needed information from it, and updating the control point data structure according to this information. The last step is building a GUI, which offers a friendly interface to make the protocol usage easy and funny!! The last step is building a GUI, which offers a friendly interface to make the protocol usage easy and funny!!

20 Special Challenges and Solutions Multicasting: the protocol is based on sending http multicast messages at the discovery step, however we don’t have the ability to do such a thing, since the BREW SDK doesn’t support multicasting. Multicasting: the protocol is based on sending http multicast messages at the discovery step, however we don’t have the ability to do such a thing, since the BREW SDK doesn’t support multicasting. Synchronization problems such like listening to many sockets at the same time, and updating the data structure when getting information from the device: we bypassed these problems by using callback functions that act when a special events occur. Synchronization problems such like listening to many sockets at the same time, and updating the data structure when getting information from the device: we bypassed these problems by using callback functions that act when a special events occur. Parsing the XML format messages: we implemented a special XML parser that satisfies our needs. Parsing the XML format messages: we implemented a special XML parser that satisfies our needs.

21 The Control Point: Data Structures and Modules

22 The Control Point Data Structure The control point struct contains: The control point struct contains: Identifier Identifier Connection sockets (one socket for each protocol step) Connection sockets (one socket for each protocol step) List of connected devices List of connected devices ……. …….

23 Cont. The device struct contains: The device struct contains: Information about the device : device type,device version, identifier,name and manufacturer. Information about the device : device type,device version, identifier,name and manufacturer. The device description URL. The device description URL. List of UPnP Services. List of UPnP Services.

24 Cont. The service struct contains: The service struct contains: Information about the service : service version, service ID and service type. Information about the service : service version, service ID and service type. Service Description URL. Service Description URL. Control URL. Control URL. Subscription URL. Subscription URL. List of actions that can be invoked by this service. List of actions that can be invoked by this service. List of state variables. List of state variables. ….. …..

25 Cont. Each control action has a name and a list of arguments. Each control action has a name and a list of arguments. A state variable struct is consisted of: A state variable struct is consisted of: Name, data type, default value and value. Name, data type, default value and value.

26 Data Structure Schema Data Structure Schema Control Point ID Sockets Device List UDP Socket Description Sockets Control Socket Subscription Socket Eventing Socket Device 1Device 2 ………. Service 1Service 2 Control Action 1 State variable 1 ……….

27 Main Modules Building message module: creating messages according to the protocol syntax rules in every step of the protocol. Building message module: creating messages according to the protocol syntax rules in every step of the protocol. Discovery Module: this module actually activates the control point, and creates UDP socket,sends, receives and reads messages in the Discovery step, and according to these messages updates the data structure. Discovery Module: this module actually activates the control point, and creates UDP socket,sends, receives and reads messages in the Discovery step, and according to these messages updates the data structure. Device description and Service Description Modules: creating connection, sending, receiving and reading messages in the description step, and according to these messages updating the data structure. Device description and Service Description Modules: creating connection, sending, receiving and reading messages in the description step, and according to these messages updating the data structure.

28 Cont. Control Module: creating connection, sending, receiving and reading messages in the control step of the protocol. Control Module: creating connection, sending, receiving and reading messages in the control step of the protocol. Eventing Module: creating connection, reading, sending and receiving eventing and subscription messages in the eventing step, and updating the data structure if needed. Eventing Module: creating connection, reading, sending and receiving eventing and subscription messages in the eventing step, and updating the data structure if needed. List Module: removing, adding and getting items (e.g devices, services) from the lists in the data structure. List Module: removing, adding and getting items (e.g devices, services) from the lists in the data structure.

29 Cont. Parsing Module: Parsing different formats of messages according to the protocol step. (e.g. control,eventing messages). Parsing Module: Parsing different formats of messages according to the protocol step. (e.g. control,eventing messages). Menu Module: This module creates graphical interface, that makes the usage of the protocol services easy and funny!! Menu Module: This module creates graphical interface, that makes the usage of the protocol services easy and funny!!

30 User Interface

31 The Protocol Interface The service we have tested is a clock: the control point sends a request to the device (demo device in this case) which reply with the time. The service we have tested is a clock: the control point sends a request to the device (demo device in this case) which reply with the time. The state variable is the location of the device. The state variable is the location of the device. At first the user chooses the protocol icon on the mobile, then he/she clicks start: At first the user chooses the protocol icon on the mobile, then he/she clicks start:

32 Cont. The control point starts searching for a device (discovery step). The control point starts searching for a device (discovery step). Afterwards the control point discovers a device and proposes getting the device description. Afterwards the control point discovers a device and proposes getting the device description.

33 Cont. The user is asked if he is interested in getting the service description (Description step): The user is asked if he is interested in getting the service description (Description step):

34 Cont. Control Step: The device is ready to invoke an action : Control Step: The device is ready to invoke an action :

35 References Universal Plug and Play forum, http;//www.upnp.org Universal Plug and Play forum, http;//www.upnp.org UPnP architecture, http://www.upnp.org/resources/documents/CleanUPnPDA101- 20031202s.pdf UPnP architecture, http://www.upnp.org/resources/documents/CleanUPnPDA101- 20031202s.pdf Intel’s UPnP SDK for Linux, http://developer.intel.com/ial/upnp/ Intel’s UPnP SDK for Linux, http://developer.intel.com/ial/upnp/ Simple object access protocol, http://www.w3.org/TR/SOAP/ Simple object access protocol, http://www.w3.org/TR/SOAP/ http://www.artima.com/spontaneous/upnp_digihome2.html http://www.artima.com/spontaneous/upnp_digihome2.html http://www.artima.com/spontaneous/upnp_digihome2.html http://brewforums.qualcomm.com/ http://brewforums.qualcomm.com/


Download ppt "Universal Plug and Play (UPnP) Presented by: Kamal Kamal Kamal Kamal Mohammad Atieh Mohammad Atieh."

Similar presentations


Ads by Google