Title: CORBA Record and Replay
1CORBA Record and Replay
- Irfan Pyarali
- TAO Workshop
2Motivation for Recording and Replaying CORBA
Traffic
- Recording CORBA Traffic
- Logging
- Debugging
- Auditing
- Tracking
- Replaying CORBA Requests
- Compare original reply with the new reply
- System determinism
- Identify behavior anomalies
3Where to Record CORBA Traffic
4CRR Architecture
Client
Server
request replies
Client
request
Logger Manager
Generic Client
new reply
5How to Record CORBA Traffic
- Recording level
- GIOP level
- Black box testing can be done by recording GIOP
messages - Difficult to tell exactly what has changed
- Interceptor level
- Individual parameters can be inspected
- Can tell exactly what has changed
- Filtering what is recorded
- Interfaces
- Implementations (servants)
- Methods
- Clients this might be difficult since servers
typically do not know which client is issuing the
request - Parameter values will probably need a ETCL like
mechanism
6What to Record
- CORBA Request
- Interface name
- Operation name
- Operation type oneway or twoway
- IOR
- For each parameter
- Mode in, inout or out
- TypeCode
- Value for in and inout but not out parameters
- Result
- TypeCode
- Exceptions
- TypeCode
- Successful reply
- TypeCode and value for inout, out and result but
not in parameters - Failed reply
- TypeCode and value for exception raised
7Example IDL
- interface Test
-
- exception error
-
- long reason
-
- long method_longs
- (in long a,
- inout long b,
- out long c)
- raises (error)
-
8Example Recorded Request (1)
interface Test exception error long reason
long method_longs (in long a,
inout long b, out long c) raises
(error)
- ltrequestgt
- ltinterfacegtIDLTest1.0lt/interfacegt
- ltoperationgtmethod_longslt/operationgt
- ltoperation_typegttwowaylt/operation_typegt
- ltiorgtIOR010000000d0000004...lt/iorgt
- ltparametergt
- ltmodegtINlt/modegt
- lttypecodegt
- ltbasictypegtlonglt/basictypegt
- lt/typecodegt
- ltvaluegt1lt/valuegt
- lt/parametergt
- ltparametergt
- ltmodegtINOUTlt/modegt
- lttypecodegt
- ltbasictypegtlonglt/basictypegt
- lt/typecodegt
- ltvaluegt2lt/valuegt
- lt/parametergt
ltparametergt ltmodegtOUTlt/modegt lttypecodegt
ltbasictypegtlonglt/basictypegt lt/typecodegt
lt/parametergt ltresultgt lttypecodegt
ltbasictypegtlonglt/basictypegt lt/typecodegt
lt/resultgt
9Example Recorded Request (2)
interface Test exception error long reason
long method_longs (in long a,
inout long b, out long c) raises
(error)
ltraisesgt lttypecodegt ltexceptiongt
ltnamegterrorlt/namegt ltidgtIDLTest/error1.0lt/idgt
ltmembergt ltnamegtreasonlt/namegt
ltbasictypegtlonglt/basictypegt lt/membergt
lt/exceptiongt lt/typecodegt lt/raisesgt lt/requestgt
10Example Successful Reply
- ltreplygt
- ltreply_statusgtSUCCESSFULlt/reply_statusgt
- ltparametergt
- lttypecodegt
- ltbasictypegtlonglt/basictypegt
- lt/typecodegt
- ltvaluegt7lt/valuegt
- lt/parametergt
- ltparametergt
- lttypecodegt
- ltbasictypegtlonglt/basictypegt
- lt/typecodegt
- ltvaluegt8lt/valuegt
- lt/parametergt
- ltresultgt
- lttypecodegt
- ltbasictypegtlonglt/basictypegt
- lt/typecodegt
- ltvaluegt9lt/valuegt
interface Test exception error long reason
long method_longs (in long a,
inout long b, out long c) raises
(error)
11Example System Exception
interface Test exception error long reason
long method_longs (in long a,
inout long b, out long c) raises
(error)
- ltreplygt
- ltreply_statusgtSYSTEM_EXCEPTIONlt/reply_statusgt
- ltraisesgt
- ltcomplexvaluegt
- ltidgtNO_IMPLEMENTlt/idgt
- ltminorgt1413545984lt/minorgt
- ltcompletedgtNOlt/completedgt
- lt/complexvaluegt
- lt/raisesgt
- lt/replygt
12Example User Exception
interface Test exception error long reason
long method_longs (in long a,
inout long b, out long c) raises
(error)
- ltreplygt
- ltreply_statusgtUSER_EXCEPTIONlt/reply_statusgt
- ltraisesgt
- lttypecodegt
- ltexceptiongt
- ltnamegterrorlt/namegt
- ltidgtIDLTest/error1.0lt/idgt
- ltmembergt
- ltnamegtreasonlt/namegt
- ltbasictypegtlonglt/basictypegt
- lt/membergt
- lt/exceptiongt
- lt/typecodegt
- ltcomplexvaluegt
- ltvaluegt-1lt/valuegt
- lt/complexvaluegt
- lt/raisesgt
- lt/replygt
13Alternate Recording Schemes
- Portable Interceptors pass parameters as Anys
- Interpretive Recursively traverse each parameter
represented by an Any to find base type and value - Compile Added new backend to the IDL compiler
that generates logging code that knows exactly
the TypeCode and layout of the parameters - Classic tradeoffs size, speed, requiring updates
whenever IDL changes
14Basic Types
- null
- void
- short
- long
- ushort
- ulong
- float
- double
- boolean
- char
- octet
- TypeCode
- objref
- longlong
- ulonglong
- longdouble
- wchar
15Complex Types
- any Record type of what is in the any
- structure Record the names and types of each
member - union Record the discriminator type for each
member, record the case label, member name, and
member type - enumeration Record the enumerators
- string Record the bounds if any
- sequence Record the bound (if any) and the
element type - array Record the dimensions and element type
- alias Record the type of the aliased type
- exception Record the names and types of each
member - fixed Record digits and scale
16Generic Client Replaying Requests
- Parses XML representation of CORBA requests
converting it into CORBA IIOP request using DII,
replay it, and returning the result in XML - ACEXML SAX based parser
- Create IOR - tricky if being redirected to
alternate server - For each method that needs to be replayed
- Set method
- For each parameter, create TypeCode, and then
fill in value - Set TypeCode of return value
- Set TypeCodes of all possible exceptions
- Record new reply from replay
- Compare with original reply to check for
differences - Implementation notes
- Creating TypeCode using TypeCode factory
- Union label have values
- Filling values using DynAny
- Anys are very tricky
17Conclusions and Future Work
- CORBA Record and Replay may become a CORBA
specification through the C4I Task Force - Standardization of XML schema
- Integration into Ovation
- Only works with skeletons based servers
- This limitation comes from Portable Interceptors
- Add value type support
- Compiled logging was initially designed for Orbix
3 - Need to be modified to support CORBA 3 ORBs
- Record QoS properties
- Including real-time and protocol properties
related to the CORBA traffic