Networking Essentials hard
What is the difference between TCP Keepalive and HTTP Keep-Alive?
- A Both protocols are conceptually identical and are used interchangeably by various modern browsers and web-servers to manage the persistent state of a user's session.
- B TCP Keepalive reuses high-level application headers to maintain the connection, while HTTP Keep-Alive relies on low-level sequence number synchronization at the transport layer.
- C TCP Keepalive is a low-level 'heartbeat' used to detect if a connection is still alive; HTTP Keep-Alive is an agreement to reuse the same TCP socket for multiple sequential requests.
- D The HTTP-level Keep-Alive mechanism has been fully deprecated in modern web browsers in favor of the more efficient and secure 128-bit transport-layer alternative.
Answer: C. TCP Keepalive is a low-level 'heartbeat' used to detect if a connection is still alive; HTTP Keep-Alive is an agreement to reuse the same TCP socket for multiple sequential requests.
TCP Keepalive is like a pulse: the kernel sends a tiny empty packet every few minutes just to make sure the other computer hasn't crashed or unplugged its cable. It keeps the 'socket' alive in the operating system. HTTP Keep-Alive (also called Persistence) is about efficiency: it tells the server 'Don't hang up after you send this image; I want to use this same connection to ask for the next image'. This saves the time and effort of opening a new connection for every single item on a webpage. In short: TCP Keepalive prevents 'zombie' connections; HTTP Keep-Alive allows for 'efficient' multitasking over one connection.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the downside of enabling 'Sticky Sessions' (Session Affinity) on a Load Balancer?
- In WebRTC (P2P Mesh), why is a STUN server required?
- What is the fundamental difference between a Network Switch and a Router?
- In Cloud Networking (AWS), what is the limitation of VPC Peering compared to a Transit Gateway?
- Which protocol is ideal for real-time multiplayer gaming positions or Voice over IP (VoIP), and why?
- What is the purpose of the 'Time To Live' (TTL) field in an IP packet?