Skip to content

Commit bf98773

Browse files
committed
Add MULTI port mode to pcn-loadbalancer-rp
Signed-off-by: Leonardo Di Giovanna <[email protected]>
1 parent c856376 commit bf98773

23 files changed

+879
-214
lines changed

Documentation/services/pcn-loadbalancer-rp/loadbalancer-rp.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33

44
This service implements a ``Reverse Proxy Load Balancer``.
5-
According to the algorithm, incoming IP packets are delivered to the real servers by replacing their IP destination address with the one of the real server, chosen by the load balancing logic. Hence, IP address rewriting is performed in both directions, for traffic coming from the Internet and the reverse.
6-
Packet are hashed to determine which is the correct backend; the hashing function guarantees that all packets belonging to the same TCP/UDP session will always be terminated to the same backend server.
5+
According to the algorithm, incoming IP packets are delivered to the real servers by replacing their IP destination address with the one of the real server, chosen by the load balancing logic. Hence, IP address rewriting is performed in both directions, for traffic coming from the Internet and the reverse. Packet are hashed to determine which is the correct backend; the hashing function guarantees that all packets belonging to the same TCP/UDP session will always be terminated to the same backend server.
76

8-
Unknown packets (e.g., ARP; IPv6) are simply forwarded as they are.
7+
This service supports two different port types (FRONTEND and BACKEND) and two different port modes (SINGLE and MULTI). Depending on the port mode, the cube can have one or more FRONTEND ports: in SINGLE port mode (which is the default one), only a single FRONTEND port is supported, whereas multiple FRONTEND ports are supported in MULTI port mode. The MULTI port mode is specifically designed in order to allow the service to work properly as part of our Kubernetes networking solution (please see [polykube](https://github.com/polycube-network/polykube) to get more information about it). Regardless the port mode, only a BACKEND port is supported.
98

9+
If a packet coming from a FRONTEND port is directed to a service, DNAT is performed on it; the corresponding reverse natting operation is performed for packets coming from backends and on the way back to clients. ARP packets are forwarded as they are (in MULTI port mode, if the packet is an ARP request from the BACKEND port, it is forwarded to the right FRONTEND port). Unknown packets (e.g., IPv6) are simply forwarded as they are (in MULTI port mode, if the packet comes from the BACKEND port, it is flooded to all the FRONTEND ports).
1010

1111
## Features
1212

1313

14+
- Support for different port modes (SINGLE and MULTI)
15+
- Support for multiple frontend ports (in MULTI port mode)
1416
- Support for multiple virtual services (with multiple ``vip:protocol:port`` tuples)
1517
- Support for ICMP Echo Request, hence enabling to ``ping`` virtual servers
1618
- Session affinity: a TCP session is always terminated to the same backend server even in case the number of backend servers changes at run-time (e.g., a new backend is added)
@@ -21,8 +23,11 @@ Unknown packets (e.g., ARP; IPv6) are simply forwarded as they are.
2123

2224
## Limitations
2325

26+
- In SINGLE port mode, only two ports are supported (a FRONTEND and a BACKEND port)
27+
- In MULTI port mode, multiple FRONTEND port are supported but only a single BACKEND port can exists
28+
- In MULTI port mode, an IPv4 address must be configured on FRONTEND port creation in order to allow packets to flow back to the frontend clients
29+
- In MULTI port mode, the supported topology is the one leveraged in the [polykube](https://github.com/polycube-network/polykube) Kubernetes networking solution
2430

25-
- Supports only two interfaces
2631

2732
## How to use
2833

@@ -38,7 +43,7 @@ Each backend supports a ``weight`` that determines how incoming sessions are dis
3843

3944
A set of ``virtual services``, which are specified by a Virtual IP address, protocol and a port (``vip:protocol:port``), are mapped to a given set of ``backend services``, actually running on multiple real servers.
4045

41-
Hence, this service exports two network interfaces:
46+
Hence, in SINGLE port mode, this service exports two network interfaces:
4247
- Frontend port: connects the LB to the clients that connect to the virtual service, likely running on the public Internet
4348
- Backend port: connects the LB to to backend servers
4449

src/services/pcn-loadbalancer-rp/datamodel/lbrp.yang

+16-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,25 @@ module lbrp {
2626
mandatory true;
2727
description "Type of the LB port (e.g. FRONTEND or BACKEND)";
2828
}
29+
leaf ip {
30+
type inet:ipv4-address;
31+
description "IP address of the client interface (only for FRONTEND port)";
32+
polycube-base:cli-example "10.10.1.1";
33+
}
34+
}
35+
}
36+
37+
leaf port_mode {
38+
type enumeration {
39+
enum SINGLE;
40+
enum MULTI;
2941
}
42+
default SINGLE;
43+
description "LB mode of operation. 'SINGLE' is optimized for working with a single FRONTEND port. 'MULTI' allows to manage multiple FRONTEND port";
3044
}
3145

3246
container src-ip-rewrite {
33-
description "If configured, when a client request arrives to the LB, the source IP addrress is replaced with another IP address from the 'new' range";
47+
description "If configured, when a client request arrives to the LB, the source IP address is replaced with another IP address from the 'new' range";
3448

3549
leaf ip-range {
3650
type inet:ipv4-prefix;
@@ -51,7 +65,7 @@ module lbrp {
5165
leaf name {
5266
type string;
5367
description "Service name related to the backend server of the pool is connected to";
54-
polycube-base:cli-example "Service-nigx";
68+
polycube-base:cli-example "Service-nginx";
5569
}
5670

5771
leaf vip {

0 commit comments

Comments
 (0)