Skip to content

Commit f27266d

Browse files
committed
Documentation - Attach multiple transparent cubes
The aim of this commit is to provide simple but straightforward documentation concerning the possibility to attach multiple transparent cubes to the same interface. Signed-off-by: Simone Magnani <simonemagnani.96@gmail.com>
1 parent 642c19b commit f27266d

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

Documentation/tutorials/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Available tutorials
1818
tutorial1/tutorial1
1919
tutorial2/tutorial2
2020
tutorial3/tutorial3
21-
21+
tutorial4/tutorial4
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Tutorial 4: Attach/Detatch multiple transparent cubes
2+
=============================================================
3+
4+
This simple tutorial aims to show how multiple cubes can be attached to the same interface/port. For the sake of semplicity the configuration presented in this tutorial is really simple, but enough to undestand the principle behind these operations.
5+
6+
Before to start, remind that not only different transparent cubes (such as firewall, nat, etc.) can be attached in pipeline to the same interface, but also cubes of the same type can be inserted, like two firewalls.
7+
8+
The transparent cubes used as example in this tutorial are two different instances of :doc:`description <../../services/pcn-dynmon/dynmon>`, which will be attached to a :doc:`description <../../services/pcn-simplebridge/simplebridge>` port as in figure.
9+
10+
::
11+
12+
+--------+ +--------+
13+
+ | +---------+---------+ |
14+
---| bridge |------------------| dynmon0 | dynmon1 | bridge |---
15+
+ 1 |\ +---------+--------+ 2 |
16+
+--------+ \ /+--------+
17+
| /
18+
| |
19+
br1:port1 br2:port2
20+
21+
Set up bridges
22+
--------------
23+
24+
To set up the two bridges, please refer to this :doc:`description <../../services/pcn-simplebridge/example1>`, which describes how to configure the cubes and create a link between two ports.
25+
26+
27+
Step1: Create transparent cubes
28+
------------------------------
29+
30+
Now that the basic topology is ready, create the two Dynmon instances:
31+
32+
::
33+
34+
polycubectl dynmon add monitorA
35+
polycubectl dynmon add monitorB
36+
37+
38+
Step2: Attach cubes
39+
-------------------
40+
41+
To completely undestand all the possibility the framework offers to attach cubes, the command line helper can be used.
42+
In bash (in many shells may not be configured by default), type the following command to see all the possible parameters:
43+
44+
::
45+
46+
~$ polycubectl attach ?
47+
48+
keyword type description
49+
<cube> cube Transparent cube to be attached (E.g. nat1)
50+
<port> cube:port or netdev Port of a cube or netdev to attach the transparent cube (E.g. rt2:port2 or eth0)
51+
position=value Position to place the cube. auto, first, last
52+
before=value Place the cube before another one
53+
after=value Place the cube after another one
54+
55+
Example:
56+
attach nat1 rt:port1
57+
58+
As in our case, when more than one cube need to be attached in pipeline to the same interface, one parameter betweeen position/before/after should be specified, otherwise the framework cannot understand where the user wants that cube to be placed.
59+
60+
Firstly, to attach *monitor1* to *br2:port2*:
61+
62+
::
63+
64+
~$ polycubectl attach monitor1 br2:port2
65+
66+
Notice that since there are not other cubes attached yet, the position can be omitted.
67+
68+
Finally, to attach also *monitor1* to *monitor2*:
69+
70+
::
71+
72+
~$ polycubectl attach monitor2 br2:port2 after=monitor1
73+
#
74+
# OR
75+
#
76+
~$ polycubectl attach monitor2 br2:port2 position=last
77+
78+
Now the configuration is completed. Every Dynmon instance is working standalone and each one can be configured differently.
79+
80+
**Last consideration:**
81+
82+
pay attention to the order, especially when different services which can eventually decide to drop packets are working in pipeline, since the final result may not be as expected (if dynmon0 decided to drop a packet dynmon1 would not receive it).

0 commit comments

Comments
 (0)