32. Population
Maglev: A Fast and Reliable Software Network Load Balancer | https://www.usenix.org/system/files/conference/nsdi16/nsdi16-paper-eisenbud.pdf
Population
Permutationtable ( 3x 7 )
B1 B0 B1 B0 B2 B2 B0
Lookup_table ( size =7 )
B0 B1 B2
3 0 3
0 2 4
4 4 5
1 6 6
5 1 0
2 3 1
6 5 2
[0] [1] [2] [3] [4] [5] [6]
Assign backends by
preference list
33. Load Balancing
Maglev: A Fast and Reliable Software Network Load Balancer | https://www.usenix.org/system/files/conference/nsdi16/nsdi16-paper-eisenbud.pdf
B1 B0 B1 B0 B2 B2 B0
each backend will receive an
almost equal numberof
connections.
[0] [1] [2] [3] [4] [5] [6]
L4-LB
L4-LB
B0 =3 * connection
B1 =2 * connection
B2 =2 * connection
34. Minimal disruption
Maglev: A Fast and Reliable Software Network Load Balancer | https://www.usenix.org/system/files/conference/nsdi16/nsdi16-paper-eisenbud.pdf
Population
Permutationtable ( 2x 7 )
B0 B2
3 3
0 4
4 5
1 6
5 0
2 1
6 2
Assign backends by
preference list
Before
B1
B0
B1
B0
B2
B2
B2
B1 is
Removed
Re-Permutate
Hashing
Lookup_table ( size =7 )
After
B1 -> B0
B0
B1 -> B0
B0
B2
B2
B2
Same Value By
hashing
Lookup_table ( size =7 )
35. Hard to implement Google’s Maglev
Maglev: A Fast and Reliable Software Network Load Balancer | https://www.usenix.org/system/files/conference/nsdi16/nsdi16-paper-eisenbud.pdf
Backend SelectionPacket ProcessingPacket Forwarding
48. 5-Tuples Hash
192.68.0.2
IPVS
IPVS MH
IPVS
IPVS MH
IPVS
IPVS MH
Container[0]
Container[1]
Container[2]
Container[3]
IPVS MH is no need to track connection table
for forwarding packets to same destination.
53. TCP Connection Loss 2
192.68.0.3
Container[0]
Container[1]
Container[2]
Container[3]
L4-LB
L4-LB
1. Connection
Established With
Container[3]
2. A Load
Balancer Down
3. ECMP Disruption.
Forward packet
another l4 although
the serving LB is
alive. 4. Container[1] has no
idea about connection
with container[3]
5. Container[1] Send RST.
Connection Closed
L4-LB
57. Efficient and Reliable Load Balancer
IPVS MH IPVS MH IPVS MH IPVS MH IPVS MH
Add IP of containers
dynamically To IPVS
Add IP of containers
dynamically To IPVS
58. No Loss TCP Connection
192.68.0.2
Container[0]
Container[1]
Container[2]
Container[3]
L4-LB
IPVS
1. Connection
Established With
Container[2]
2. A Load
Balancer Down
3. ECMP Disruption.
Forward packet
another l4
4. IPVS MH can forward
the packet to same
destination by hashing.
5. Continue the
Established connection.
IPVS MH
59. No Loss TCP Connection 2
192.68.0.3
Container[0]
Container[1]
Container[2]
Container[3]
L4-LB
1. Connection
Established With
Container[3]
2. A Load
Balancer Down
3. ECMP Disruption.
Forward packet
another l4 although
the serving LB is
alive.
5. Continue the
Established connection.
IPVS
IPVS
IPVS MH
4. IPVS MH can forward
the packet to same
destination by hashing
With no connection info.
60. At least 1 Load Balancer up,
IPVS MH IPVS MH IPVS MH IPVS MH IPVS MH
Add IP of containers
dynamically To IPVS
Add IP of containers
dynamically To IPVS
61. Can Hash Consistently With No Connection Loss
IPVS MH IPVS MH IPVS MH IPVS MH IPVS MH
Add IP of containers
dynamically To IPVS
Add IP of containers
dynamically To IPVS
63. Required
Linux Kernel >= 4.18
See Also: https://github.com/torvalds/linux/blob/master/net/netfilter/ipvs
Choose M in Kernel menuconfig
to use IP_VS_MH