OpenTTCN/How do I/Enable Unix transport
From OpenTTCN
Home | Developer's corner | Knowledge base | Working documents | Documentation | OpenTTCN IDE | Tutorials | Training | How do I | Frequently asked questions | Technical support |
How do I enable Unix transport?
Introduction
OpenTTCN Tester components usually communicate with each other through CORBA calls. These calls are by default transported on TCP/IP connections. On Linux and other Unix-like operating systems, the underlying CORBA middleware library omniORB enables the possibility to use a faster alternative: Unix sockets.
If your test system is running on Linux operating system and you are experiencing performance problems, Unix socket transport may improve your performance. Unix transport only resolves performance problems related to message transfer bandwidth eg. transferring large messages or running test suites with significant amounts of logging. Unix transport can only be used inside a single Linux host, and any distributed network infrastructure will fall back to using TCP/IP.
It is recommended to write a performance test case of the problematic scenario and compare performance with / without Unix transport enabled. Use the test results to make the final decision whether use of Unix transport is necessary and beneficial in your situation.
Note: Name resolution will still use TCP/IP, but connections to system components will use Unix sockets. Name resolution is the way the system components find each other.
Requirements
- Only available in OpenTTCN Tester 4.0beta2.1 and greater and OpenTTCN SDK 4.0beta2.1 and greater.
- Requires Linux platform.
Enabling Unix transport
To enable Unix transport, edit your etc/openttcn.conf file, and set use-unix-transport to yes:
use-unix-transport = yes
This automatically enables Unix transport for all OpenTTCN Tester binaries (openttcnd, session, tester etc). You must restart openttcnd server to enable the option.
This option does not control SDK based adapters such as robo. For robo, there is a command-line option to enable use of Unix transport:
--use-unix-transport, -U enable Unix socket CORBA transport
requires the feature being enabled in
runtime environment (OTRE)
For custom SDK adapters you must add a call to the otSetOrbUnixTransport(true) function, defined in isl/TTCN3.h:
/** * @brief Enable use of Unix transport for CORBA communications. * * @param useUnixTransport Whether to enable or disable use of Unix transport. * default state is disabled. Can only be enabled on Unix-like platforms where * the CORBA implementation supports this. * * @remark Takes effect when otResolveInitialReferences is called directly or * via the other initialization functions. Value cannot be changed after the ORB * has been initialized. * * @remark Subsequent calls to this function will override the previous setting. */ void otSetOrbUnixTransport(bool useUnixTransport);
This function must be called before calling otResolveInitialReferences or otInitAdapter to initialize the adapter.
Verifying status
Activation of Unix transport can be verified in many ways:
- Unix socket meta-files being created in /tmp/omni-USERNAME directory when binaries are run.
- If openttcnd is started directly from the command-line with openttcnd start it should print out "Enabling Unix transport".
- Compare number of transmitted packets on loopback interface (sudo ifconfig) when running with unix transport enabled/disabled. This only works if there is no other traffic on the machine.
