CORBA Group Four Assignment
CORBA Group Four Assignment
BURIE CAMPUS
DEPARTMENT OF COMPUTER SCIENCE
DISTRIBUTED SYSTEM ASSIGNMENT
Group members ID
I
Introduction
II
1. Overview of CORBA
1
the early 1990s, CORBA provides a standardized framework for software
components, or objects, to interoperate across different programming languages,
operating systems, and network protocols. It achieves this through a middleware layer
that abstracts the complexities of network communication, allowing clients to invoke
methods on remote objects as if they were local. CORBA's design emphasizes
interoperability, scalability, and modularity, making it a foundational technology for
distributed systems in enterprise applications.
2
transparently. The IDL acts as a universal contract, specifying object interfaces
independently of any programming language. IDL compilers generate stubs and
skeletons in the target languages, allowing clients and servers written in different
languages to invoke methods on each other seamlessly. This supports code reuse and
modular development, making CORBA well-suited for large-scale systems where
components may be developed by diverse teams using varied programming
languages.
CORBA also offers location transparency, a feature that allows clients to invoke
methods on remote objects as if they were local, simplifying application design and
enhancing scalability. The inclusion of standardized CORBA services, such as the
Naming Service for object location, the Event Service for asynchronous
communication, and the Transaction Service for distributed transactions, further
3
enhances its utility. These services provide robust support for building modular,
extensible systems that can handle complex business logic and maintain data
consistency across distributed nodes.
While CORBA’s complexity and performance overhead compared to lighter protocols
are notable drawbacks, its use is justified in scenarios requiring legacy system
integration, high interoperability, or where the investment in CORBA infrastructure
already exists. For example, in industries with mission-critical legacy applications,
CORBA ensures compatibility without requiring a complete system overhaul.
Additionally, its maturity, backed by the Object Management Group (OMG), offers a
stable and well-documented standard, which can be advantageous for long-term
projects where reliability and standardization are paramount. Thus, CORBA is a
strategic choice for organizations needing a robust, interoperable, and scalable
middleware solution in specific distributed computing contexts.
4. Middleware System
4.1 Definition and Characteristics
4
Key characteristics of middleware systems include:
Service Provision: It offers services like naming, event handling, security, and
transactions, enhancing system functionality.
5
4.3 Role of CORBA as Middleware
The Common Object Request Broker Architecture (CORBA) serves as a
quintessential middleware system, designed to facilitate seamless communication
between distributed objects in heterogeneous computing environments. Middleware,
in general, acts as an intermediary layer that abstracts the complexities of network
communication, platform differences, and language disparities, allowing diverse
applications to interoperate efficiently. CORBA exemplifies this role by providing a
robust framework for distributed object communication, bridging the gap between
clients and servers across different programming languages, operating systems, and
network protocols. Its architecture, centered around the Object Request Broker
(ORB), Interface Definition Language (IDL), object adapters, and CORBA services,
ensures interoperability, location transparency, and scalability, making it a powerful
object-oriented middleware solution.
4.3.1 Bridging Distributed Objects
At its core, CORBA acts as a bridge between distributed objects, enabling them to
communicate as if they were local, despite being hosted on different machines or
implemented in different languages. Middleware’s primary function is to abstract the
underlying infrastructure—network protocols, operating systems, and hardware—
allowing applications to focus on business logic rather than communication details.
CORBA achieves this through its central component, the Object Request Broker
(ORB), which serves as a "software bus" mediating all interactions between clients
and servers. For example, in the banking system discussed later, a Python client can
invoke methods on a C++ server without needing to handle the intricacies of cross-
language communication or network transmission. The ORB ensures that requests and
responses are routed correctly, making CORBA an effective middleware for
distributed object-oriented systems.
CORBA leverages the Interface Definition Language (IDL) to define object interfaces
in a language-neutral manner, a key feature that underscores its role as middleware.
The IDL specifies the methods, parameters, and data types an object supports, serving
as a contract between the client and server. This contract is compiled into client-side
6
stubs and server-side skeletons, which act as proxies and templates, respectively, to
facilitate communication. The stubs translate client method calls into ORB-
compatible requests, while the skeletons invoke the corresponding methods on the
server-side object implementation.
On the server side, CORBA employs the Object Adapter, typically the Portable
Object Adapter (POA), to manage object lifecycles and dispatch requests, further
solidifying its middleware role. The Object Adapter acts as a bridge between the ORB
and the object implementation (servant), performing tasks such as object registration,
request dispatching, and lifecycle management. The server registers objects with the
ORB via the Object Adapter, which generates IORs for each object. When the ORB
receives a client request, the Object Adapter dispatches it to the appropriate servant
based on the IOR. The Object Adapter also activates and deactivates objects as
needed, supporting policies for threading, persistence, and request handling.
In the banking system, the C++ server uses the POA to activate the Account object
and bind it to the Naming Service. When the Python client sends a request, the
server’s ORB forwards it to the POA, which invokes the corresponding method on the
Account implementation. This structured management of server-side objects ensures
7
that the middleware layer (CORBA) handles the complexities of distributed object
management, allowing developers to focus on implementing business logic.
8
systems. Its architecture is layered, modular, and centered around the Object Request
Broker (ORB), which acts as the core mediator for object communication. The
architecture is composed of several interconnected components: the ORB, Interface
Definition Language (IDL), stubs and skeletons, object adapters, CORBA services,
and interoperability protocols (GIOP/IIOP). These components work together to
provide location transparency, interoperability, and scalability, making CORBA
suitable for enterprise-grade distributed applications.
The ORB is the backbone of CORBA, acting as a middleware layer that mediates
communication between clients and objects. It handles critical tasks such as locating
remote objects using Interoperable Object References (IORs), marshaling client
requests (serializing data into a platform-neutral format) and unmarshaling responses,
routing requests and responses between client and server ORBs over a network, and
managing communication protocols, ensuring seamless interaction across
heterogeneous systems. Each client and server has its own ORB instance, which
communicates with other ORBs using standardized protocols, ensuring
interoperability.
9
Stubs and skeletons are generated from IDL files and serve as the interface between
the application code and the ORB. The stub, residing on the client side, encapsulates
the logic for marshaling method calls and sending them to the server’s ORB. The
skeleton, on the server side, unmarshals incoming requests, invokes the appropriate
method on the servant, and marshals the response back to the client. Together, they
ensure transparent communication, hiding network and language-specific details from
developers.
The object adapter manages the lifecycle of CORBA objects on the server side,
bridging the ORB and the servant (the actual object implementation). The most
commonly used object adapter is the Portable Object Adapter (POA), which provides
flexibility in handling object activation, deactivation, and request dispatching. The
POA supports policies for object persistence, threading, and request handling,
allowing developers to customize server behavior. It registers objects with the ORB
and generates IORs, which clients use to reference objects.
10
CORBA ensures interoperability between ORBs through the General Inter-ORB
Protocol (GIOP), an abstract protocol that defines message formats and
request/response semantics. The Internet Inter-ORB Protocol (IIOP), a concrete
implementation of GIOP over TCP/IP, enables ORBs to communicate over the
Internet. IIOP ensures that CORBA systems from different vendors or
implementations can interoperate, providing a standardized communication layer for
distributed environments.
Diagram Breakdown
This diagram provides a concise and structured representation of the CORBA
architecture, illustrating the key components and their interactions in a distributed
system. It captures the essence of how CORBA facilitates communication between
clients and object implementations (servers) through the Object Request Broker
(ORB), ensuring interoperability and location transparency. The diagram is divided
into three main sections: the Client, the ORB Interface and ORB Core, and the Object
11
Implementation (Server), with arrows indicating the flow of communication between
these components.
Client: On the left side, the Client represents the entity that initiates requests to access
services provided by remote objects. The Client can interact with the ORB in two
ways: Dynamic Invocation, which allows the Client to invoke methods on objects at
runtime without precompiled stubs, using the Dynamic Invocation Interface (DII),
offering flexibility for scenarios where the object’s interface is not known at compile
time; and IDL Stubs, which are precompiled client-side proxies generated from the
Interface Definition Language (IDL), translating the Client’s method calls into
requests that the ORB can process, providing a static and efficient way to invoke
remote methods.
ORB Interface and ORB Core: At the center of the diagram, the ORB Interface and
ORB Core form the heart of the CORBA architecture. The ORB Interface serves as
the entry point for both the Client and the Object Implementation to interact with the
ORB, providing APIs for tasks like initializing the ORB and managing object
references. The ORB Core, shown as the foundation, handles the core functionality of
communication.
12
5.3.2 Interaction Flow
The arrows in the diagram illustrate the flow of communication: the Client sends a
request via the IDL Stubs or Dynamic Invocation, which is processed by the ORB
Interface; the ORB Core marshals the request, locates the target object, and transmits
it to the server’s ORB; on the server side, the ORB Core unmarshals the request, the
Object Adapter dispatches it to the servant through the IDL Skeleton, and the Object
Implementation processes it; the response follows the reverse path: it is marshaled by
the skeleton, transmitted back through the ORB Core, unmarshaled, and delivered to
the Client.
6. Implementing CORBA
13
The client-side implementation focuses on invoking remote methods on the server’s
`Account` object via the ORB. The process begins with initializing the ORB, which
establishes the client’s connection to the CORBA infrastructure. The client then uses
the Naming Service to locate the `Account` object by resolving a hierarchical name
(e.g., `Bank/Account`). Once the object reference is obtained, the client narrows it to
the `Account` interface, ensuring type safety. The client then invokes methods such as
depositing an amount, withdrawing funds, and checking the balance. It also handles
exceptions, such as insufficient funds, to manage error scenarios gracefully. Finally,
the client shuts down the ORB to release resources. This implementation leverages
the ORB for location transparency and showcases CORBA’s language neutrality
through the use of Python.
The server-side implementation involves creating the actual object that provides the
banking services, registering it with the ORB, and making it available to clients. The
server implements the `Account` interface defined in the IDL, maintaining a balance
variable to track the account’s state. It provides logic for depositing (increasing the
balance), withdrawing (decreasing the balance while checking for sufficient funds),
and checking the balance (returning the current value). The server initializes the ORB
and activates the Portable Object Adapter (POA), which manages the object’s
lifecycle. The server then creates an instance of the `Account` implementation,
activates it with the POA, and binds it to the Naming Service under a specific name
(e.g., `Bank/Account`). The server runs the ORB event loop to listen for client
requests and process them. The use of C++ ensures performance, the POA supports
scalability, and the Naming Service facilitates dynamic object discovery.
The application utilizes the Naming Service to enable the client to locate the server’s
`Account` object dynamically. The Naming Service acts as a directory where the
server registers the `Account` object under a hierarchical name (e.g.,
`Bank/Account`). The client queries the Naming Service to resolve this name into an
object reference, which it then uses to invoke methods. This service decouples the
14
client from the server’s physical location, enhancing scalability and flexibility. The
Naming Service simplifies object location in distributed systems and was chosen over
alternatives like hardcoding object references for its dynamic nature. Other potential
CORBA services, such as the Event Service for asynchronous communication or the
Transaction Service for managing distributed transactions, could enhance the system
but were not implemented in this project.
The setup and configuration process ensures that the CORBA environment is properly
configured to run the application. The steps include installing OmniORB and its
Python bindings on the development machine (e.g., Ubuntu 22.04), which involves
installing packages such as `omniorb`, `omniorb-nameserver`, and `python3-omniorb`
using the package manager to provide the necessary libraries, the omniidl compiler,
and the Naming Service; compiling the `Bank.idl` file using the omniidl compiler to
generate the necessary stubs and skeletons for both C++ (server) and Python (client),
ensuring the client and server can communicate using the defined interface; starting
the Naming Service on a specific port (e.g., 2809) to act as a directory for object
references, allowing the server to register objects and the client to locate them
dynamically; running the C++ server, which initializes the ORB, activates the POA,
registers the `Account` object with the Naming Service, and enters the ORB event
loop to handle client requests; and running the Python client, which initializes the
ORB, resolves the `Account` object via the Naming Service, invokes methods, and
shuts down the ORB when finished. Each step ensures the application runs smoothly
by establishing the necessary infrastructure for distributed communication.
During implementation, several challenges arose, along with their solutions. ORB
configuration errors occurred when the client failed to connect to the Naming Service
due to a misconfigured endpoint, resolved by ensuring the Naming Service ran on the
correct port and specifying the proper `corbaloc` URL in both client and server
configurations (e.g., `corbaloc:iiop:localhost:2809/NameService`). IDL compilation
15
issues emerged when errors occurred due to missing dependencies or improper
installation of the omniidl compiler, addressed by installing all required packages
(e.g., `python3-omniorb-omnipy` for Python bindings) and verifying the IDL syntax.
Interoperability problems arose when the Python client failed to narrow the object
reference to the `Account` interface due to inconsistent generated stubs, fixed by
recompiling the IDL file for both languages to ensure compatibility and verifying the
Naming Service binding. Naming Service binding conflicts occurred when the server
failed to bind the object to the Naming Service because the name was already in use,
resolved by restarting the Naming Service with a fresh context. These challenges
highlight the importance of proper configuration and testing in CORBA
implementations.
The testing phase began with a detailed plan to verify the functionality, reliability, and
performance of the CORBA-based banking system. The plan outlined the following
objectives: functional testing to ensure that all methods defined in the Account
interface (deposit, withdraw, checkBalance) work as expected across the client and
server; error handling testing to validate that exceptions, such as InsufficientFunds,
are correctly raised and managed; interoperability testing to confirm that the Python
client and C++ server communicate seamlessly via the ORB, leveraging CORBA’s
language neutrality; performance testing to assess the system’s response time and
throughput under various loads to identify potential bottlenecks; scalability testing to
evaluate the system’s ability to handle multiple concurrent clients using the Naming
Service; and security validation to verify that basic security assumptions hold, given
CORBA’s inherent exposure in a distributed environment. Test cases were designed
based on the IDL-defined interface and the expected behavior of the banking system.
Key scenarios included successful deposits and withdrawals, failed withdrawals due
to insufficient funds, and balance checks after multiple transactions. The test
environment was set up on Ubuntu 22.04 LTS with OmniORB installed, mirroring the
16
development setup to ensure consistency. Test tools included manual execution
scripts, log analysis, and basic timing utilities to measure performance.
Tests were conducted to ensure the Python client could invoke methods on the C++
server. The client successfully resolved the Account object via the Naming Service
and performed all operations without type mismatches or communication failures.
This validated CORBA’s ability to bridge different languages through the ORB and
IDL-generated stubs/skeletons.
17
7.2.3 Performance Testing
Test Case: Measure response time for 100 consecutive checkBalance calls with a
single client.
Setup: Recorded the time using Python’s time module.
Expected Outcome: Response time should be consistent, with minimal latency.
Actual Outcome: Average response time was approximately 50 milliseconds per call,
with occasional spikes to 100 milliseconds due to network overhead. This highlighted
the ORB’s marshaling/unmarshaling latency, a known CORBA characteristic.
Test Case: Attempt unauthorized access by modifying the client to use an incorrect
object name.
Expected Outcome: The Naming Service should fail to resolve the object, preventing
access.
Actual Outcome: The client received a CORBA::OBJECT_NOT_FOUND exception,
confirming that the Naming Service enforces name-based access control. However, no
encryption was tested, as CORBA’s default setup lacks built-in security, indicating a
potential vulnerability.
18
The test results demonstrated that the core functionality of the banking system was
successfully implemented. All deposit, withdrawal, and balance check operations
worked as expected, with the InsufficientFunds exception handling functioning
correctly. Interoperability between Python and C++ was validated, confirming
CORBA’s language neutrality. Performance testing revealed acceptable response
times for a single client but indicated scalability limitations with multiple clients,
likely due to the server’s single-threaded design and ORB overhead. Security
validation showed that name resolution provided basic access control, but the lack of
encryption or authentication highlighted a security gap in the current setup.
19
modern alternatives like REST (typically 10-20 milliseconds per call with JSON),
CORBA’s overhead is noticeable, reflecting its complex middleware architecture. The
Naming Service performed reliably, resolving object references in under 10
milliseconds, but the server’s single-threaded nature limited throughput to
approximately 10 requests per second with 10 clients. This analysis suggests that
optimizing the server with multi-threading or using a more efficient ORB
implementation (e.g., TAO) could improve performance.
Error handling was a critical aspect of testing. The InsufficientFunds exception was
triggered and caught successfully, displaying the reason to the client. However, initial
tests revealed issues with ORB initialization errors due to misconfigured endpoints,
which were resolved by ensuring consistent corbaloc URLs. Debugging involved
analyzing server logs and client exception messages. Tools like gdb for C++ and
Python’s traceback were used to trace issues, such as IDL compilation errors caused
by missing dependencies. This process ensured robust error detection and resolution,
enhancing system reliability.
While the current implementation relies on the Naming Service for basic access
control, it lacks encryption or authentication, exposing it to potential interception or
unauthorized access in a networked environment. Tests confirmed that incorrect
object names failed to resolve, but a malicious client could still attempt brute-force
name guessing. For production use, integrating the CORBA Security Service would
be necessary to add authentication and encryption. This validation underscores the
need for additional security measures, which should be documented as a future
enhancement.
20
Scalability testing revealed that the system could handle up to 10 concurrent clients,
but performance degraded beyond this due to the server’s single-threaded design. The
Naming Service scaled well, managing multiple resolutions without failure. To
simulate higher loads, a script launched 20 clients, resulting in timeouts and
inconsistent responses, indicating a bottleneck at the server level. Adjusting the POA
policies to support multi-threading or deploying multiple server instances could
mitigate this. This testing provided valuable insights into the system’s limits and areas
for optimization.
8. Advantages of CORBA
21
on entirely different platforms without requiring modifications, enhancing flexibility
and interoperability in heterogeneous environments.
9. Challenges of CORBA
CORBA, despite its strengths in distributed systems, faces significant challenges that
have contributed to its declining use. These include complexity in setup, performance
overhead, limited web support, a steep learning curve, and vendor-specific issues.
The setup and configuration of CORBA systems are notably complex, involving
multiple components like the Object Request Broker (ORB), Interface Definition
Language (IDL), object adapters, and services such as the Naming Service.
Developers must define IDL files, compile them into stubs and skeletons, configure
ORBs, and manage network communication via the Internet Inter-ORB Protocol
(IIOP). This intricate process is error-prone and time-consuming compared to modern
alternatives like REST APIs, which require minimal setup, making CORBA less
appealing for smaller projects or teams with limited expertise.
22
Performance overhead is another challenge, as the ORB’s marshaling and
unmarshaling of data, along with IIOP’s message overhead, introduce latency. In
contrast, lightweight protocols like REST (using JSON over HTTP) or gRPC (using
Protocol Buffers) offer better efficiency, making them preferable for high-
performance applications like microservices. CORBA’s design, optimized for
enterprise systems, is less suited for today’s fast-paced, real-time requirements.
CORBA’s lack of native support for web-based environments further limits its
relevance. Unlike REST or GraphQL, which integrate seamlessly with HTTP and web
browsers, CORBA relies on IIOP, which is incompatible with standard web clients.
This misalignment with web-centric, cloud-native architectures restricts its use in
modern applications.
23
Conclusion
However, our implementation and testing also highlighted challenges, such as the
complexity of setup and configuration, performance overhead due to marshaling and
unmarshaling, and limited native support for modern web-based architectures. While
CORBA excels in legacy and large-scale distributed systems, its declining
prominence in favor of simpler alternatives like REST and gRPC reflects the evolving
demands of distributed computing.
24
References
1. Henning, M., & Vinoski, S. (1999). Advanced CORBA Programming with C++.
Addison-Wesley.
2. Orfali, R., Harkey, D., & Edwards, J. (1996). The Essential CORBA: Systems
Integration Using Distributed Objects. Wiley.
3. Siegel, J. (2000). CORBA 3 Fundamentals and Programming (2nd ed.). Wiley.
Research Papers & Standards
4. Object Management Group (OMG). (2021). Common Object Request Broker
Architecture (CORBA) Specification, Version 3.4. OMG Document formal/2021-02-
01.
5. Vinoski, S. (1997). "CORBA: Integrating Diverse Applications Within Distributed
Heterogeneous Environments". IEEE Communications Magazine, 35(2), 46-55.
6. Schmidt, D. C., & Vinoski, S. (1999). "The OMG Event Service". C++ Report,
11(2), 47-52.
7. The OmniORB Project. (2023). OmniORB Documentation. Retrieved from
https://omniorb.sourceforge.net/docs.html
8. Python Software Foundation. (2023). OmniORB-Python Bindings Documentation.
Retrieved from https://docs.python.org/3/library/omniorb.html
9. IBM. (2020). "What is CORBA?" IBM Developer. Retrieved from
https://developer.ibm.com/articles/l-corba/
10 Oracle. (2022). "Java IDL: The CORBA API for Java". Oracle Docs. Retrieved
from https://docs.oracle.com/javase/8/docs/technotes/guides/idl/
10. Google. (2023). gRPC Documentation. Retrieved from https://grpc.io/docs/
11. Fielding, R. (2000). "Architectural Styles and the Design of Network-Based
Software Architectures" (Ph.D. Dissertation). University of California, Irvine.
(Introduces REST as an alternative to CORBA.)
25