OnCallReadyStart learning

TCP, TLS & HTTP: glossary

141 terms, in plain words, with where each one is taught.

/etc/environment
A file of VAR=value lines read at login for every user; one place to set proxy variables. Services started by systemd do not read it. Lesson 11.23
4-tuple (tuple, four-tuple, 5-tuple)
The four numbers that identify one TCP connection: source IP, source port, destination IP, destination port. Two connections may share any three of them, never all four. Lesson 11.8
407 Proxy Authentication Required (407, Proxy Authentication Required)
The status a forward proxy returns when it wants credentials before forwarding your request. Lesson 11.23
503 Service Unavailable (503, Service Unavailable)
The status a server or proxy returns when it cannot take the request right now: no healthy backend, overloaded, or in maintenance.
504 Gateway Timeout (504, Gateway Timeout)
The status a proxy returns when the backend accepted the connection but did not answer in time (the proxy's read timeout). Lesson 11.21
accept queue (accept())
The kernel's queue of fully set-up connections waiting for the server program to pick them up with accept(). If the program is too slow, the queue fills and new connections are dropped. Lesson 11.5
AIA (Authority Information Access, AIA fetching)
A field in a certificate that says where to download its issuer. Browsers use it to fill in a missing intermediate; curl, Python, Go and Java do not. Lesson 11.15
ALPN (Application-Layer Protocol Negotiation)
The part of the TLS handshake where client and server agree which protocol runs inside, for example h2 (HTTP/2) or http/1.1. Lesson 11.13
backlog (listen backlog, listen queue)
The size of a listener's accept queue, chosen by the program when it starts listening and capped by the kernel setting somaxconn. Lesson 11.5
base64
A way to write any bytes as plain letters and digits. It is encoding, not encryption: base64 -d turns it straight back. Lesson 11.17
Basic Constraints (CA:TRUE, CA:FALSE)
A certificate extension saying whether it may sign other certificates (CA:TRUE) or not (CA:FALSE, a leaf). Lesson 11.17
bind address (0.0.0.0, bound to 127.0.0.1, listen address)
The IP address a server listens on. 127.0.0.1 means only programs on the same box can connect; 0.0.0.0 (or * in ss) means every address the box has. Lesson 11.1
body (request body, response body, payload)
The data after the headers of an HTTP request or response: the HTML, the JSON, the uploaded file.
CA (certificate authority, CAs, certificate authorities)
An organisation (or a company's internal team) that signs certificates. You trust a certificate because a CA you already trust signed it. Lesson 11.15
cacerts ($JAVA_HOME/lib/security/cacerts)
Java's own trust store file. Java programs ignore the Ubuntu one, so a CA added with update-ca-certificates may not reach them. Lesson 11.15
capture filter (BPF, Berkeley Packet Filter, BPF filter)
The expression at the end of a tcpdump command (host 10.0.3.12 and port 443) that says which packets to record. The kernel applies it, so the rest are never copied. Lesson 11.11
certificate chain (chain of trust, incomplete chain)
The leaf certificate plus the intermediates that link it to a trusted root. A server that sends only the leaf breaks every client that does not go and fetch the rest. Lesson 11.15
CertVerify (CertificateVerify)
The TLS handshake message where the server proves it owns the private key for the certificate it sent. Lesson 11.15
chunked (Transfer-Encoding: chunked)
Sending an HTTP body in pieces, each with its own length, when the total size is not known in advance. Lesson 11.21
cipher (cipher suite, ciphers)
The encryption method two sides agree on in the TLS handshake (for example TLS_AES_256_GCM_SHA384). You rarely choose it; you see it in curl -v and openssl output. Lesson 11.13
client_max_body_size (413, Request Entity Too Large)
nginx's limit on the size of a request body; bigger uploads get 413 Request Entity Too Large. Lesson 11.21
CLOSE-WAIT (CLOSE_WAIT)
The other side has closed, and your program has not called close() on its end yet. It never times out, so a growing count is always a bug in the program (a socket leak). Lesson 11.5
CN (Common Name)
An old field in a certificate's subject that used to hold the server name. Modern clients ignore it and check the SAN list instead. Lesson 11.15
Connection reset by peer (reset by peer, ECONNRESET, curl: (56))
The error when a connection that was already working is killed by an RST from the other side or from something in the middle. Lesson 11.1
Connection timed out (timed out (connect), curl: (28), ETIMEDOUT)
The error when a SYN gets no answer at all: the kernel retries for a while, then gives up. Usually a firewall silently dropping packets, or a host that is down. Lesson 11.1
Content-Type (Content-Length)
Headers describing the body: Content-Type what kind of data it is (application/json, text/html), Content-Length how many bytes it has. Lesson 11.21
CRL (certificate revocation list, revocation)
A list, published by a CA, of certificates it has cancelled before their expiry date (for example because the key leaked). Lesson 11.15
curl -I (--head)
curl sending a HEAD request and printing only the response headers. Lesson 11.21
curl -k (--insecure)
curl told to skip certificate checks. Fine to confirm the problem is the certificate; never a fix, because it also accepts an attacker's certificate. Lesson 11.15
curl -L (--location)
curl following redirects to the final URL, instead of stopping at the 3xx.
curl -v (--verbose)
curl showing every step: the IP it connected to (*), the TLS handshake, request headers (>) and response headers (<), all on stderr. Lesson 11.1
curl exit codes (curl: (7), curl: (6), curl: (35))
The number curl prints in brackets and returns as its exit status: 6 = name did not resolve, 7 = could not connect (refused), 28 = timed out, 35 = TLS handshake failed, 60 = certificate not trusted. Lesson 11.1
DF (Don't Fragment, DF bit, ping -M do)
The "Don't Fragment" flag in the IP header. With DF set, a router that cannot pass a big packet must drop it and send back an ICMP "fragmentation needed" message. Lesson 11.13
downstream (downstream call, downstream service)
A service your service calls to do its job (the next one along the chain). If it hangs and you have no timeout, you hang too. Lesson 11.8
DROP
A firewall action that throws a packet away and says nothing, so the client keeps retrying until it times out. Most firewalls DROP by default. Lesson 11.1
EADDRNOTAVAIL (Cannot assign requested address)
The error connect() returns when no free source port is left for that destination: the classic sign of port exhaustion. Lesson 11.8
EC (ECDSA, elliptic curve)
Elliptic curve: the newer kind of key pair next to RSA. Smaller keys for the same strength; both work for TLS certificates. Lesson 11.17
ephemeral port (ephemeral ports, ephemeral port range, ip_local_port_range)
The temporary source port the kernel picks for each outgoing connection, from a range (32768-60999 by default on Linux). Lesson 11.8
ESTAB (ESTABLISHED)
The ss state of a working connection: the handshake is done and data can flow both ways. Lesson 11.5
exponential backoff (backoff)
Retrying with a wait that doubles each time (1s, 2s, 4s, 8s...). The kernel does it for unanswered SYNs; good clients do it for failed requests. Lesson 11.1
Extended Key Usage (EKU, TLS Web Server Authentication)
A certificate extension listing what the certificate may be used for, such as server authentication or client authentication. Lesson 11.17
FIN
A TCP flag meaning "I have finished sending". Each side sends its own FIN when it closes the connection. Lesson 11.1
FIN-WAIT (FIN-WAIT-1, FIN-WAIT-2, FIN_WAIT)
The states of the side that closed first, while it waits for the other side to acknowledge and send its own FIN. Lesson 11.5
firewall (firewalls, firewall rule, firewall rules)
Rules, in the kernel or on a device in the path, that decide which packets may pass. A packet that is not allowed is either dropped silently or rejected with an answer. Lesson 11.1
forward proxy (forward proxies, corporate proxy, egress proxy)
A proxy on the client side that all outgoing traffic must go through (common in companies). Programs find it through HTTP_PROXY-style variables. Lesson 11.23
Frag needed (fragmentation needed, ICMP type 3, frag needed and DF set)
The ICMP message (type 3, code 4) a router sends when a DF packet is too big for the next link. It carries the MTU that would fit. Lesson 11.13
fragment (fragments, fragmented, IP fragmentation)
Cutting one IP packet into smaller pieces so it fits a smaller link. Routers only do it when the packet allows it. Lesson 11.13
fullchain (fullchain.pem, fullchain.crt)
One file holding the leaf certificate followed by its intermediates, in that order: what a server should be configured to send. Lesson 11.15
GET
The HTTP method for reading something. Safe to repeat: it should never change anything on the server.
The fixed fields at the start of a packet (addresses, ports, flags, lengths) that tell the network and the kernel what to do with the data after it. Lesson 11.1
hop (hops)
One router on the way to a destination. A path with three routers in the middle is three hops. Lesson 11.13
Host header (Host:)
The request header naming the site you want. One server on one IP can serve many sites and picks by this header. Lesson 11.21
HTML
The text format of web pages: what a browser downloads and draws.
HTTP headers (headers, request headers, response headers)
The Name: value lines after the first line of an HTTP request or response (Host, Content-Type, Location...). curl -v prints them with > (sent) and < (received). Lesson 11.21
HTTP keep-alive (keep-alive, Connection: keep-alive, persistent connection)
Reusing one TCP connection for many HTTP requests instead of opening a new one each time. The real fix for port exhaustion. Lesson 11.8
HTTP redirect (301, 302, 307)
A 3xx response telling the client to go to another URL, given in the Location header. 301/308 mean "moved for good", 302/307 "for now". Lesson 11.21
HTTP_PROXY (HTTPS_PROXY)
Environment variables most command-line tools read to find the forward proxy, for plain and TLS traffic. Lesson 11.23
HTTP/2 (h2)
The second major HTTP version: the same methods, headers and status codes, but binary and able to send many requests over one connection at the same time. Lesson 11.13
HTTP/3 (QUIC)
The newest HTTP version, which runs over QUIC (on UDP) instead of TCP. Most internal traffic is still HTTP/1.1 or HTTP/2. Lesson 11.21
idempotency key (Idempotency-Key)
A unique ID a client sends with a request so the server can recognise a retry and not do the work twice. Lesson 11.21
idle timeout (idle timeouts)
How long something in the middle (a load balancer, a NAT device, a firewall) keeps a quiet connection before forgetting it. After that, the next packet on it gets a reset or nothing. Lesson 11.1
intermediate (intermediate CA, intermediates, intermediate certificate)
A CA certificate signed by a root that does the day-to-day signing of server certificates. The server must send it along with its own certificate. Lesson 11.15
IPsec
A common way to build encrypted site-to-site VPN tunnels between two networks. It adds 50-73 bytes to every packet. Lesson 11.13
keystore (key store, keystores)
A Java file that holds certificates (and possibly private keys), protected by a password. The trust store is one kind of keystore. Lesson 11.17
keytool
Java's command for its trust stores and key stores: -list to see entries, -importcert to add a CA, -alias for the entry name. Lesson 11.17
L4 (layer 4, L4 load balancer, L7)
Where a load balancer works: L4 forwards TCP connections without looking inside; L7 reads the HTTP request and can route by host, path or header. Lesson 11.21
LAST-ACK (LAST_ACK)
The side that closed second has sent its FIN and waits for the final ACK. Lesson 11.5
leaf certificate (leaf, server certificate)
The certificate for the server itself (the name you connect to), at the bottom of the chain. Lesson 11.15
Let's Encrypt (certbot, ACME)
A free public CA that issues 90-day certificates automatically; certbot is the usual tool that requests and renews them.
load balancer idle timeout
How long a load balancer keeps an idle connection before dropping it (often 4 or 5 minutes). Connections kept longer in a client pool break on their next use unless keepalive is shorter. Lesson 11.8
metrics exporter (exporter, exporters)
A small program that publishes a box's numbers (load, memory, disk) over HTTP so a monitoring server can collect them. Lesson 11.1
MSS (maximum segment size, mss 1460)
The largest piece of data one TCP packet will carry, announced by each side in its SYN. Normally the MTU minus 40 bytes of IP and TCP headers (1500 - 40 = 1460). Lesson 11.1
MSS clamping (clamp MSS, advmss)
Rewriting the MSS in SYN packets (or setting it per route with advmss) so both sides send packets small enough for the path, even when ICMP is blocked. Lesson 11.13
mTLS (mutual TLS, client certificate, client certificates)
TLS where the client also presents a certificate, so the server knows who is connecting, not only the other way round. Lesson 11.17
MTU (maximum transmission unit)
The largest packet a network link can carry in one piece, usually 1500 bytes on Ethernet. ip link shows it per interface. Lesson 11.1
MTU black hole (black hole, black holes, PMTU black hole)
A path where big packets vanish without an error while small ones pass: the handshake works, then the connection hangs as soon as real data is sent. Lesson 11.11
no_proxy
The list of hosts and domains that should NOT go through the forward proxy (internal names, 127.0.0.1). Missing an internal domain here sends internal calls to the proxy, which cannot reach them. Lesson 11.23
Node.js
A program that runs JavaScript outside the browser, for example as a web server (Express is a popular Node.js web framework).
notAfter (notBefore, expiry date, expired certificate)
The dates a certificate is valid between. After notAfter, every client refuses it: "certificate has expired". Lesson 11.15
nstat (TcpExtListenOverflows, ListenOverflows, TcpExtListenDrops)
A tool that prints the kernel's network counters. TcpExtListenOverflows counts connections dropped because an accept queue was full. Lesson 11.8
OCSP (OCSP stapling)
A way for a client to ask the CA "is this certificate still valid right now?". It can add a slow extra request to the first connection. Lesson 11.27
OpenJDK
The free, open-source build of Java that Ubuntu packages. Ubuntu's OpenJDK uses a trust store generated from the system CAs; downloaded JDKs ship their own. Lesson 11.17
openssl
The Swiss-army command for TLS and certificates: connect and show the handshake (s_client), decode a certificate (x509), check a chain (verify). Lesson 11.15
openssl s_client (s_client)
openssl acting as a TLS client: it connects, prints the certificate chain the server sent and whether it verifies. -connect host:port, -servername for SNI, -showcerts for every certificate. Lesson 11.15
openssl verify (-CAfile, -untrusted)
openssl checking a certificate against a CA file offline: -CAfile the roots you trust, -untrusted the intermediates to build the chain with. Lesson 11.15
openssl x509 (x509 -noout, -enddate, -ext subjectAltName)
openssl decoding a certificate file: -noout do not reprint it, -subject/-issuer who it is and who signed it, -enddate when it expires, -text everything.
overlay network (overlay networks)
A virtual network built on top of another one by tunnelling packets between hosts. Like any tunnel, it lowers the usable MTU. Lesson 11.13
packet capture (pcap, .pcap, capture file)
Recording packets as they cross an interface, usually to a .pcap file you can read later (tcpdump -r) or open in Wireshark.
path MTU (PMTU, PMTUD, path MTU discovery)
The smallest MTU on the whole route between two hosts. Hosts learn it from ICMP "fragmentation needed" messages, which is why blocking all ICMP breaks it. Lesson 11.13
PEM (.pem, BEGIN CERTIFICATE)
The text format for certificates and keys: base64 between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines. Several can sit in one file. Lesson 11.15
PKCS12 (PKCS#12, .p12, PKCS)
A binary file format that bundles a certificate, its chain and its private key in one password-protected file; Java trust stores often use it. Lesson 11.17
PKIX (PKIX path building failed, unable to find valid certification path)
The words in Java's error when it cannot link a server's certificate to a CA in its own trust store. Lesson 11.17
port exhaustion (SNAT port exhaustion, ephemeral port exhaustion)
Running out of free source ports towards one destination, usually because every request opens a new connection and the old ones sit in TIME-WAIT. Lesson 11.8
POST
The HTTP method for creating or doing something (place an order, send a message). Not safe to repeat blindly: sending it twice may do it twice. Lesson 11.21
proxy_pass
The nginx directive that says where to forward a request: proxy_pass http://127.0.0.1:8080; makes nginx a reverse proxy for that address. Lesson 11.23
proxy_read_timeout (proxy_connect_timeout, proxy_send_timeout)
nginx timeouts for its connection to the backend: connect (to set it up) and read (to wait for the answer, default 60s). Hitting read gives the client a 504. Lesson 11.23
PUT (PATCH, DELETE)
HTTP methods for replacing (PUT), partly changing (PATCH) and removing (DELETE) something. PUT and DELETE are meant to be safe to repeat; PATCH may not be. Lesson 11.21
Recv-Q (Send-Q, Recv-Q and Send-Q)
Two ss columns. On a connection: bytes received but not yet read by the program (Recv-Q) and bytes sent but not yet acknowledged (Send-Q). On a listener: connections waiting to be accepted, and the queue's limit. Lesson 11.1
redirect loop (too many redirects, ERR_TOO_MANY_REDIRECTS)
Two redirects pointing at each other (often http -> https -> http behind a proxy), so the client bounces until it gives up. Lesson 11.21
REJECT
A firewall action that refuses a packet and answers (with an RST or an ICMP error), so the client fails fast with "refused" or "unreachable". Lesson 11.1
Retry-After
A response header (with 429 or 503) telling the client how many seconds to wait before trying again. Lesson 11.21
root CA (root certificate, root certificates, trust anchor)
A CA certificate that signs itself and sits in your trust store. Everything you trust leads back to one. Lesson 11.15
round robin (least connections, load-balancing algorithm)
The simplest load-balancing rule: send each new request to the next backend in the list, in turn. Lesson 11.23
RTT (round-trip time, round trip)
How long a packet takes to reach the other side and for the answer to come back. The TCP handshake costs one RTT; ping shows it as time=. Lesson 11.1
SAN (Subject Alternative Name, subjectAltName)
The list of names a certificate is valid for. Clients check the name you connected to against this list only; the old CN field is ignored. Lesson 11.15
SDKMAN (SDKMAN!)
A tool that downloads and switches between Java versions in your home directory. Each Java it installs has its own trusted-certificates file. Lesson 11.17
self-signed (self-signed certificate, self signed)
A certificate signed by its own key instead of a CA. Nobody trusts it until you add it to the trust store yourself. Lesson 11.15
sequence number (seq, seq and ack)
The number each side gives the bytes it sends, so the other side can acknowledge exactly what arrived and ask again for what is missing. Lesson 11.1
SNAT (source NAT)
NAT that rewrites the source address of outgoing packets, so many machines share one public IP. That device then has its own limited supply of source ports. Lesson 11.8
SNI (Server Name Indication, -servername)
The server name the client sends at the start of the TLS handshake, so one IP address can serve different certificates for different names. Lesson 11.15
socket leak (leaked sockets, leaking sockets)
A program that opens connections and forgets to close them, so sockets (and file descriptors) pile up until it hits its limit. Lesson 11.5
somaxconn (net.core.somaxconn)
The kernel's upper limit on any listener's backlog (4096 on current Ubuntu). A program asking for more gets this. Lesson 11.8
source port (destination port, source and destination port)
The two port numbers in every TCP or UDP packet: the destination port picks the program on the far side, the source port is the (usually random) port the sender uses for this connection. Lesson 11.1
ss -o (timer:, timer:(keepalive, timer:(timewait)
ss also showing each socket's timer (-o): which countdown is running on it (keepalive, retransmit, timewait) and how long is left. Lesson 11.5
ss -s
ss printing a summary: how many sockets exist in total and per state, instead of listing each one. Lesson 11.5
ss -tan (ss -tanp, ss -ta)
ss showing all TCP sockets (-t TCP, -a all states, not just listeners, -n numbers instead of names, -p the owning process). Lesson 11.5
SSLHandshakeException (javax.net.ssl.SSLHandshakeException, javax.net.ssl)
The Java exception for a TLS handshake that failed, most often because of an untrusted or incomplete chain. Lesson 11.17
SYN-ACK (Flags [S.])
The server's reply to a SYN: "yes, let's talk, and I received your SYN". The second packet of the three-way handshake. Lesson 11.1
SYN-RECV (SYN_RECV)
A server socket that received a SYN and answered with SYN-ACK, but has not yet had the final ACK. Lesson 11.5
SYN-SENT (SYN_SENT)
A client socket that has sent its SYN and is waiting for an answer. Many of them pointing at one address means that address is not answering. Lesson 11.5
TCP connection (connection, connections)
A two-way pipe between two programs that TCP sets up with a handshake before any data flows, and tears down with FIN packets at the end. Lesson 11.1
TCP flags (PSH, Flags [.], Flags [P.])
On/off markers in the header of every TCP packet (SYN, ACK, FIN, RST, PSH). tcpdump prints them in brackets: S = SYN, . = ACK, P = push data, F = FIN, R = RST. Lesson 11.1
TCP keepalive (SO_KEEPALIVE, tcp_keepalive_time)
Small probe packets the kernel sends on an idle connection to check the other end is still there, and to keep middle boxes from forgetting it. Off unless the program asks; the default first probe comes after two hours. Lesson 11.8
TCP state machine (socket state, socket states, TCP states)
The fixed list of states a TCP connection moves through (SYN-SENT, ESTAB, FIN-WAIT, TIME-WAIT, CLOSE-WAIT...), and which packet moves it from one to the next. ss shows each socket's current state. Lesson 11.5
tcp_fin_timeout (net.ipv4.tcp_fin_timeout)
The kernel setting for how long a socket may stay in FIN-WAIT-2. It does not change TIME-WAIT, despite what many blog posts say. Lesson 11.5
tcp_syn_retries (net.ipv4.tcp_syn_retries)
The kernel setting for how many times an unanswered SYN is resent before connect() gives up. The default 6 retries is why a dropped connection takes about 127 seconds to fail. Lesson 11.1
tcp_tw_reuse (net.ipv4.tcp_tw_reuse)
A kernel setting that lets a new outgoing connection reuse a source port still in TIME-WAIT. It softens port exhaustion but does not fix the missing keep-alive. Lesson 11.8
time_connect (time_appconnect, time_starttransfer, time_total)
curl -w timing variables, each counted from the start: TCP connected (time_connect), TLS done (time_appconnect), first byte (time_starttransfer), finished (time_total). Subtract neighbours to get each phase. Lesson 11.21
TIME-WAIT (TIME_WAIT, TIME-WAIT state)
The state the side that closed first sits in for 60 seconds after the connection ends, so late packets cannot confuse a new connection. Normal in small numbers; tens of thousands mean connections are not being reused.
TLS (Transport Layer Security, SSL)
The protocol that encrypts a TCP connection and proves who the server is with a certificate. HTTPS is HTTP inside TLS. Lesson 11.1
TLS handshake (TLS handshakes)
The exchange after the TCP handshake where client and server agree on encryption and the server sends its certificate chain for the client to check. It adds one more round trip in TLS 1.3. Lesson 11.8
TLS termination (terminates TLS, TLS offload)
A proxy handling the TLS for the backends: the client's encrypted connection ends at the proxy, which talks plain HTTP (or new TLS) to the app. Lesson 11.23
tracepath
A tool that walks the route to a host hop by hop and reports the MTU where it shrinks (pmtu 1400). Needs no root, unlike traceroute with some options. Lesson 11.13
trust store (truststore, CA bundle, ca-certificates.crt)
The file or directory of root CA certificates a program trusts. On Ubuntu, /etc/ssl/certs/ca-certificates.crt; Java keeps its own. Lesson 11.15
TTFB (time to first byte)
How long from starting a request until the first byte of the answer arrives: name lookup, connect, TLS, sending the request and the server's work, all together. Lesson 11.27
tunnel (tunnels, tunnel interface)
A link that wraps each packet inside another packet (a VPN, for example). The wrapping adds bytes, so the tunnel's MTU is smaller than the network under it. Lesson 11.13
update-ca-certificates (/usr/local/share/ca-certificates)
The Ubuntu command that rebuilds the system trust store after you drop a .crt file into /usr/local/share/ca-certificates/. Lesson 11.15
URL (URLs)
A web address such as https://api.lab:8443/orders?id=7: the scheme (http/https), the host, an optional port, the path, and optional query parameters after ?. Lesson 11.1
wildcard certificate (*.lab, wildcard cert)
A certificate whose SAN is *.example.com: valid for any single name directly under it (api.example.com), but not for example.com itself or a.b.example.com. Lesson 11.15
Wireshark
A graphical program for reading packet captures in detail. You capture on the server with tcpdump -w, then open the file on your laptop. Lesson 11.11
X-Forwarded-For (XFF, X-Forwarded-Proto, X-Real-IP)
Headers a proxy adds so the app behind it knows the real client address (X-Forwarded-For) and whether the client used https (X-Forwarded-Proto). Only trust them when your own proxy set them. Lesson 11.21