Contents T-110.5140 Network Application Frameworks and XML „ Mobile Middleware ‹ Motivation Mobile Middleware ‹ Examples

„ Summary 18.3.2008 Sasu Tarkoma

Mobile Middleware I Mobile Middleware II

„ Middleware is typically designed and „ Goals for middleware: implemented for fixed-network hosts ‹ fault-tolerance, adaptability, ‹ High bandwidth, low latency, reliable heterogeneity,scalability, resource sharing

communication „ Mobile middleware ‹ Persistent storage and sufficient computing ‹ dynamically changing context power ‹ decoupled ‹ No mobility ) events, tuple spaces „ Mobile environment requires new ‹ Basic solution for wireless solutions ) Use a proxy ‹ Existing middleware services do not scale ‹ Previous lectures: mobility is challenging ‹ Small devices / embedded systems pose totally different challenges

Secure Reflection WAE mobile XML Middleware routing

„ In general, middleware provides IPv6 .NET Objects transparency to the underlying conditions XML mobility, ‹ Location transparency in RPC/RMI J2ME HIP „ In mobile environments this is not always desired Symbian NAF ‹ Sometimes we need to know about location changes, QoS changes, etc. Mobility Security „ Requirement for reflective middleware Wireless ‹ Should expose for querying / changing CORBA important parameters ‹ Under development Plain IPv4 MIP

1 WAE Examples

„ Wireless Application Environment (WAE) ‹ A suite of protocols and specifications for „ WAE optimizing data transfer for wireless communication „ J2ME „ WAP stack „ Symbian ‹ Focus on binary transmission „ MAEMO ‹ Protocols „ Android ) WSP (Wireless Session Protocol) „ Wireless CORBA • HTTP replacement, “compressed” ) WTP (Wireless Transaction Protocol) „ • Request/response, more efficient than TCP „ Pervasive Computing Middleware ) WTLS (Wireless Transport Layer Security) „ Fuego • Based on TLS, may not be end-to-end with a gateway ) WDP (Wireless Datagram Protocol) • UDP replacement

Programming model Web Access

„ Data transformation encoded Client Gateway Server ‹ WAP gateway performs data transformation request request between WML (or XHTML) and HTML „ Data compression Encoders HTTP ‹ Technique are used for dealing with images and Decoders Server Web wireless other graphics Browser „ Adaptability ‹ User profile and device characteristics are stored in the WAP gateway Protocol encoded Gateways response CGI,.. „ Security response ‹ Secure Enterprise Proxy (SEP) using 128-bit encryption in WAP 1.2 „ Service discovery and mobility support ‹ WAP’s “walled garden” – WAP gateways are provided by ISP such as AOL

Comparison WAE: current status

WAE Other „ WAP Forum now in OMA (Open Mobile Alliance) HTML/JSHTML/JS WAE Other „ WAP 2.0, is a re-engineering of WAP using a cut- down version of XHTML with end-to-end HTTP SessionSession Layer Layer (WSP) (WSP) „ Gateway and custom protocol suite is optional. HTTP HTTP „ WAP used by many handsets TransactionTransaction Layer Layer (WTP) (WTP) ‹ 1.2 version introduced WAP Push (typically using an SMS message)

TLSTLS - - SSL SSL SecuritySecurity Layer Layer (WTSL) (WTSL) „ Typically versatile networking stacks with also IPv6 support TransportTransport Layer Layer (WDP,UDP) (WDP,UDP) TCP/IPTCP/IP UDP/IPUDP/IP Bearers:Bearers: SMS,CDMA,..SMS,CDMA,..

2 2 Platform Micro Edition (J2ME)

„ Java for consumer electronics and embedded devices

„ A virtual machine and a set of APIs

„ Configurations and profiles ‹ Configurations ) two-low level APIs and optimized VMs • CDC, CLDC ‹ Profiles ) API specification on top of a configuration for complete runtime ) CLDC: MIDP ) CDC: Foundation, Personal Basis, Personal ) Specify both APIs and Configurations Source: http://developers.sun.com/techtopics/mobility/getstart/articles/survey/ ) Profiles defined using (JCP)

J2ME optional packages CLDC Technology

