Transportation Protocols
Transportation protocols are essential for managing how data is transferred across networks. The most well-known and widely used transport layer protocols are:
TCP (Transmission Control Protocol)
- Reliable and connection-oriented.
- Ensures data arrives in order, without errors, and without duplicates.
- Therefor slower as udp.
- Used in: HTTP/HTTPS (web browsing), FTP (file transfers), SMTP/IMAP/POP3 (email), SSH
HTTP (HyperText Transfer Protocol)
Http is a text-based transfer protocol widely used in the web. It's used in browsers as well for e.g. REST calls
Gzip
It's possible to use HTTP with compression as long as the server and client both support it, which is nearly everywhere the case. Enabling GZIP will compress the text transferred between server and client.
- Smaller file sizes (up to 70–90% smaller).
- Faster page load times.
- Lower bandwidth usage.
- Better user experience and SEO performance.
Feature | HTTP without gzip | HTTP with gzip |
---|---|---|
Compression | No | Yes |
File size | Larger | Smaller |
Load speed | Slower | Faster |
Bandwidth efficiency | Poor | Efficient |
Server/browser load | Normal | Slight CPU overhead |
HTTP/2
Http/2 is an improved version of http/1.1. The main improvements are:
- Multiplexing: Allows multiple resources to be requested and sent in parallel over a single connection.
- Header Compression: Reduces size of redundant headers, especially useful for APIs.
- Binary Framing: More efficient and less error-prone than text-based format of HTTP/1.1.
- Server Push: Lets the server proactively send assets (like CSS/JS) the browser will likely need.
So, if possible its good to switch to the new standard if possible. One drawback is, that http/2 is binary based, so it's harder to read the content.
Feature | HTTP/1.1 | HTTP/2 |
---|---|---|
Multiplexing | No – one request per connection | Yes – multiple requests per connection |
Header compression | No | Yes (HPACK compression) |
Protocol format | Text-based | Binary-based |
Request prioritization | Limited | Supported |
Server Push | Not supported | Supported |
Latency & speed | Higher (slower) | Lower (faster) |
Connection reuse | Limited | Efficient |
Browser support | All browsers | All modern browsers |
Comparisson of typical scenarios
Scenario | HTTP/1.1 Performance | HTTP/2 Performance | Speed Gain |
---|---|---|---|
Many small files (images, JS, CSS) | Slower, multiple connections | Multiplexed in one connection | 20% – 50% faster |
High-latency networks (e.g., mobile) | High delays, blocked requests | Faster with multiplexing | Up to 2× faster |
Complex webpages with many assets | Blocked & serialized requests | Parallel asset loading | 50% – 70% faster |
Well-optimized sites | Already efficient | Slightly better | 1.5× to 3× faster (in some cases) |
Header size and overhead | Large, repetitive headers | Compressed with HPACK | Lower latency, smaller size |
UDP
- Connectionless and faster than TCP.
- No guarantee of delivery, order, or error correction.
- Faster than tcp
- Used in: DNS (domain name resolution), VoIP (voice calls), Online gaming, Streaming media