This commit is contained in:
xtaci
2016-08-26 15:51:33 +08:00
parent 8f3d3f4d8d
commit f84e40075a
2 changed files with 46 additions and 1 deletions
+31 -1
View File
@@ -2,11 +2,41 @@
simple multiplexing
# goals
1. window size controls all the streams in total.
1. receive window is shared among the streams.
2. precise flow control.
3. precise memory control.
4. maximized payload.
5. optimized for high-speed streams.
```
FRAMETYPE=Data, OPTIONS=(flagSYN, flagACK, flagFIN, flagRST)
+---------------+--------------+------------+--------------+--------------------------------+
| | | | | |
| FRAMETYPE(1B) | OPTIONS(1B) | LENGTH(2B) | STREAMID(4B) | DATA(MAX 64K) |
| | | | | |
+---------------+--------------+------------+--------------+--------------------------------+
FRAMETYPE=WindowUpdate
+---------------+--------------+------------+
| | |
| FRAMETYPE(1B) | WINDOWSIZE(4B) |
| | |
+---------------+--------------+------------+
FRAMETYPE=Ping, OPTIONS=(flagSYN, flagACK)
+---------------+--------------+------------+------------+
| | | |
| FRAMETYPE(1B) | OPTIONS(1B) | PINGID(4B) |
| | | |
+---------------+--------------+------------+------------+
FRAMETYPE=GoAway
+---------------+---------------+
| | |
| FRAMETYPE(1B) | ERROR(2B) |
| | |
+---------------+---------------+
```
# status
in-progress
+15
View File
@@ -0,0 +1,15 @@
package smux
const ( // frame types
frameData uint8 = iota
frameWindowUpdate
framePing
frameGoAway
)
const ( // options
flagSYN uint16 = 1 << iota
flagACK
flagFIN
flagRST
)