„ Connected Limited Device Configuration (CLDC); JSR 30, „ JSR 172: J2ME Web Services Specification JSR 139 „ Content Handler API (CHAPI) JSR 211 „ Mobile Information Device Profile (MIDP); JSR 37, JSR 118 „ Information Module Profile, (IMP); JSR 195 ‹ allows the invocation of J2ME platform applications „ Java Technology for the Wireless Industry, (JTWI); JSR 185 from native applications and vice versa „ Wireless Messaging API (WMA); JSR 120, JSR 205 „ Security and Trust Services JSR-177 „ Mobile Media API (MMAPI); JSR 135 „ Location API for J2ME; JSR 179 „ J2ME Client Provisioning JSR-124 „ SIP API for J2ME; JSR 180 ‹ J2ME Client Provisioning Specification defines a „ FileConnection and PIM API (JSR-75) server partitioning standard for provisioning „ Security and Trust Services API for J2ME, (SATSA); JSR-177 applications. „ Mobile 3D Graphics; JSR-184 „ J2ME Web Services APIs, (WSA); JSR 172 „ Mobile Media API JSR-135 „ Bluetooth API (JSR-82, Motorola, Java Partner Site) „ J2ME Content Handler API, (CHAPI); JSR 211

CDC Technology Symbian

„ Connected Device Configuration (CDC); JSR 36, „ OS for handheld devices with limited JSR 218 resources

„ Foundation Profile, (FP); JSR 46, JSR 218 „ User interface framework „ Personal Basis Profile, (PBP); JSR 129, JSR 217 „ APIs (++) „ Personal Profile, (PP); JSR 62, JSR 216 „ Tools „ J2ME RMI Optional Package, (RMI OP); JSR 66 „ „ JDBC Optional Package for CDC/Foundation ‹ Pre-emptive, multitasking, multithreading, Profile API; JSR 169 memory protection „ Java TV API; JSR 927 ‹ Event-based, active objects „ Java Secure Socket Extension for Connected ‹ Memory conservation, reliability, CPU Device Configuration (JSSE) optimizations

3 Software Components Symbian architecture

„ Kernel UI Framework ‹ Manages and controls access to hw Java J2ME ‹ Hw-supported privileges, kernel mode Application Services „ Application ‹ Program with a user interface ‹ Runs in user mode in its own process Generic OS Comms Multimedia & Connec-

„ Server Services Services Graphics Srv. tivity Srv. ‹ Program without a user interface ‹ Manages resources, provides interface to clients Base Services ‹ File server, window server, comms, ..

„ Engine ‹ Application part that manipulates data, typically Kernel Services & Hardware Abstraction separate DLL

MAEMO

„ Open Source development platform for Nokia Internet Tablets and other - based devices

„ Maemo SDK

„ www.maemo.org

Android Wireless CORBA

„ Mobile OS and application platform from „ CORBA does not support accessing „ mobile objects or wireless „ Linux kernel communication „ Open Source (not yet available) ‹ Wireless CORBA specification „ Uses Java to build applications (Java SE class parts from project) „ Three basic requirements „ Optimized virtual machine called ”” ‹ Invocations from mobile objects ‹ Runs .dex files (derived from .class or .) ‹ Invocations to mobile objects ‹ Relies on underlying system for process isolation, memory mng, and threading ‹ Wireless communication

„ Independent of Sun and JCP „ Home bridge

„ Java APIs for basic comms, location, SQLite, „ Access bridges OpenGL, SyncML „ Tunnelling over wireless

„ Handoff protocols

4 Mobile IP vs. WCORBA Architecture• Redirects requests for • Abstract transport-independentservices on the terminal tunnel• Encapsulates, for GIOP forwardsmessages• Keeps or ignores track of the current • Other side end of the Access Bridgeaccess bridge „ MIP addresses host mobility, not object incoming GIOP messages • Encapsulate/decapsulates• Concrete tunnels for msgs TCP/IP, mobility • Decapsulates and forwards • GeneratesUDP/IP mobility and events WAP WDP. „ MIP does not specifically support • Protocolmessages requires from thereliable GIOP and tunnel wireless protocols ordered• Generates delivery mobility events • Lists available services „ MIP hides all handoff events ‹ location-aware services difficult to implement

Handoffs Network Initiated Handoff

„ Network initiated handoff ‹ started by an external application ‹ optional to support make-before-break

„ Terminal initiated handoff ‹ terminal discovered a new Access Bridge ‹ make-before-break is required

„ Access recovery

„ The Home Location Agent is updated

„ Old Access Bridges are informed

„ Mobility events are generated in the visited domain and the terminal domain

Mobile Web Server Overview

„ Port of Apache web server to Symbian S60

„ Custom gateway to connect mobile servers with the Internet ‹ The firewall/NAT problem Webserver Browser „ Link 2 1 ‹ http://research.nokia.com/research/projects/m 3 obile-web-server/index.html 2.5/3G Operator Firewall DNS Gateway Internet

By courtesy of Johan Wikman Presented in EuroOSCON 2006

