1 / 31

11a. Networking and Mobile Devices

11a. Networking and Mobile Devices. Introduction Problems Patterns and considerations Sample techniques Mobile Java and web services Symbian OS and Bluetooth Maemo and WLAN Summary. Introduction. Fundamentally, mobile devices liberate from the restrictions associated with a location

nalani
Download Presentation

11a. Networking and Mobile Devices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 11a. Networking and Mobile Devices • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and web services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  2. Introduction • Fundamentally, mobile devices liberate from the restrictions associated with a location • Physical distribution • Basic laws of distributed systems development apply • Can be taken as yet another resource whose accessing can be slower • E.g. memory • Special issues • Basic connectivity; associated with numerous different technologies • Proxies, bridges, and gateways • Statefulness vs. statelessness; associated with restricted bandwidth • Each station can have its own state vs. no stored state • Testing related complications • Stateless can implement stateful by carrying all state information in transmissions • Infrastructure assisted or ad-hoc between peers via e.g. Bluetooth connection • Servers and registry components vs. dynamic service discovery and formation Mobiiliohjelmointi Kevät 2009

  3. Station 2 Proxy WirelessStation Fixed domain Wireless domain Station 1 From Fixed to Wireless:Proxy approach Mobiiliohjelmointi Kevät 2009

  4. Corba invocations object object GIOP GIOP GTP GTP IIOP IIOP Adaptation and transport Adaptation and transport TCP TCP Terminal Access bridge Other ORB wireless fixed Example Proxy: Wireless Corba Mobiiliohjelmointi Kevät 2009

  5. WAP device Web server WAP gateway WAE WAE HTTP WSP WSP HTTP WTP WTP SSL WTLS WTLS SSL TCP WDP WDP TCP IP Bearer Bearer IP Example Proxy: WAP Mobiiliohjelmointi Kevät 2009

  6. Application layer: Wireless application environment (WAE) (includes WML and WMLScript) Session layer: Wireless session protocol (WSP) Transaction layer: Wireless transaction protocol (WTP) bypassing apps Security layer: Wireless transport layer security (WTLS) Transport layer: Wireless datagram protocol (WDP) Bearers (SMS, CSD, GPRS,...) WAP Stack in Device Mobiiliohjelmointi Kevät 2009

  7. Content and goals • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and Web Services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  8. Special characteristics induce some fundamental problems • Bandwidth restrictions (GPRS, WCDMA, WLAN, …) • Communication packet travel times • Different gateways etc. lead to an extended travel times in communication • Lack of an established specialized standard • Internet technologies copied, adapted, extended, etc. • Telecommunications originated technologies evolving to different directions, different contexts, and adapting properties from Internet communications • Different devices implement a different set of features, so implementing a system that works in all combinations is hardened • Cost of connection and passing information • Money • Energy • Service providers not interested in implementing numerous versions of the same service • Special tools for automatically configuring a service Mobiiliohjelmointi Kevät 2009

  9. Content and goals • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and Web Services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  10. Restrictions and disclaimers • We will mostly be looking inside mobile devices, not to • Network architectures • Individual protocols • Related consequences • Optimizations that are only available for a device manufacturer (or its subcontractors) are overlooked • In other words, these should not be something whose use can be restricted • Focus on what an application developer can do when composing a networking application Mobiiliohjelmointi Kevät 2009

  11. Goals • Be prepared to hide long loading times; preserve the feeling of being in control from the user’s perspective • Proactiveness when applicable • Take into account adaptation needs associated with the facilities of a particular device • Installation base? • Always let the user know what is taking place regarding communications • Cost, no response, etc. • Fail with style! Mobiiliohjelmointi Kevät 2009

  12. Design idioms and patterns • Use a networking wrapper that can be reimplemented if communication techniques/requirements change • Porting requirements • Treat networking features as yet another resource • Resource management and explict allocation • May not be always available, so certain dynamic characteristics must be built in • Allocate responsibility for networking operations to a some particular unit of the system • Async networking library may do this for you automatically • Manually: One thread for the network, one for UI • Stateless vs. stateful applications • Often predetermined by the requirements that originate from assumed user group Mobiiliohjelmointi Kevät 2009

  13. Considerations • Telephony or data communications? • Telephony • SMS, MMS • Commonly rapid connections (something may be taking place behind the curtains however) • Network push is ok • Data communications • GPRS, 3G, WLAN • Long connection time • How to make a network initated operation? • Push or pull? • Connection speed? • Cost? Mobiiliohjelmointi Kevät 2009

  14. Content and goals • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and web services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  15. Web Services Overview UDDI servicelookup WSDL servicedescription Web service device serviceuse Mobiiliohjelmointi Kevät 2009

  16. Web Service (Cont’d) • Application model • No particular model; offers independent services • Finding web services • UDDI • WS Dynamic Discovery • Service use • Acts as a service, not as an object • Bearers • SOAP • Fundamentally bearer independent, practical implementations commonly use HTTP Mobiiliohjelmointi Kevät 2009

  17. MIDP Java and Web Services LocalApplication • Application calls stub • Stub calls WB via SPI • SPI opens a connection to remote WS • Remote computer serves the request 1 Stub RemoteServices 2 Service ProviderInterface 3 Local Client 4 Network Device Mobiiliohjelmointi Kevät 2009

  18. APIs and Tools • Java API for XML processing (JAXP) • Non-validating parser intended to parse incoming XML documents • Java API for XML-based RPC (JAX-RPC) • Implementation of RPC • Service Provider Interface (SPI) • Stub generation in a compatible fashion • Stub Generator • Generation of client-side proxy that can be called by the application to make calls to WS Mobiiliohjelmointi Kevät 2009

  19. Architecture <<interface>>java.rmi.Remote javax.microedition.xml.rpc.* <<interface>>javax.xml.rpc.Stub <<interface>>Service Interface javax.xml.rpc.JAXRPCException javax.xml.namespace.QName <<interface>>java.rmi.Remote Stub Vendor-specific JAX-RPC classes <<interface>>Service Interface Application Mobiiliohjelmointi Kevät 2009

  20. Content and goals • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and web services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  21. BT HOST (Laptop, MCU) app2 app1 UDP/TCPIP PPP RFCOMM SDP L2CAP Host Controller Interface Driver Physical connection (USB/UART/I2C...) BT HW Host Controller Interface Driver Link manager Baseband controller Bluetooth Architecture Mobiiliohjelmointi Kevät 2009

  22. Bluetooth (Cont’d) • Application model • No particular model; offers independent services • Bluetooth profiles define different applications • Finding BT services • SDP • Service use • RFCOMM, serial port emulating protocol, can be used as a bearer for more complex protocols • Other protocols for using certain standardized services (e.g. OBEX) • Bearers • Own radio technology (frequency 2,4000-2,4835GHz) Mobiiliohjelmointi Kevät 2009

  23. Symbian Bluetooth Facilities • Service Database • Hosts information that can be used by other devices • Used via Database Server API (RSdp), actual database characterized by RSdpDatabase • Service discovery • Used to find devices, services and service attributes • Discovery agent (CSdpAgent) for configuring and starting the search • Notifier interface (MSdpAgentNotifier) for callbacks • Service use • E.g. socket communication Mobiiliohjelmointi Kevät 2009

  24. Service record creation CBTApp RSdp RSpdDatabase Connect() Open() CreateServiceRecordL() UpdateAttributeL() UpdateAttributeL() UpdateAttributeL() UpdateAttributeL() Mobiiliohjelmointi Kevät 2009

  25. Bluetooth service discovery Framework CBTApp CSdpAgent NewL() ListServicesL() SetRecordFilterL() NextRecordRequestL() NextRecordRequestComplete() AttributeRequestL() AttributeRequestResult() AttributeRequestComplete() NextRecordRequestL() . . . Mobiiliohjelmointi Kevät 2009

  26. Content and goals • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and Web Services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  27. Infrastructure • When active WLAN is visible to apps as network access • No need for further complications when the system is up and running • Selection of the framework and actions taken when something changes to be defined • Framework for selecting the correct network and managing the existence of the access Mobiiliohjelmointi Kevät 2009

  28. On Connection Event // Define events that will occur as changes occur in networking conditions. static void on_connection_event(ConIcConnection *connection, ConIcConnectionEvent *event, gpointer user_data) { switch(con_ic_connection_event_get_status(event)) { case CON_IC_STATUS_CONNECTED: connected = TRUE; break; case CON_IC_STATUS_DISCONNECTED: case CON_IC_STATUS_DISCONNECTING: default: connected = FALSE; break; } } Mobiiliohjelmointi Kevät 2009

  29. Initialize networking // Initializes networking functionality. If a non-zero value is returned, the // operation is considered successfull, otherwise a failure is assumed. ConIcConnection * InitializeNetworking() { ConIcConnection *myConnection = con_ic_connection_new(); if(myConnection) { g_signal_connect(G_OBJECT (myConnection), "connection-event", G_CALLBACK (on_connection_event), NULL); g_object_set(myConnection, "automatic-connection-events", TRUE, NULL); con_ic_connection_connect(myConnection,CON_IC_CONNECT_FLAG_NONE); } return myConnection; // The return value is simply used as a boolean value. } Mobiiliohjelmointi Kevät 2009

  30. Content and goals • Introduction • Problems • Patterns and considerations • Sample techniques • Mobile Java and Web Services • Symbian OS and Bluetooth • Maemo and WLAN • Summary Mobiiliohjelmointi Kevät 2009

  31. Summary • Network resources form yet another layer of facilities and resources for applications • Longish travel-through times • Restricted support for handovers can sometimes cause problems (e.g. IP address change) • Firewalls, etc. • Number of design patterns that apply to the design of the applications relying on the use of network • Interactivity is a key goal! Mobiiliohjelmointi Kevät 2009

More Related