Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vakgroep Informatietechnologie Deel III: Paradigma’s Software Ontwikkeling 4. Ontwerp van Telecom Services Prof.Dr.Ir. Filip De Turck.

Similar presentations


Presentation on theme: "Vakgroep Informatietechnologie Deel III: Paradigma’s Software Ontwikkeling 4. Ontwerp van Telecom Services Prof.Dr.Ir. Filip De Turck."— Presentation transcript:

1 Vakgroep Informatietechnologie Deel III: Paradigma’s Software Ontwikkeling 4. Ontwerp van Telecom Services Prof.Dr.Ir. Filip De Turck

2 Vakgroep Informatietechnologie Domotica Telecom Services

3 Software Ontwikkeling I Home Use case RFID reader 1 11

4 Software Ontwikkeling I Need for User Priorities RFID reader 2 1 2 2 1 UserPriority 13 25 Home Use Case (with user priorities) : User Policies are not supported in OSGi -> research topic

5 Software Ontwikkeling I Need for Service Priorities RFID reader 1 End user Service Priority Video on demand 1 Surveillance9 Home Surveillance Service 1 DANGER Home Use Case (with user priorities) :

6 Software Ontwikkeling I RFID reader 1 End user Service Priority Video on demand 1 Surveillance9 Home Surveillance Service 1 DANGER Home Use Case (with service priorities) :

7 Software Ontwikkeling I Technical realization of user and service policy enforcement End user Service Priority Video on demand 1 Surveillance9 Home Surveillance Service UPnP Media Streamer UPnP Media Render OSGi Service Gateway

8 Software Ontwikkeling I Home networks Intelligente Router Gateway tot het home netwerk Besturing security systeem  Software + framework Complete afscherming gebruiker (black box) Home netwerk Apparaten Protocollen Vermelde technologieën X10 OSGi Software Elektriciteitsnet X10 USB

9 Software Ontwikkeling I X10 Intelligente router Apparaat X10 Controller X10 Module Lichtnet opdracht adres commando Voor mij?

10 Software Ontwikkeling I Cross compiling Makefile CC=/usr/crossdev/mips/bin/mips-linux-gcc LD=/usr/crossdev/mips/bin/mips-linux-ld all: test test: test.c $(CC) -g -c test.c $(LD) -o test test.o –lc –lx10 # $(CC) -static -o test test.c libx10.a clean: rm -f test *.o

11 Software Ontwikkeling I Example Code #include #include "x10_api.h" void new_error_handler(int code, char *arg, struct x10_status_t *status); void function_hook(unsigned char house, int unit, int function, int dim_level, struct x10_status_t *status); int main(int argc,char **argv) { struct x10_status_t *status; int return_code; /* We open the API */ if(!(status=x10_open("/dev/ttyS0", new_error_handler, function_hook, 10000000))) { fprintf(stderr,"Could not open the serial port %s !\n",argv[1]); exit(1); } printf("\n\nNow turning ON the A5 module...\n"); return_code = x10_send_cmd('A', 5, X10_CMD_ON, 0, status); printf("x10_send_cmd return code = %d\n",return_code); x10_close(status); }

12 Vakgroep Informatietechnologie Enabling Java-based VoIP backend platforms through JVM performance tuning

13 Software Ontwikkeling I Outline Introduction Java 4 Telecom Evaluation Setup Java Virtual Machine Default behavior Possible Optimizations Optimized Behavior Results Conclusions

14 Software Ontwikkeling I Introduction Software backend platforms are increasingly popular in VoIP offerings. Java is currently one of the most popular programming languages for implementing business logic. Is Java suitable for implementing VoIP and telecom related applications? Java Application Servers for Telecom related applications are emerging: SIP Servlet JAIN SLEE

15 Software Ontwikkeling I Telecom Applications: VoIP Telecom related applications have very specific requirements Low Latency High Throughput Example: Softswitch How fast can it set up a call? How many calls can in set up per second? Java 4 Telecom?

16 Software Ontwikkeling I Java Virtual Machine: Features Java Byte Code is executed by a virtual Machine This makes it platform independent Java features automatic Memory Management and a Garbage Collector This simplifies the task of the developer

17 Software Ontwikkeling I Java Virtual Machine: Problems Java Byte Code is executed by a virtual Machine This can be a performance penalty Java features automatic Memory Management and a Garbage Collector This can cause a performance penalty due to unpredictable behavior of the system.

