OUROBOROS-TUTORIAL

Section: Ouroboros User Manual (7)
Updated: 2018-10-05
Index Return to wiki

 

NAME

ouroboros-tutorial - A tutorial introduction to managing Ouroboros

 

SYNOPSIS

irm *

 

DESCRIPTION

This tutorial explains how to start and configure the Ouroboros Inter-Process Communication subsystem.

 

STARTING AND STOPPING THE IPC RESOURCE MANAGER DAEMON

For the tutorials, it is recommended to start the IRMd (you will need root privileges) as a user process, writing output to stdout (If your system has an IRMd running as a systemd service, you will need to stop it).

$ irmd --stdout

Terminating the irmd can be done by pressing Ctrl+C if it is running in the foreground or by sending it a kill command for its process ID:

$ kill 25959

The output should be

==25959== irmd(II): Ouroboros IPC Resource Manager daemon started...
==25959== irmd(II): IRMd shutting down...
==25959== irmd(II): Bye.

 

PINGING A SERVER APPLICATION OVER THE LOOPBACK ADAPTER

With a running irmd, let's create an IPC process. For this tutorial, we will create and bootstrap an eth-llc IPCP over the loopback interface. To observe what's going on, open another terminal window. Note that "ipcp bootstrap" will create an IPCP if an IPCP by that name does not yet exist (See ouroboros(8)).

$ irm ipcp bootstrap type eth-llc name llc layer llc if lo

==23918== irmd(II): Created IPCP 23932.
==23932== ipcpd/eth-llc(II): Using raw socket device.
==23918== irmd(II): Bootstrapped IPCP 23932 in layer llc.

Now that we have the IPCP bootstrapped, it can act as a local network layer that can provide full connectivity between all processes in the system. Let's test it using the oping application. First, let's choose a name for the server ("my.oping.server") and register in the llc layer.

$ irm reg name my.oping.server layer llc

The IRMd should respond with

==23918== irmd(II): Registered my.oping.server in llc as 716016b1.

Now start a server of oping in the background (or in a different terminal) and bind the process to the name "my.oping.server" (replace the correct process id for your system).

$ oping -l &
[1] 24063
$ irm bind process 24063 name my.oping.server

With the server up and running, let's connect a client and send 3 pings:

$ oping -n my.oping.server -c 3
Pinging my.oping.server with 64 bytes of data:

64 bytes from my.oping.server: seq=0 time=0.475 ms
64 bytes from my.oping.server: seq=1 time=0.304 ms
64 bytes from my.oping.server: seq=2 time=0.398 ms

--- my.oping.server ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time: 3001.011 ms
rtt min/avg/max/mdev = 0.304/0.392/0.475/0.086 ms

That's all there is to it! The IRMd should log the flow allocation. There are two endpoints of the flow (flow_id's 0 and 1), one for the server (1) and one for the client (0). After the flow request, a new flow_id is created at the server side (flow_id 1) and then a previously pending flow (on flow_id 0) is allocated following the response from the server.

When the communication is done, the flow is deallocated and the resources (flow_id's 0 and 1) are released.

==23918== irmd(II): Flow request arrived for my.oping.server.
==23918== irmd(II): Flow on flow_id 1 allocated.
==23918== irmd(II): Flow on flow_id 0 allocated.
==23918== irmd(II): Completed deallocation of flow_id 0 by process 23932.
==23918== irmd(II): Completed deallocation of flow_id 1 by process 23932.

 

TERMINOLOGY

Please see ouroboros-glossary(7).

 

SEE ALSO

ouroboros(8)

 

COLOPHON

This page is part of the Ouroboros project, found at http://ouroboros.rocks

These man pages are licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/


 

Index

NAME
SYNOPSIS
DESCRIPTION
STARTING AND STOPPING THE IPC RESOURCE MANAGER DAEMON
PINGING A SERVER APPLICATION OVER THE LOOPBACK ADAPTER
TERMINOLOGY
SEE ALSO
COLOPHON

This document was created by man2html, using the manual pages.
Time: 11:27:07 GMT, April 23, 2024