5 Pervasive computing middleware Projects Key Issues UIC Heterogeneity of devices and networks: It helps users to specialize to the particular Fuego Core (HIIT) properties of different devices and network environments X-Middle Disconnected operations in mobile applications: It allows mobile users to share data when they are connected, or replicate the data and perform operations on them off-line when they are disconnected; data reconciliation takes place when user gets reconnected „ Mobile and wireless environments have different requirements than desktop Gaia Dynamic adaptation to the context of mobile applications: It supports the development and execution of portable applications in active spaces systems Lime Programming constructs which are sensitive to the mobility constraints: It explores ‹ User mobility, terminal mobility, connectivity, the idea by providing with a global virtual data structure and a tuple space device characteristics, dynamic environments (Tspace), whose content is determined by the connectivity among mobile hosts „ Vision: A service application is Tspaces Asynchronous messaging-based communication facilities without any explicit support for context-awareness: It explores the idea of combination of tuple space distributed among various application (Tspace) and a database that is implemented in Java. Tspace targets nomadic servers, network elements and terminals environment where server contains tuple databases, reachable by mobile devices roaming around „ Three year Tekes project (2002-2004) L2imbo QoS monitoring and control by adapting applications in mobile computing environment: It provides the facilities of multiple spaces, tuple hierarchy, and QoS ‹ Industrial partners: Nokia, TeliaSonera, Elisa, attributes Ericsson, Movial Aura Distraction-free pervasive computing: It develops the system architecture, algorithms, ‹ Open source software interfaces and evaluation techniques to meet the goal of pervasive computing „ Demonstration at WMCSA 2004

Ubiquitous and Pervasive software Fuego Architecture MobileMobile Services Services MobileMobile Applications Applications PresencePresence Service Service

„ The Fuego middleware service set for PresencePresence Client Client Sync. File mobile computing System Event Service Sync.FileSync.File system system Filter Service ‹ Data communication Event Bus ) Efficient wireless SOAP Filter Service ServletsServlets ApacheApache Axis Axis ) Efficient content-based routing (asynchronous events) JettyJetty WirelessWireless SOAP SOAP JettyJetty WirelessWireless SOAP/SOAP SOAP/SOAP ‹ Data synchronization ) 3-way XML document merging HTTPHTTP 1.1 1.1 BEEPBEEP HTTPHTTP 1.1 1.1 BEEPBEEP ) XML-aware distributed file system TCP ‹ Applications ) Presence service, mobile ticker, image-album Host Identity Protocol (HIP) IPIP Mobile Clients Distributed Servers

AutomaticAutomatic reconciliation reconciliation of of XML XML documents documents OptimizedUbiquitous storage and of PervasiveXML software Optimized storage ofExpressiveExpressive XML async. async. communication communication Ad-hocAd-hoc file file sharing sharingContent-based routingMobileMobile using Services Services filters PresencePresence service serviceContent-based based based on on routingevents events using filters FUEGO DEMO IntegratesIntegrates with with existing existing file file systems systemsEvent buffering (NFS) (NFS) / mobility support MobileMobile Applications ApplicationsControlControl of of presence presenceEvent attributebufferingattribute visibility visibility/ mobility support SupportSupport for for context-aware context-awarePresencePresence operation Serviceoperation Service

PresencePresence Client Client Sync. File EfficientEfficient sync/async sync/async messaging messagingSystem Event Service Sync.FileSync.File system systemEfficientEfficient XML XML serialization serialization Filter Service PersistentPersistent Eventconnections connections Bus across across mobility mobility Reliable messaging Filter Service ServletsServletsReliable messagingApacheApache Axis Axis MultiplexingMultiplexing multiple multiple connections connections on on TCP TCP Jetty PrioritizationPrioritizationJetty of of connections connections Jetty End-to-endEnd-to-endWireless Wirelessauthentication authentication SOAP SOAP of of hosts hosts Jetty WirelessWireless SOAP/SOAP SOAP/SOAP EncryptionEncryption of of network network traffic traffic using using IPsec IPsec HTTPHTTP Mobility1.1 Mobility1.1 and and multihoming multihomingBEEPBEEP support support HTTPHTTP 1.1 1.1 BEEPBEEP ResilientResilient sockets sockets TCP Host Identity Protocol (HIP) IPIP Mobile Clients Distributed Servers

6 Summary

„ Mobile middleware ‹ Desktop middleware not usable on small, mobile devices ‹ Special solutions are needed ‹ J2ME, WAE, Wireless CORBA, ..

„ Current trend ‹ Flexibility, decoupled nature ‹ Convergence / unification

7