Numerical Concept on HTTP and HTTPS

HTTP (HyperText Transfer Protocol) and HTTPS (HyperText Transfer Protocol Secure), we can consider the following key aspects:

1. Port Numbers

  • HTTP uses port 80 by default.
  • HTTPS uses port 443 by default (encrypted with TLS/SSL).

2. Status Codes (Numerical Responses)

HTTP and HTTPS both use three-digit numerical status codes to communicate responses. Some common ones include:

  • 1xx – Informational (e.g., 100 Continue)
  • 2xx – Success (e.g., 200 OK, 201 Created)
  • 3xx – Redirection (e.g., 301 Moved Permanently, 302 Found)
  • 4xx – Client Errors (e.g., 404 Not Found, 403 Forbidden)
  • 5xx – Server Errors (e.g., 500 Internal Server Error, 503 Service Unavailable)

3. Encryption Key Length (For HTTPS)

HTTPS uses encryption methods like TLS (Transport Layer Security) or SSL (Secure Sockets Layer). The encryption key lengths vary:

  • 128-bit encryption (older standard, still secure)
  • 256-bit encryption (common in modern security for stronger protection)

4. TLS Versions (For HTTPS Security)

  • TLS 1.0 (deprecated)
  • TLS 1.1 (deprecated)
  • TLS 1.2 (widely used)
  • TLS 1.3 (latest, more secure)

5. HTTPS Performance Overhead

  • HTTPS requires extra computational power for encryption/decryption, typically increasing response time by ~5-10% compared to HTTP.
  • Modern optimizations like HTTP/2 and HTTP/3 have reduced this impact.

1. Latency Calculation

A website is hosted on a server located 3000 km away. If the network speed is 200,000 km/s, calculate the round-trip time (RTT) for an HTTP request.

Solution:


2. Data Transfer Time in HTTP

A webpage of 2 MB is to be downloaded over an HTTP connection with a bandwidth of 10 Mbps. Calculate the download time assuming ideal conditions.


3. HTTPS Encryption Overhead

A standard HTTP request takes 100 ms for a response. If HTTPS adds a 30% overhead due to encryption and decryption, what is the new response time?


4. TCP Handshake Delay in HTTPS

HTTPS requires an extra TLS handshake that takes 50 ms. If an HTTP connection takes 200 ms, what is the total time for HTTPS?


5. Impact of Parallel Connections in HTTP vs. HTTPS

A browser downloads 10 resources over one connection in HTTP, taking 1 second per resource. In HTTPS, it uses 2 parallel connections. How much time is saved?

Solution:


Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *