summaryrefslogtreecommitdiff
path: root/doc/man/ouroboros-tutorial.7
blob: 0f92a4e3c29e7ea7ba60546bfeed304f7da5384b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.\" Ouroboros man pages CC-BY 2017 - 2021
.\" Dimitri Staessens <dimitri@ouroboros.rocks>
.\" Sander Vrijders <sander@ouroboros.rocks>

.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 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 \fBouroboros\fR(8)).

.RS 4
$ irm ipcp bootstrap type eth-llc name llc layer llc if lo
.RE

.RS 4
==23918== irmd(II): Created IPCP 23932.
.br
==23932== ipcpd/eth-llc(II): Using raw socket device.
.br
==23918== irmd(II): Bootstrapped IPCP 23932 in layer llc.
.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 in the llc
layer.

.RS 4
$ irm reg name my.oping.server layer llc
.RE

The IRMd should respond with

.RS 4
==23918== irmd(II): Registered my.oping.server in llc 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/