Embedded middleware
1 / 30

Embedded Middleware - PowerPoint PPT Presentation

  • Uploaded on

Embedded Middleware. Lecture 23. Previous Lecture. Source of deterministic errors and random noises Basics of signal spectrum Nyquist sampling Fourier transform Basic filters What you can do and when you should ask for help. Overview of Today’s Lecture. What is middleware? CORBA

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Embedded Middleware' - ken

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Previous lecture l.jpg
Previous Lecture

  • Source of deterministic errors and random noises

  • Basics of signal spectrum

    • Nyquist sampling

    • Fourier transform

  • Basic filters

    • What you can do and when you should ask for help

Overview of today s lecture l.jpg
Overview of Today’s Lecture

  • What is middleware?

    • CORBA

    • Java (EJB)

    • DCOM

    • Comparing different middleware

  • Get to know one middleware (CORBA) in depth

  • Middleware in embedded systems

    • What are the criteria?

Moving beyond a single processor l.jpg
Moving Beyond A Single Processor

  • So far, we’ve only dealt with the issues of a single embedded processor

  • What if we want to get embedded processors to run applications that communicate across the network?

  • Networked/distributed programs

    • Processes that communicate over the network (or on the same machine)

    • Client – piece of code that requests services

    • Server – piece of code that provides the services

Writing distributed programs l.jpg
Writing Distributed Programs

  • Common ways of writing distributed client-server programs

  • Sockets

    • Low-level interface to the operating system for TCP and UDP


    • Even lower-level interface within the kernel (almost device-driver level)

  • Shared memory

    • Low-level interface for clients and servers on the same machine to communicate using a chunk of memory that they share

  • Shared files

    • Clients and servers exchange information through a shared file system

  • RPC (Remote Procedure Call)

    • Clients communicate with long-lived server processes (daemons) over the network

Socket programming l.jpg
Socket Programming

  • Server’s role

    • Binds to an Internet (IP) address

    • Listens for clients on the network

    • Provides services to clients that connect to it

  • Client’s role

    • Knows the server’s IP address

    • Connects to the server

    • Sends service requests

  • Client and server exchange messages over TCP or UDP

  • Socket/networking code mixed with “real” client and server logic



Listens for

more clients



Exchange of messages

over an established connection

Low level network programming l.jpg
Low-level Network Programming

  • Very efficient mechanism

  • Available on almost every operating system

  • Standardized application programming interface (API)

  • Can be used for clients and servers to communicate on the same machine and across the network

  • But …..

    • Exposes too many low-level details

    • Application writer must be able to debug network-level issues and problems

    • Mixes application logic with networking logic

    • Clients must know where servers live

    • If client and server run on different byte-ordered machines, they must be aware of these differences in talking to each other

And middleware was born l.jpg
….. And Middleware was Born

  • Layer between the operating system and the application

  • Hides the operating system’s details from the application developer


  • Why do we need/have middleware?

    • It makes it easier to write distributed applications

    • Takes care of all the networking code and the messaging

    • Leaves you free to focus on writing the application

High level overview of middleware l.jpg

Written in some neutral Interface

Definition Language (IDL)



Server’s real implementation

(in a programming language)

Client’s real implementation

(in a programming language)











Written in a

programming language,

but independent of clients



Some protocol over TCP/IP

High-Level Overview of Middleware

Corba common object request broker architecture l.jpg
CORBA (Common Object Request Broker Architecture)

  • Middleware for interoperability from the Object Management Group

    • CMU is a member of the OMG, along with 800 other companies/universities

  • The key component is the “broker” (ORB)

    • Shields the client and the server from each other’s differences

  • What’s the CORBA client-server model?

    • Language transparency: Clients and servers can be written in different programming languages

    • Location transparency: Client and server don’t care about each other’s locations

    • Interoperability: Clients and servers can run on different hardware, operating systems and still be able to talk to each other using a protocol called IIOP

    • No support for distributed garbage collection

  • Real-Time CORBA standard available

J2ee java 2 enterprise edition l.jpg
J2EE (Java 2 Enterprise Edition)

  • Sun Microsystems’ Java-based middleware

    • Implicitly has all of Java’s portability advantages

    • Component: application-level software unit

    • Container: runtime support/services for a component

  • On the client side

    • Applets, application clients executing in their own JVM

  • On the server side

    • Web components

      • Servlets and Java Server Pages (JSP)

    • Enterprise Java Beans (EJB) components can contain two kinds of objects

      • Session beans: valid for the duration of a client-server session

      • Entity beans: valid for the lifetime of the persistent data that it manages

  • What makes J2EE powerful?

    • Can interface to multiple existing back-end systems and technologies

    • Power of Java’s intrinsic portability, graphical, web & garbage collection capabilities

  • Real-Time Java standard available

Dcom distributed component object model l.jpg
DCOM (Distributed Component Object Model)

  • Microsoft’s middleware

  • DCOM server

    • Body of code containing multiple objects

    • Each object can support multiple interfaces

    • Can be written in Java, C++, Pascal

  • DCOM client

    • Gets a pointer to one of the interfaces

    • Talks to the server over that interface

    • Doesn’t care if the server is local or remote

  • Client-server communication

    • Occurs over the Object Remote Procedure Call (ORPC)

    • Originates from DCE’s RPC (where Distributed Computing Environment, or DCE, was one of the earliest middleware platforms)

    • The broker is called the Service Control Manager (SCM)

  • Some support for distributed garbage collection

