/
notes
49 lines (39 loc) · 1.11 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
resources:
http://www.tenouk.com/Module43a.html
http://sock-raw.org/papers/sock_raw
http://www.secdev.org/
C | S
-------------------------|-------------
info? | type: filtered|open|nat
| ip: y.y.y.y
-------------------------|-------------
if S.type == open: connect, stop
otherwise negotiate holepunch for S
-----------------------------------------
s_holepunch | port: N
ip: x.x.x.x |
-----------------------------------------
connect(y.y.y.y:N)
i = 0
N_i = algo_next(N)
while !connected && (type & nat) == 1
if i > max_tries
break
N_i = algo_next(N_i)
connect(y.y.y.y:N_i)
if connected: stop
-------------------------|----------------
c_holepunch |
ip: x.x.x.x |
port: M |
type: filt|open|nat |
-------------------------|----------------
connect(x.x.x.x:M)
i = 0
M_i = algo_next(M)
while !connected
if i > max_tries
break
M_i = algo_next(M_i)
connect(y.y.y.y:M_i)
if connected: stop