Skip to content

Commit e774ea9

Browse files
committed
refactor(http 2.0): consolidate the notes into one, add in common http 2.0 pitfalls
1 parent 943a5cd commit e774ea9

File tree

8 files changed

+66
-103
lines changed

8 files changed

+66
-103
lines changed

content/Networking MISC/gRPC.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ tags:
88
- programming
99
- over
1010
Creation Date: 2025-07-20, 17:38
11-
Last Date: 2025-07-20T18:36:29+08:00
12-
References:
13-
draft:
11+
Last Date: 2025-10-02T22:12:38+08:00
12+
References:
13+
draft:
1414
description: Learn gRPC, the high-performance RPC framework that enables seamless network communication between applications using protobuf serialization, including step-by-step Python code examples for building type-safe distributed systems.
1515
---
1616
## Abstract
1717
---
1818
- An **RPC framework** that allows applications to communicate across [[Computer Network|networks]] as if they were **calling local functions**, hiding the complexity of network communication
19-
- Built on top of. [[HTTP 1.2|HTTP 2.0]], using [protobuf](https://protobuf.dev/) for efficient data transfer in binary format
19+
- Built on top of. [[HTTP 2.0]], using [protobuf](https://protobuf.dev/) for efficient data transfer in binary format
2020

2121
>[!important] Network protocol VS Framework
2222
> **Network protocol** is the low-level rules for how data moves across networks (like HTTP/2, [[TCP]]).

content/Networking Protocol/HTTP/HTTP 1.2/HTTP 1.2 Server Push.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

content/Networking Protocol/HTTP/HTTP 1.2/HTTP 1.2.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

content/Networking Protocol/HTTP/HTTP 1.2/HTTP Frame.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

content/Networking Protocol/HTTP/HTTP 1.2/HTTP Multiplexing (多路复用).md

Lines changed: 0 additions & 22 deletions
This file was deleted.

content/Networking Protocol/HTTP/HTTP 1.2/HTTP Stream.md

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
Author:
3+
- Xinyang YU
4+
Author Profile:
5+
- https://linkedin.com/in/xinyang-yu
6+
tags:
7+
- networking
8+
Creation Date: 2023-08-18T12:56:00
9+
Last Date: 2025-10-02T22:17:23+08:00
10+
References:
11+
draft:
12+
description:
13+
---
14+
## Abstract
15+
---
16+
[[HTTP 1.1]] but with the following 4 improvements
17+
1. [[#HTTP Multiplexing]]
18+
2. [[#Server Push]]
19+
3. Compressing the [[HTTP Headers]] with [[HPACK]]
20+
4. HTTP messages are binary-encoded instead of ASCII-encoded, this is more efficient for parsing & less readable for hackers
21+
22+
## HTTP Stream
23+
---
24+
- An HTTP stream consists of multiple [[#HTTP Frame]]
25+
26+
>[!important]
27+
> Each HTTP stream (a pair of [[HTTP Request]]/[[HTTP Response]]) doesn't need to be sent in order in the same [[TCP Connection]], so HTTP response can be received in a different order of sending the HTTP requests. This is achieved with HTTP Stream ID (流标示符) in the HTTP frame.
28+
29+
### HTTP Frame
30+
![[http1.2_frame.png|500]]
31+
32+
- An abstraction that allows us to divide [[HTTP Request]] and [[HTTP Response]] into multiple pieces
33+
- There are two types - HTTP header frame, HTTP data frame
34+
35+
## HTTP Multiplexing
36+
---
37+
- A [[HTTP 2.0]] feature powered by [[#HTTP Stream]], solves [[Head-of-Line Blocking (队头堵塞)#HTTP Head-of-Line Blocking]] in [[HTTP 1.1]]. Each request-response pair is assigned a unique identifier (stream), allowing the client and server to send and **receive responses out of order**, independent of when the requests were made.
38+
- Usually comes with [[TLS]]
39+
40+
>[!success] Better performance
41+
> With multiple [[HTTP Request]] in one [[TCP Connection]] at the same time, waiting time reduced greatly aka better performance.
42+
43+
>[!important] On high-loss or high-latency networks, HTTP/1.1 can actually be faster
44+
> Because we will still have the [[Head-of-Line Blocking (队头堵塞)#TCP Head-of-Line Blocking]], and HTTP 1.1 may perform better with multiple [[TCP Connection]].
45+
>
46+
> To elaborate more, HTTP/2 multiplexes many requests over a **single TCP connection**. If one packet in that connection is lost, the entire connection stalls until retransmission happens. In contrast, HTTP/1.1 can open 6–8 parallel TCP connections per domain, so a packet loss only stalls that one stream, not all.
47+
48+
49+
50+
## Server Push
51+
---
52+
- A [[HTTP 2.0]] improvement that allows client/server to push [[Network Object]] it thinks client/server needs without the need to receive any specific [[HTTP Request]] for the object. This **reduces the number of round trips taken**
53+
54+
>[!caution]
55+
> However, if a host clicks on the web page, many network objects will be received. This may result in potential [[DDoS]: a single HTTP request can trigger multiple [[HTTP Response]].
56+
>
57+
> If not tuned carefully, the server might push unnecessary or already-cached resources, **wasting bandwidth**.
58+
59+

content/Networking Protocol/HTTP/Head-of-Line Blocking (队头堵塞).md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Author Profile:
66
tags:
77
- networking
88
Creation Date: 2023-08-18T12:59:13+08:00
9-
Last Date: 2024-04-29T01:52:14+08:00
10-
References:
9+
Last Date: 2025-10-02T22:04:31+08:00
10+
References:
1111
---
1212
## Abstract
1313
---
@@ -28,7 +28,7 @@ References:
2828
> 2. Technologies like [[Webpack]] consolidate many Object into a few object to minimise the chance of blocking
2929
>
3030
> **Networking Solution**
31-
> - [[HTTP Multiplexing (多路复用)]]
31+
> - [[HTTP 2.0#HTTP Multiplexing]]
3232
3333

3434

0 commit comments

Comments
 (0)