Critical thinking l.jpg
Critical Thinking

What are the differences between DCOM, EJB and CORBA?

Overview of corba l.jpg

Server’s IDL



















IIOP (Internet Inter-ORB Protocol)

Overview of CORBA

Interface definition language idl l.jpg
Interface Definition Language (IDL)

  • Used to define

    • Interfaces: methods or behavior (but not attributes or state) of a server object

    • Modules: packages of related interfaces and types

  • IDL is not a programming language

    • No conditional constructs such as if, else, then, while, do, etc.

  • IDL compiler

    • Provided with every ORB

    • Input = Server’s interface in IDL

    • Output = Skeleton and stub in a programming language (Java, C++, etc.)

  • What are the IDL types?

    • Basic types: octet, char, short, long, double

    • Structured types: string, sequence<someOtherType>, union, struct

    • Arbitrary types: any

    • User-defined types: e.g., interfaces

Example of an idl interface l.jpg
Example of an IDL Interface



exceptionZeroBalance {};

typedef sequence<double> DepositHistory;

interface Account


string getBalance(instring accountNumber);

void depositMoney(indouble amount,

out double balance,

inout DepositHistory latest);

double withdrawMoney (in double amount)




Stubs and skeletons l.jpg
Stubs and Skeletons

  • What is a stub, anyway?

    • Automatically generated by the IDL compiler

    • Client-side glue in Java/C++

    • Marshals (packages) parameters from the client into a message to be sent to the server

    • Unmarshals results from the response message

  • What is a skeleton, anyway?

    • Automatically generated by the IDL compiler

    • Server-side glue in Java/C++

    • Unmarshals (unpackages) messages into the parameters that the client intended to send

    • Marshals results into a response message

Portable object adapter poa l.jpg
Portable Object Adapter (POA)

  • Exists only within CORBA servers

  • Dispatches incoming requests to the right target servants

  • Also acts as a namespace for the collection of servants it manages

  • Additional policies that you can use to customize a POA:

    • Multithreading

    • Activation on demand

    • Persistent references (lifespan of objects)

    • Unique object identifiers

  • A server process can have multiple POAs, each configured differently, and each responsible for a certain set of servants

Corba s protocols l.jpg
CORBA’s Protocols

  • General Inter-ORB Protocol (GIOP)

    • Specification of a protocol, and not the implementation

    • Eight message formats: Request, Reply, LocateRequest, LocateReply, CancelRequest, MessageError, CloseConnection, Fragment

    • Well-defined headers for every message

    • Carries the sender’s byte ordering

    • Can be mapped onto any “real” protocol that is connection-oriented

  • Internet Inter-ORB Protocol (IIOP)

    • Concrete implementation of GIOP specification onto TCP/IP

    • Must be supported by every ORB

    • Allows objects to communicate without caring about their operating systems, hardware architectures, etc.

Other corba components l.jpg
Other CORBA Components

  • Implementation Repository

    • Stores location of the executables in your file system

    • Run-time registry of servers and clients

    • Very specific to the vendor

  • Interface Repository

    • Stores the type information of all CORBA objects in your application

    • Dynamic invocation interface implies that you don’t know your types ahead of time, and you can look these up at run-time

  • Naming Service

    • Registry of user-friendly names associated with object references

    • Servants can bind references by a name

    • Clients can look up references by that name

Interoperable object references iors l.jpg






Interoperable Object References (IORs)

  • Stringified format of a reference

    • Can be stored in a file, sent across the network, etc.

    • Contains server’s hostname, port number, object key, etc.

  • Sample IOR looks like this:


System and user exceptions l.jpg
System and User Exceptions

  • Exception – Something bad/illegal/undesirable occurred

  • System Exceptions

    • Defined within the CORBA standard

    • Can alert the application of communication errors, resource exhaustion, invalid object references, host crashes

    • Usually raised by the ORB before the request gets to the servant

    • Format of a System Exception

      • Minor code: Identifies the source of the problem (e.g., COMM_FAILURE)


    • Make sure that your CORBA clients catch system exceptions!

  • User Exceptions

    • Can be defined within IDL interfaces

    • Each method of an interface can raise exceptions

Middleware in embedded systems l.jpg
Middleware in Embedded Systems

  • Requirements

    • Limited resources: Smaller footprint (requires less code-bloat)

    • Real-time support (available in Real-Time CORBA specification)

  • Full CORBA implementation: 150 Kbytes – 5 Mbytes!

  • What are your options?

    • Minimal CORBA: Throw out some of the heavyweight CORBA mechanisms (~ 30-60 Kbytes)

    • IIOP Engine: Use a library that keeps only the IIOP protocol part (~ 15 Kbytes)

    • CORBA Gateways: TCP bridge from the embedded processors to a CORBA gateway that talks to the rest of the world

Summary of lecture l.jpg
Summary of Lecture

  • What is middleware?

    • CORBA

    • Java (EJB)

    • DCOM

    • Compare the different middleware

  • Get to know one middleware (CORBA) really well

  • Middleware in embedded systems

    • What are the criteria?