.\" Ouroboros man pages CC-BY 2017 - 2024 .\" Dimitri Staessens .\" Sander Vrijders .TH OUROBOROS-TUTORIAL 7 2018-10-05 Ouroboros "Ouroboros User Manual" .SH NAME ouroboros-tutorial - A tutorial introduction to managing Ouroboros .SH SYNOPSIS irm * .SH DESCRIPTION This tutorial explains how to start and configure the Ouroboros Inter-Process Communication subsystem. .SH 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). .RS 4 $ irmd --stdout .RE 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: .RS 4 $ kill 25959 .RE The output should be .RS 4 ==25959== irmd(II): Ouroboros IPC Resource Manager daemon started... .br ==25959== irmd(II): IRMd shutting down... .br ==25959== irmd(II): Bye. .RE .SH PINGING A SERVER APPLICATION OVER THE LOOPBACK ADAPTER With a running irmd, let's create an IPC process. For this tutorial, we will create a unicast IPCP, attach it to the loopback interface and bootstrap it. To observe what's going on, open another terminal window. .RS 4 $ irm ipcp create name lan type unicast .RE .RS 4 ==23918== irmd(II): Created IPCP 23932. .RE An IPCP needs a \fIpoint of attachment\fR: the transmission technology it sends and receives on. Attach it to the loopback interface (See \fBouroboros\fR(8)). .RS 4 $ irm ipcp poa attach name lan eth dev lo .RE .RS 4 ==23918== irmd(II): Attached IPCP 23932. .RE .RS 4 $ irm ipcp bootstrap name lan layer lan .RE .RS 4 ==23918== irmd(II): Bootstrapped IPCP 23932. .RE 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 it in the lan layer. .RS 4 $ irm name create my.oping.server .br $ irm name register my.oping.server layer lan .RE The IRMd should respond with .RS 4 ==23918== irmd(II): Created new name: my.oping.server. .br ==23918== irmd(II): Registered my.oping.server with IPCP 23932 as 716016b1. .RE 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). .RS 4 $ oping -l & .br [1] 24063 .br $ irm bind process 24063 name my.oping.server .RE With the server up and running, let's connect a client and send 3 pings: .RS 4 $ oping -n my.oping.server -c 3 .br Pinging my.oping.server with 64 bytes of data: 64 bytes from my.oping.server: seq=0 time=0.475 ms .br 64 bytes from my.oping.server: seq=1 time=0.304 ms .br 64 bytes from my.oping.server: seq=2 time=0.398 ms --- my.oping.server ping statistics --- .br 3 packets transmitted, 3 received, 0% packet loss, time: 3001.011 ms .br rtt min/avg/max/mdev = 0.304/0.392/0.475/0.086 ms .RE 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. .RS 4 ==23918== irmd(II): Flow request arrived for my.oping.server. .br ==23918== irmd(II): Flow on flow_id 1 allocated. .br ==23918== irmd(II): Flow on flow_id 0 allocated. .br ==23918== irmd(II): Completed deallocation of flow_id 0 by process 23932. .br ==23918== irmd(II): Completed deallocation of flow_id 1 by process 23932. .RE .SH TERMINOLOGY Please see \fBouroboros-glossary\fR(7). .SH SEE ALSO \fBouroboros\fR(8) .SH 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/