Socket wrapper

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

The socket wrapper library is a C library that facilitates the testing of complex multi-node distributed systems on a single node. It supports TCP and UDP functionality by redirecting them over UNIX Sockets on the same node.

Using the socket wrapper library allows software developers to test complex systems without needing multiple computers[1].

Project History

The socket wrapper code was initially written in 2005 by Jelmer Vernooij to allow the Samba torture suite to run against an smbd on the same machine within a make test run.

It has evolved considerably since that time and now allows a single development system to simulate a network of nodes relatively cheaply.

Project Functionality and Uses

The socket wrapper library redirects all network communication over TCP and UDP to occur over Unix domain sockets so that the multiple daemons can communicate with each other on a single test system. This allows developers to create tests that do not need multiple nodes and, perhaps more importantly, means that developers do not need to devote resources to testing that are unconnected from the internet and from their development systems, as the IP addresses used in the test are unconnected to the rest of your environment.

The library uses the UNIX LD PRELOAD facility to install itself ahead of libc or glibc when applications run.

The socket wrapper library can also automatically capture all the packets transmitted via the library in a pcap file for analysis with Wireshark.

Alternative Approaches

Alternative approaches include Containers and Virtual Machines (VMs), however, both entail greater overhead than using socket wrappers where it provide the necessary functionality.

For example, virtual machines use significantly more memory because each VM requires enough memory and disk space for the OS. Similarly, Containers require enough disk space on the development system for the operating system but does not require space for the kernel.

Similar Libraries

Users of the socket wrapper library usually want to use the resolv wrapper library as well.

References

  1. Lua error in package.lua at line 80: module 'strict' not found.

External Links