ILB stands for Life Boat
I mean, ofc not literally (duh). But I often like to imagine an LB as a lifeboat for my requests: to which island (i.e. server) it should be directed, whether the weather is stormy or not (health monitors), or if there is no island left after all (bad gateway).
In a nutshell, a load balancer balances load (genius). But there are some terms to keep in mind that helped me sound educated enough :p. They are as follows:
- Octavia
- Used for providing the load-balancing service.
- Barbican
- Stores secrets, i.e. keys.
- Neutron
- The networking service from OpenStack. Responsible for subnets and security groups.
- Amphora
- Octavia's default way of implementing a load balancer. It boots a small VM running HAProxy.
- Keystone
- Identity / auth token service.
A good thing to keep in mind is that a load balancer is a specific function that a proxy can perform. A reverse proxy is a role.
Now, these are mostly jargon. But then, jargon sells. The key idea that I kept in mind while building TLS offloading is that the LB is a lifeboat with desperate requests on it, trying to reach their server.
IIIf you know, you know
Before we actually get into TLS offloading, we need to understand a very pretty idea: the Diffie–Hellman algo. I have created a visualisation for it that you can find here. It has some really beautiful mathematics that allows us to telepathically agree on a key. A basic version of it is here:
The maths, gentlyp = 23, g = 5 — two strangers, one secret
Why they match: Ba = (gb)a = gab = (ga)b = Ab (mod p). An eavesdropper sees p, g, A and B — getting s means digging a or b back out (the discrete log problem). Trivial for 23. Hopeless for a 2048-bit p.
The key idea to keep in mind is that Diffie–Hellman solves the problem of encrypting data, and not identity. A person in the middle (called the man in the middle) can impersonate the server you are talking to. And just like any other situationship, there is no way to know what you mean to the person :p
IIIRSA: Real Shit Algorithm
One of the most gratifying experiences I had was learning about the RSA algorithm (and no, its full form is not Real Shit. It's Rivest–Shamir–Adleman). It's an asymmetric encryption algorithm that allows our browser to verify the certificate and the certificate chain, and ultimately solves the problem of identity.
RSA relies on a very beautiful theorem by Euler:
You can check out the proof here. But this very idea — being able to decrypt a hash signed by a private key, and then individually compare and verify the hash — is the very foundation of TLS.
I have added a simple derivation of how RSA works below.
RSA, derived with tiny numbersp = 3, q = 11 — keys, encrypt, decrypt, sign
Toy numbers, obviously — real keys use primes hundreds of digits long, which is what makes factoring n back into p and q hopeless. (Strictly, Euler needs gcd(m, n) = 1; the result holds for every m anyway — that bit's in the proof.)
IVGive me a certificate
I think I deserve a certificate for writing this article and making the visualiser, if I'm being honest. And so thinks every domain on the internet. Think of a certificate as your Aadhaar card. And you only trust an Aadhaar card because it is signed by the Government of India (or whoever signs that white plastic). CA certs work the same way: a chain of trust and validity which, if broken at any point, is easily detectable (due to our beloved RSA), and moreover prevents the man-in-the-middle attack (and situationships and identity crises).
For a better visualisation of the chain, you can visit my visualiser (cool stuff onli).
VThe final rescue
Once the TLS handshake is done and the DH keys are exchanged, our humans (requests) are able to talk to the lifeboat (LB) and can inform it where they want to be headed. Finally, they have a common language, and voila — my requests are saved.
Honestly, it was one of the more interesting pieces of work that I had the fortune of implementing, and more importantly, I got a much deeper understanding of how the S in HTTPS actually works. Super fun stuff. I highly recommend you check it out and play around with it on your own.
VIScratchpad
As usual with anything I make, a lot of pages were filled with ideation, proofs, and wrapping my head around stuff. A couple of pages from that.




