This package provides you example programs that helps you accomplish this assignment.
- ipc, net, mnt: The three directories contain one-shot server-client communication examples.
- runc: The files to run a runc container, config.json and rootfs, are provided.
- ns: A demonstration of how a proccess can set its namespace.
Note that the last two requires the root privilege.
- Start container A, which runs the server program. The server should block for an incoming message.
- Start container B, which runs the client program. The client should block for user inputs.
- Choose any two of the NET, MNT, IPC namespaces, says X and Y.
- Run the bridge program on the host. The bridge should set its X namespace the same as container A's X namespace, and Y the same as B's.
- Type any messages at the client side. This should casuse the message to be sent through the common namespace, which is Y, between container B and the bridge program.
- The bridge program then redirect the message through X namespace between container A and itself.
- The server program in container A gets the message, and directly send identical message back.
- The brdige then redirect the message from the server to the client.
- The client should display the result.
As an example, the terminal running a client with a working echo service should look like this:
$ ./client
This is the first sentence
This is the first sentence
second
second
OK?
OK?
...
where the first lines are user inputs, and the indentical,second lines are echo from the server program.
Note: a desired echo service should like be grep .
command.
Please report any problems you encounter on ILMS. We will do our best to help you accomplish this assignment.