Skip to content

Commit 72d0300

Browse files
committed
Added documentation for Transparent HelloWorld
Signed-off-by: Fulvio Risso <[email protected]>
1 parent 9cbf55c commit 72d0300

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

Documentation/services/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This folder contains the list of services (a.k.a. *cubes*) currently available i
1111
pcn-ddosmitigator/ddosmitigator
1212
pcn-firewall/firewall
1313
pcn-helloworld/helloworld
14+
pcn-transparenthelloworld/transparenthelloworld
1415
pcn-iptables/iptables
1516
pcn-k8sfilter/k8sfilter
1617
pcn-k8switch/k8switch

Documentation/services/pcn-helloworld/helloworld.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
Helloworld
22
==========
33

4-
**Note**: documentation of the current release is focused on the final user and not in developers. This service is intended to be used only by developers, so this documentation could be incomplete and have some inacuracies.
5-
6-
This service demonstrates how to create a minimal cube, which includes both the dataplane `fast path` and the control/management `slow path` parts
4+
This service is oriented to demonstrate to developers how to create a minimal cube, which includes both the dataplane `fast path` and the control/management `slow path`.
75

86
Helloworld is a simple service that receives the traffic on a network interface and can either:
97

@@ -18,8 +16,10 @@ How to use
1816

1917
::
2018

21-
# create network namespaces
22-
# TODO.
19+
# create network namespaces with usual commands
20+
# we assume you have two interfaces (veth1
21+
# and veth2 already working here)
22+
2323

2424
# create the instance
2525
polycubectl helloworld add hw0
@@ -33,7 +33,7 @@ How to use
3333

3434
# send packets to the service
3535

36-
# try another actions, forward, slowpath
36+
# try another action, such as forward
3737
polycubectl hw0 set action=forward
3838

3939

@@ -49,6 +49,7 @@ Helloworld includes the minimum amount of code that a service requires to be run
4949
- **src/helloworld-lib.cpp** contains the implementation of interface that is used when the service is compiled as a shared library.
5050
- **datamodel/helloworld.yang** contains the service datamodel.
5151

52+
5253
Compile and install
5354
-------------------
5455

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Transparent Helloworld
2+
======================
3+
4+
This service is oriented to demonstrate to developers how to create a minimal transparent cube, which includes both the dataplane `fast path` and the control/management `slow path`.
5+
6+
The behaviour of this service is very similar as :doc:`Helloworld <services/pcn-helloworld/helloworld>`; however, it attaches to an existing interface (in fact, it is *transparent*) instead of having its own set of interfaces.
7+
From the developer point of view, it inherits from the ``polycube-transparent-base`` datamodel instead of ``polycube-standard-base``.
8+
9+
Transparent Helloworld is a simple service that receives the traffic on a network interface and can either:
10+
11+
- allow packets to pass
12+
- send packets to the slow path
13+
- drop packets
14+
15+
The behavior of this service can be changed by setting the ``ingress-action`` and ``egress-action`` flags, which tell the data plane how packets have to be processed.
16+
In fact, this service can distinguish between *ingress* (i.e., from the network device up to the TCP/IP stack) or *egress* (vice versa) packets, enabling to set different actions for them.
17+
18+
19+
How to use
20+
----------
21+
22+
::
23+
24+
# we assume a physical interface named 'eth0'
25+
# is available in the system
26+
27+
# create a transparent hello world
28+
polycubectl transparenthelloworld add thw0
29+
30+
# attach to eth0
31+
polycubectl attach thw0 eth0
32+
33+
# you can ping the Internet from your host
34+
# e.g., ping 8.8.8.8
35+
# and see that the ping works properly
36+
37+
# now let's change action in the ingress-path
38+
polycubectl thw0 set ingress-action=slowpath
39+
40+
# now you can see that the ping does no longer work
41+
#
42+
# in exchange, polycubed prints a log message each
43+
# time it receives a new packet in the slow path
44+
45+
# restore 'pass' behavior
46+
polycubectl thw0 set ingress-action=pass
47+
48+
# now the 'ping' works again
49+
50+

0 commit comments

Comments
 (0)