18 Software Ontwikkeling I Evaluation: Proxy 200 benchmark OK [200] BYE ACK OK [200] Ringing [180] Trying [100] Invite Ringing [180] OK [200] ACK BYE OK [200] Media transfer AliceProxyBob Measured Time Interval No Media Session started when benchmarking

19 Software Ontwikkeling I Evaluation Setup: Hardware Alice Bob Proxy Perform routing Internet Dual Opteron 1.6Ghz 2GB RAM Linux kernel 2.6

20 Software Ontwikkeling I Evaluation Setup: Software SIP Servlet BEA Weblogic SIP Server JAIN SLEE Open Cloud Rhino Benchmark software SIPp (test tool / traffic generator for the SIP protocol)

21 Software Ontwikkeling I SIP Servlet: Architecture Container based Life cycle management Manage network listen points Very similar to HTTP- Servlet SIP Protocol Specific Request Response Model

22 Software Ontwikkeling I JAIN SLEE: Architecture Container based Life cycle management Protocol Agnostic Resource Adaptors allow protocols to be “plugged in” Manage network Listen Points Event driven and asynchronous Application client

23 Software Ontwikkeling I Results: SIP Servlet (default) 25 ms 50 ms

24 Software Ontwikkeling I Cause of the problems? Memory Management and Garbage Collector Legend Heap Usage GC-Time GC-occurrence Tenured Gen. Young Gen. long lasting GC heap resizing low response time Image created with gcviewer (http://www.tagtraum.com/gcviewer.html)

25 Software Ontwikkeling I Solution: Virtual Machine Tuning Memory Organization Garbage Collection

26 Software Ontwikkeling I Young generation Tenured generation Eden Survivor Virtual TenuredPerm Perm generation Tiny Survivor Spaces Virtual Tenured Perm Eden Memory Tuning Fixed Young Generation Size Total Heap Size large enough Other Generation Sizes NOT Fixed

27 Software Ontwikkeling I Default All generations Parallel & Concurrent All generations Concurrent Only for tenured generation Parallel Only for young generation Garbage Collector Tuning Long GC pauses Multi- threaded GC GC partially parallel with Application Execution Performance implications: More resources are spent on Garbage Collection

28 Software Ontwikkeling I Tuning Options -Xmx512m -XX:MaxNewSize=32m -XX:NewSize=32m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycleMin=0 -XX:CMSIncrementalDutyCycle=10 -XX:+UseTLAB -XX:MaxTenuringThreshold=0 -XX:SurvivorRatio=128 Sizing of the memory generations Selection of the Garbage Collector Allow multi- threaded memory allocation Move long living objects to Tenured Generation

29 Software Ontwikkeling I Problems solved? Legend Heap Usage GC-Time GC-occurrence Tenured Gen. Young Gen. No long lasting GC No heap resizing low response time Image created with gcviewer (http://www.tagtraum.com/gcviewer.html)

30 Software Ontwikkeling I Results: SIP Servlet 25 ms 50 ms Higher CPU load Improved Latencies

31 Software Ontwikkeling I Results: JAIN SLEE (untuned) 25 ms 50 ms

32 Software Ontwikkeling I Results: JAIN SLEE 25 ms 50 ms

33 Software Ontwikkeling I Conclusions Java Technologies can simplify the Design and Management of Telecom and VoIP related applications Java Virtual Machine Tuning can improve the Java Garbage Collection significantly Java Application Servers combined with appropriate tuning can meet strict Low Latency Requirements

34 Vakgroep Informatietechnologie Telecom Services on handheld devices

35 Software Ontwikkeling I Handheld devices – different OS In-house / specific Windows Mobile Symbian OS Embedded Linux Palm OS BlackBerry

36 Software Ontwikkeling I Handheld devices – J2ME Device / Hardware Native Operating System Configuration Profile Optional Packages Vendor- specific classes Applications modular and scalable architecture Configuration: CLDC / CDC Profiles: MIDP / FP / P (basis) P Mobile phones: MIDP 2.0 CLDC 1.1 “MIDlet (suite)” WMA, MMAPI, Bluetooth APIs Nokia UI

37 Software Ontwikkeling I Handheld devices – J2ME Development steps for a MIDP application 1.Compilation using an ordinary Java compiler 2.Conversion of the classes to CLDC format (preverification) 3.Creation of the manifest file 4.Packaging into a JAR-file (+ creation of the JAD-file) 5.Installation onto the target device - through WAP - through PC-connection (e.g. Nokia’s PC Suite) SUN’s WTK IDE Netbeans Mobility Pack

38 Software Ontwikkeling I Handheld devices – J2ME Code Examples Webaccess- through HttpConnection String getViaHttpConnection(String url) throws IOException { HttpConnection c = null; InputStream is = null; StringBuffer str = new StringBuffer(); try { c = (HttpConnection)Connector.open(url); // Getting the InputStream will open the connection and read the HTTP headers. // They are stored until requested. is = c.openInputStream(); // Get the length and process the data int len = (int)c.getLength(); int ch; while ((ch = is.read()) != -1) { str.append((char)ch); } } finally { if (is != null) is.close(); if (c != null) c.close(); }

39 Software Ontwikkeling I Handheld devices – J2ME Code Examples SIP- JSR 180 “SIP API for J2ME” - defined as Optional Package - minimum requirements: CLDC 1.0 public void sendTextMessage(String msg) { SipClientConnection sc = null; try { // open SIP connection sc = (SipClientConnection) Connector.open("sip:sip.example@host.com:5060"); // initialize SIP request MESSAGE sc.initRequest("MESSAGE", null); // set some headers sc.setHeader("From", "sip:user@host.com"); sc.setHeader("Subject", "testing...");...

40 Software Ontwikkeling I Handheld devices – J2ME Code Examples... // write message body sc.setHeader("Content-Type", "text/plain"); sc.setHeader("Content-Length", Integer.toString(msg.length())); OutputStream os = sc.openContentOutputStream(); os.write(msg.getBytes()); os.close(); // close stream and send the message to the network // wait max 15 seconds for response sc.receive(15000); // response received if(sc.getStatusCode() == 200) { // handle 200 OK response } else { // handle other responses } sc.close(); } catch(Exception ex){ // handle Exceptions } }

41 Software Ontwikkeling I Handheld devices – J2ME Code Examples Video Service - JSR 135 MMAPI (Mobile Media API) - provides a framework for playing media content - designed to run with any protocol and format The method below plays a video file the on mobile device:... Player p; VideoControl vc; try { p = Manager.createPlayer(“rtsp://server/somemovie.mpg"); p.realize(); // get video control vc = (VideoControl) p.getControl("VideoControl");.... p.start(); } catch(IOException ioe) { } catch(MediaException me) { }... Note: This will only work on devices which support real time input streams!

42 Software Ontwikkeling I Handheld devices -Windows CE Windows CE = a modular OS that serves as the foundation of several classes of devices Windows Mobile = a subset of platforms based on Windows CE - high market share in the PDA market (~50%) - 2003 - Pocket PC - Smartphone - Pocket PC Phone Edition - 5.0- Pocket PC - Smartphone - Portable Media Center The Operating System

43 Software Ontwikkeling I Handheld devices - Windows CE Software development native code- Visual C++ - high performance - direct hardware access - smallest footprint managed code through the.NET CF - Visual Basic and Visual C# - Rapid Application Development - No bad pointers or memory leaks

44 Software Ontwikkeling I Handheld devices - Windows CE - subset of the.NET framework - base class libraries + few additional libraries - 2 versions : 1.0 (2003 / 2003 SE) & 2.0 (5.0).NET Compact Framework Visual C# code Visual C# code Visual Basic code Visual Basic code Compiler Common Intermediate Language Common Intermediate Runtime 0111 0100 1010 1101 0101 Common Language Infrastructure

45 Software Ontwikkeling I Handheld devices - Windows CE Code Examples Webaccess - through System.Net.WebClient The following example takes the URI of a resource, retrieves it, and displays the response. … if (args == null || args.Length == 0) { throw new ApplicationException ("Specify the URI of the resource to retrieve."); } WebClient client = new WebClient (); // Add a user agent header in case the requested URI contains a query. client.Headers.Add ("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;.NET CLR 1.0.3705;)"); Stream data = client.OpenRead (args[0]); StreamReader reader = new StreamReader (data); string s = reader.ReadToEnd (); Console.WriteLine (s); data.Close (); reader.Close (); } …

46 Software Ontwikkeling I Handheld devices - Windows CE Code Examples SIP Since Windows CE 4.2 : VoIP TUI is a fully functional, customizable, and extensible suite of common telephony features for users. Third party SIP API : http://www.independentsoft.com/

47 Software Ontwikkeling I Handheld devices - Windows CE Code Examples using Independentsoft.Sip; using Independentsoft.Sip.Sdp; … client = new SipClient("sipdomain.com","Bob","password"); client.ReceiveRequest += new ReceiveRequestEventHandler(OnReceiveRequest); client.ReceiveResponse += new ReceiveResponseEventHandler(OnReceiveResponse); client.Connect(); client.Register("sip:test.com", "sip:Bob@test.com", "sip:Bob@test.com"); Console.WriteLine("Send message to Alice or press \"q\" to exit."); string message = ""; while(message != "q"){ Console.Write("Bob:"); message = Console.ReadLine(); client.SendMessage("sip:Bob@test.com","sip:Alice@test.com",message);} client.Disconnect();} private static void OnReceiveRequest(object sender, RequestEventArgs e) { client.AcceptRequest(e.Request); if(e.Request.Method == SipMethod.Message){ Console.WriteLine("Alice:"+e.Request.Body);} …

48 Software Ontwikkeling I Handheld devices - Windows CE Code Examples Video service - through e.g. DirectX 9.0 SDK using Microsoft.DirectX.AudioVideoPlayback; public class MyVideoPlayer : System.Windows.Forms.Form {... private void OpenFile() { try { Video ourVideo = new Video("C:\\Example.avi");... }... }

49 Software Ontwikkeling I Handheld devices – Symbian OS multitasking OS designed for 2.5G and 3G mobile phones very high market share in the smartphone market (~70%) the successor of the Epoc OS started as version 6.0 and currently into version 9.2 advanced, open standard OS to its licensees (Sony) Ericsson, Nokia, Panasonic, Samsung and Siemens software development: J2ME and Symbian C++ The Operating System

50 Software Ontwikkeling I Handheld devices – Symbian OS ≠ standard C++ offers highest performance and functionality on Symbian OS 4 standardized software frameworks Resolution (pixels)User Interaction UIQ208-240 x 320 pen-based (+ small keyboard) Series 60176 x 208central navigation key Series 80 / 9200 Series640 x 200full keyboard Series 90640 x 320pen-based Symbian C++ code not complete portable between the different frameworks ( ~ 80 %)

51 Software Ontwikkeling I Handheld devices – Symbian OS Code Examples Webaccess void CHttpClient::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod) {... TUriParser8 uri; uri.Parse(aUri); RHTTPTransaction trans = iSession.OpenTransactionL(uri, *iTransObs, aMethod);... }; - creating a transaction - opening a session class CHttpClient : public CBase,... {... private: RHTTPSession iSession;... }; CHttpClient::CHttpClient() {... iSession.OpenL();...}

52 Software Ontwikkeling I Handheld devices – Symbian OS Code Examples SIP- Nokia plugin for Series 60, 2nd Edition - integrated in Series 60 Platform, 3rd Edition (v9.1) iSIP = CSIP::NewL(KAppUid, *iMySIPObserver); iConnection = CSIPConnection::NewL(*iSIP, KIapIdentifier, *iMyConnectionObserver); - initiation of the SIP client API - registration of a SIP user CleanupStack::PushL(aor); CSIPAddress* addr = CSIPAddress::DecodeL(_L8("sip:user@host.com")); CleanupStack::PushL(addr); CSIPContactHeader* contact = CSIPContactHeader::NewL(addr); CleanupStack::Pop(addr); CleanupStack::PushL(contact); CSIPRefresh* refresh = CSIPRefresh::NewLC(); iRegistration = CSIPRegistrationBinding::NewL(*iConnection, aor, contact, refresh); CleanupStack::Pop(3);

53 Software Ontwikkeling I Handheld devices – Symbian OS Code Examples Video service - CVideoPlayerUtility provides a simple interface to open, play and obtain information from sampled video data. The video data can be supplied either in a file, a descriptor or a URL - streaming supported ( MVideoLoadingObserver) class CRMMVideoRenderer : public CBase, public MVideoPlayerUtilityObserver, public MVideoLoadingObserver { private: CVideoPlayerUtility* iVideoPlayerUtility; …} … iVideoPlayerUtility = CVideoPlayerUtility::NewL( *this, iPriority, iPref, iWindowSession, *iScreenDevice, iDisplayWindowhandle, iDisplayWindowRect, iClipWindowRect ) … // turn on the status reporting for connecting, buffering, and re-buffering iVideoPlayerUtility->RegisterForVideoLoadingNotification(*this); … // load a videostream TRAPD( err, iVideoPlayerUtility->OpenUrlL( iUrl, iIapId, iMimeType, iControllerUid ) ); if ( err != KErrNone ) { iObserver->ErrorMsg(err); }


Download ppt "Vakgroep Informatietechnologie Deel III: Paradigma’s Software Ontwikkeling 4. Ontwerp van Telecom Services Prof.Dr.Ir. Filip De Turck."

Similar presentations


Ads by Google