Attachment "sync-trigger-research.tar" to
tech note [cd9843ab40]
added by
opus-ocx2
2026-10-19 12:54:40.
0000: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
0010: 65 61 72 63 68 2f 00 00 00 00 00 00 00 00 00 00 earch/..........
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0060: 00 00 00 00 30 30 30 30 37 35 35 00 30 30 30 30 ....0000755.0000
0070: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
0080: 30 30 30 30 30 30 30 00 31 35 32 36 35 34 31 31 0000000.15265411
0090: 33 37 31 00 30 31 33 37 37 30 00 20 35 00 00 00 371.013770. 5...
00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0100: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0120: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0200: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
0210: 65 61 72 63 68 2f 71 75 65 73 74 69 6f 6e 2e 6d earch/question.m
0220: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d...............
0230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0260: 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
0270: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
0280: 30 30 30 31 35 33 30 00 31 35 32 36 35 34 31 31 0001530.15265411
0290: 33 37 31 00 30 31 36 31 36 30 00 20 30 00 00 00 371.016160. 0...
02a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
02f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0300: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
0310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0320: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
0330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
03f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0400: 54 68 65 20 6d 61 69 6e 74 61 69 6e 65 72 2c 20 The maintainer,
0410: 32 30 32 36 2d 31 30 2d 31 39 2c 20 69 6e 20 74 2026-10-19, in t
0420: 68 65 20 6f 63 78 32 20 74 68 72 65 61 64 20 28 he ocx2 thread (
0430: 63 61 36 66 30 63 66 34 39 66 29 3a 20 22 4e 6f ca6f0cf49f): "No
0440: 74 20 68 61 76 69 6e 67 20 61 6e 20 65 76 65 6e t having an even
0450: 74 20 74 72 69 67 67 65 72 20 6f 6e 20 61 20 72 t trigger on a r
0460: 65 6d 6f 74 65 20 73 79 6e 63 20 69 73 20 70 72 emote sync is pr
0470: 6f 62 6c 65 6d 61 74 69 63 2e 20 49 73 20 74 68 oblematic. Is th
0480: 65 20 6d 6f 72 65 20 66 75 6e 64 61 6d 65 6e 74 e more fundament
0490: 61 6c 20 6e 65 65 64 20 61 20 77 61 79 20 74 6f al need a way to
04a0: 20 74 72 69 67 67 65 72 20 61 20 6e 65 74 77 6f trigger a netwo
04b0: 72 6b 2d 77 69 64 65 20 73 79 6e 63 68 72 6f 6e rk-wide synchron
04c0: 69 7a 61 74 69 6f 6e 3f 20 49 73 20 69 74 20 74 ization? Is it t
04d0: 6f 20 70 72 6f 76 69 64 65 20 61 20 4e 41 54 2d o provide a NAT-
04e0: 74 72 61 76 65 72 73 61 6c 20 66 6f 72 20 73 79 traversal for sy
04f0: 6e 63 20 6f 70 65 72 61 74 69 6f 6e 73 3f 20 43 nc operations? C
0500: 61 6e 20 77 65 20 73 79 6e 63 20 70 65 65 72 73 an we sync peers
0510: 2c 20 65 61 63 68 20 62 65 68 69 6e 64 20 4e 41 , each behind NA
0520: 54 73 2c 20 77 69 74 68 6f 75 74 20 74 68 65 20 Ts, without the
0530: 70 75 62 6c 69 63 20 73 65 72 76 65 72 3f 20 49 public server? I
0540: 73 20 74 68 65 72 65 20 73 6f 6d 65 74 68 69 6e s there somethin
0550: 67 20 6d 6f 72 65 20 6d 69 6e 69 6d 61 6c 20 77 g more minimal w
0560: 65 20 63 61 6e 20 64 6f 3f 20 53 65 65 6d 73 20 e can do? Seems
0570: 6c 69 6b 65 20 54 61 69 6c 73 63 61 6c 65 20 61 like Tailscale a
0580: 6e 64 20 61 6c 6c 20 74 68 65 20 68 6f 6c 65 2d nd all the hole-
0590: 70 75 6e 63 68 69 6e 67 20 73 74 69 6c 6c 20 72 punching still r
05a0: 65 6c 79 20 6f 6e 20 68 6f 73 74 65 64 20 73 65 ely on hosted se
05b0: 72 76 69 63 65 73 20 61 74 20 73 6f 6d 65 20 6c rvices at some l
05c0: 65 76 65 6c 2e 20 49 73 20 74 68 65 72 65 20 61 evel. Is there a
05d0: 20 6d 69 6e 69 6d 61 6c 20 6f 6e 65 20 77 65 20 minimal one we
05e0: 63 61 6e 20 70 72 6f 64 75 63 65 20 73 70 65 63 can produce spec
05f0: 69 66 69 63 20 74 6f 20 46 6f 73 73 69 6c 20 73 ific to Fossil s
0600: 79 6e 63 68 72 6f 6e 69 7a 61 74 69 6f 6e 3f 20 ynchronization?
0610: 43 61 6e 20 77 65 20 61 74 20 6c 65 61 73 74 20 Can we at least
0620: 70 75 6e 63 68 20 4e 41 54 73 20 77 69 74 68 20 punch NATs with
0630: 55 50 6e 50 20 6f 72 20 73 69 6d 69 6c 61 72 3f UPnP or similar?
0640: 20 57 68 61 74 20 64 6f 65 73 20 68 74 74 70 73 What does https
0650: 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 69 ://forum.syncthi
0660: 6e 67 2e 6e 65 74 2f 74 2f 75 73 65 2d 74 61 69 ng.net/t/use-tai
0670: 6c 73 63 61 6c 65 73 2d 74 65 63 68 6e 69 71 75 lscales-techniqu
0680: 65 73 2d 66 6f 72 2d 6e 61 74 2d 74 72 61 76 65 es-for-nat-trave
0690: 72 73 61 6c 2f 32 32 34 37 31 20 73 61 79 3f 22 rsal/22471 say?"
06a0: 0a 0a 46 6f 75 72 20 72 65 61 64 65 72 73 20 28 ..Four readers (
06b0: 72 65 61 64 2d 2a 2e 6a 73 6f 6e 3a 20 65 61 63 read-*.json: eac
06c0: 68 20 63 6c 61 69 6d 20 77 69 74 68 20 69 74 73 h claim with its
06d0: 20 73 6f 75 72 63 65 29 2c 20 6f 6e 65 20 77 72 source), one wr
06e0: 69 74 65 72 20 28 61 6e 73 77 65 72 2e 6d 64 29 iter (answer.md)
06f0: 2c 20 6f 6e 65 20 63 68 65 63 6b 65 72 20 74 68 , one checker th
0700: 61 74 20 6f 70 65 6e 65 64 20 65 61 63 68 20 73 at opened each s
0710: 6f 75 72 63 65 20 61 6e 64 20 63 6f 72 72 65 63 ource and correc
0720: 74 65 64 20 74 68 65 20 64 72 61 66 74 20 28 63 ted the draft (c
0730: 68 65 63 6b 2e 6d 64 2c 20 77 69 74 68 20 77 68 heck.md, with wh
0740: 61 74 20 69 74 20 63 68 61 6e 67 65 64 20 61 6e at it changed an
0750: 64 20 77 68 79 29 2e 0a 00 00 00 00 00 00 00 00 d why)..........
0760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
07a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
07b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
07c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
07d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
07e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
07f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0800: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
0810: 65 61 72 63 68 2f 63 68 65 63 6b 2e 6d 64 00 00 earch/check.md..
0820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0860: 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
0870: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
0880: 30 30 32 33 31 36 33 00 31 35 32 36 35 34 31 31 0023163.15265411
0890: 33 37 31 00 30 31 35 33 37 34 00 20 30 00 00 00 371.015374. 0...
08a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
08f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0900: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
0910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0920: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
0930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
09a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
09b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
09c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
09d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
09e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
09f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0a00: 31 2e 20 4e 65 74 77 6f 72 6b 2d 77 69 64 65 20 1. Network-wide
0a10: 74 72 69 67 67 65 72 3a 20 63 6c 6f 73 65 2e 20 trigger: close.
0a20: 45 61 63 68 20 6e 6f 64 65 20 6d 75 73 74 20 68 Each node must h
0a30: 65 61 72 20 73 6f 6f 6e 20 74 68 61 74 20 73 6f ear soon that so
0a40: 6d 65 74 68 69 6e 67 20 72 65 61 63 68 65 64 20 mething reached
0a50: 74 68 65 20 70 75 62 6c 69 63 20 73 65 72 76 65 the public serve
0a60: 72 2c 20 74 68 65 6e 20 70 75 6c 6c 20 61 6e 64 r, then pull and
0a70: 20 70 75 73 68 20 74 68 65 72 65 20 61 73 20 6e push there as n
0a80: 6f 77 2e 20 46 6f 73 73 69 6c 20 68 61 73 20 6e ow. Fossil has n
0a90: 6f 20 62 75 69 6c 74 2d 69 6e 20 77 61 79 20 66 o built-in way f
0aa0: 6f 72 20 61 20 73 65 72 76 65 72 20 74 6f 20 63 or a server to c
0ab0: 61 6c 6c 20 61 20 63 6c 6f 6e 65 2e 20 41 20 63 all a clone. A c
0ac0: 6c 6f 6e 65 20 63 61 6e 20 72 65 70 6f 72 74 20 lone can report
0ad0: 69 74 73 20 55 52 4c 2c 20 62 75 74 20 74 68 65 its URL, but the
0ae0: 20 73 65 72 76 65 72 20 6f 6e 6c 79 20 72 65 63 server only rec
0af0: 6f 72 64 73 20 69 74 2e 0a 0a 32 2e 20 4e 41 54 ords it...2. NAT
0b00: 20 74 72 61 76 65 72 73 61 6c 3a 20 6e 6f 74 20 traversal: not
0b10: 66 6f 72 20 74 68 61 74 2e 20 41 20 72 65 71 75 for that. A requ
0b20: 65 73 74 20 61 20 6e 6f 64 65 20 73 65 6e 64 73 est a node sends
0b30: 20 6f 75 74 77 61 72 64 20 67 65 74 73 20 74 68 outward gets th
0b40: 72 6f 75 67 68 20 6e 65 61 72 6c 79 20 65 76 65 rough nearly eve
0b50: 72 79 20 4e 41 54 2c 20 65 76 65 6e 20 61 20 63 ry NAT, even a c
0b60: 61 72 72 69 65 72 20 4e 41 54 20 28 61 6e 20 49 arrier NAT (an I
0b70: 53 50 20 73 68 61 72 69 6e 67 20 69 74 73 20 61 SP sharing its a
0b80: 64 64 72 65 73 73 65 73 20 61 6d 6f 6e 67 20 63 ddresses among c
0b90: 75 73 74 6f 6d 65 72 73 29 2e 20 54 68 65 20 73 ustomers). The s
0ba0: 65 72 76 65 72 20 61 6e 73 77 65 72 73 20 69 74 erver answers it
0bb0: 20 77 68 65 6e 20 6e 65 77 73 20 63 6f 6d 65 73 when news comes
0bc0: 2e 20 48 6f 6c 65 20 70 75 6e 63 68 69 6e 67 20 . Hole punching
0bd0: 69 74 73 65 6c 66 20 6e 65 65 64 73 20 73 75 63 itself needs suc
0be0: 68 20 61 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 74 h a connection t
0bf0: 6f 20 61 20 73 65 72 76 65 72 20 66 69 72 73 74 o a server first
0c00: 2e 0a 0a 33 2e 20 57 69 74 68 6f 75 74 20 74 68 ...3. Without th
0c10: 65 20 73 65 72 76 65 72 3a 20 67 65 6e 65 72 61 e server: genera
0c20: 6c 6c 79 20 6e 6f 74 2c 20 75 6e 6c 65 73 73 20 lly not, unless
0c30: 6f 6e 65 20 70 65 65 72 20 69 73 20 72 65 61 63 one peer is reac
0c40: 68 61 62 6c 65 20 28 70 75 62 6c 69 63 20 61 64 hable (public ad
0c50: 64 72 65 73 73 20 6f 72 20 70 6f 72 74 20 66 6f dress or port fo
0c60: 72 77 61 72 64 29 20 61 6e 64 20 74 68 65 20 6f rward) and the o
0c70: 74 68 65 72 20 6b 6e 6f 77 73 20 69 74 73 20 61 ther knows its a
0c80: 64 64 72 65 73 73 2e 20 4f 74 68 65 72 77 69 73 ddress. Otherwis
0c90: 65 20 62 6f 74 68 20 70 65 65 72 73 20 6e 65 65 e both peers nee
0ca0: 64 20 61 20 6d 61 63 68 69 6e 65 20 74 68 65 79 d a machine they
0cb0: 20 63 61 6e 20 65 61 63 68 20 72 65 61 63 68 20 can each reach
0cc0: 74 6f 20 73 77 61 70 20 6f 75 74 73 69 64 65 20 to swap outside
0cd0: 61 64 64 72 65 73 73 65 73 2e 0a 0a 34 2e 20 4d addresses...4. M
0ce0: 6f 72 65 20 6d 69 6e 69 6d 61 6c 3a 20 79 65 73 ore minimal: yes
0cf0: 2c 20 62 65 6c 6f 77 2e 0a 0a 35 2e 20 54 61 69 , below...5. Tai
0d00: 6c 73 63 61 6c 65 3a 20 79 65 73 2e 20 41 20 63 lscale: yes. A c
0d10: 6f 6f 72 64 69 6e 61 74 69 6f 6e 20 73 65 72 76 oordination serv
0d20: 65 72 20 73 77 61 70 73 20 6b 65 79 73 20 61 6e er swaps keys an
0d30: 64 20 61 64 64 72 65 73 73 65 73 2e 20 52 65 6c d addresses. Rel
0d40: 61 79 73 20 63 61 72 72 79 20 73 65 74 75 70 20 ays carry setup
0d50: 61 6e 64 20 66 61 6c 6c 62 61 63 6b 20 74 72 61 and fallback tra
0d60: 66 66 69 63 2c 20 61 6e 64 20 79 6f 75 20 63 61 ffic, and you ca
0d70: 6e 20 72 75 6e 20 79 6f 75 72 20 6f 77 6e 2e 20 n run your own.
0d80: 53 79 6e 63 74 68 69 6e 67 20 6c 69 6b 65 77 69 Syncthing likewi
0d90: 73 65 20 75 73 65 73 20 64 69 73 63 6f 76 65 72 se uses discover
0da0: 79 2c 20 53 54 55 4e 20 61 6e 64 20 72 65 6c 61 y, STUN and rela
0db0: 79 20 73 65 72 76 65 72 73 2e 0a 0a 36 2e 20 41 y servers...6. A
0dc0: 20 46 6f 73 73 69 6c 20 70 75 6e 63 68 65 72 20 Fossil puncher
0dd0: 6e 65 65 64 73 20 74 68 72 65 65 20 70 61 72 74 needs three part
0de0: 73 3a 20 61 64 64 72 65 73 73 20 65 78 63 68 61 s: address excha
0df0: 6e 67 65 20 74 68 72 6f 75 67 68 20 6f 75 72 20 nge through our
0e00: 73 65 72 76 65 72 3b 20 61 20 73 6d 61 6c 6c 20 server; a small
0e10: 55 44 50 20 73 65 72 76 69 63 65 20 62 65 73 69 UDP service besi
0e20: 64 65 20 69 74 20 28 53 54 55 4e 2c 20 77 68 69 de it (STUN, whi
0e30: 63 68 20 74 65 6c 6c 73 20 61 20 6e 6f 64 65 20 ch tells a node
0e40: 69 74 73 20 6f 75 74 73 69 64 65 20 61 64 64 72 its outside addr
0e50: 65 73 73 3b 20 46 6f 73 73 69 6c 20 73 79 6e 63 ess; Fossil sync
0e60: 20 73 70 65 61 6b 73 20 6f 6e 6c 79 20 48 54 54 speaks only HTT
0e70: 50 29 3b 20 61 6e 64 20 61 20 68 65 6c 70 65 72 P); and a helper
0e80: 20 6f 6e 20 65 61 63 68 20 6e 6f 64 65 20 74 68 on each node th
0e90: 61 74 20 63 61 72 72 69 65 73 20 73 79 6e 63 20 at carries sync
0ea0: 74 68 72 6f 75 67 68 20 74 68 65 20 68 6f 6c 65 through the hole
0eb0: 2e 20 49 6e 20 6f 6e 65 20 6c 61 72 67 65 20 73 . In one large s
0ec0: 74 75 64 79 20 28 34 2e 34 20 6d 69 6c 6c 69 6f tudy (4.4 millio
0ed0: 6e 20 74 72 69 65 73 20 69 6e 20 74 68 65 20 49 n tries in the I
0ee0: 50 46 53 20 6e 65 74 77 6f 72 6b 29 2c 20 61 62 PFS network), ab
0ef0: 6f 75 74 20 37 30 25 20 6f 66 20 70 75 6e 63 68 out 70% of punch
0f00: 65 73 20 77 6f 72 6b 65 64 20 6f 6e 63 65 20 70 es worked once p
0f10: 65 65 72 73 20 68 61 64 20 73 77 61 70 70 65 64 eers had swapped
0f20: 20 61 64 64 72 65 73 73 65 73 20 74 68 72 6f 75 addresses throu
0f30: 67 68 20 61 20 72 65 6c 61 79 2e 20 54 68 65 20 gh a relay. The
0f40: 72 65 73 74 20 73 74 61 79 20 6f 6e 20 74 68 65 rest stay on the
0f50: 20 72 65 6c 61 79 2c 20 77 68 69 63 68 20 68 65 relay, which he
0f60: 72 65 20 77 6f 75 6c 64 20 62 65 20 6f 75 72 20 re would be our
0f70: 73 65 72 76 65 72 2e 0a 0a 37 2e 20 55 50 6e 50 server...7. UPnP
0f80: 2c 20 4e 41 54 2d 50 4d 50 20 61 6e 64 20 50 43 , NAT-PMP and PC
0f90: 50 20 64 6f 6e 27 74 20 70 75 6e 63 68 2e 20 54 P don't punch. T
0fa0: 68 65 79 20 61 73 6b 20 74 68 65 20 72 6f 75 74 hey ask the rout
0fb0: 65 72 20 66 6f 72 20 61 20 70 6f 72 74 20 66 6f er for a port fo
0fc0: 72 77 61 72 64 2e 20 54 68 61 74 20 6e 65 65 64 rward. That need
0fd0: 73 20 61 20 72 6f 75 74 65 72 20 74 68 61 74 20 s a router that
0fe0: 73 75 70 70 6f 72 74 73 20 69 74 2c 20 77 69 74 supports it, wit
0ff0: 68 20 74 68 65 20 73 65 74 74 69 6e 67 20 6f 6e h the setting on
1000: 2e 20 41 20 63 61 72 72 69 65 72 20 4e 41 54 20 . A carrier NAT
1010: 6f 72 20 73 65 63 6f 6e 64 20 72 6f 75 74 65 72 or second router
1020: 20 64 65 66 65 61 74 73 20 69 74 20 75 6e 6c 65 defeats it unle
1030: 73 73 20 74 68 61 74 20 62 6f 78 20 61 6c 73 6f ss that box also
1040: 20 73 70 65 61 6b 73 20 50 43 50 2e 20 49 6e 20 speaks PCP. In
1050: 61 20 42 69 74 63 6f 69 6e 20 43 6f 72 65 20 74 a Bitcoin Core t
1060: 65 73 74 20 74 61 62 6c 65 2c 20 35 20 6f 66 20 est table, 5 of
1070: 31 36 20 72 6f 75 74 65 72 73 20 6f 72 20 73 65 16 routers or se
1080: 72 76 69 63 65 73 20 77 6f 72 6b 65 64 20 77 69 rvices worked wi
1090: 74 68 20 50 43 50 20 6f 72 20 4e 41 54 2d 50 4d th PCP or NAT-PM
10a0: 50 20 75 6e 74 6f 75 63 68 65 64 2e 20 41 20 62 P untouched. A b
10b0: 6f 6e 75 73 2c 20 6e 6f 74 20 61 20 62 61 73 65 onus, not a base
10c0: 2e 0a 0a 38 2e 20 54 68 65 20 74 68 72 65 61 64 ...8. The thread
10d0: 3a 20 66 6f 75 72 20 70 6f 73 74 73 2c 20 6e 6f : four posts, no
10e0: 20 64 65 63 69 73 69 6f 6e 2c 20 6e 6f 20 72 65 decision, no re
10f0: 70 6c 79 20 66 72 6f 6d 20 66 6f 72 75 6d 20 73 ply from forum s
1100: 74 61 66 66 2e 20 54 77 6f 20 75 73 65 72 73 20 taff. Two users
1110: 74 68 65 20 66 6f 72 75 6d 20 6d 61 72 6b 73 20 the forum marks
1120: 22 43 6f 6e 74 72 69 62 75 74 6f 72 22 20 73 61 "Contributor" sa
1130: 79 20 53 79 6e 63 74 68 69 6e 67 20 61 6c 72 65 y Syncthing alre
1140: 61 64 79 20 70 75 6e 63 68 65 73 20 6f 76 65 72 ady punches over
1150: 20 54 43 50 20 61 6e 64 20 55 44 50 20 77 68 65 TCP and UDP whe
1160: 72 65 20 69 74 20 63 61 6e 2e 20 4f 6e 65 20 61 re it can. One a
1170: 64 64 73 20 74 68 61 74 20 54 61 69 6c 73 63 61 dds that Tailsca
1180: 6c 65 20 6f 6e 6c 79 20 70 75 6c 6c 73 20 6d 6f le only pulls mo
1190: 72 65 20 74 72 69 63 6b 73 20 66 6f 72 20 4e 41 re tricks for NA
11a0: 54 73 20 74 68 61 74 20 6d 61 70 20 65 61 63 68 Ts that map each
11b0: 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 64 69 66 destination dif
11c0: 66 65 72 65 6e 74 6c 79 2e 0a 0a 53 6d 61 6c 6c ferently...Small
11d0: 65 73 74 20 77 6f 72 74 68 20 62 75 69 6c 64 69 est worth buildi
11e0: 6e 67 3a 20 61 20 77 61 69 74 20 70 61 67 65 2e ng: a wait page.
11f0: 20 54 68 65 20 6e 6f 64 65 20 61 73 6b 73 20 74 The node asks t
1200: 68 65 20 70 75 62 6c 69 63 20 73 65 72 76 65 72 he public server
1210: 20 74 6f 20 61 6e 73 77 65 72 20 6f 6e 63 65 20 to answer once
1220: 69 74 73 20 72 65 63 65 69 70 74 20 6e 75 6d 62 its receipt numb
1230: 65 72 20 28 46 6f 73 73 69 6c 20 6e 75 6d 62 65 er (Fossil numbe
1240: 72 73 20 65 61 63 68 20 61 72 72 69 76 61 6c 29 rs each arrival)
1250: 20 70 61 73 73 65 73 20 4e 2e 20 41 20 73 63 72 passes N. A scr
1260: 69 70 74 20 75 6e 64 65 72 20 46 6f 73 73 69 6c ipt under Fossil
1270: 27 73 20 2f 65 78 74 20 63 68 65 63 6b 73 20 65 's /ext checks e
1280: 61 63 68 20 73 65 63 6f 6e 64 2c 20 61 73 20 2f ach second, as /
1290: 63 68 61 74 2d 70 6f 6c 6c 20 64 6f 65 73 2e 20 chat-poll does.
12a0: 54 68 65 20 6e 6f 64 65 20 73 79 6e 63 73 20 61 The node syncs a
12b0: 6e 64 20 61 73 6b 73 20 61 67 61 69 6e 20 77 69 nd asks again wi
12c0: 74 68 20 74 68 65 20 6e 65 77 20 6e 75 6d 62 65 th the new numbe
12d0: 72 2c 20 73 6f 20 6e 6f 74 68 69 6e 67 20 74 68 r, so nothing th
12e0: 61 74 20 61 72 72 69 76 65 73 20 62 65 74 77 65 at arrives betwe
12f0: 65 6e 20 61 73 6b 73 20 69 73 20 6d 69 73 73 65 en asks is misse
1300: 64 2e 20 49 74 20 61 6c 73 6f 20 61 76 6f 69 64 d. It also avoid
1310: 73 20 77 61 69 74 69 6e 67 20 6f 6e 20 74 68 65 s waiting on the
1320: 20 61 66 74 65 72 2d 72 65 63 65 69 76 65 20 68 after-receive h
1330: 6f 6f 6b 2c 20 77 68 69 63 68 20 63 61 6e 20 72 ook, which can r
1340: 75 6e 20 61 20 6d 69 6e 75 74 65 20 6f 72 20 6d un a minute or m
1350: 6f 72 65 20 6c 61 74 65 2e 0a 0a 43 6f 73 74 3a ore late...Cost:
1360: 20 6f 6e 65 20 73 63 72 69 70 74 2c 20 6e 6f 74 one script, not
1370: 20 79 65 74 20 62 75 69 6c 74 20 6f 72 20 74 72 yet built or tr
1380: 69 65 64 3b 20 74 77 6f 20 73 65 72 76 65 72 20 ied; two server
1390: 70 72 6f 63 65 73 73 65 73 20 70 65 72 20 77 61 processes per wa
13a0: 69 74 69 6e 67 20 6e 6f 64 65 3b 20 72 65 70 6c iting node; repl
13b0: 69 65 73 20 77 69 74 68 69 6e 20 46 6f 73 73 69 ies within Fossi
13c0: 6c 27 73 20 64 65 66 61 75 6c 74 20 36 30 30 20 l's default 600
13d0: 73 20 72 65 71 75 65 73 74 20 6c 69 6d 69 74 3b s request limit;
13e0: 20 2d 2d 65 78 74 72 6f 6f 74 20 6f 6e 20 74 68 --extroot on th
13f0: 65 20 73 65 72 76 65 72 2e 20 4e 6f 74 20 63 68 e server. Not ch
1400: 65 63 6b 65 64 3a 20 77 68 65 74 68 65 72 20 70 ecked: whether p
1410: 72 6f 78 69 65 73 20 63 75 74 20 6c 6f 6e 67 20 roxies cut long
1420: 72 65 71 75 65 73 74 73 2e 0a 0a 4e 6f 74 20 73 requests...Not s
1430: 6f 6c 76 65 64 3a 20 73 79 6e 63 69 6e 67 20 77 olved: syncing w
1440: 69 74 68 6f 75 74 20 74 68 65 20 70 75 62 6c 69 ithout the publi
1450: 63 20 73 65 72 76 65 72 2c 20 6f 72 20 61 20 6e c server, or a n
1460: 6f 64 65 20 74 68 61 74 20 63 61 6e 6e 6f 74 20 ode that cannot
1470: 72 65 61 63 68 20 69 74 2e 0a 0a 53 4f 55 52 43 reach it...SOURC
1480: 45 53 3a 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 ES:.https://foss
1490: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
14a0: 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f 73 79 doc/trunk/www/sy
14b0: 6e 63 2e 77 69 6b 69 23 74 72 61 6e 73 70 6f 72 nc.wiki#transpor
14c0: 74 20 28 22 41 6c 6c 20 63 6f 6d 6d 75 6e 69 63 t ("All communic
14d0: 61 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 63 6c ation between cl
14e0: 69 65 6e 74 20 61 6e 64 20 73 65 72 76 65 72 20 ient and server
14f0: 69 73 20 76 69 61 20 48 54 54 50 20 72 65 71 75 is via HTTP requ
1500: 65 73 74 73 2e 20 54 68 65 20 73 65 72 76 65 72 ests. The server
1510: 20 69 73 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f is listening fo
1520: 72 20 69 6e 63 6f 6d 69 6e 67 20 48 54 54 50 20 r incoming HTTP
1530: 72 65 71 75 65 73 74 73 2e 22 29 0a 68 74 74 70 requests.").http
1540: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
1550: 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d rg/home/file?nam
1560: 65 3d 73 72 63 2f 78 66 65 72 2e 63 26 63 69 3d e=src/xfer.c&ci=
1570: 32 63 66 63 33 39 38 65 26 6c 6e 3d 31 38 36 31 2cfc398e&ln=1861
1580: 2d 31 38 37 32 20 28 22 70 72 61 67 6d 61 20 63 -1872 ("pragma c
1590: 6c 69 65 6e 74 2d 75 72 6c 20 2e 2e 2e 20 74 68 lient-url ... th
15a0: 65 69 72 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 eir relationship
15b0: 20 63 6f 75 6c 64 2c 20 69 6e 20 74 68 65 6f 72 could, in theor
15c0: 79 2c 20 62 65 20 69 6e 76 65 72 74 65 64 20 62 y, be inverted b
15d0: 79 20 68 61 76 69 6e 67 20 74 68 65 20 73 65 72 y having the ser
15e0: 76 65 72 20 63 61 6c 6c 20 74 68 65 20 63 6c 69 ver call the cli
15f0: 65 6e 74 20 61 74 20 55 52 4c 22 3b 20 69 74 20 ent at URL"; it
1600: 6f 6e 6c 79 20 63 61 6c 6c 73 20 78 66 65 72 5f only calls xfer_
1610: 73 79 6e 63 77 69 74 68 28 29 2c 20 77 68 69 63 syncwith(), whic
1620: 68 20 77 72 69 74 65 73 20 61 20 22 73 79 6e 63 h writes a "sync
1630: 66 72 6f 6d 3a 55 52 4c 22 20 63 6f 6e 66 69 67 from:URL" config
1640: 20 72 6f 77 29 0a 68 74 74 70 73 3a 2f 2f 66 6f row).https://fo
1650: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
1660: 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f e/file?name=src/
1670: 63 68 61 74 2e 63 26 63 69 3d 32 63 66 63 33 39 chat.c&ci=2cfc39
1680: 38 65 26 6c 6e 3d 36 32 39 2d 37 39 31 20 28 22 8e&ln=629-791 ("
1690: 68 61 6e 67 69 6e 67 2d 47 45 54 20 6f 72 20 6c hanging-GET or l
16a0: 6f 6e 67 2d 70 6f 6c 6c 22 3b 20 69 44 65 6c 61 ong-poll"; iDela
16b0: 79 20 3d 20 31 30 30 30 20 6d 73 3b 20 50 52 41 y = 1000 ms; PRA
16c0: 47 4d 41 20 72 65 70 6f 73 69 74 6f 72 79 2e 64 GMA repository.d
16d0: 61 74 61 5f 76 65 72 73 69 6f 6e 3b 20 63 68 61 ata_version; cha
16e0: 74 2d 70 6f 6c 6c 2d 74 69 6d 65 6f 75 74 20 64 t-poll-timeout d
16f0: 65 66 61 75 6c 74 20 34 32 30 29 0a 68 74 74 70 efault 420).http
1700: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
1710: 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d rg/home/file?nam
1720: 65 3d 73 72 63 2f 73 63 68 65 6d 61 2e 63 26 63 e=src/schema.c&c
1730: 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 31 30 i=2cfc398e&ln=10
1740: 31 2d 31 31 30 20 28 22 57 68 65 6e 65 76 65 72 1-110 ("Whenever
1750: 20 6e 65 77 20 62 6c 6f 62 73 20 61 72 65 20 72 new blobs are r
1760: 65 63 65 69 76 65 64 20 69 6e 74 6f 20 74 68 65 eceived into the
1770: 20 72 65 70 6f 73 69 74 6f 72 79 2c 20 61 6e 20 repository, an
1780: 65 6e 74 72 79 20 69 6e 20 74 68 69 73 20 74 61 entry in this ta
1790: 62 6c 65 20 72 65 63 6f 72 64 73 20 74 68 65 20 ble records the
17a0: 73 6f 75 72 63 65 22 3b 20 72 63 76 69 64 20 49 source"; rcvid I
17b0: 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b NTEGER PRIMARY K
17c0: 45 59 29 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 EY).https://foss
17d0: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
17e0: 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 68 6f file?name=src/ho
17f0: 6f 6b 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 ok.c&ci=2cfc398e
1800: 26 6c 6e 3d 34 34 35 2d 34 36 33 20 28 68 6f 6f &ln=445-463 (hoo
1810: 6b 5f 62 61 63 6b 6f 66 66 69 63 65 20 73 6b 69 k_backoffice ski
1820: 70 73 20 77 6f 72 6b 20 69 6e 73 69 64 65 20 27 ps work inside '
1830: 68 6f 6f 6b 2d 65 6d 62 61 72 67 6f 27 20 61 6e hook-embargo' an
1840: 64 20 63 6f 6d 70 61 72 65 73 20 6d 61 78 28 72 d compares max(r
1850: 63 76 69 64 29 29 0a 68 74 74 70 73 3a 2f 2f 66 cvid)).https://f
1860: 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f ossil-scm.org/ho
1870: 6d 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 me/doc/trunk/www
1880: 2f 73 65 72 76 65 72 65 78 74 2e 77 69 6b 69 20 /serverext.wiki
1890: 28 22 2d 2d 65 78 74 72 6f 6f 74 20 44 49 52 45 ("--extroot DIRE
18a0: 43 54 4f 52 59 22 3b 20 22 46 69 6c 65 73 20 74 CTORY"; "Files t
18b0: 68 61 74 20 61 72 65 20 65 78 65 63 75 74 61 62 hat are executab
18c0: 6c 65 20 61 72 65 20 72 75 6e 20 61 73 20 43 47 le are run as CG
18d0: 49 22 29 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 I").https://foss
18e0: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
18f0: 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 65 78 file?name=src/ex
1900: 74 63 67 69 2e 63 26 63 69 3d 32 63 66 63 33 39 tcgi.c&ci=2cfc39
1910: 38 65 26 6c 6e 3d 32 39 32 2d 33 36 36 20 28 70 8e&ln=292-366 (p
1920: 6f 70 65 6e 32 20 73 74 61 72 74 73 20 61 20 63 open2 starts a c
1930: 68 69 6c 64 20 43 47 49 20 70 72 6f 63 65 73 73 hild CGI process
1940: 3b 20 46 6f 73 73 69 6c 20 72 65 61 64 73 20 69 ; Fossil reads i
1950: 74 73 20 77 68 6f 6c 65 20 72 65 70 6c 79 29 0a ts whole reply).
1960: 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 https://fossil-s
1970: 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 cm.org/home/file
1980: 3f 6e 61 6d 65 3d 73 72 63 2f 6d 61 69 6e 2e 63 ?name=src/main.c
1990: 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d &ci=2cfc398e&ln=
19a0: 33 36 36 39 2d 33 36 37 35 20 28 61 20 63 68 69 3669-3675 (a chi
19b0: 6c 64 20 70 72 6f 63 65 73 73 20 66 6f 72 20 65 ld process for e
19c0: 61 63 68 20 63 6f 6e 6e 65 63 74 69 6f 6e 3b 20 ach connection;
19d0: 66 6f 73 73 69 6c 5f 73 65 74 5f 74 69 6d 65 6f fossil_set_timeo
19e0: 75 74 28 46 4f 53 53 49 4c 5f 44 45 46 41 55 4c ut(FOSSIL_DEFAUL
19f0: 54 5f 54 49 4d 45 4f 55 54 29 2c 20 77 68 69 63 T_TIMEOUT), whic
1a00: 68 20 69 73 20 36 30 30 2c 20 75 6e 6c 65 73 73 h is 600, unless
1a10: 20 2d 2d 6d 61 78 2d 6c 61 74 65 6e 63 79 20 69 --max-latency i
1a20: 73 20 67 69 76 65 6e 29 0a 68 74 74 70 73 3a 2f s given).https:/
1a30: 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f /fossil-scm.org/
1a40: 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 home/doc/trunk/w
1a50: 77 77 2f 68 6f 6f 6b 73 2e 6d 64 20 28 22 72 75 ww/hooks.md ("ru
1a60: 6e 20 62 79 20 74 68 65 20 62 61 63 6b 6f 66 66 n by the backoff
1a70: 69 63 65 22 3b 20 22 64 65 66 65 72 20 72 75 6e ice"; "defer run
1a80: 6e 69 6e 67 20 74 68 65 20 61 66 74 65 72 2d 72 ning the after-r
1a90: 65 63 65 69 76 65 20 70 75 73 68 20 66 6f 72 20 eceive push for
1aa0: 36 30 20 73 65 63 6f 6e 64 73 22 29 0a 68 74 74 60 seconds").htt
1ab0: 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e ps://fossil-scm.
1ac0: 6f 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 org/home/doc/tru
1ad0: 6e 6b 2f 77 77 77 2f 62 61 63 6b 6f 66 66 69 63 nk/www/backoffic
1ae0: 65 2e 6d 64 20 28 22 77 69 6c 6c 20 6e 6f 74 20 e.md ("will not
1af0: 6f 63 63 75 72 20 6d 6f 72 65 20 66 72 65 71 75 occur more frequ
1b00: 65 6e 74 6c 79 20 74 68 61 6e 20 6f 6e 63 65 20 ently than once
1b10: 65 76 65 72 79 20 36 30 20 73 65 63 6f 6e 64 73 every 60 seconds
1b20: 22 3b 20 22 49 66 20 61 20 46 6f 73 73 69 6c 20 "; "If a Fossil
1b30: 73 65 72 76 65 72 20 69 73 20 69 64 6c 65 2c 20 server is idle,
1b40: 74 68 65 6e 20 6e 6f 20 62 61 63 6b 6f 66 66 69 then no backoffi
1b50: 63 65 20 70 72 6f 63 65 73 73 65 73 20 77 69 6c ce processes wil
1b60: 6c 20 62 65 20 72 75 6e 6e 69 6e 67 22 29 0a 68 l be running").h
1b70: 74 74 70 73 3a 2f 2f 77 77 77 2e 73 71 6c 69 74 ttps://www.sqlit
1b80: 65 2e 6f 72 67 2f 70 72 61 67 6d 61 2e 68 74 6d e.org/pragma.htm
1b90: 6c 23 70 72 61 67 6d 61 5f 64 61 74 61 5f 76 65 l#pragma_data_ve
1ba0: 72 73 69 6f 6e 0a 68 74 74 70 73 3a 2f 2f 77 77 rsion.https://ww
1bb0: 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 w.rfc-editor.org
1bc0: 2f 72 66 63 2f 72 66 63 35 31 32 38 2e 68 74 6d /rfc/rfc5128.htm
1bd0: 6c 20 28 72 65 6e 64 65 7a 76 6f 75 73 20 73 65 l (rendezvous se
1be0: 72 76 65 72 3b 20 63 6f 6e 6e 65 63 74 69 6f 6e rver; connection
1bf0: 20 72 65 76 65 72 73 61 6c 20 22 6f 6e 6c 79 20 reversal "only
1c00: 77 6f 72 6b 73 20 73 6f 20 6c 6f 6e 67 20 61 73 works so long as
1c10: 20 6f 6e 6c 79 20 6f 6e 65 20 6f 66 20 74 68 65 only one of the
1c20: 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6e 67 20 70 communicating p
1c30: 65 65 72 73 20 69 73 20 62 65 68 69 6e 64 20 61 eers is behind a
1c40: 20 4e 41 54 22 29 0a 68 74 74 70 73 3a 2f 2f 62 NAT").https://b
1c50: 66 6f 72 64 2e 69 6e 66 6f 2f 70 75 62 2f 6e 65 ford.info/pub/ne
1c60: 74 2f 70 32 70 6e 61 74 2f 20 28 63 6c 69 65 6e t/p2pnat/ (clien
1c70: 74 73 20 22 61 6c 72 65 61 64 79 20 68 61 76 65 ts "already have
1c80: 20 61 63 74 69 76 65 20 55 44 50 20 73 65 73 73 active UDP sess
1c90: 69 6f 6e 73 20 77 69 74 68 20 61 20 72 65 6e 64 ions with a rend
1ca0: 65 7a 76 6f 75 73 20 73 65 72 76 65 72 20 53 22 ezvous server S"
1cb0: 3b 20 4e 41 54 73 20 61 6c 6c 6f 63 61 74 65 20 ; NATs allocate
1cc0: 70 75 62 6c 69 63 20 65 6e 64 70 6f 69 6e 74 73 public endpoints
1cd0: 20 66 6f 72 20 6f 75 74 67 6f 69 6e 67 20 73 65 for outgoing se
1ce0: 73 73 69 6f 6e 73 29 0a 68 74 74 70 73 3a 2f 2f ssions).https://
1cf0: 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f www.rfc-editor.o
1d00: 72 67 2f 72 66 63 2f 72 66 63 38 34 34 35 2e 68 rg/rfc/rfc8445.h
1d10: 74 6d 6c 20 28 22 49 43 45 20 61 73 73 75 6d 65 tml ("ICE assume
1d20: 73 20 74 68 61 74 20 74 68 65 20 61 67 65 6e 74 s that the agent
1d30: 73 20 61 72 65 20 61 62 6c 65 20 74 6f 20 65 73 s are able to es
1d40: 74 61 62 6c 69 73 68 20 61 20 73 69 67 6e 61 6c tablish a signal
1d50: 69 6e 67 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 62 ing connection b
1d60: 65 74 77 65 65 6e 20 65 61 63 68 20 6f 74 68 65 etween each othe
1d70: 72 22 29 0a 68 74 74 70 73 3a 2f 2f 77 77 77 2e r").https://www.
1d80: 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f 72 rfc-editor.org/r
1d90: 66 63 2f 72 66 63 38 34 38 39 2e 68 74 6d 6c 20 fc/rfc8489.html
1da0: 28 53 54 55 4e 20 6c 65 74 73 20 61 6e 20 65 6e (STUN lets an en
1db0: 64 70 6f 69 6e 74 20 22 64 65 74 65 72 6d 69 6e dpoint "determin
1dc0: 65 20 74 68 65 20 49 50 20 61 64 64 72 65 73 73 e the IP address
1dd0: 20 61 6e 64 20 70 6f 72 74 20 61 6c 6c 6f 63 61 and port alloca
1de0: 74 65 64 20 74 6f 20 69 74 20 62 79 20 61 20 4e ted to it by a N
1df0: 41 54 22 3b 20 55 44 50 20 61 6e 64 20 54 43 50 AT"; UDP and TCP
1e00: 29 0a 68 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 ).https://www.rf
1e10: 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 c-editor.org/rfc
1e20: 2f 72 66 63 35 33 38 32 2e 68 74 6d 6c 0a 68 74 /rfc5382.html.ht
1e30: 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e tps://tailscale.
1e40: 63 6f 6d 2f 62 6c 6f 67 2f 68 6f 77 2d 6e 61 74 com/blog/how-nat
1e50: 2d 74 72 61 76 65 72 73 61 6c 2d 77 6f 72 6b 73 -traversal-works
1e60: 20 28 44 45 52 50 20 69 73 20 75 73 65 64 20 22 (DERP is used "
1e70: 61 73 20 61 20 64 61 74 61 20 72 65 6c 61 79 20 as a data relay
1e80: 77 68 65 6e 20 4e 41 54 20 74 72 61 76 65 72 73 when NAT travers
1e90: 61 6c 20 66 61 69 6c 73 20 2e 2e 2e 20 61 6e 64 al fails ... and
1ea0: 20 61 73 20 74 68 65 20 73 69 64 65 20 63 68 61 as the side cha
1eb0: 6e 6e 65 6c 22 3b 20 43 47 4e 41 54 3b 20 70 65 nnel"; CGNAT; pe
1ec0: 72 2d 64 65 73 74 69 6e 61 74 69 6f 6e 20 6d 61 r-destination ma
1ed0: 70 70 69 6e 67 73 29 0a 68 74 74 70 73 3a 2f 2f ppings).https://
1ee0: 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d 2f 62 6c tailscale.com/bl
1ef0: 6f 67 2f 68 6f 77 2d 74 61 69 6c 73 63 61 6c 65 og/how-tailscale
1f00: 2d 77 6f 72 6b 73 20 28 6e 6f 64 65 20 22 6c 65 -works (node "le
1f10: 61 76 65 73 20 69 74 73 20 70 75 62 6c 69 63 20 aves its public
1f20: 6b 65 79 20 61 6e 64 20 61 20 6e 6f 74 65 20 61 key and a note a
1f30: 62 6f 75 74 20 77 68 65 72 65 20 74 68 61 74 20 bout where that
1f40: 6e 6f 64 65 20 63 61 6e 20 63 75 72 72 65 6e 74 node can current
1f50: 6c 79 20 62 65 20 66 6f 75 6e 64 22 29 0a 68 74 ly be found").ht
1f60: 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e tps://tailscale.
1f70: 63 6f 6d 2f 6b 62 2f 31 32 33 32 2f 64 65 72 70 com/kb/1232/derp
1f80: 2d 73 65 72 76 65 72 73 20 28 63 75 73 74 6f 6d -servers (custom
1f90: 20 44 45 52 50 3a 20 22 62 75 69 6c 64 2c 20 64 DERP: "build, d
1fa0: 65 70 6c 6f 79 2c 20 61 6e 64 20 75 70 64 61 74 eploy, and updat
1fb0: 65 20 74 68 65 20 63 6d 64 2f 64 65 72 70 65 72 e the cmd/derper
1fc0: 20 62 69 6e 61 72 79 22 29 0a 68 74 74 70 73 3a binary").https:
1fd0: 2f 2f 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d 2f //tailscale.com/
1fe0: 62 6c 6f 67 2f 70 65 65 72 2d 72 65 6c 61 79 73 blog/peer-relays
1ff0: 2d 67 61 20 28 22 63 75 73 74 6f 6d 65 72 2d 64 -ga ("customer-d
2000: 65 70 6c 6f 79 65 64 22 20 72 65 6c 61 79 73 29 eployed" relays)
2010: 0a 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e 73 79 .https://docs.sy
2020: 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 65 72 ncthing.net/user
2030: 73 2f 73 74 64 69 73 63 6f 73 72 76 2e 68 74 6d s/stdiscosrv.htm
2040: 6c 0a 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 l.https://raw.gi
2050: 74 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e thubusercontent.
2060: 63 6f 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 64 6f com/syncthing/do
2070: 63 73 2f 6d 61 69 6e 2f 75 73 65 72 73 2f 72 65 cs/main/users/re
2080: 6c 61 79 69 6e 67 2e 72 73 74 0a 68 74 74 70 73 laying.rst.https
2090: 3a 2f 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 ://raw.githubuse
20a0: 72 63 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e rcontent.com/syn
20b0: 63 74 68 69 6e 67 2f 64 6f 63 73 2f 6d 61 69 6e cthing/docs/main
20c0: 2f 75 73 65 72 73 2f 73 74 72 65 6c 61 79 73 72 /users/strelaysr
20d0: 76 2e 72 73 74 0a 68 74 74 70 73 3a 2f 2f 72 61 v.rst.https://ra
20e0: 77 2e 67 69 74 68 75 62 75 73 65 72 63 6f 6e 74 w.githubusercont
20f0: 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 68 69 6e ent.com/syncthin
2100: 67 2f 64 6f 63 73 2f 6d 61 69 6e 2f 75 73 65 72 g/docs/main/user
2110: 73 2f 63 6f 6e 66 69 67 2e 72 73 74 20 28 73 74 s/config.rst (st
2120: 75 6e 53 65 72 76 65 72 20 22 64 65 66 61 75 6c unServer "defaul
2130: 74 22 20 65 78 70 61 6e 64 73 20 74 6f 20 70 75 t" expands to pu
2140: 62 6c 69 63 20 53 54 55 4e 20 73 65 72 76 65 72 blic STUN server
2150: 73 29 0a 68 74 74 70 73 3a 2f 2f 61 72 78 69 76 s).https://arxiv
2160: 2e 6f 72 67 2f 61 62 73 2f 32 35 31 30 2e 32 37 .org/abs/2510.27
2170: 35 30 30 20 28 22 37 30 25 20 c2 b1 20 37 2e 31 500 ("70% ± 7.1
2180: 25 20 66 6f 72 20 74 68 65 20 68 6f 6c 65 2d 70 % for the hole-p
2190: 75 6e 63 68 69 6e 67 20 73 74 61 67 65 22 2c 20 unching stage",
21a0: 44 43 55 74 52 20 69 6e 20 49 50 46 53 2c 20 34 DCUtR in IPFS, 4
21b0: 2e 34 20 6d 69 6c 6c 69 6f 6e 20 61 74 74 65 6d .4 million attem
21c0: 70 74 73 29 0a 68 74 74 70 73 3a 2f 2f 77 77 77 pts).https://www
21d0: 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f .rfc-editor.org/
21e0: 72 66 63 2f 72 66 63 36 38 38 36 2e 68 74 6d 6c rfc/rfc6886.html
21f0: 20 28 72 65 71 75 65 73 74 73 20 67 6f 20 22 74 (requests go "t
2200: 6f 20 74 68 65 69 72 20 64 65 66 61 75 6c 74 20 o their default
2210: 67 61 74 65 77 61 79 22 3b 20 72 65 63 75 72 73 gateway"; recurs
2220: 69 76 65 20 6d 61 70 70 69 6e 67 20 22 74 68 69 ive mapping "thi
2230: 73 20 64 6f 63 75 6d 65 6e 74 20 64 6f 65 73 20 s document does
2240: 6e 6f 74 20 61 64 76 6f 63 61 74 65 22 29 0a 68 not advocate").h
2250: 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 ttps://www.rfc-e
2260: 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 ditor.org/rfc/rf
2270: 63 36 38 38 37 2e 68 74 6d 6c 20 28 22 64 65 73 c6887.html ("des
2280: 69 67 6e 65 64 20 74 6f 20 62 65 20 69 6d 70 6c igned to be impl
2290: 65 6d 65 6e 74 65 64 20 69 6e 20 74 68 65 20 63 emented in the c
22a0: 6f 6e 74 65 78 74 20 6f 66 20 43 61 72 72 69 65 ontext of Carrie
22b0: 72 2d 47 72 61 64 65 20 4e 41 54 73 20 2e 2e 2e r-Grade NATs ...
22c0: 20 61 73 20 77 65 6c 6c 20 61 73 22 20 68 6f 6d as well as" hom
22d0: 65 20 4e 41 54 73 3b 20 6e 65 73 74 65 64 20 4e e NATs; nested N
22e0: 41 54 20 22 6d 61 79 20 69 74 73 65 6c 66 20 61 AT "may itself a
22f0: 63 74 20 61 73 20 61 20 50 43 50 20 63 6c 69 65 ct as a PCP clie
2300: 6e 74 20 74 6f 20 74 68 65 20 75 70 73 74 72 65 nt to the upstre
2310: 61 6d 20 4e 41 54 22 29 0a 68 74 74 70 73 3a 2f am NAT").https:/
2320: 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e /www.rfc-editor.
2330: 6f 72 67 2f 72 66 63 2f 72 66 63 36 39 37 30 2e org/rfc/rfc6970.
2340: 68 74 6d 6c 0a 68 74 74 70 73 3a 2f 2f 72 61 77 html.https://raw
2350: 2e 67 69 74 68 75 62 75 73 65 72 63 6f 6e 74 65 .githubuserconte
2360: 6e 74 2e 63 6f 6d 2f 6d 69 6e 69 75 70 6e 70 2f nt.com/miniupnp/
2370: 6d 69 6e 69 75 70 6e 70 2f 6d 61 73 74 65 72 2f miniupnp/master/
2380: 6d 69 6e 69 75 70 6e 70 64 2f 6d 69 6e 69 75 70 miniupnpd/miniup
2390: 6e 70 64 2e 63 6f 6e 66 20 28 22 45 6e 61 62 6c npd.conf ("Enabl
23a0: 65 20 4e 41 54 2d 50 4d 50 20 61 6e 64 20 50 43 e NAT-PMP and PC
23b0: 50 20 73 75 70 70 6f 72 74 20 28 64 65 66 61 75 P support (defau
23c0: 6c 74 20 69 73 20 6e 6f 29 22 29 0a 68 74 74 70 lt is no)").http
23d0: 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 62 s://github.com/b
23e0: 69 74 63 6f 69 6e 2f 62 69 74 63 6f 69 6e 2f 69 itcoin/bitcoin/i
23f0: 73 73 75 65 73 2f 33 31 36 36 33 20 28 31 36 2d ssues/31663 (16-
2400: 72 6f 77 20 63 6f 6d 70 61 74 69 62 69 6c 69 74 row compatibilit
2410: 79 20 74 61 62 6c 65 3b 20 35 20 72 6f 77 73 20 y table; 5 rows
2420: 6d 61 72 6b 65 64 20 65 6e 61 62 6c 65 64 20 62 marked enabled b
2430: 79 20 64 65 66 61 75 6c 74 20 61 6e 64 20 77 6f y default and wo
2440: 72 6b 69 6e 67 29 0a 68 74 74 70 73 3a 2f 2f 66 rking).https://f
2450: 6f 72 75 6d 2e 73 79 6e 63 74 68 69 6e 67 2e 6e orum.syncthing.n
2460: 65 74 2f 72 61 77 2f 32 32 34 37 31 0a 68 74 74 et/raw/22471.htt
2470: 70 73 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 ps://forum.synct
2480: 68 69 6e 67 2e 6e 65 74 2f 74 2f 32 32 34 37 31 hing.net/t/22471
2490: 2e 6a 73 6f 6e 20 28 70 6f 73 74 73 5f 63 6f 75 .json (posts_cou
24a0: 6e 74 20 34 3b 20 68 61 73 5f 61 63 63 65 70 74 nt 4; has_accept
24b0: 65 64 5f 61 6e 73 77 65 72 20 66 61 6c 73 65 3b ed_answer false;
24c0: 20 6e 6f 20 6d 6f 64 65 72 61 74 6f 72 2c 20 61 no moderator, a
24d0: 64 6d 69 6e 20 6f 72 20 73 74 61 66 66 20 70 6f dmin or staff po
24e0: 73 74 73 3b 20 62 74 39 30 20 61 6e 64 20 4e 75 sts; bt90 and Nu
24f0: 6d 6d 65 72 33 37 38 20 61 72 65 20 69 6e 20 74 mmer378 are in t
2500: 68 65 20 22 63 6f 6e 74 72 69 62 75 74 6f 72 73 he "contributors
2510: 22 20 67 72 6f 75 70 29 0a 0a 43 48 41 4e 47 45 " group)..CHANGE
2520: 44 3a 0a 2d 20 49 74 65 6d 20 31 3a 20 22 6e 6f D:.- Item 1: "no
2530: 20 77 61 79 22 20 62 65 63 61 6d 65 20 22 6e 6f way" became "no
2540: 20 62 75 69 6c 74 2d 69 6e 20 77 61 79 22 2c 20 built-in way",
2550: 77 69 74 68 20 61 20 6e 6f 74 65 20 74 68 61 74 with a note that
2560: 20 74 68 65 20 73 65 72 76 65 72 20 6f 6e 6c 79 the server only
2570: 20 72 65 63 6f 72 64 73 20 61 20 55 52 4c 20 74 records a URL t
2580: 68 65 20 63 6c 6f 6e 65 20 72 65 70 6f 72 74 73 he clone reports
2590: 2e 20 54 68 65 20 63 69 74 65 64 20 78 66 65 72 . The cited xfer
25a0: 2e 63 20 6c 69 6e 65 73 20 64 65 73 63 72 69 62 .c lines describ
25b0: 65 20 61 20 63 6c 69 65 6e 74 2d 75 72 6c 20 70 e a client-url p
25c0: 72 61 67 6d 61 20 74 68 61 74 20 73 61 79 73 20 ragma that says
25d0: 74 68 65 20 72 6f 6c 65 73 20 22 63 6f 75 6c 64 the roles "could
25e0: 2c 20 69 6e 20 74 68 65 6f 72 79 2c 20 62 65 20 , in theory, be
25f0: 69 6e 76 65 72 74 65 64 22 2c 20 62 75 74 20 74 inverted", but t
2600: 68 65 20 73 65 72 76 65 72 20 6f 6e 6c 79 20 73 he server only s
2610: 74 6f 72 65 73 20 74 68 65 20 55 52 4c 2e 0a 2d tores the URL..-
2620: 20 49 74 65 6d 20 32 3a 20 22 61 6e 79 20 4e 41 Item 2: "any NA
2630: 54 22 20 62 65 63 61 6d 65 20 22 6e 65 61 72 6c T" became "nearl
2640: 79 20 65 76 65 72 79 20 4e 41 54 22 2e 20 54 68 y every NAT". Th
2650: 65 20 73 6f 75 72 63 65 73 20 73 61 79 20 4e 41 e sources say NA
2660: 54 73 20 22 67 65 6e 65 72 61 6c 6c 79 22 20 61 Ts "generally" a
2670: 6c 6c 6f 77 20 6f 75 74 62 6f 75 6e 64 20 73 65 llow outbound se
2680: 73 73 69 6f 6e 73 2c 20 6e 6f 74 20 61 6c 77 61 ssions, not alwa
2690: 79 73 2e 0a 2d 20 49 74 65 6d 20 32 3a 20 22 61 ys..- Item 2: "a
26a0: 6e 20 49 53 50 20 73 68 61 72 69 6e 67 20 6f 6e n ISP sharing on
26b0: 65 20 61 64 64 72 65 73 73 22 20 62 65 63 61 6d e address" becam
26c0: 65 20 22 73 68 61 72 69 6e 67 20 69 74 73 20 61 e "sharing its a
26d0: 64 64 72 65 73 73 65 73 20 61 6d 6f 6e 67 20 63 ddresses among c
26e0: 75 73 74 6f 6d 65 72 73 22 2e 20 54 61 69 6c 73 ustomers". Tails
26f0: 63 61 6c 65 20 64 65 73 63 72 69 62 65 73 20 43 cale describes C
2700: 47 4e 41 54 20 61 73 20 6d 61 70 70 69 6e 67 20 GNAT as mapping
2710: 63 75 73 74 6f 6d 65 72 73 20 6f 6e 74 6f 20 22 customers onto "
2720: 61 20 73 6d 61 6c 6c 65 72 20 6e 75 6d 62 65 72 a smaller number
2730: 20 6f 66 20 70 75 62 6c 69 63 20 49 50 73 22 2c of public IPs",
2740: 20 6e 6f 74 20 6f 6e 65 2e 0a 2d 20 49 74 65 6d not one..- Item
2750: 20 32 3a 20 22 74 68 61 74 20 73 61 6d 65 20 63 2: "that same c
2760: 6f 6e 6e 65 63 74 69 6f 6e 22 20 62 65 63 61 6d onnection" becam
2770: 65 20 22 73 75 63 68 20 61 20 63 6f 6e 6e 65 63 e "such a connec
2780: 74 69 6f 6e 20 74 6f 20 61 20 73 65 72 76 65 72 tion to a server
2790: 22 2e 20 48 6f 6c 65 20 70 75 6e 63 68 69 6e 67 ". Hole punching
27a0: 20 6e 65 65 64 73 20 65 61 63 68 20 70 65 65 72 needs each peer
27b0: 20 74 6f 20 68 61 76 65 20 61 20 73 65 73 73 69 to have a sessi
27c0: 6f 6e 20 77 69 74 68 20 61 20 72 65 6e 64 65 7a on with a rendez
27d0: 76 6f 75 73 20 73 65 72 76 65 72 2c 20 6e 6f 74 vous server, not
27e0: 20 74 68 65 20 6c 6f 6e 67 2d 70 6f 6c 6c 20 72 the long-poll r
27f0: 65 71 75 65 73 74 20 69 74 73 65 6c 66 2e 0a 2d equest itself..-
2800: 20 49 74 65 6d 20 36 3a 20 22 46 6f 73 73 69 6c Item 6: "Fossil
2810: 20 73 70 65 61 6b 73 20 6f 6e 6c 79 20 48 54 54 speaks only HTT
2820: 50 22 20 62 65 63 61 6d 65 20 22 46 6f 73 73 69 P" became "Fossi
2830: 6c 20 73 79 6e 63 20 73 70 65 61 6b 73 20 6f 6e l sync speaks on
2840: 6c 79 20 48 54 54 50 22 2e 20 73 79 6e 63 2e 77 ly HTTP". sync.w
2850: 69 6b 69 20 6d 61 6b 65 73 20 74 68 61 74 20 63 iki makes that c
2860: 6c 61 69 6d 20 66 6f 72 20 73 79 6e 63 2c 20 77 laim for sync, w
2870: 68 65 72 65 20 73 73 68 3a 20 61 6e 64 20 66 69 here ssh: and fi
2880: 6c 65 3a 20 61 6c 73 6f 20 63 61 72 72 79 20 48 le: also carry H
2890: 54 54 50 2e 0a 2d 20 49 74 65 6d 20 36 3a 20 61 TTP..- Item 6: a
28a0: 64 64 65 64 20 77 68 61 74 20 74 68 65 20 37 30 dded what the 70
28b0: 25 20 73 74 75 64 79 20 6d 65 61 73 75 72 65 64 % study measured
28c0: 20 28 34 2e 34 20 6d 69 6c 6c 69 6f 6e 20 74 72 (4.4 million tr
28d0: 69 65 73 20 69 6e 20 49 50 46 53 29 20 61 6e 64 ies in IPFS) and
28e0: 20 68 6f 77 20 61 64 64 72 65 73 73 65 73 20 77 how addresses w
28f0: 65 72 65 20 73 77 61 70 70 65 64 20 28 74 68 72 ere swapped (thr
2900: 6f 75 67 68 20 61 20 72 65 6c 61 79 29 2e 20 54 ough a relay). T
2910: 68 65 20 70 61 70 65 72 27 73 20 37 30 25 20 69 he paper's 70% i
2920: 73 20 74 68 65 20 68 6f 6c 65 2d 70 75 6e 63 68 s the hole-punch
2930: 69 6e 67 20 73 74 61 67 65 20 6f 66 20 44 43 55 ing stage of DCU
2940: 74 52 20 61 66 74 65 72 20 70 65 65 72 73 20 63 tR after peers c
2950: 6f 6e 6e 65 63 74 20 74 68 72 6f 75 67 68 20 61 onnect through a
2960: 20 72 65 6c 61 79 2e 0a 2d 20 49 74 65 6d 20 36 relay..- Item 6
2970: 3a 20 22 54 68 65 20 72 65 73 74 20 6e 65 65 64 : "The rest need
2980: 20 74 68 65 20 73 65 72 76 65 72 22 20 62 65 63 the server" bec
2990: 61 6d 65 20 22 73 74 61 79 20 6f 6e 20 74 68 65 ame "stay on the
29a0: 20 72 65 6c 61 79 2c 20 77 68 69 63 68 20 68 65 relay, which he
29b0: 72 65 20 77 6f 75 6c 64 20 62 65 20 6f 75 72 20 re would be our
29c0: 73 65 72 76 65 72 22 2e 20 49 6e 20 74 68 65 20 server". In the
29d0: 73 74 75 64 79 2c 20 66 61 69 6c 65 64 20 70 75 study, failed pu
29e0: 6e 63 68 65 73 20 73 74 61 79 20 72 65 6c 61 79 nches stay relay
29f0: 65 64 2e 0a 2d 20 49 74 65 6d 20 37 3a 20 22 68 ed..- Item 7: "h
2a00: 6f 6d 65 20 72 6f 75 74 65 72 22 20 62 65 63 61 ome router" beca
2a10: 6d 65 20 22 72 6f 75 74 65 72 22 2c 20 61 6e 64 me "router", and
2a20: 20 22 6e 6f 20 63 61 72 72 69 65 72 20 4e 41 54 "no carrier NAT
2a30: 20 6f 72 20 73 65 63 6f 6e 64 20 72 6f 75 74 65 or second route
2a40: 72 22 20 62 65 63 61 6d 65 20 22 64 65 66 65 61 r" became "defea
2a50: 74 73 20 69 74 20 75 6e 6c 65 73 73 20 74 68 61 ts it unless tha
2a60: 74 20 62 6f 78 20 61 6c 73 6f 20 73 70 65 61 6b t box also speak
2a70: 73 20 50 43 50 22 2e 20 52 46 43 20 36 38 38 37 s PCP". RFC 6887
2a80: 20 64 65 73 69 67 6e 73 20 50 43 50 20 66 6f 72 designs PCP for
2a90: 20 63 61 72 72 69 65 72 20 4e 41 54 73 20 61 6e carrier NATs an
2aa0: 64 20 6e 65 73 74 65 64 20 4e 41 54 73 2e 20 4f d nested NATs. O
2ab0: 6e 6c 79 20 4e 41 54 2d 50 4d 50 20 28 52 46 43 nly NAT-PMP (RFC
2ac0: 20 36 38 38 36 29 20 61 6e 64 20 55 50 6e 50 20 6886) and UPnP
2ad0: 49 47 44 20 77 69 74 68 6f 75 74 20 61 6e 20 69 IGD without an i
2ae0: 6e 74 65 72 77 6f 72 6b 69 6e 67 20 66 75 6e 63 nterworking func
2af0: 74 69 6f 6e 20 28 52 46 43 20 36 39 37 30 29 20 tion (RFC 6970)
2b00: 61 72 65 20 6c 69 6d 69 74 65 64 20 74 6f 20 74 are limited to t
2b10: 68 65 20 6c 6f 63 61 6c 20 67 61 74 65 77 61 79 he local gateway
2b20: 2e 0a 2d 20 49 74 65 6d 20 37 3a 20 22 74 65 73 ..- Item 7: "tes
2b30: 74 65 72 73 20 66 6f 75 6e 64 20 35 20 6f 66 20 ters found 5 of
2b40: 31 36 20 72 6f 75 74 65 72 73 20 6f 72 20 73 65 16 routers or se
2b50: 72 76 69 63 65 73 20 77 6f 72 6b 65 64 20 75 6e rvices worked un
2b60: 74 6f 75 63 68 65 64 22 20 62 65 63 61 6d 65 20 touched" became
2b70: 22 69 6e 20 61 20 42 69 74 63 6f 69 6e 20 43 6f "in a Bitcoin Co
2b80: 72 65 20 74 65 73 74 20 74 61 62 6c 65 2c 20 35 re test table, 5
2b90: 20 6f 66 20 31 36 20 77 6f 72 6b 65 64 20 77 69 of 16 worked wi
2ba0: 74 68 20 50 43 50 20 6f 72 20 4e 41 54 2d 50 4d th PCP or NAT-PM
2bb0: 50 20 75 6e 74 6f 75 63 68 65 64 22 2e 20 54 68 P untouched". Th
2bc0: 65 20 74 61 62 6c 65 20 74 65 73 74 73 20 6f 6e e table tests on
2bd0: 6c 79 20 50 43 50 20 61 6e 64 20 4e 41 54 2d 50 ly PCP and NAT-P
2be0: 4d 50 2c 20 73 69 6e 63 65 20 42 69 74 63 6f 69 MP, since Bitcoi
2bf0: 6e 20 43 6f 72 65 20 68 61 64 20 64 72 6f 70 70 n Core had dropp
2c00: 65 64 20 55 50 6e 50 2e 20 41 6c 73 6f 2c 20 61 ed UPnP. Also, a
2c10: 20 6c 61 74 65 72 20 63 6f 6d 6d 65 6e 74 20 28 later comment (
2c20: 69 6e 73 74 61 67 69 62 62 73 2c 20 4a 75 6c 79 instagibbs, July
2c30: 20 32 30 32 35 29 20 72 65 70 6f 72 74 73 20 61 2025) reports a
2c40: 20 56 65 72 69 7a 6f 6e 20 72 6f 75 74 65 72 20 Verizon router
2c50: 6e 6f 74 20 77 6f 72 6b 69 6e 67 2c 20 77 68 69 not working, whi
2c60: 6c 65 20 74 68 65 20 74 61 62 6c 65 20 6d 61 72 le the table mar
2c70: 6b 73 20 61 20 22 56 65 72 69 7a 6f 6e 20 64 65 ks a "Verizon de
2c80: 66 61 75 6c 74 2d 70 72 6f 76 69 64 65 64 20 72 fault-provided r
2c90: 6f 75 74 65 72 22 20 61 73 20 77 6f 72 6b 69 6e outer" as workin
2ca0: 67 2c 20 73 6f 20 35 20 6d 61 79 20 62 65 20 68 g, so 5 may be h
2cb0: 69 67 68 2e 0a 2d 20 49 74 65 6d 20 38 3a 20 22 igh..- Item 8: "
2cc0: 6e 6f 20 63 6f 72 65 20 6d 61 69 6e 74 61 69 6e no core maintain
2cd0: 65 72 22 20 62 65 63 61 6d 65 20 22 6e 6f 20 72 er" became "no r
2ce0: 65 70 6c 79 20 66 72 6f 6d 20 66 6f 72 75 6d 20 eply from forum
2cf0: 73 74 61 66 66 22 2e 20 54 68 65 20 4a 53 4f 4e staff". The JSON
2d00: 20 73 68 6f 77 73 20 6e 6f 20 6d 6f 64 65 72 61 shows no modera
2d10: 74 6f 72 2c 20 61 64 6d 69 6e 20 6f 72 20 73 74 tor, admin or st
2d20: 61 66 66 20 70 6f 73 74 73 2e 20 49 20 63 6f 75 aff posts. I cou
2d30: 6c 64 20 6e 6f 74 20 63 6f 6e 66 69 72 6d 20 77 ld not confirm w
2d40: 68 65 74 68 65 72 20 74 68 65 20 74 77 6f 20 22 hether the two "
2d50: 43 6f 6e 74 72 69 62 75 74 6f 72 22 20 75 73 65 Contributor" use
2d60: 72 73 20 61 72 65 20 63 6f 72 65 20 6d 61 69 6e rs are core main
2d70: 74 61 69 6e 65 72 73 2e 0a 2d 20 49 74 65 6d 20 tainers..- Item
2d80: 38 3a 20 22 41 20 63 6f 6e 74 72 69 62 75 74 6f 8: "A contributo
2d90: 72 20 73 61 79 73 22 20 62 65 63 61 6d 65 20 22 r says" became "
2da0: 54 77 6f 20 75 73 65 72 73 20 2e 2e 2e 20 73 61 Two users ... sa
2db0: 79 20 2e 2e 2e 20 77 68 65 72 65 20 69 74 20 63 y ... where it c
2dc0: 61 6e 22 2e 20 42 6f 74 68 20 62 74 39 30 20 28 an". Both bt90 (
2dd0: 22 69 66 20 70 6f 73 73 69 62 6c 65 22 29 20 61 "if possible") a
2de0: 6e 64 20 4e 75 6d 6d 65 72 33 37 38 20 28 22 77 nd Nummer378 ("w
2df0: 68 65 72 65 20 61 70 70 6c 69 63 61 62 6c 65 22 here applicable"
2e00: 29 20 73 61 79 20 53 79 6e 63 74 68 69 6e 67 20 ) say Syncthing
2e10: 70 75 6e 63 68 65 73 20 6f 76 65 72 20 54 43 50 punches over TCP
2e20: 20 61 6e 64 20 55 44 50 2e 20 54 68 65 20 54 61 and UDP. The Ta
2e30: 69 6c 73 63 61 6c 65 20 72 65 6d 61 72 6b 20 69 ilscale remark i
2e40: 73 20 62 74 39 30 27 73 20 61 6c 6f 6e 65 20 28 s bt90's alone (
2e50: 22 61 20 66 65 77 20 6d 6f 72 65 20 74 72 69 63 "a few more tric
2e60: 6b 73 20 74 6f 20 64 65 61 6c 20 77 69 74 68 20 ks to deal with
2e70: 45 6e 64 70 6f 69 6e 74 2d 44 65 70 65 6e 64 65 Endpoint-Depende
2e80: 6e 74 20 4e 41 54 73 22 29 2e 0a 2d 20 43 6f 73 nt NATs")..- Cos
2e90: 74 20 6c 69 6e 65 3a 20 22 46 6f 73 73 69 6c 27 t line: "Fossil'
2ea0: 73 20 36 30 30 20 73 20 72 65 71 75 65 73 74 20 s 600 s request
2eb0: 6c 69 6d 69 74 22 20 62 65 63 61 6d 65 20 22 46 limit" became "F
2ec0: 6f 73 73 69 6c 27 73 20 64 65 66 61 75 6c 74 20 ossil's default
2ed0: 36 30 30 20 73 20 72 65 71 75 65 73 74 20 6c 69 600 s request li
2ee0: 6d 69 74 22 2e 20 6d 61 69 6e 2e 63 20 75 73 65 mit". main.c use
2ef0: 73 20 46 4f 53 53 49 4c 5f 44 45 46 41 55 4c 54 s FOSSIL_DEFAULT
2f00: 5f 54 49 4d 45 4f 55 54 20 28 36 30 30 29 20 75 _TIMEOUT (600) u
2f10: 6e 6c 65 73 73 20 2d 2d 6d 61 78 2d 6c 61 74 65 nless --max-late
2f20: 6e 63 79 20 6f 72 20 61 20 43 47 49 20 22 74 69 ncy or a CGI "ti
2f30: 6d 65 6f 75 74 3a 22 20 6c 69 6e 65 20 73 65 74 meout:" line set
2f40: 73 20 61 6e 6f 74 68 65 72 20 76 61 6c 75 65 2e s another value.
2f50: 0a 2d 20 4e 6f 74 20 63 6f 6e 66 69 72 6d 65 64 .- Not confirmed
2f60: 2c 20 6c 65 66 74 20 61 73 20 69 73 3a 20 77 68 , left as is: wh
2f70: 65 74 68 65 72 20 70 72 6f 78 69 65 73 20 63 75 ether proxies cu
2f80: 74 20 6c 6f 6e 67 20 72 65 71 75 65 73 74 73 20 t long requests
2f90: 28 74 68 65 20 64 72 61 66 74 20 61 6c 72 65 61 (the draft alrea
2fa0: 64 79 20 73 61 79 73 20 73 6f 29 2e 20 63 68 61 dy says so). cha
2fb0: 74 2e 63 27 73 20 6f 77 6e 20 6e 6f 74 65 20 73 t.c's own note s
2fc0: 61 79 73 20 69 74 73 20 34 32 30 20 73 20 64 65 ays its 420 s de
2fd0: 66 61 75 6c 74 20 22 77 6f 72 6b 73 20 77 65 6c fault "works wel
2fe0: 6c 20 66 6f 72 20 46 6f 73 73 69 6c 20 62 65 68 l for Fossil beh
2ff0: 69 6e 64 20 74 68 65 20 61 6c 74 68 74 74 70 64 ind the althttpd
3000: 20 77 65 62 20 73 65 72 76 65 72 22 2c 20 77 68 web server", wh
3010: 69 63 68 20 73 75 67 67 65 73 74 73 20 61 20 6d ich suggests a m
3020: 61 72 67 69 6e 20 75 6e 64 65 72 20 36 30 30 20 argin under 600
3030: 73 2e 20 45 76 65 72 79 20 6f 74 68 65 72 20 73 s. Every other s
3040: 65 6e 74 65 6e 63 65 20 69 6e 20 74 68 65 20 64 entence in the d
3050: 72 61 66 74 20 6d 61 74 63 68 65 64 20 69 74 73 raft matched its
3060: 20 73 6f 75 72 63 65 20 61 73 20 77 72 69 74 74 source as writt
3070: 65 6e 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 en..............
3080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
30f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
31a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
31b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
31c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
31d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
31e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
31f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3200: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
3210: 65 61 72 63 68 2f 61 6e 73 77 65 72 2e 6d 64 00 earch/answer.md.
3220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3260: 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
3270: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
3280: 30 30 31 30 30 32 32 00 31 35 32 36 35 34 31 31 0010022.15265411
3290: 33 37 31 00 30 31 35 36 30 34 00 20 30 00 00 00 371.015604. 0...
32a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
32b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
32c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
32d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
32e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
32f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3300: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
3310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3320: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
3330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
33a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
33b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
33c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
33d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
33e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
33f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
3400: 31 2e 20 4e 65 74 77 6f 72 6b 2d 77 69 64 65 20 1. Network-wide
3410: 74 72 69 67 67 65 72 3a 20 63 6c 6f 73 65 2e 20 trigger: close.
3420: 45 61 63 68 20 6e 6f 64 65 20 6d 75 73 74 20 68 Each node must h
3430: 65 61 72 20 73 6f 6f 6e 20 74 68 61 74 20 73 6f ear soon that so
3440: 6d 65 74 68 69 6e 67 20 72 65 61 63 68 65 64 20 mething reached
3450: 74 68 65 20 70 75 62 6c 69 63 20 73 65 72 76 65 the public serve
3460: 72 2c 20 74 68 65 6e 20 70 75 6c 6c 20 61 6e 64 r, then pull and
3470: 20 70 75 73 68 20 74 68 65 72 65 20 61 73 20 6e push there as n
3480: 6f 77 2e 20 46 6f 73 73 69 6c 20 68 61 73 20 6e ow. Fossil has n
3490: 6f 20 77 61 79 20 66 6f 72 20 61 20 73 65 72 76 o way for a serv
34a0: 65 72 20 74 6f 20 63 61 6c 6c 20 61 20 63 6c 6f er to call a clo
34b0: 6e 65 2e 0a 0a 32 2e 20 4e 41 54 20 74 72 61 76 ne...2. NAT trav
34c0: 65 72 73 61 6c 3a 20 6e 6f 74 20 66 6f 72 20 74 ersal: not for t
34d0: 68 61 74 2e 20 41 20 72 65 71 75 65 73 74 20 61 hat. A request a
34e0: 20 6e 6f 64 65 20 73 65 6e 64 73 20 6f 75 74 77 node sends outw
34f0: 61 72 64 20 67 65 74 73 20 74 68 72 6f 75 67 68 ard gets through
3500: 20 61 6e 79 20 4e 41 54 2c 20 65 76 65 6e 20 61 any NAT, even a
3510: 20 63 61 72 72 69 65 72 20 4e 41 54 20 28 61 6e carrier NAT (an
3520: 20 49 53 50 20 73 68 61 72 69 6e 67 20 6f 6e 65 ISP sharing one
3530: 20 61 64 64 72 65 73 73 29 2c 20 61 6e 64 20 74 address), and t
3540: 68 65 20 73 65 72 76 65 72 20 61 6e 73 77 65 72 he server answer
3550: 73 20 69 74 20 77 68 65 6e 20 6e 65 77 73 20 63 s it when news c
3560: 6f 6d 65 73 2e 20 48 6f 6c 65 20 70 75 6e 63 68 omes. Hole punch
3570: 69 6e 67 20 6e 65 65 64 73 20 74 68 61 74 20 73 ing needs that s
3580: 61 6d 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 ame connection f
3590: 69 72 73 74 2e 0a 0a 33 2e 20 57 69 74 68 6f 75 irst...3. Withou
35a0: 74 20 74 68 65 20 73 65 72 76 65 72 3a 20 67 65 t the server: ge
35b0: 6e 65 72 61 6c 6c 79 20 6e 6f 74 2c 20 75 6e 6c nerally not, unl
35c0: 65 73 73 20 6f 6e 65 20 70 65 65 72 20 69 73 20 ess one peer is
35d0: 72 65 61 63 68 61 62 6c 65 20 28 70 75 62 6c 69 reachable (publi
35e0: 63 20 61 64 64 72 65 73 73 20 6f 72 20 70 6f 72 c address or por
35f0: 74 20 66 6f 72 77 61 72 64 29 20 61 6e 64 20 74 t forward) and t
3600: 68 65 20 6f 74 68 65 72 20 6b 6e 6f 77 73 20 69 he other knows i
3610: 74 73 20 61 64 64 72 65 73 73 2e 20 4f 74 68 65 ts address. Othe
3620: 72 77 69 73 65 20 62 6f 74 68 20 70 65 65 72 73 rwise both peers
3630: 20 6e 65 65 64 20 61 20 6d 61 63 68 69 6e 65 20 need a machine
3640: 74 68 65 79 20 63 61 6e 20 65 61 63 68 20 72 65 they can each re
3650: 61 63 68 20 74 6f 20 73 77 61 70 20 6f 75 74 73 ach to swap outs
3660: 69 64 65 20 61 64 64 72 65 73 73 65 73 2e 0a 0a ide addresses...
3670: 34 2e 20 4d 6f 72 65 20 6d 69 6e 69 6d 61 6c 3a 4. More minimal:
3680: 20 79 65 73 2c 20 62 65 6c 6f 77 2e 0a 0a 35 2e yes, below...5.
3690: 20 54 61 69 6c 73 63 61 6c 65 3a 20 79 65 73 2e Tailscale: yes.
36a0: 20 41 20 63 6f 6f 72 64 69 6e 61 74 69 6f 6e 20 A coordination
36b0: 73 65 72 76 65 72 20 73 77 61 70 73 20 6b 65 79 server swaps key
36c0: 73 20 61 6e 64 20 61 64 64 72 65 73 73 65 73 2e s and addresses.
36d0: 20 52 65 6c 61 79 73 20 63 61 72 72 79 20 73 65 Relays carry se
36e0: 74 75 70 20 61 6e 64 20 66 61 6c 6c 62 61 63 6b tup and fallback
36f0: 20 74 72 61 66 66 69 63 2c 20 61 6e 64 20 79 6f traffic, and yo
3700: 75 20 63 61 6e 20 72 75 6e 20 79 6f 75 72 20 6f u can run your o
3710: 77 6e 2e 20 53 79 6e 63 74 68 69 6e 67 20 6c 69 wn. Syncthing li
3720: 6b 65 77 69 73 65 20 75 73 65 73 20 64 69 73 63 kewise uses disc
3730: 6f 76 65 72 79 2c 20 53 54 55 4e 20 61 6e 64 20 overy, STUN and
3740: 72 65 6c 61 79 20 73 65 72 76 65 72 73 2e 0a 0a relay servers...
3750: 36 2e 20 41 20 46 6f 73 73 69 6c 20 70 75 6e 63 6. A Fossil punc
3760: 68 65 72 20 6e 65 65 64 73 20 74 68 72 65 65 20 her needs three
3770: 70 61 72 74 73 3a 20 61 64 64 72 65 73 73 20 65 parts: address e
3780: 78 63 68 61 6e 67 65 20 74 68 72 6f 75 67 68 20 xchange through
3790: 6f 75 72 20 73 65 72 76 65 72 3b 20 61 20 73 6d our server; a sm
37a0: 61 6c 6c 20 55 44 50 20 73 65 72 76 69 63 65 20 all UDP service
37b0: 62 65 73 69 64 65 20 69 74 20 28 53 54 55 4e 2c beside it (STUN,
37c0: 20 77 68 69 63 68 20 74 65 6c 6c 73 20 61 20 6e which tells a n
37d0: 6f 64 65 20 69 74 73 20 6f 75 74 73 69 64 65 20 ode its outside
37e0: 61 64 64 72 65 73 73 3b 20 46 6f 73 73 69 6c 20 address; Fossil
37f0: 73 70 65 61 6b 73 20 6f 6e 6c 79 20 48 54 54 50 speaks only HTTP
3800: 29 3b 20 61 6e 64 20 61 20 68 65 6c 70 65 72 20 ); and a helper
3810: 6f 6e 20 65 61 63 68 20 6e 6f 64 65 20 74 68 61 on each node tha
3820: 74 20 63 61 72 72 69 65 73 20 73 79 6e 63 20 74 t carries sync t
3830: 68 72 6f 75 67 68 20 74 68 65 20 68 6f 6c 65 2e hrough the hole.
3840: 20 49 6e 20 6f 6e 65 20 6c 61 72 67 65 20 73 74 In one large st
3850: 75 64 79 20 61 62 6f 75 74 20 37 30 25 20 6f 66 udy about 70% of
3860: 20 70 75 6e 63 68 65 73 20 77 6f 72 6b 65 64 20 punches worked
3870: 6f 6e 63 65 20 61 64 64 72 65 73 73 65 73 20 77 once addresses w
3880: 65 72 65 20 6b 6e 6f 77 6e 2e 20 54 68 65 20 72 ere known. The r
3890: 65 73 74 20 6e 65 65 64 20 74 68 65 20 73 65 72 est need the ser
38a0: 76 65 72 2e 0a 0a 37 2e 20 55 50 6e 50 2c 20 4e ver...7. UPnP, N
38b0: 41 54 2d 50 4d 50 20 61 6e 64 20 50 43 50 20 64 AT-PMP and PCP d
38c0: 6f 6e 27 74 20 70 75 6e 63 68 2e 20 54 68 65 79 on't punch. They
38d0: 20 61 73 6b 20 74 68 65 20 68 6f 6d 65 20 72 6f ask the home ro
38e0: 75 74 65 72 20 66 6f 72 20 61 20 70 6f 72 74 20 uter for a port
38f0: 66 6f 72 77 61 72 64 2e 20 54 68 61 74 20 6e 65 forward. That ne
3900: 65 64 73 20 61 20 72 6f 75 74 65 72 20 74 68 61 eds a router tha
3910: 74 20 73 75 70 70 6f 72 74 73 20 69 74 2c 20 77 t supports it, w
3920: 69 74 68 20 74 68 65 20 73 65 74 74 69 6e 67 20 ith the setting
3930: 6f 6e 2c 20 61 6e 64 20 6e 6f 20 63 61 72 72 69 on, and no carri
3940: 65 72 20 4e 41 54 20 6f 72 20 73 65 63 6f 6e 64 er NAT or second
3950: 20 72 6f 75 74 65 72 2e 20 42 69 74 63 6f 69 6e router. Bitcoin
3960: 20 43 6f 72 65 20 74 65 73 74 65 72 73 20 66 6f Core testers fo
3970: 75 6e 64 20 35 20 6f 66 20 31 36 20 72 6f 75 74 und 5 of 16 rout
3980: 65 72 73 20 6f 72 20 73 65 72 76 69 63 65 73 20 ers or services
3990: 77 6f 72 6b 65 64 20 75 6e 74 6f 75 63 68 65 64 worked untouched
39a0: 2e 20 41 20 62 6f 6e 75 73 2c 20 6e 6f 74 20 61 . A bonus, not a
39b0: 20 62 61 73 65 2e 0a 0a 38 2e 20 54 68 65 20 74 base...8. The t
39c0: 68 72 65 61 64 3a 20 66 6f 75 72 20 70 6f 73 74 hread: four post
39d0: 73 2c 20 6e 6f 20 64 65 63 69 73 69 6f 6e 2c 20 s, no decision,
39e0: 6e 6f 20 63 6f 72 65 20 6d 61 69 6e 74 61 69 6e no core maintain
39f0: 65 72 2e 20 41 20 63 6f 6e 74 72 69 62 75 74 6f er. A contributo
3a00: 72 20 73 61 79 73 20 53 79 6e 63 74 68 69 6e 67 r says Syncthing
3a10: 20 61 6c 72 65 61 64 79 20 70 75 6e 63 68 65 73 already punches
3a20: 20 6f 76 65 72 20 54 43 50 20 61 6e 64 20 55 44 over TCP and UD
3a30: 50 2c 20 61 6e 64 20 74 68 61 74 20 54 61 69 6c P, and that Tail
3a40: 73 63 61 6c 65 20 6f 6e 6c 79 20 61 64 64 73 20 scale only adds
3a50: 74 72 69 63 6b 73 20 66 6f 72 20 4e 41 54 73 20 tricks for NATs
3a60: 74 68 61 74 20 63 68 61 6e 67 65 20 70 6f 72 74 that change port
3a70: 20 70 65 72 20 64 65 73 74 69 6e 61 74 69 6f 6e per destination
3a80: 2e 0a 0a 53 6d 61 6c 6c 65 73 74 20 77 6f 72 74 ...Smallest wort
3a90: 68 20 62 75 69 6c 64 69 6e 67 3a 20 61 20 77 61 h building: a wa
3aa0: 69 74 20 70 61 67 65 2e 20 54 68 65 20 6e 6f 64 it page. The nod
3ab0: 65 20 61 73 6b 73 20 74 68 65 20 70 75 62 6c 69 e asks the publi
3ac0: 63 20 73 65 72 76 65 72 20 74 6f 20 61 6e 73 77 c server to answ
3ad0: 65 72 20 6f 6e 63 65 20 69 74 73 20 72 65 63 65 er once its rece
3ae0: 69 70 74 20 6e 75 6d 62 65 72 20 28 46 6f 73 73 ipt number (Foss
3af0: 69 6c 20 6e 75 6d 62 65 72 73 20 65 61 63 68 20 il numbers each
3b00: 61 72 72 69 76 61 6c 29 20 70 61 73 73 65 73 20 arrival) passes
3b10: 4e 2e 20 41 20 73 63 72 69 70 74 20 75 6e 64 65 N. A script unde
3b20: 72 20 46 6f 73 73 69 6c 27 73 20 2f 65 78 74 20 r Fossil's /ext
3b30: 63 68 65 63 6b 73 20 65 61 63 68 20 73 65 63 6f checks each seco
3b40: 6e 64 2c 20 61 73 20 2f 63 68 61 74 2d 70 6f 6c nd, as /chat-pol
3b50: 6c 20 64 6f 65 73 2e 20 54 68 65 20 6e 6f 64 65 l does. The node
3b60: 20 73 79 6e 63 73 20 61 6e 64 20 61 73 6b 73 20 syncs and asks
3b70: 61 67 61 69 6e 20 77 69 74 68 20 74 68 65 20 6e again with the n
3b80: 65 77 20 6e 75 6d 62 65 72 2c 20 73 6f 20 6e 6f ew number, so no
3b90: 74 68 69 6e 67 20 74 68 61 74 20 61 72 72 69 76 thing that arriv
3ba0: 65 73 20 62 65 74 77 65 65 6e 20 61 73 6b 73 20 es between asks
3bb0: 69 73 20 6d 69 73 73 65 64 2e 20 49 74 20 61 6c is missed. It al
3bc0: 73 6f 20 61 76 6f 69 64 73 20 77 61 69 74 69 6e so avoids waitin
3bd0: 67 20 6f 6e 20 74 68 65 20 61 66 74 65 72 2d 72 g on the after-r
3be0: 65 63 65 69 76 65 20 68 6f 6f 6b 2c 20 77 68 69 eceive hook, whi
3bf0: 63 68 20 63 61 6e 20 72 75 6e 20 61 20 6d 69 6e ch can run a min
3c00: 75 74 65 20 6f 72 20 6d 6f 72 65 20 6c 61 74 65 ute or more late
3c10: 2e 0a 0a 43 6f 73 74 3a 20 6f 6e 65 20 73 63 72 ...Cost: one scr
3c20: 69 70 74 2c 20 6e 6f 74 20 79 65 74 20 62 75 69 ipt, not yet bui
3c30: 6c 74 20 6f 72 20 74 72 69 65 64 3b 20 74 77 6f lt or tried; two
3c40: 20 73 65 72 76 65 72 20 70 72 6f 63 65 73 73 65 server processe
3c50: 73 20 70 65 72 20 77 61 69 74 69 6e 67 20 6e 6f s per waiting no
3c60: 64 65 3b 20 72 65 70 6c 69 65 73 20 77 69 74 68 de; replies with
3c70: 69 6e 20 46 6f 73 73 69 6c 27 73 20 36 30 30 20 in Fossil's 600
3c80: 73 20 72 65 71 75 65 73 74 20 6c 69 6d 69 74 3b s request limit;
3c90: 20 2d 2d 65 78 74 72 6f 6f 74 20 6f 6e 20 74 68 --extroot on th
3ca0: 65 20 73 65 72 76 65 72 2e 20 4e 6f 74 20 63 68 e server. Not ch
3cb0: 65 63 6b 65 64 3a 20 77 68 65 74 68 65 72 20 70 ecked: whether p
3cc0: 72 6f 78 69 65 73 20 63 75 74 20 6c 6f 6e 67 20 roxies cut long
3cd0: 72 65 71 75 65 73 74 73 2e 0a 0a 4e 6f 74 20 73 requests...Not s
3ce0: 6f 6c 76 65 64 3a 20 73 79 6e 63 69 6e 67 20 77 olved: syncing w
3cf0: 69 74 68 6f 75 74 20 74 68 65 20 70 75 62 6c 69 ithout the publi
3d00: 63 20 73 65 72 76 65 72 2c 20 6f 72 20 61 20 6e c server, or a n
3d10: 6f 64 65 20 74 68 61 74 20 63 61 6e 6e 6f 74 20 ode that cannot
3d20: 72 65 61 63 68 20 69 74 2e 0a 0a 53 4f 55 52 43 reach it...SOURC
3d30: 45 53 3a 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 ES:.https://foss
3d40: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
3d50: 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f 73 79 doc/trunk/www/sy
3d60: 6e 63 2e 77 69 6b 69 23 74 72 61 6e 73 70 6f 72 nc.wiki#transpor
3d70: 74 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c t.https://fossil
3d80: 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 -scm.org/home/fi
3d90: 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 78 66 65 72 le?name=src/xfer
3da0: 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c .c&ci=2cfc398e&l
3db0: 6e 3d 31 38 36 31 2d 31 38 37 32 0a 68 74 74 70 n=1861-1872.http
3dc0: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
3dd0: 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d rg/home/file?nam
3de0: 65 3d 73 72 63 2f 63 68 61 74 2e 63 26 63 69 3d e=src/chat.c&ci=
3df0: 32 63 66 63 33 39 38 65 26 6c 6e 3d 36 32 39 2d 2cfc398e&ln=629-
3e00: 37 39 31 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 791.https://foss
3e10: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
3e20: 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 73 63 file?name=src/sc
3e30: 68 65 6d 61 2e 63 26 63 69 3d 32 63 66 63 33 39 hema.c&ci=2cfc39
3e40: 38 65 26 6c 6e 3d 31 30 31 2d 31 31 30 0a 68 74 8e&ln=101-110.ht
3e50: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
3e60: 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e .org/home/file?n
3e70: 61 6d 65 3d 73 72 63 2f 68 6f 6f 6b 2e 63 26 63 ame=src/hook.c&c
3e80: 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 34 34 i=2cfc398e&ln=44
3e90: 35 2d 34 36 33 0a 68 74 74 70 73 3a 2f 2f 66 6f 5-463.https://fo
3ea0: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
3eb0: 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f e/doc/trunk/www/
3ec0: 73 65 72 76 65 72 65 78 74 2e 77 69 6b 69 0a 68 serverext.wiki.h
3ed0: 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 ttps://fossil-sc
3ee0: 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f m.org/home/file?
3ef0: 6e 61 6d 65 3d 73 72 63 2f 65 78 74 63 67 69 2e name=src/extcgi.
3f00: 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e c&ci=2cfc398e&ln
3f10: 3d 32 39 32 2d 33 36 36 0a 68 74 74 70 73 3a 2f =292-366.https:/
3f20: 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f /fossil-scm.org/
3f30: 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 home/file?name=s
3f40: 72 63 2f 6d 61 69 6e 2e 63 26 63 69 3d 32 63 66 rc/main.c&ci=2cf
3f50: 63 33 39 38 65 26 6c 6e 3d 33 36 36 39 2d 33 36 c398e&ln=3669-36
3f60: 37 35 0a 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 75.https://fossi
3f70: 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 64 l-scm.org/home/d
3f80: 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f 68 6f 6f oc/trunk/www/hoo
3f90: 6b 73 2e 6d 64 0a 68 74 74 70 73 3a 2f 2f 66 6f ks.md.https://fo
3fa0: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
3fb0: 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f e/doc/trunk/www/
3fc0: 62 61 63 6b 6f 66 66 69 63 65 2e 6d 64 0a 68 74 backoffice.md.ht
3fd0: 74 70 73 3a 2f 2f 77 77 77 2e 73 71 6c 69 74 65 tps://www.sqlite
3fe0: 2e 6f 72 67 2f 70 72 61 67 6d 61 2e 68 74 6d 6c .org/pragma.html
3ff0: 23 70 72 61 67 6d 61 5f 64 61 74 61 5f 76 65 72 #pragma_data_ver
4000: 73 69 6f 6e 0a 68 74 74 70 73 3a 2f 2f 77 77 77 sion.https://www
4010: 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f .rfc-editor.org/
4020: 72 66 63 2f 72 66 63 35 31 32 38 2e 68 74 6d 6c rfc/rfc5128.html
4030: 0a 68 74 74 70 73 3a 2f 2f 62 66 6f 72 64 2e 69 .https://bford.i
4040: 6e 66 6f 2f 70 75 62 2f 6e 65 74 2f 70 32 70 6e nfo/pub/net/p2pn
4050: 61 74 2f 0a 68 74 74 70 73 3a 2f 2f 77 77 77 2e at/.https://www.
4060: 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f 72 rfc-editor.org/r
4070: 66 63 2f 72 66 63 38 34 34 35 2e 68 74 6d 6c 0a fc/rfc8445.html.
4080: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 63 2d https://www.rfc-
4090: 65 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 editor.org/rfc/r
40a0: 66 63 38 34 38 39 2e 68 74 6d 6c 0a 68 74 74 70 fc8489.html.http
40b0: 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 s://www.rfc-edit
40c0: 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 63 35 33 or.org/rfc/rfc53
40d0: 38 32 2e 68 74 6d 6c 0a 68 74 74 70 73 3a 2f 2f 82.html.https://
40e0: 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d 2f 62 6c tailscale.com/bl
40f0: 6f 67 2f 68 6f 77 2d 6e 61 74 2d 74 72 61 76 65 og/how-nat-trave
4100: 72 73 61 6c 2d 77 6f 72 6b 73 0a 68 74 74 70 73 rsal-works.https
4110: 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d ://tailscale.com
4120: 2f 62 6c 6f 67 2f 68 6f 77 2d 74 61 69 6c 73 63 /blog/how-tailsc
4130: 61 6c 65 2d 77 6f 72 6b 73 0a 68 74 74 70 73 3a ale-works.https:
4140: 2f 2f 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d 2f //tailscale.com/
4150: 6b 62 2f 31 32 33 32 2f 64 65 72 70 2d 73 65 72 kb/1232/derp-ser
4160: 76 65 72 73 0a 68 74 74 70 73 3a 2f 2f 74 61 69 vers.https://tai
4170: 6c 73 63 61 6c 65 2e 63 6f 6d 2f 62 6c 6f 67 2f lscale.com/blog/
4180: 70 65 65 72 2d 72 65 6c 61 79 73 2d 67 61 0a 68 peer-relays-ga.h
4190: 74 74 70 73 3a 2f 2f 64 6f 63 73 2e 73 79 6e 63 ttps://docs.sync
41a0: 74 68 69 6e 67 2e 6e 65 74 2f 75 73 65 72 73 2f thing.net/users/
41b0: 73 74 64 69 73 63 6f 73 72 76 2e 68 74 6d 6c 0a stdiscosrv.html.
41c0: 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 https://raw.gith
41d0: 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f ubusercontent.co
41e0: 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 64 6f 63 73 m/syncthing/docs
41f0: 2f 6d 61 69 6e 2f 75 73 65 72 73 2f 72 65 6c 61 /main/users/rela
4200: 79 69 6e 67 2e 72 73 74 0a 68 74 74 70 73 3a 2f ying.rst.https:/
4210: 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 /raw.githubuserc
4220: 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 ontent.com/synct
4230: 68 69 6e 67 2f 64 6f 63 73 2f 6d 61 69 6e 2f 75 hing/docs/main/u
4240: 73 65 72 73 2f 73 74 72 65 6c 61 79 73 72 76 2e sers/strelaysrv.
4250: 72 73 74 0a 68 74 74 70 73 3a 2f 2f 72 61 77 2e rst.https://raw.
4260: 67 69 74 68 75 62 75 73 65 72 63 6f 6e 74 65 6e githubuserconten
4270: 74 2e 63 6f 6d 2f 73 79 6e 63 74 68 69 6e 67 2f t.com/syncthing/
4280: 64 6f 63 73 2f 6d 61 69 6e 2f 75 73 65 72 73 2f docs/main/users/
4290: 63 6f 6e 66 69 67 2e 72 73 74 0a 68 74 74 70 73 config.rst.https
42a0: 3a 2f 2f 61 72 78 69 76 2e 6f 72 67 2f 61 62 73 ://arxiv.org/abs
42b0: 2f 32 35 31 30 2e 32 37 35 30 30 0a 68 74 74 70 /2510.27500.http
42c0: 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 s://www.rfc-edit
42d0: 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 63 36 38 or.org/rfc/rfc68
42e0: 38 36 2e 68 74 6d 6c 0a 68 74 74 70 73 3a 2f 2f 86.html.https://
42f0: 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f www.rfc-editor.o
4300: 72 67 2f 72 66 63 2f 72 66 63 36 38 38 37 2e 68 rg/rfc/rfc6887.h
4310: 74 6d 6c 0a 68 74 74 70 73 3a 2f 2f 77 77 77 2e tml.https://www.
4320: 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f 72 rfc-editor.org/r
4330: 66 63 2f 72 66 63 36 39 37 30 2e 68 74 6d 6c 0a fc/rfc6970.html.
4340: 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 https://raw.gith
4350: 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f ubusercontent.co
4360: 6d 2f 6d 69 6e 69 75 70 6e 70 2f 6d 69 6e 69 75 m/miniupnp/miniu
4370: 70 6e 70 2f 6d 61 73 74 65 72 2f 6d 69 6e 69 75 pnp/master/miniu
4380: 70 6e 70 64 2f 6d 69 6e 69 75 70 6e 70 64 2e 63 pnpd/miniupnpd.c
4390: 6f 6e 66 0a 68 74 74 70 73 3a 2f 2f 67 69 74 68 onf.https://gith
43a0: 75 62 2e 63 6f 6d 2f 62 69 74 63 6f 69 6e 2f 62 ub.com/bitcoin/b
43b0: 69 74 63 6f 69 6e 2f 69 73 73 75 65 73 2f 33 31 itcoin/issues/31
43c0: 36 36 33 0a 68 74 74 70 73 3a 2f 2f 66 6f 72 75 663.https://foru
43d0: 6d 2e 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f m.syncthing.net/
43e0: 72 61 77 2f 32 32 34 37 31 0a 68 74 74 70 73 3a raw/22471.https:
43f0: 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 69 6e //forum.syncthin
4400: 67 2e 6e 65 74 2f 74 2f 32 32 34 37 31 2e 6a 73 g.net/t/22471.js
4410: 6f 6e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 on..............
4420: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
44a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
44b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
44c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
44d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
44e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
44f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
45a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
45b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
45c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
45d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
45e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
45f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4600: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
4610: 65 61 72 63 68 2f 72 65 61 64 2d 70 6f 72 74 6d earch/read-portm
4620: 61 70 2e 6a 73 6f 6e 00 00 00 00 00 00 00 00 00 ap.json.........
4630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4660: 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
4670: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
4680: 30 30 34 31 31 36 33 00 31 35 32 36 35 34 31 31 0041163.15265411
4690: 33 37 31 00 30 31 37 32 36 33 00 20 30 00 00 00 371.017263. 0...
46a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
46b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
46c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
46d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
46e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
46f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4700: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
4710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4720: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
4730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
47a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
47b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
47c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
47d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
47e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
47f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
4800: 7b 0a 20 22 70 6f 69 6e 74 73 22 3a 20 5b 0a 20 {. "points": [.
4810: 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 {. "claim": "
4820: 53 68 6f 72 74 20 61 6e 73 77 65 72 3a 20 79 65 Short answer: ye
4830: 73 2c 20 73 6f 6d 65 74 69 6d 65 73 2c 20 62 75 s, sometimes, bu
4840: 74 20 79 6f 75 20 63 61 6e 27 74 20 63 6f 75 6e t you can't coun
4850: 74 20 6f 6e 20 69 74 2e 20 41 20 6e 6f 64 65 20 t on it. A node
4860: 62 65 68 69 6e 64 20 61 20 68 6f 6d 65 20 72 6f behind a home ro
4870: 75 74 65 72 20 63 61 6e 20 61 73 6b 20 74 68 65 uter can ask the
4880: 20 72 6f 75 74 65 72 20 74 6f 20 66 6f 72 77 61 router to forwa
4890: 72 64 20 61 20 54 43 50 20 70 6f 72 74 20 74 6f rd a TCP port to
48a0: 20 69 74 73 20 6f 77 6e 20 66 6f 73 73 69 6c 20 its own fossil
48b0: 73 65 72 76 65 72 2c 20 75 73 69 6e 67 20 55 50 server, using UP
48c0: 6e 50 20 49 47 44 2c 20 4e 41 54 2d 50 4d 50 20 nP IGD, NAT-PMP
48d0: 6f 72 20 50 43 50 2e 20 54 68 69 73 20 77 6f 72 or PCP. This wor
48e0: 6b 73 20 6f 6e 6c 79 20 69 66 20 74 68 72 65 65 ks only if three
48f0: 20 74 68 69 6e 67 73 20 61 72 65 20 61 6c 6c 20 things are all
4900: 74 72 75 65 3a 20 28 31 29 20 74 68 65 20 72 6f true: (1) the ro
4910: 75 74 65 72 20 73 70 65 61 6b 73 20 6f 6e 65 20 uter speaks one
4920: 6f 66 20 74 68 65 73 65 20 70 72 6f 74 6f 63 6f of these protoco
4930: 6c 73 2c 20 28 32 29 20 74 68 61 74 20 70 72 6f ls, (2) that pro
4940: 74 6f 63 6f 6c 20 69 73 20 73 77 69 74 63 68 65 tocol is switche
4950: 64 20 6f 6e 2c 20 61 6e 64 20 28 33 29 20 74 68 d on, and (3) th
4960: 65 20 72 6f 75 74 65 72 20 69 74 73 65 6c 66 20 e router itself
4970: 68 6f 6c 64 73 20 74 68 65 20 70 75 62 6c 69 63 holds the public
4980: 20 49 50 76 34 20 61 64 64 72 65 73 73 2c 20 6d IPv4 address, m
4990: 65 61 6e 69 6e 67 20 6e 6f 20 63 61 72 72 69 65 eaning no carrie
49a0: 72 2d 67 72 61 64 65 20 4e 41 54 20 61 6e 64 20 r-grade NAT and
49b0: 6e 6f 20 73 65 63 6f 6e 64 20 72 6f 75 74 65 72 no second router
49c0: 20 75 70 73 74 72 65 61 6d 2e 20 45 61 63 68 20 upstream. Each
49d0: 63 6f 6e 64 69 74 69 6f 6e 20 66 61 69 6c 73 20 condition fails
49e0: 69 6e 20 61 20 72 65 61 6c 20 73 68 61 72 65 20 in a real share
49f0: 6f 66 20 68 6f 6d 65 73 20 28 73 65 65 20 74 68 of homes (see th
4a00: 65 20 70 6f 69 6e 74 73 20 62 65 6c 6f 77 29 2e e points below).
4a10: 20 53 6f 20 75 73 65 20 70 6f 72 74 20 6d 61 70 So use port map
4a20: 70 69 6e 67 20 61 73 20 61 6e 20 6f 70 74 69 6f ping as an optio
4a30: 6e 61 6c 20 66 61 73 74 20 70 61 74 68 20 61 6e nal fast path an
4a40: 64 20 6b 65 65 70 20 70 6f 6c 6c 69 6e 67 20 61 d keep polling a
4a50: 73 20 74 68 65 20 66 61 6c 6c 62 61 63 6b 2e 20 s the fallback.
4a60: 54 61 69 6c 73 63 61 6c 65 2c 20 77 68 69 63 68 Tailscale, which
4a70: 20 75 73 65 73 20 61 6c 6c 20 74 68 72 65 65 20 uses all three
4a80: 70 72 6f 74 6f 63 6f 6c 73 2c 20 73 61 79 73 3a protocols, says:
4a90: 20 5c 22 59 6f 75 20 63 61 6e 27 74 20 72 65 6c \"You can't rel
4aa0: 79 20 6f 6e 20 74 68 65 73 65 20 70 72 6f 74 6f y on these proto
4ab0: 63 6f 6c 73 20 62 65 69 6e 67 20 70 72 65 73 65 cols being prese
4ac0: 6e 74 2e 20 54 68 65 79 20 6d 69 67 68 74 20 6e nt. They might n
4ad0: 6f 74 20 62 65 20 69 6d 70 6c 65 6d 65 6e 74 65 ot be implemente
4ae0: 64 20 6f 6e 20 79 6f 75 72 20 64 65 76 69 63 65 d on your device
4af0: 73 2e 20 54 68 65 79 20 6d 69 67 68 74 20 62 65 s. They might be
4b00: 20 64 69 73 61 62 6c 65 64 20 62 79 20 64 65 66 disabled by def
4b10: 61 75 6c 74 20 61 6e 64 20 6e 6f 62 6f 64 79 20 ault and nobody
4b20: 6b 6e 65 77 20 74 6f 20 74 75 72 6e 20 74 68 65 knew to turn the
4b30: 6d 20 6f 6e 2e 20 54 68 65 79 20 6d 69 67 68 74 m on. They might
4b40: 20 68 61 76 65 20 62 65 65 6e 20 64 69 73 61 62 have been disab
4b50: 6c 65 64 20 62 79 20 70 6f 6c 69 63 79 2e 5c 22 led by policy.\"
4b60: 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
4b70: 22 68 74 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 "https://tailsca
4b80: 6c 65 2e 63 6f 6d 2f 62 6c 6f 67 2f 68 6f 77 2d le.com/blog/how-
4b90: 6e 61 74 2d 74 72 61 76 65 72 73 61 6c 2d 77 6f nat-traversal-wo
4ba0: 72 6b 73 20 28 73 65 63 74 69 6f 6e 20 27 50 61 rks (section 'Pa
4bb0: 72 74 69 61 6c 6c 79 20 6d 61 6e 69 70 75 6c 61 rtially manipula
4bc0: 74 69 6e 67 20 70 6f 72 74 20 6d 61 70 73 27 29 ting port maps')
4bd0: 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 ". },. {. "c
4be0: 6c 61 69 6d 22 3a 20 22 54 68 65 20 53 79 6e 63 laim": "The Sync
4bf0: 74 68 69 6e 67 20 74 68 72 65 61 64 20 74 68 65 thing thread the
4c00: 20 6d 61 69 6e 74 61 69 6e 65 72 20 6c 69 6e 6b maintainer link
4c10: 65 64 20 69 73 20 73 68 6f 72 74 3a 20 66 6f 75 ed is short: fou
4c20: 72 20 70 6f 73 74 73 2e 20 54 68 65 20 6f 70 65 r posts. The ope
4c30: 6e 69 6e 67 20 70 6f 73 74 20 28 32 30 32 34 2d ning post (2024-
4c40: 30 37 2d 32 33 29 20 61 73 6b 73 20 53 79 6e 63 07-23) asks Sync
4c50: 74 68 69 6e 67 20 74 6f 20 61 64 6f 70 74 20 54 thing to adopt T
4c60: 61 69 6c 73 63 61 6c 65 27 73 20 6d 65 74 68 6f ailscale's metho
4c70: 64 73 20 27 66 6f 72 20 70 75 6e 63 68 69 6e 67 ds 'for punching
4c80: 20 74 68 72 6f 75 67 68 20 4e 41 54 73 20 77 69 through NATs wi
4c90: 74 68 6f 75 74 20 55 50 6e 50 20 61 6e 64 20 4e thout UPnP and N
4ca0: 41 54 2d 50 4d 50 20 69 6e 63 6c 75 64 69 6e 67 AT-PMP including
4cb0: 20 70 65 6f 70 6c 65 20 73 74 75 63 6b 20 62 65 people stuck be
4cc0: 68 69 6e 64 20 43 47 2d 4e 41 54 27 2e 20 41 20 hind CG-NAT'. A
4cd0: 53 79 6e 63 74 68 69 6e 67 20 63 6f 6e 74 72 69 Syncthing contri
4ce0: 62 75 74 6f 72 20 28 62 74 39 30 29 20 72 65 70 butor (bt90) rep
4cf0: 6c 69 65 64 3a 20 5c 22 57 65 27 72 65 20 61 6c lied: \"We're al
4d00: 72 65 61 64 79 20 75 73 69 6e 67 20 68 6f 6c 65 ready using hole
4d10: 70 75 6e 63 68 69 6e 67 20 74 6f 20 65 73 74 61 punching to esta
4d20: 62 6c 69 73 68 20 54 43 50 2f 55 44 50 20 63 6f blish TCP/UDP co
4d30: 6e 6e 65 63 74 69 6f 6e 73 2c 20 69 66 20 70 6f nnections, if po
4d40: 73 73 69 62 6c 65 2e 20 54 68 65 20 6f 6e 6c 79 ssible. The only
4d50: 20 72 65 61 6c 20 64 69 66 66 65 72 65 6e 63 65 real difference
4d60: 20 69 73 20 74 68 61 74 20 54 61 69 6c 73 63 61 is that Tailsca
4d70: 6c 65 20 69 73 20 70 75 6c 6c 69 6e 67 20 61 20 le is pulling a
4d80: 66 65 77 20 6d 6f 72 65 20 74 72 69 63 6b 73 20 few more tricks
4d90: 74 6f 20 64 65 61 6c 20 77 69 74 68 20 45 6e 64 to deal with End
4da0: 70 6f 69 6e 74 2d 44 65 70 65 6e 64 65 6e 74 20 point-Dependent
4db0: 4e 41 54 73 2e 5c 22 20 41 20 6c 61 74 65 72 20 NATs.\" A later
4dc0: 70 6f 73 74 20 73 61 79 73 20 68 6f 6c 65 20 70 post says hole p
4dd0: 75 6e 63 68 69 6e 67 20 69 73 20 27 6d 6f 73 74 unching is 'most
4de0: 6c 79 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 ly based on the
4df0: 69 64 65 61 20 74 68 61 74 20 74 77 6f 20 64 65 idea that two de
4e00: 76 69 63 65 73 20 64 69 61 6c 20 65 61 63 68 20 vices dial each
4e10: 6f 74 68 65 72 20 6f 6e 20 74 68 65 20 73 61 6d other on the sam
4e20: 65 20 70 6f 72 74 73 20 61 74 20 74 68 65 20 73 e ports at the s
4e30: 61 6d 65 20 74 69 6d 65 27 2c 20 77 69 74 68 20 ame time', with
4e40: 53 54 55 4e 20 61 73 20 74 68 65 20 6f 6e 65 20 STUN as the one
4e50: 70 61 72 74 20 6e 65 65 64 69 6e 67 20 73 70 65 part needing spe
4e60: 63 69 61 6c 20 63 6f 64 65 2e 20 54 68 65 20 74 cial code. The t
4e70: 68 72 65 61 64 20 73 61 79 73 20 6e 6f 74 68 69 hread says nothi
4e80: 6e 67 20 6d 6f 72 65 20 61 62 6f 75 74 20 70 6f ng more about po
4e90: 72 74 20 6d 61 70 70 69 6e 67 2e 22 2c 0a 20 20 rt mapping.",.
4ea0: 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
4eb0: 73 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 s://forum.syncth
4ec0: 69 6e 67 2e 6e 65 74 2f 72 61 77 2f 32 32 34 37 ing.net/raw/2247
4ed0: 31 20 28 70 6f 73 74 73 20 23 31 2c 20 23 32 2c 1 (posts #1, #2,
4ee0: 20 23 34 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 #4)". },. {.
4ef0: 20 20 22 63 6c 61 69 6d 22 3a 20 22 53 79 6e 63 "claim": "Sync
4f00: 74 68 69 6e 67 20 64 6f 65 73 20 75 73 65 20 70 thing does use p
4f10: 6f 72 74 20 6d 61 70 70 69 6e 67 20 61 73 20 77 ort mapping as w
4f20: 65 6c 6c 2e 20 49 74 73 20 6e 61 74 45 6e 61 62 ell. Its natEnab
4f30: 6c 65 64 20 6f 70 74 69 6f 6e 20 6d 65 61 6e 73 led option means
4f40: 20 27 57 68 65 74 68 65 72 20 74 6f 20 61 74 74 'Whether to att
4f50: 65 6d 70 74 20 74 6f 20 70 65 72 66 6f 72 6d 20 empt to perform
4f60: 61 20 55 50 6e 50 20 61 6e 64 20 4e 41 54 2d 50 a UPnP and NAT-P
4f70: 4d 50 20 70 6f 72 74 20 6d 61 70 70 69 6e 67 20 MP port mapping
4f80: 66 6f 72 20 69 6e 63 6f 6d 69 6e 67 20 73 79 6e for incoming syn
4f90: 63 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 2e 27 20 c connections.'
4fa0: 54 68 65 20 73 61 6d 70 6c 65 20 63 6f 6e 66 69 The sample confi
4fb0: 67 20 75 73 65 73 20 6e 61 74 4c 65 61 73 65 4d g uses natLeaseM
4fc0: 69 6e 75 74 65 73 20 36 30 20 61 6e 64 20 6e 61 inutes 60 and na
4fd0: 74 52 65 6e 65 77 61 6c 4d 69 6e 75 74 65 73 20 tRenewalMinutes
4fe0: 33 30 2e 20 49 74 73 20 66 69 72 65 77 61 6c 6c 30. Its firewall
4ff0: 20 70 61 67 65 20 73 61 79 73 20 74 68 61 74 20 page says that
5000: 77 69 74 68 6f 75 74 20 61 20 70 6f 72 74 20 66 without a port f
5010: 6f 72 77 61 72 64 2c 20 27 52 65 6c 61 79 69 6e orward, 'Relayin
5020: 67 20 6d 61 79 20 77 6f 72 6b 20 77 65 6c 6c 20 g may work well
5030: 65 6e 6f 75 67 68 20 2e 2e 2e 20 62 75 74 20 77 enough ... but w
5040: 69 6c 6c 20 70 65 72 66 6f 72 6d 20 70 6f 6f 72 ill perform poor
5050: 6c 79 20 69 6e 20 63 6f 6d 70 61 72 69 73 6f 6e ly in comparison
5060: 20 74 6f 20 61 20 64 69 72 65 63 74 20 63 6f 6e to a direct con
5070: 6e 65 63 74 69 6f 6e 2e 27 22 2c 0a 20 20 20 22 nection.'",. "
5080: 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a source": "https:
5090: 2f 2f 64 6f 63 73 2e 73 79 6e 63 74 68 69 6e 67 //docs.syncthing
50a0: 2e 6e 65 74 2f 75 73 65 72 73 2f 63 6f 6e 66 69 .net/users/confi
50b0: 67 2e 68 74 6d 6c 20 3b 20 68 74 74 70 73 3a 2f g.html ; https:/
50c0: 2f 64 6f 63 73 2e 73 79 6e 63 74 68 69 6e 67 2e /docs.syncthing.
50d0: 6e 65 74 2f 75 73 65 72 73 2f 66 69 72 65 77 61 net/users/firewa
50e0: 6c 6c 2e 68 74 6d 6c 22 0a 20 20 7d 2c 0a 20 20 ll.html". },.
50f0: 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 48 {. "claim": "H
5100: 6f 77 20 55 50 6e 50 20 49 47 44 20 6f 70 65 6e ow UPnP IGD open
5110: 73 20 61 20 70 6f 72 74 3a 20 74 68 65 20 70 72 s a port: the pr
5120: 6f 67 72 61 6d 20 73 65 6e 64 73 20 61 20 64 69 ogram sends a di
5130: 73 63 6f 76 65 72 79 20 72 65 71 75 65 73 74 20 scovery request
5140: 28 27 4d 2d 53 45 41 52 43 48 27 29 20 74 6f 20 ('M-SEARCH') to
5150: 74 68 65 20 6d 75 6c 74 69 63 61 73 74 20 61 64 the multicast ad
5160: 64 72 65 73 73 20 32 33 39 2e 32 35 35 2e 32 35 dress 239.255.25
5170: 35 2e 32 35 30 20 6f 6e 20 70 6f 72 74 20 31 39 5.250 on port 19
5180: 30 30 2e 20 54 68 65 20 72 6f 75 74 65 72 20 61 00. The router a
5190: 6e 73 77 65 72 73 2c 20 74 68 65 20 70 72 6f 67 nswers, the prog
51a0: 72 61 6d 20 72 65 61 64 73 20 74 68 65 20 72 6f ram reads the ro
51b0: 75 74 65 72 27 73 20 64 65 76 69 63 65 20 64 65 uter's device de
51c0: 73 63 72 69 70 74 69 6f 6e 20 6f 76 65 72 20 48 scription over H
51d0: 54 54 50 2c 20 74 68 65 6e 20 73 65 6e 64 73 20 TTP, then sends
51e0: 61 20 53 4f 41 50 20 27 41 64 64 50 6f 72 74 4d a SOAP 'AddPortM
51f0: 61 70 70 69 6e 67 27 20 72 65 71 75 65 73 74 2e apping' request.
5200: 20 54 68 65 20 6d 69 6e 69 75 70 6e 70 63 20 63 The miniupnpc c
5210: 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 74 6f 6f 6c ommand-line tool
5220: 20 73 68 6f 77 73 20 77 68 61 74 20 67 6f 65 73 shows what goes
5230: 20 69 6e 20 74 68 61 74 20 72 65 71 75 65 73 74 in that request
5240: 3a 20 60 75 70 6e 70 63 20 2d 61 20 69 70 20 70 : `upnpc -a ip p
5250: 6f 72 74 20 65 78 74 65 72 6e 61 6c 5f 70 6f 72 ort external_por
5260: 74 20 70 72 6f 74 6f 63 6f 6c 20 5b 64 75 72 61 t protocol [dura
5270: 74 69 6f 6e 5d 60 2e 20 4c 65 61 73 65 20 74 69 tion]`. Lease ti
5280: 6d 65 3a 20 75 6e 64 65 72 20 49 47 44 3a 31 2c me: under IGD:1,
5290: 20 27 30 27 20 6d 65 61 6e 73 20 61 20 70 65 72 '0' means a per
52a0: 6d 61 6e 65 6e 74 20 6d 61 70 70 69 6e 67 2e 20 manent mapping.
52b0: 55 6e 64 65 72 20 49 47 44 3a 32 2c 20 30 20 69 Under IGD:2, 0 i
52c0: 73 20 72 65 70 6c 61 63 65 64 20 62 79 20 74 68 s replaced by th
52d0: 65 20 6d 61 78 69 6d 75 6d 20 6f 66 20 36 30 34 e maximum of 604
52e0: 38 30 30 20 73 65 63 6f 6e 64 73 20 28 6f 6e 65 800 seconds (one
52f0: 20 77 65 65 6b 29 2e 22 2c 0a 20 20 20 22 73 6f week).",. "so
5300: 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f urce": "https://
5310: 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 en.wikipedia.org
5320: 2f 77 69 6b 69 2f 49 6e 74 65 72 6e 65 74 5f 47 /wiki/Internet_G
5330: 61 74 65 77 61 79 5f 44 65 76 69 63 65 5f 50 72 ateway_Device_Pr
5340: 6f 74 6f 63 6f 6c 20 28 73 65 63 74 69 6f 6e 20 otocol (section
5350: 27 49 6e 74 65 72 6e 61 6c 73 27 29 20 3b 20 68 'Internals') ; h
5360: 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 75 ttps://raw.githu
5370: 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f 6d busercontent.com
5380: 2f 6d 69 6e 69 75 70 6e 70 2f 6d 69 6e 69 75 70 /miniupnp/miniup
5390: 6e 70 2f 6d 61 73 74 65 72 2f 6d 69 6e 69 75 70 np/master/miniup
53a0: 6e 70 63 2f 73 72 63 2f 75 70 6e 70 63 2e 63 20 npc/src/upnpc.c
53b0: 28 75 73 61 67 65 20 74 65 78 74 29 20 3b 20 68 (usage text) ; h
53c0: 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 ttps://www.rfc-e
53d0: 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 ditor.org/rfc/rf
53e0: 63 36 39 37 30 2e 68 74 6d 6c 20 28 71 75 6f 74 c6970.html (quot
53f0: 65 3a 20 5c 22 49 6e 20 49 47 44 3a 31 2c 20 74 e: \"In IGD:1, t
5400: 68 65 20 76 61 6c 75 65 20 30 20 6d 65 61 6e 73 he value 0 means
5410: 20 69 6e 66 69 6e 69 74 65 3b 20 69 6e 20 49 47 infinite; in IG
5420: 44 3a 32 2c 20 69 74 20 69 73 20 72 65 6d 61 70 D:2, it is remap
5430: 70 65 64 20 74 6f 20 74 68 65 20 49 47 44 20 6d ped to the IGD m
5440: 61 78 69 6d 75 6d 20 6f 66 20 36 30 34 38 30 30 aximum of 604800
5450: 20 73 65 63 6f 6e 64 73 2e 5c 22 29 22 0a 20 20 seconds.\")".
5460: 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d },. {. "claim
5470: 22 3a 20 22 48 6f 77 20 4e 41 54 2d 50 4d 50 20 ": "How NAT-PMP
5480: 6f 70 65 6e 73 20 61 20 70 6f 72 74 3a 20 74 68 opens a port: th
5490: 65 20 63 6c 69 65 6e 74 20 73 65 6e 64 73 20 61 e client sends a
54a0: 20 55 44 50 20 70 61 63 6b 65 74 20 74 6f 20 70 UDP packet to p
54b0: 6f 72 74 20 35 33 35 31 20 6f 66 20 69 74 73 20 ort 5351 of its
54c0: 64 65 66 61 75 6c 74 20 67 61 74 65 77 61 79 20 default gateway
54d0: 61 6e 64 20 77 61 69 74 73 20 32 35 30 20 6d 73 and waits 250 ms
54e0: 20 66 6f 72 20 61 20 72 65 70 6c 79 2e 20 41 73 for a reply. As
54f0: 6b 69 6e 67 20 66 6f 72 20 74 68 65 20 65 78 74 king for the ext
5500: 65 72 6e 61 6c 20 61 64 64 72 65 73 73 20 74 61 ernal address ta
5510: 6b 65 73 20 61 20 32 2d 62 79 74 65 20 72 65 71 kes a 2-byte req
5520: 75 65 73 74 2e 20 41 20 6d 61 70 70 69 6e 67 20 uest. A mapping
5530: 72 65 71 75 65 73 74 20 63 61 72 72 69 65 73 20 request carries
5540: 74 68 65 20 69 6e 74 65 72 6e 61 6c 20 70 6f 72 the internal por
5550: 74 2c 20 61 20 73 75 67 67 65 73 74 65 64 20 65 t, a suggested e
5560: 78 74 65 72 6e 61 6c 20 70 6f 72 74 20 61 6e 64 xternal port and
5570: 20 61 20 72 65 71 75 65 73 74 65 64 20 6c 69 66 a requested lif
5580: 65 74 69 6d 65 2e 20 54 68 65 20 72 65 70 6c 79 etime. The reply
5590: 20 67 69 76 65 73 20 74 68 65 20 65 78 74 65 72 gives the exter
55a0: 6e 61 6c 20 70 6f 72 74 20 61 63 74 75 61 6c 6c nal port actuall
55b0: 79 20 61 73 73 69 67 6e 65 64 20 28 69 74 20 63 y assigned (it c
55c0: 61 6e 20 64 69 66 66 65 72 20 66 72 6f 6d 20 74 an differ from t
55d0: 68 65 20 6f 6e 65 20 61 73 6b 65 64 20 66 6f 72 he one asked for
55e0: 29 20 61 6e 64 20 74 68 65 20 6c 69 66 65 74 69 ) and the lifeti
55f0: 6d 65 20 67 72 61 6e 74 65 64 2e 20 44 65 74 61 me granted. Deta
5600: 69 6c 73 20 66 72 6f 6d 20 74 68 65 20 52 46 43 ils from the RFC
5610: 3a 20 74 68 65 20 72 65 63 6f 6d 6d 65 6e 64 65 : the recommende
5620: 64 20 6c 69 66 65 74 69 6d 65 20 69 73 20 37 32 d lifetime is 72
5630: 30 30 20 73 3b 20 63 6c 69 65 6e 74 73 20 73 68 00 s; clients sh
5640: 6f 75 6c 64 20 27 62 65 67 69 6e 20 74 72 79 69 ould 'begin tryi
5650: 6e 67 20 74 6f 20 72 65 6e 65 77 20 74 68 65 20 ng to renew the
5660: 6d 61 70 70 69 6e 67 20 68 61 6c 66 77 61 79 20 mapping halfway
5670: 74 6f 20 65 78 70 69 72 79 20 74 69 6d 65 2c 20 to expiry time,
5680: 6c 69 6b 65 20 44 48 43 50 27 3b 20 61 20 6c 69 like DHCP'; a li
5690: 66 65 74 69 6d 65 20 6f 66 20 30 20 64 65 6c 65 fetime of 0 dele
56a0: 74 65 73 20 74 68 65 20 6d 61 70 70 69 6e 67 3b tes the mapping;
56b0: 20 61 20 27 53 65 63 6f 6e 64 73 20 53 69 6e 63 a 'Seconds Sinc
56c0: 65 20 53 74 61 72 74 20 6f 66 20 45 70 6f 63 68 e Start of Epoch
56d0: 27 20 76 61 6c 75 65 20 74 68 61 74 20 67 6f 65 ' value that goe
56e0: 73 20 62 61 63 6b 77 61 72 64 73 20 74 65 6c 6c s backwards tell
56f0: 73 20 74 68 65 20 63 6c 69 65 6e 74 20 74 68 65 s the client the
5700: 20 67 61 74 65 77 61 79 20 72 65 62 6f 6f 74 65 gateway reboote
5710: 64 2c 20 73 6f 20 69 74 20 6d 75 73 74 20 72 65 d, so it must re
5720: 63 72 65 61 74 65 20 69 74 73 20 6d 61 70 70 69 create its mappi
5730: 6e 67 73 2e 20 52 46 43 20 36 38 38 36 20 69 73 ngs. RFC 6886 is
5740: 20 49 6e 66 6f 72 6d 61 74 69 6f 6e 61 6c 20 61 Informational a
5750: 6e 64 20 68 61 73 20 62 65 65 6e 20 73 75 70 65 nd has been supe
5760: 72 73 65 64 65 64 20 62 79 20 50 43 50 2e 22 2c rseded by PCP.",
5770: 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 . "source": "h
5780: 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 ttps://www.rfc-e
5790: 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 ditor.org/rfc/rf
57a0: 63 36 38 38 36 2e 68 74 6d 6c 20 28 73 65 63 74 c6886.html (sect
57b0: 69 6f 6e 73 20 31 2e 31 2c 20 33 2e 31 2c 20 33 ions 1.1, 3.1, 3
57c0: 2e 32 2c 20 33 2e 33 2c 20 33 2e 36 2c 20 33 2e .2, 3.3, 3.6, 3.
57d0: 37 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 7)". },. {.
57e0: 22 63 6c 61 69 6d 22 3a 20 22 48 6f 77 20 50 43 "claim": "How PC
57f0: 50 20 6f 70 65 6e 73 20 61 20 70 6f 72 74 3a 20 P opens a port:
5800: 50 43 50 20 61 6c 73 6f 20 75 73 65 73 20 55 44 PCP also uses UD
5810: 50 20 70 6f 72 74 20 35 33 35 31 2c 20 61 6e 64 P port 5351, and
5820: 20 69 74 73 20 70 61 63 6b 65 74 73 20 61 72 65 its packets are
5830: 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 68 compatible with
5840: 20 4e 41 54 2d 50 4d 50 2e 20 54 6f 20 66 69 6e NAT-PMP. To fin
5850: 64 20 61 20 50 43 50 20 73 65 72 76 65 72 2c 20 d a PCP server,
5860: 74 68 65 20 63 6c 69 65 6e 74 20 75 73 65 73 20 the client uses
5870: 6f 6e 65 20 63 6f 6e 66 69 67 75 72 65 64 20 27 one configured '
5880: 69 6e 20 61 20 63 6f 6e 66 69 67 75 72 61 74 69 in a configurati
5890: 6f 6e 20 66 69 6c 65 20 6f 72 20 76 69 61 20 44 on file or via D
58a0: 48 43 50 27 2c 20 61 6e 64 20 6f 74 68 65 72 77 HCP', and otherw
58b0: 69 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 20 ise the default
58c0: 72 6f 75 74 65 72 2e 20 54 68 65 20 4d 41 50 20 router. The MAP
58d0: 72 65 71 75 65 73 74 20 63 72 65 61 74 65 73 20 request creates
58e0: 61 20 6d 61 70 70 69 6e 67 20 66 6f 72 20 69 6e a mapping for in
58f0: 63 6f 6d 69 6e 67 20 63 6f 6e 6e 65 63 74 69 6f coming connectio
5900: 6e 73 2e 20 43 6c 69 65 6e 74 73 20 72 65 6e 65 ns. Clients rene
5910: 77 20 61 74 20 61 20 72 61 6e 64 6f 6d 20 70 6f w at a random po
5920: 69 6e 74 20 62 65 74 77 65 65 6e 20 31 2f 32 20 int between 1/2
5930: 61 6e 64 20 35 2f 38 20 6f 66 20 74 68 65 20 6c and 5/8 of the l
5940: 69 66 65 74 69 6d 65 2e 20 55 6e 6c 69 6b 65 20 ifetime. Unlike
5950: 4e 41 54 2d 50 4d 50 2c 20 50 43 50 20 77 61 73 NAT-PMP, PCP was
5960: 20 77 72 69 74 74 65 6e 20 74 6f 20 63 6f 76 65 written to cove
5970: 72 20 63 61 72 72 69 65 72 2d 67 72 61 64 65 20 r carrier-grade
5980: 4e 41 54 2c 20 44 53 2d 4c 69 74 65 20 61 6e 64 NAT, DS-Lite and
5990: 20 4e 41 54 36 34 2c 20 61 6e 64 20 69 74 20 73 NAT64, and it s
59a0: 75 70 70 6f 72 74 73 20 49 50 76 36 2e 20 41 20 upports IPv6. A
59b0: 50 43 50 20 73 65 72 76 65 72 20 27 4d 55 53 54 PCP server 'MUST
59c0: 20 6f 6e 6c 79 20 61 63 63 65 70 74 20 6e 6f 72 only accept nor
59d0: 6d 61 6c 20 28 6e 6f 6e 2d 54 48 49 52 44 5f 50 mal (non-THIRD_P
59e0: 41 52 54 59 29 20 50 43 50 20 72 65 71 75 65 73 ARTY) PCP reques
59f0: 74 73 20 66 72 6f 6d 20 61 20 63 6c 69 65 6e 74 ts from a client
5a00: 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 69 6e 74 on the same int
5a10: 65 72 66 61 63 65 20 66 72 6f 6d 20 77 68 69 63 erface from whic
5a20: 68 20 69 74 20 77 6f 75 6c 64 20 6e 6f 72 6d 61 h it would norma
5a30: 6c 6c 79 20 72 65 63 65 69 76 65 20 70 61 63 6b lly receive pack
5a40: 65 74 73 20 66 72 6f 6d 20 74 68 61 74 20 63 6c ets from that cl
5a50: 69 65 6e 74 27 2e 22 2c 0a 20 20 20 22 73 6f 75 ient'.",. "sou
5a60: 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 77 rce": "https://w
5a70: 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 ww.rfc-editor.or
5a80: 67 2f 72 66 63 2f 72 66 63 36 38 38 37 2e 68 74 g/rfc/rfc6887.ht
5a90: 6d 6c 20 28 73 65 63 74 69 6f 6e 73 20 32 2e 31 ml (sections 2.1
5aa0: 2c 20 38 2e 31 2c 20 31 31 2c 20 31 31 2e 32 2e , 8.1, 11, 11.2.
5ab0: 31 2c 20 31 38 2e 31 2e 31 29 22 0a 20 20 7d 2c 1, 18.1.1)". },
5ac0: 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a . {. "claim":
5ad0: 20 22 57 68 79 20 69 74 20 66 61 69 6c 73 20 62 "Why it fails b
5ae0: 65 68 69 6e 64 20 64 6f 75 62 6c 65 20 4e 41 54 ehind double NAT
5af0: 20 6f 72 20 63 61 72 72 69 65 72 2d 67 72 61 64 or carrier-grad
5b00: 65 20 4e 41 54 3a 20 65 61 63 68 20 70 72 6f 74 e NAT: each prot
5b10: 6f 63 6f 6c 20 74 61 6c 6b 73 20 74 6f 20 6f 6e ocol talks to on
5b20: 65 20 62 6f 78 20 6f 6e 6c 79 2c 20 74 68 65 20 e box only, the
5b30: 64 65 66 61 75 6c 74 20 67 61 74 65 77 61 79 20 default gateway
5b40: 28 6f 72 20 61 20 63 6f 6e 66 69 67 75 72 65 64 (or a configured
5b50: 20 50 43 50 20 73 65 72 76 65 72 29 2e 20 41 20 PCP server). A
5b60: 6d 61 70 70 69 6e 67 20 6f 6e 20 79 6f 75 72 20 mapping on your
5b70: 68 6f 6d 65 20 72 6f 75 74 65 72 20 64 6f 65 73 home router does
5b80: 20 6e 6f 74 68 69 6e 67 20 74 6f 20 61 20 73 65 nothing to a se
5b90: 63 6f 6e 64 20 4e 41 54 20 75 70 73 74 72 65 61 cond NAT upstrea
5ba0: 6d 20 6f 66 20 69 74 2e 20 4e 41 54 2d 50 4d 50 m of it. NAT-PMP
5bb0: 20 73 61 79 73 20 6f 75 74 72 69 67 68 74 20 74 says outright t
5bc0: 68 61 74 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 hat it does not
5bd0: 68 61 6e 64 6c 65 20 74 68 69 73 20 63 61 73 65 handle this case
5be0: 2e 20 49 74 73 20 73 65 63 74 69 6f 6e 20 34 2e . Its section 4.
5bf0: 33 2e 31 20 28 4e 41 54 20 62 65 68 69 6e 64 20 3.1 (NAT behind
5c00: 4e 41 54 29 20 62 65 67 69 6e 73 3a 20 5c 22 53 NAT) begins: \"S
5c10: 6f 6d 65 20 70 65 6f 70 6c 65 27 73 20 70 72 69 ome people's pri
5c20: 6d 61 72 79 20 49 50 76 34 20 61 64 64 72 65 73 mary IPv4 addres
5c30: 73 2c 20 61 73 73 69 67 6e 65 64 20 62 79 20 74 s, assigned by t
5c40: 68 65 69 72 20 49 53 50 2c 20 6d 61 79 20 69 74 heir ISP, may it
5c50: 73 65 6c 66 20 62 65 20 61 20 4e 41 54 20 61 64 self be a NAT ad
5c60: 64 72 65 73 73 2e 5c 22 20 49 74 20 74 68 65 6e dress.\" It then
5c70: 20 64 65 63 6c 69 6e 65 73 20 74 6f 20 64 65 66 declines to def
5c80: 69 6e 65 20 72 65 63 75 72 73 69 76 65 20 6d 61 ine recursive ma
5c90: 70 70 69 6e 67 3a 20 5c 22 54 68 69 73 20 64 6f pping: \"This do
5ca0: 63 75 6d 65 6e 74 20 64 6f 65 73 20 6e 6f 74 20 cument does not
5cb0: 61 64 76 6f 63 61 74 65 20 74 68 61 74 20 61 6e advocate that an
5cc0: 64 20 64 6f 65 73 20 6e 6f 74 20 74 72 79 20 74 d does not try t
5cd0: 6f 20 70 72 65 73 63 72 69 62 65 20 68 6f 77 20 o prescribe how
5ce0: 69 74 20 77 6f 75 6c 64 20 62 65 20 64 6f 6e 65 it would be done
5cf0: 2e 5c 22 20 50 43 50 20 61 73 73 75 6d 65 73 20 .\" PCP assumes
5d00: 61 20 73 69 6e 67 6c 65 20 70 61 74 68 20 6f 75 a single path ou
5d10: 74 20 28 73 65 63 74 69 6f 6e 20 32 2e 33 29 2e t (section 2.3).
5d20: 20 46 6f 72 20 6e 65 73 74 65 64 20 4e 41 54 20 For nested NAT
5d30: 69 74 20 6f 6e 6c 79 20 6e 6f 74 65 73 20 74 68 it only notes th
5d40: 61 74 20 74 68 65 20 69 6e 6e 65 72 20 67 61 74 at the inner gat
5d50: 65 77 61 79 20 27 6d 61 79 20 69 74 73 65 6c 66 eway 'may itself
5d60: 20 61 63 74 20 61 73 20 61 20 50 43 50 20 63 6c act as a PCP cl
5d70: 69 65 6e 74 20 74 6f 20 74 68 65 20 75 70 73 74 ient to the upst
5d80: 72 65 61 6d 20 4e 41 54 27 2e 20 52 46 43 20 36 ream NAT'. RFC 6
5d90: 39 37 30 20 65 78 70 6c 61 69 6e 73 20 74 68 61 970 explains tha
5da0: 74 20 61 20 68 6f 6d 65 20 72 6f 75 74 65 72 27 t a home router'
5db0: 73 20 55 50 6e 50 20 49 47 44 20 63 61 6e 6e 6f s UPnP IGD canno
5dc0: 74 20 63 6f 6e 74 72 6f 6c 20 74 68 65 20 49 53 t control the IS
5dd0: 50 27 73 20 63 61 72 72 69 65 72 2d 67 72 61 64 P's carrier-grad
5de0: 65 20 4e 41 54 20 75 6e 6c 65 73 73 20 74 68 65 e NAT unless the
5df0: 20 72 6f 75 74 65 72 20 74 72 61 6e 73 6c 61 74 router translat
5e00: 65 73 20 49 47 44 20 72 65 71 75 65 73 74 73 20 es IGD requests
5e10: 69 6e 74 6f 20 50 43 50 2e 22 2c 0a 20 20 20 22 into PCP.",. "
5e20: 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a source": "https:
5e30: 2f 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 //www.rfc-editor
5e40: 2e 6f 72 67 2f 72 66 63 2f 72 66 63 36 38 38 36 .org/rfc/rfc6886
5e50: 2e 74 78 74 20 28 73 65 63 74 69 6f 6e 20 34 2e .txt (section 4.
5e60: 33 2e 31 29 20 3b 20 68 74 74 70 73 3a 2f 2f 77 3.1) ; https://w
5e70: 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 ww.rfc-editor.or
5e80: 67 2f 72 66 63 2f 72 66 63 36 38 38 37 2e 74 78 g/rfc/rfc6887.tx
5e90: 74 20 28 73 65 63 74 69 6f 6e 73 20 32 2e 33 20 t (sections 2.3
5ea0: 61 6e 64 20 33 29 20 3b 20 68 74 74 70 73 3a 2f and 3) ; https:/
5eb0: 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e /www.rfc-editor.
5ec0: 6f 72 67 2f 72 66 63 2f 72 66 63 36 39 37 30 2e org/rfc/rfc6970.
5ed0: 68 74 6d 6c 20 28 49 6e 74 72 6f 64 75 63 74 69 html (Introducti
5ee0: 6f 6e 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 on)". },. {.
5ef0: 20 22 63 6c 61 69 6d 22 3a 20 22 54 68 65 20 6d "claim": "The m
5f00: 6f 73 74 20 63 6f 6d 6d 6f 6e 20 72 6f 75 74 65 ost common route
5f10: 72 2d 73 69 64 65 20 69 6d 70 6c 65 6d 65 6e 74 r-side implement
5f20: 61 74 69 6f 6e 2c 20 6d 69 6e 69 75 70 6e 70 64 ation, miniupnpd
5f30: 2c 20 72 65 66 75 73 65 73 20 74 6f 20 6d 61 70 , refuses to map
5f40: 20 70 6f 72 74 73 20 77 68 65 6e 20 69 74 20 69 ports when it i
5f50: 73 20 62 65 68 69 6e 64 20 61 6e 6f 74 68 65 72 s behind another
5f60: 20 4e 41 54 2e 20 49 74 73 20 73 61 6d 70 6c 65 NAT. Its sample
5f70: 20 63 6f 6e 66 69 67 20 73 61 79 73 3a 20 5c 22 config says: \"
5f80: 54 68 65 20 57 41 4e 20 69 6e 74 65 72 66 61 63 The WAN interfac
5f90: 65 20 6d 75 73 74 20 68 61 76 65 20 61 20 70 75 e must have a pu
5fa0: 62 6c 69 63 20 49 50 20 61 64 64 72 65 73 73 2e blic IP address.
5fb0: 20 4f 74 68 65 72 77 69 73 65 20 69 74 20 69 73 Otherwise it is
5fc0: 20 62 65 68 69 6e 64 20 4e 41 54 20 61 6e 64 20 behind NAT and
5fd0: 70 6f 72 74 20 66 6f 72 77 61 72 64 69 6e 67 20 port forwarding
5fe0: 69 73 20 69 6d 70 6f 73 73 69 62 6c 65 2e 5c 22 is impossible.\"
5ff0: 20 42 79 20 64 65 66 61 75 6c 74 20 69 74 20 64 By default it d
6000: 69 73 61 62 6c 65 73 20 70 6f 72 74 20 66 6f 72 isables port for
6010: 77 61 72 64 69 6e 67 20 77 68 65 6e 20 69 74 73 warding when its
6020: 20 65 78 74 65 72 6e 61 6c 20 61 64 64 72 65 73 external addres
6030: 73 20 69 73 20 61 20 70 72 69 76 61 74 65 20 6f s is a private o
6040: 6e 65 2e 20 49 74 73 20 6c 69 73 74 20 6f 66 20 ne. Its list of
6050: 70 72 69 76 61 74 65 20 72 61 6e 67 65 73 20 69 private ranges i
6060: 6e 63 6c 75 64 65 73 20 74 68 65 20 63 61 72 72 ncludes the carr
6070: 69 65 72 2d 67 72 61 64 65 20 4e 41 54 20 72 61 ier-grade NAT ra
6080: 6e 67 65 20 28 31 30 30 2e 36 34 2e 30 2e 30 2f nge (100.64.0.0/
6090: 31 30 2c 20 27 52 46 43 36 35 39 38 20 53 68 61 10, 'RFC6598 Sha
60a0: 72 65 64 20 41 64 64 72 65 73 73 20 53 70 61 63 red Address Spac
60b0: 65 27 29 2e 20 54 68 65 72 65 20 61 72 65 20 6f e'). There are o
60c0: 70 74 2d 69 6e 20 77 6f 72 6b 61 72 6f 75 6e 64 pt-in workaround
60d0: 73 3a 20 61 20 53 54 55 4e 20 63 68 65 63 6b 20 s: a STUN check
60e0: 28 65 78 74 5f 70 65 72 66 6f 72 6d 5f 73 74 75 (ext_perform_stu
60f0: 6e 29 20 6f 72 20 61 6e 20 61 6c 6c 6f 77 2d 70 n) or an allow-p
6100: 72 69 76 61 74 65 20 73 65 74 74 69 6e 67 2e 22 rivate setting."
6110: 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
6120: 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 https://raw.gith
6130: 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f ubusercontent.co
6140: 6d 2f 6d 69 6e 69 75 70 6e 70 2f 6d 69 6e 69 75 m/miniupnp/miniu
6150: 70 6e 70 2f 6d 61 73 74 65 72 2f 6d 69 6e 69 75 pnp/master/miniu
6160: 70 6e 70 64 2f 6d 69 6e 69 75 70 6e 70 64 2e 63 pnpd/miniupnpd.c
6170: 6f 6e 66 20 3b 20 68 74 74 70 73 3a 2f 2f 72 61 onf ; https://ra
6180: 77 2e 67 69 74 68 75 62 75 73 65 72 63 6f 6e 74 w.githubusercont
6190: 65 6e 74 2e 63 6f 6d 2f 6d 69 6e 69 75 70 6e 70 ent.com/miniupnp
61a0: 2f 6d 69 6e 69 75 70 6e 70 2f 6d 61 73 74 65 72 /miniupnp/master
61b0: 2f 6d 69 6e 69 75 70 6e 70 64 2f 67 65 74 69 66 /miniupnpd/getif
61c0: 61 64 64 72 2e 63 20 28 61 64 64 72 5f 69 73 5f addr.c (addr_is_
61d0: 72 65 73 65 72 76 65 64 29 20 3b 20 68 74 74 70 reserved) ; http
61e0: 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 6d s://github.com/m
61f0: 69 6e 69 75 70 6e 70 2f 6d 69 6e 69 75 70 6e 70 iniupnp/miniupnp
6200: 2f 63 6f 6d 6d 69 74 2f 38 65 31 30 61 31 61 65 /commit/8e10a1ae
6210: 61 62 39 62 38 63 64 34 64 33 62 32 65 39 36 34 ab9b8cd4d3b2e964
6220: 62 30 32 65 39 61 64 34 30 39 63 66 33 61 61 61 b02e9ad409cf3aaa
6230: 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 ". },. {. "c
6240: 6c 61 69 6d 22 3a 20 22 49 6e 20 70 72 69 6e 63 laim": "In princ
6250: 69 70 6c 65 20 74 68 65 20 49 53 50 20 63 6f 75 iple the ISP cou
6260: 6c 64 20 72 75 6e 20 61 20 50 43 50 20 73 65 72 ld run a PCP ser
6270: 76 65 72 20 6f 6e 20 69 74 73 20 6f 77 6e 20 63 ver on its own c
6280: 61 72 72 69 65 72 2d 67 72 61 64 65 20 4e 41 54 arrier-grade NAT
6290: 2e 20 52 46 43 20 36 38 38 38 20 52 45 51 2d 39 . RFC 6888 REQ-9
62a0: 20 73 61 79 73 3a 20 5c 22 41 20 43 47 4e 20 4d says: \"A CGN M
62b0: 55 53 54 20 69 6d 70 6c 65 6d 65 6e 74 20 61 20 UST implement a
62c0: 70 72 6f 74 6f 63 6f 6c 20 67 69 76 69 6e 67 20 protocol giving
62d0: 73 75 62 73 63 72 69 62 65 72 73 20 65 78 70 6c subscribers expl
62e0: 69 63 69 74 20 63 6f 6e 74 72 6f 6c 20 6f 76 65 icit control ove
62f0: 72 20 4e 41 54 20 6d 61 70 70 69 6e 67 73 2e 20 r NAT mappings.
6300: 54 68 61 74 20 70 72 6f 74 6f 63 6f 6c 20 53 48 That protocol SH
6310: 4f 55 4c 44 20 62 65 20 74 68 65 20 50 6f 72 74 OULD be the Port
6320: 20 43 6f 6e 74 72 6f 6c 20 50 72 6f 74 6f 63 6f Control Protoco
6330: 6c 5c 22 2e 20 49 6e 20 70 72 61 63 74 69 63 65 l\". In practice
6340: 2c 20 54 61 69 6c 73 63 61 6c 65 20 72 65 70 6f , Tailscale repo
6350: 72 74 73 20 74 68 61 74 20 27 43 47 4e 41 54 20 rts that 'CGNAT
6360: 49 53 50 73 20 74 65 6e 64 20 74 6f 20 74 75 72 ISPs tend to tur
6370: 6e 20 74 68 65 6d 20 6f 66 66 20 69 6e 20 74 68 n them off in th
6380: 65 20 65 71 75 69 70 6d 65 6e 74 20 74 68 65 79 e equipment they
6390: 20 70 75 74 20 69 6e 20 68 6f 6d 65 73 20 69 6e put in homes in
63a0: 20 6f 72 64 65 72 20 74 6f 20 61 76 6f 69 64 20 order to avoid
63b0: 73 6f 66 74 77 61 72 65 20 67 65 74 74 69 6e 67 software getting
63c0: 20 63 6f 6e 66 75 73 65 64 20 62 79 20 74 68 65 confused by the
63d0: 20 5c 22 77 72 6f 6e 67 5c 22 20 72 65 73 75 6c \"wrong\" resul
63e0: 74 73 20 74 68 65 79 20 77 6f 75 6c 64 20 67 65 ts they would ge
63f0: 74 2e 27 20 57 69 6b 69 70 65 64 69 61 20 73 61 t.' Wikipedia sa
6400: 79 73 20 50 43 50 20 27 75 70 74 61 6b 65 20 62 ys PCP 'uptake b
6410: 79 20 63 61 72 72 69 65 72 73 20 68 61 73 20 62 y carriers has b
6420: 65 65 6e 20 73 6c 6f 77 27 2c 20 61 6e 64 20 69 een slow', and i
6430: 74 73 20 73 65 63 74 69 6f 6e 20 6c 69 73 74 69 ts section listi
6440: 6e 67 20 63 61 72 72 69 65 72 73 20 74 68 61 74 ng carriers that
6450: 20 6f 66 66 65 72 20 50 43 50 20 69 73 20 65 6d offer PCP is em
6460: 70 74 79 2e 20 56 65 6e 64 6f 72 20 63 61 72 72 pty. Vendor carr
6470: 69 65 72 2d 67 72 61 64 65 20 4e 41 54 20 65 71 ier-grade NAT eq
6480: 75 69 70 6d 65 6e 74 20 28 4a 75 6e 69 70 65 72 uipment (Juniper
6490: 29 20 64 6f 65 73 20 6f 66 66 65 72 20 50 43 50 ) does offer PCP
64a0: 20 66 6f 72 20 44 53 2d 4c 69 74 65 2e 22 2c 0a for DS-Lite.",.
64b0: 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 "source": "ht
64c0: 74 70 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 64 tps://www.rfc-ed
64d0: 69 74 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 63 itor.org/rfc/rfc
64e0: 36 38 38 38 2e 68 74 6d 6c 20 28 52 45 51 2d 39 6888.html (REQ-9
64f0: 29 20 3b 20 68 74 74 70 73 3a 2f 2f 74 61 69 6c ) ; https://tail
6500: 73 63 61 6c 65 2e 63 6f 6d 2f 62 6c 6f 67 2f 68 scale.com/blog/h
6510: 6f 77 2d 6e 61 74 2d 74 72 61 76 65 72 73 61 6c ow-nat-traversal
6520: 2d 77 6f 72 6b 73 20 28 73 65 63 74 69 6f 6e 20 -works (section
6530: 27 43 6f 6e 63 65 72 6e 69 6e 67 20 43 47 4e 41 'Concerning CGNA
6540: 54 73 27 29 20 3b 20 68 74 74 70 73 3a 2f 2f 65 Ts') ; https://e
6550: 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f n.wikipedia.org/
6560: 77 69 6b 69 2f 43 61 72 72 69 65 72 2d 67 72 61 wiki/Carrier-gra
6570: 64 65 5f 4e 41 54 20 3b 20 68 74 74 70 73 3a 2f de_NAT ; https:/
6580: 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 /en.wikipedia.or
6590: 67 2f 77 69 6b 69 2f 50 6f 72 74 5f 43 6f 6e 74 g/wiki/Port_Cont
65a0: 72 6f 6c 5f 50 72 6f 74 6f 63 6f 6c 20 3b 20 68 rol_Protocol ; h
65b0: 74 74 70 73 3a 2f 2f 61 70 70 73 2e 6a 75 6e 69 ttps://apps.juni
65c0: 70 65 72 2e 6e 65 74 2f 66 65 61 74 75 72 65 2d per.net/feature-
65d0: 65 78 70 6c 6f 72 65 72 2f 66 65 61 74 75 72 65 explorer/feature
65e0: 2f 38 32 35 30 22 0a 20 20 7d 2c 0a 20 20 7b 0a /8250". },. {.
65f0: 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 48 6f 77 "claim": "How
6600: 20 63 6f 6d 6d 6f 6e 20 63 61 72 72 69 65 72 2d common carrier-
6610: 67 72 61 64 65 20 4e 41 54 20 61 6e 64 20 64 6f grade NAT and do
6620: 75 62 6c 65 20 4e 41 54 20 61 72 65 20 28 6f 6c uble NAT are (ol
6630: 64 20 64 61 74 61 2c 20 63 6f 75 6e 74 65 64 20 d data, counted
6640: 70 65 72 20 6e 65 74 77 6f 72 6b 20 72 61 74 68 per network rath
6650: 65 72 20 74 68 61 6e 20 70 65 72 20 75 73 65 72 er than per user
6660: 29 3a 20 52 69 63 68 74 65 72 20 65 74 20 61 6c ): Richter et al
6670: 2e 20 28 49 4d 43 20 32 30 31 36 29 20 66 6f 75 . (IMC 2016) fou
6680: 6e 64 20 63 61 72 72 69 65 72 2d 67 72 61 64 65 nd carrier-grade
6690: 20 4e 41 54 20 69 6e 20 5c 22 31 37 e2 80 93 31 NAT in \"17–1
66a0: 38 25 20 6f 66 20 61 6c 6c 20 45 79 65 62 61 6c 8% of all Eyebal
66b0: 6c 20 41 53 65 73 5c 22 20 28 74 68 65 20 6e 65 l ASes\" (the ne
66c0: 74 77 6f 72 6b 73 20 74 68 61 74 20 73 65 72 76 tworks that serv
66d0: 65 20 65 6e 64 20 75 73 65 72 73 29 20 61 6e 64 e end users) and
66e0: 20 69 6e 20 5c 22 6d 6f 72 65 20 74 68 61 6e 20 in \"more than
66f0: 39 30 25 20 6f 66 20 61 6c 6c 20 63 65 6c 6c 75 90% of all cellu
6700: 6c 61 72 20 41 53 65 73 5c 22 2e 20 54 68 65 69 lar ASes\". Thei
6710: 72 20 4e 65 74 61 6c 79 7a 72 20 64 61 74 61 20 r Netalyzr data
6720: 77 61 73 20 63 6f 6c 6c 65 63 74 65 64 20 32 30 was collected 20
6730: 31 34 e2 80 93 32 30 31 35 20 66 72 6f 6d 20 75 14–2015 from u
6740: 73 65 72 73 20 77 68 6f 20 63 68 6f 73 65 20 74 sers who chose t
6750: 6f 20 72 75 6e 20 74 68 65 20 74 65 73 74 2e 20 o run the test.
6760: 49 6e 20 6e 6f 6e 2d 63 65 6c 6c 75 6c 61 72 20 In non-cellular
6770: 73 65 73 73 69 6f 6e 73 2c 20 55 50 6e 50 20 72 sessions, UPnP r
6780: 65 74 75 72 6e 65 64 20 74 68 65 20 72 6f 75 74 eturned the rout
6790: 65 72 27 73 20 65 78 74 65 72 6e 61 6c 20 61 64 er's external ad
67a0: 64 72 65 73 73 20 69 6e 20 34 30 25 20 6f 66 20 dress in 40% of
67b0: 73 65 73 73 69 6f 6e 73 2e 20 4f 66 20 74 68 6f sessions. Of tho
67c0: 73 65 2c 20 38 33 25 20 77 65 72 65 20 61 20 70 se, 83% were a p
67d0: 75 62 6c 69 63 20 61 64 64 72 65 73 73 2c 20 61 ublic address, a
67e0: 6e 64 20 27 54 68 65 20 72 65 6d 61 69 6e 69 6e nd 'The remainin
67f0: 67 20 31 37 25 20 6f 66 20 74 68 65 20 63 61 73 g 17% of the cas
6800: 65 73 20 63 6c 65 61 72 6c 79 20 70 6f 69 6e 74 es clearly point
6810: 20 74 6f 20 6d 75 6c 74 69 70 6c 65 20 4e 41 54 to multiple NAT
6820: 73 2e 27 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 s.'",. "source
6830: 22 3a 20 22 68 74 74 70 73 3a 2f 2f 61 72 78 69 ": "https://arxi
6840: 76 2e 6f 72 67 2f 70 64 66 2f 31 36 30 35 2e 30 v.org/pdf/1605.0
6850: 35 36 30 36 20 28 61 62 73 74 72 61 63 74 3b 20 5606 (abstract;
6860: 73 65 63 74 69 6f 6e 20 6f 6e 20 4e 65 74 61 6c section on Netal
6870: 79 7a 72 20 6e 6f 6e 2d 63 65 6c 6c 75 6c 61 72 yzr non-cellular
6880: 20 64 65 74 65 63 74 69 6f 6e 2c 20 54 61 62 6c detection, Tabl
6890: 65 20 34 20 64 69 73 63 75 73 73 69 6f 6e 29 22 e 4 discussion)"
68a0: 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c . },. {. "cl
68b0: 61 69 6d 22 3a 20 22 52 6f 75 74 65 72 20 73 75 aim": "Router su
68c0: 70 70 6f 72 74 20 61 6e 64 20 64 65 66 61 75 6c pport and defaul
68d0: 74 73 20 76 61 72 79 20 77 69 64 65 6c 79 2e 20 ts vary widely.
68e0: 42 69 74 63 6f 69 6e 20 43 6f 72 65 20 74 65 73 Bitcoin Core tes
68f0: 74 65 72 73 20 63 68 65 63 6b 65 64 20 31 36 20 ters checked 16
6900: 72 6f 75 74 65 72 73 20 6f 72 20 73 65 72 76 69 routers or servi
6910: 63 65 73 20 62 65 66 6f 72 65 20 74 75 72 6e 69 ces before turni
6920: 6e 67 20 50 43 50 2f 4e 41 54 2d 50 4d 50 20 6f ng PCP/NAT-PMP o
6930: 6e 20 62 79 20 64 65 66 61 75 6c 74 2e 20 4f 6e n by default. On
6940: 6c 79 20 35 20 77 6f 72 6b 65 64 20 77 69 74 68 ly 5 worked with
6950: 6f 75 74 20 63 68 61 6e 67 69 6e 67 20 72 6f 75 out changing rou
6960: 74 65 72 20 73 65 74 74 69 6e 67 73 3a 20 74 68 ter settings: th
6970: 65 20 56 65 72 69 7a 6f 6e 20 64 65 66 61 75 6c e Verizon defaul
6980: 74 20 72 6f 75 74 65 72 2c 20 74 68 65 20 56 65 t router, the Ve
6990: 72 69 7a 6f 6e 20 43 52 31 30 30 30 41 2c 20 61 rizon CR1000A, a
69a0: 6e 64 20 74 68 72 65 65 20 54 50 2d 4c 69 6e 6b nd three TP-Link
69b0: 20 41 72 63 68 65 72 20 6d 6f 64 65 6c 73 2c 20 Archer models,
69c0: 61 6c 6c 20 74 68 72 6f 75 67 68 20 4e 41 54 2d all through NAT-
69d0: 50 4d 50 2e 20 50 43 50 20 77 61 73 20 73 75 70 PMP. PCP was sup
69e0: 70 6f 72 74 65 64 20 62 75 74 20 6f 66 66 20 62 ported but off b
69f0: 79 20 64 65 66 61 75 6c 74 20 6f 6e 20 74 68 65 y default on the
6a00: 20 53 70 65 63 74 72 75 6d 20 57 69 2d 46 69 20 Spectrum Wi-Fi
6a10: 36 45 20 72 6f 75 74 65 72 2c 20 74 77 6f 20 55 6E router, two U
6a20: 6e 69 46 69 20 67 61 74 65 77 61 79 73 2c 20 74 niFi gateways, t
6a30: 68 65 20 46 52 49 54 5a 21 42 6f 78 20 37 35 33 he FRITZ!Box 753
6a40: 30 20 41 58 20 61 6e 64 20 4f 50 4e 73 65 6e 73 0 AX and OPNsens
6a50: 65 2e 20 54 68 65 20 48 75 61 77 65 69 20 45 63 e. The Huawei Ec
6a60: 68 6f 4c 69 66 65 20 48 47 38 31 34 35 56 35 20 hoLife HG8145V5
6a70: 73 75 70 70 6f 72 74 65 64 20 6e 65 69 74 68 65 supported neithe
6a80: 72 2c 20 61 6e 64 20 74 68 65 20 4c 69 76 65 62 r, and the Liveb
6a90: 6f 78 20 46 69 62 72 61 20 68 61 64 20 55 50 6e ox Fibra had UPn
6aa0: 50 20 6f 6e 20 62 75 74 20 6e 6f 74 20 50 43 50 P on but not PCP
6ab0: 2f 4e 41 54 2d 50 4d 50 2e 20 4f 6e 65 20 74 65 /NAT-PMP. One te
6ac0: 73 74 65 72 20 77 72 6f 74 65 20 74 68 61 74 20 ster wrote that
6ad0: 49 53 50 20 72 6f 75 74 65 72 73 20 66 72 6f 6d ISP routers from
6ae0: 20 46 69 62 65 72 68 6f 6d 65 20 61 6e 64 20 48 Fiberhome and H
6af0: 75 61 77 65 69 2c 20 75 73 65 64 20 62 79 20 27 uawei, used by '
6b00: 62 61 73 69 63 61 6c 6c 79 20 61 6c 6c 20 6f 66 basically all of
6b10: 20 54 68 61 69 6c 61 6e 64 73 20 49 53 50 73 27 Thailands ISPs'
6b20: 2c 20 73 75 70 70 6f 72 74 20 6e 6f 74 68 69 6e , support nothin
6b30: 67 20 27 6f 74 68 65 72 20 74 68 61 6e 20 55 50 g 'other than UP
6b40: 6e 50 27 2e 20 6d 69 6e 69 75 70 6e 70 64 27 73 nP'. miniupnpd's
6b50: 20 6f 77 6e 20 64 65 66 61 75 6c 74 73 3a 20 55 own defaults: U
6b60: 50 6e 50 20 27 64 65 66 61 75 6c 74 20 69 73 20 PnP 'default is
6b70: 79 65 73 27 2c 20 4e 41 54 2d 50 4d 50 20 61 6e yes', NAT-PMP an
6b80: 64 20 50 43 50 20 27 64 65 66 61 75 6c 74 20 69 d PCP 'default i
6b90: 73 20 6e 6f 27 2e 20 4f 70 65 6e 57 72 74 20 6e s no'. OpenWrt n
6ba0: 65 65 64 73 20 6d 69 6e 69 75 70 6e 70 64 20 69 eeds miniupnpd i
6bb0: 6e 73 74 61 6c 6c 65 64 20 73 65 70 61 72 61 74 nstalled separat
6bc0: 65 6c 79 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 ely.",. "sourc
6bd0: 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 67 69 74 e": "https://git
6be0: 68 75 62 2e 63 6f 6d 2f 62 69 74 63 6f 69 6e 2f hub.com/bitcoin/
6bf0: 62 69 74 63 6f 69 6e 2f 69 73 73 75 65 73 2f 33 bitcoin/issues/3
6c00: 31 36 36 33 20 28 63 6f 6d 70 61 74 69 62 69 6c 1663 (compatibil
6c10: 69 74 79 20 74 61 62 6c 65 3b 20 63 6f 6d 6d 65 ity table; comme
6c20: 6e 74 20 62 79 20 6b 65 66 66 6e 65 74 29 20 3b nt by keffnet) ;
6c30: 20 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 https://raw.git
6c40: 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 hubusercontent.c
6c50: 6f 6d 2f 6d 69 6e 69 75 70 6e 70 2f 6d 69 6e 69 om/miniupnp/mini
6c60: 75 70 6e 70 2f 6d 61 73 74 65 72 2f 6d 69 6e 69 upnp/master/mini
6c70: 75 70 6e 70 64 2f 6d 69 6e 69 75 70 6e 70 64 2e upnpd/miniupnpd.
6c80: 63 6f 6e 66 20 3b 20 68 74 74 70 73 3a 2f 2f 6f conf ; https://o
6c90: 70 65 6e 77 72 74 2e 6f 72 67 2f 64 6f 63 73 2f penwrt.org/docs/
6ca0: 67 75 69 64 65 2d 75 73 65 72 2f 66 69 72 65 77 guide-user/firew
6cb0: 61 6c 6c 2f 75 70 6e 70 2f 75 70 6e 70 5f 73 65 all/upnp/upnp_se
6cc0: 74 75 70 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 tup". },. {.
6cd0: 20 22 63 6c 61 69 6d 22 3a 20 22 53 65 63 75 72 "claim": "Secur
6ce0: 69 74 79 20 61 64 76 69 63 65 20 63 6f 6d 6d 6f ity advice commo
6cf0: 6e 6c 79 20 73 61 79 73 20 74 6f 20 74 75 72 6e nly says to turn
6d00: 20 55 50 6e 50 20 6f 66 66 2c 20 61 6e 64 20 74 UPnP off, and t
6d10: 68 69 73 20 6f 66 74 65 6e 20 74 75 72 6e 73 20 his often turns
6d20: 6f 66 66 20 74 68 65 20 73 61 66 65 72 20 70 72 off the safer pr
6d30: 6f 74 6f 63 6f 6c 73 20 74 6f 6f 2e 20 54 61 69 otocols too. Tai
6d40: 6c 73 63 61 6c 65 3a 20 27 6d 61 6e 79 20 64 65 lscale: 'many de
6d50: 76 69 63 65 73 20 63 6f 6d 65 20 77 69 74 68 20 vices come with
6d60: 61 20 73 69 6e 67 6c 65 20 5c 22 55 50 6e 50 5c a single \"UPnP\
6d70: 22 20 63 68 65 63 6b 62 6f 78 20 74 68 61 74 20 " checkbox that
6d80: 61 63 74 75 61 6c 6c 79 20 74 6f 67 67 6c 65 73 actually toggles
6d90: 20 55 50 6e 50 2c 20 4e 41 54 2d 50 4d 50 20 61 UPnP, NAT-PMP a
6da0: 6e 64 20 50 43 50 20 61 6c 6c 20 61 74 20 6f 6e nd PCP all at on
6db0: 63 65 27 2e 20 4f 70 65 6e 57 72 74 3a 20 5c 22 ce'. OpenWrt: \"
6dc0: 55 50 6e 50 20 70 72 6f 76 69 64 65 73 20 6e 6f UPnP provides no
6dd0: 20 61 75 74 68 65 6e 74 69 63 61 74 69 6f 6e 20 authentication
6de0: 6d 65 63 68 61 6e 69 73 6d 73 2c 20 69 74 20 69 mechanisms, it i
6df0: 73 20 63 6f 6d 6d 6f 6e 6c 79 20 72 65 67 61 72 s commonly regar
6e00: 64 65 64 20 61 73 20 6f 6e 65 20 67 69 61 6e 74 ded as one giant
6e10: 20 73 65 63 75 72 69 74 79 20 68 6f 6c 65 2e 5c security hole.\
6e20: 22 20 70 66 53 65 6e 73 65 3a 20 5c 22 41 6e 79 " pfSense: \"Any
6e30: 20 70 72 6f 67 72 61 6d 20 6f 6e 20 74 68 65 20 program on the
6e40: 6e 65 74 77 6f 72 6b 20 63 61 6e 20 61 6c 6c 6f network can allo
6e50: 77 20 69 6e 20 61 6e 64 20 66 6f 72 77 61 72 64 w in and forward
6e60: 20 61 6e 79 20 74 72 61 66 66 69 63 20 e2 80 93 any traffic –
6e70: 20 61 20 70 6f 74 65 6e 74 69 61 6c 20 73 65 63 a potential sec
6e80: 75 72 69 74 79 20 6e 69 67 68 74 6d 61 72 65 2e urity nightmare.
6e90: 5c 22 20 43 45 52 54 20 56 55 23 33 35 37 38 35 \" CERT VU#35785
6ea0: 31 20 28 32 30 31 31 e2 80 93 32 30 31 32 29 20 1 (2011–2012)
6eb0: 63 6f 76 65 72 73 20 72 6f 75 74 65 72 73 20 74 covers routers t
6ec0: 68 61 74 20 61 63 63 65 70 74 65 64 20 41 64 64 hat accepted Add
6ed0: 50 6f 72 74 4d 61 70 70 69 6e 67 20 66 72 6f 6d PortMapping from
6ee0: 20 74 68 65 20 69 6e 74 65 72 6e 65 74 20 73 69 the internet si
6ef0: 64 65 2c 20 61 6e 64 20 69 74 73 20 77 6f 72 6b de, and its work
6f00: 61 72 6f 75 6e 64 20 69 73 20 74 6f 20 64 69 73 around is to dis
6f10: 61 62 6c 65 20 55 50 6e 50 2e 20 52 61 70 69 64 able UPnP. Rapid
6f20: 37 20 28 32 30 31 33 29 20 66 6f 75 6e 64 20 6f 7 (2013) found o
6f30: 76 65 72 20 38 31 20 6d 69 6c 6c 69 6f 6e 20 49 ver 81 million I
6f40: 50 73 20 61 6e 73 77 65 72 69 6e 67 20 55 50 6e Ps answering UPn
6f50: 50 20 64 69 73 63 6f 76 65 72 79 20 66 72 6f 6d P discovery from
6f60: 20 74 68 65 20 69 6e 74 65 72 6e 65 74 2c 20 61 the internet, a
6f70: 6e 64 20 6f 76 65 72 20 32 33 20 6d 69 6c 6c 69 nd over 23 milli
6f80: 6f 6e 20 76 75 6c 6e 65 72 61 62 6c 65 20 74 6f on vulnerable to
6f90: 20 6f 6e 65 20 72 65 6d 6f 74 65 2d 63 6f 64 65 one remote-code
6fa0: 2d 65 78 65 63 75 74 69 6f 6e 20 62 75 67 2e 20 -execution bug.
6fb0: 41 6b 61 6d 61 69 20 28 32 30 31 38 29 20 66 6f Akamai (2018) fo
6fc0: 75 6e 64 20 6f 76 65 72 20 36 35 2c 30 30 30 20 und over 65,000
6fd0: 72 6f 75 74 65 72 73 20 77 69 74 68 20 61 74 74 routers with att
6fe0: 61 63 6b 65 72 2d 69 6e 6a 65 63 74 65 64 20 70 acker-injected p
6ff0: 6f 72 74 20 6d 61 70 70 69 6e 67 73 2e 20 43 61 ort mappings. Ca
7000: 6c 6c 53 74 72 61 6e 67 65 72 20 28 43 56 45 2d llStranger (CVE-
7010: 32 30 32 30 2d 31 32 36 39 35 29 20 77 61 73 20 2020-12695) was
7020: 61 20 66 6c 61 77 20 69 6e 20 74 68 65 20 55 50 a flaw in the UP
7030: 6e 50 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e nP specification
7040: 20 69 74 73 65 6c 66 2e 20 54 61 69 6c 73 63 61 itself. Tailsca
7050: 6c 65 20 6e 6f 74 65 73 20 74 68 61 74 20 74 68 le notes that th
7060: 65 20 6d 61 6a 6f 72 20 62 75 67 73 20 77 65 72 e major bugs wer
7070: 65 20 27 73 69 6e 63 65 20 66 69 78 65 64 2c 20 e 'since fixed,
7080: 73 6f 20 6e 65 77 65 72 20 64 65 76 69 63 65 73 so newer devices
7090: 20 63 61 6e 20 73 61 66 65 6c 79 20 6f 66 66 65 can safely offe
70a0: 72 20 55 50 6e 50 2c 20 69 66 20 69 6d 70 6c 65 r UPnP, if imple
70b0: 6d 65 6e 74 65 64 20 70 72 6f 70 65 72 6c 79 27 mented properly'
70c0: 2e 20 4d 69 74 69 67 61 74 69 6f 6e 73 20 65 78 . Mitigations ex
70d0: 69 73 74 3a 20 6d 69 6e 69 75 70 6e 70 64 27 73 ist: miniupnpd's
70e0: 20 73 65 63 75 72 65 5f 6d 6f 64 65 20 28 6f 6e secure_mode (on
70f0: 20 62 79 20 64 65 66 61 75 6c 74 29 20 6c 65 74 by default) let
7100: 73 20 61 20 4c 41 4e 20 64 65 76 69 63 65 20 6d s a LAN device m
7110: 61 70 20 70 6f 72 74 73 20 6f 6e 6c 79 20 74 6f ap ports only to
7120: 20 69 74 73 20 6f 77 6e 20 49 50 2c 20 61 6e 64 its own IP, and
7130: 20 6d 69 6e 69 75 70 6e 70 64 20 61 6e 64 20 70 miniupnpd and p
7140: 66 53 65 6e 73 65 20 73 75 70 70 6f 72 74 20 61 fSense support a
7150: 6c 6c 6f 77 2f 64 65 6e 79 20 6c 69 73 74 73 2e llow/deny lists.
7160: 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
7170: 22 68 74 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 "https://tailsca
7180: 6c 65 2e 63 6f 6d 2f 62 6c 6f 67 2f 68 6f 77 2d le.com/blog/how-
7190: 6e 61 74 2d 74 72 61 76 65 72 73 61 6c 2d 77 6f nat-traversal-wo
71a0: 72 6b 73 20 3b 20 68 74 74 70 73 3a 2f 2f 6f 70 rks ; https://op
71b0: 65 6e 77 72 74 2e 6f 72 67 2f 64 6f 63 73 2f 67 enwrt.org/docs/g
71c0: 75 69 64 65 2d 75 73 65 72 2f 66 69 72 65 77 61 uide-user/firewa
71d0: 6c 6c 2f 75 70 6e 70 2f 75 70 6e 70 5f 73 65 74 ll/upnp/upnp_set
71e0: 75 70 20 3b 20 68 74 74 70 73 3a 2f 2f 64 6f 63 up ; https://doc
71f0: 73 2e 6e 65 74 67 61 74 65 2e 63 6f 6d 2f 70 66 s.netgate.com/pf
7200: 73 65 6e 73 65 2f 65 6e 2f 6c 61 74 65 73 74 2f sense/en/latest/
7210: 73 65 72 76 69 63 65 73 2f 75 70 6e 70 2e 68 74 services/upnp.ht
7220: 6d 6c 20 3b 20 68 74 74 70 73 3a 2f 2f 77 77 77 ml ; https://www
7230: 2e 6b 62 2e 63 65 72 74 2e 6f 72 67 2f 76 75 6c .kb.cert.org/vul
7240: 73 2f 69 64 2f 33 35 37 38 35 31 20 3b 20 68 74 s/id/357851 ; ht
7250: 74 70 73 3a 2f 2f 77 77 77 2e 72 61 70 69 64 37 tps://www.rapid7
7260: 2e 63 6f 6d 2f 62 6c 6f 67 2f 70 6f 73 74 2f 32 .com/blog/post/2
7270: 30 31 33 2f 30 31 2f 32 39 2f 73 65 63 75 72 69 013/01/29/securi
7280: 74 79 2d 66 6c 61 77 73 2d 69 6e 2d 75 6e 69 76 ty-flaws-in-univ
7290: 65 72 73 61 6c 2d 70 6c 75 67 2d 61 6e 64 2d 70 ersal-plug-and-p
72a0: 6c 61 79 2d 75 6e 70 6c 75 67 2d 64 6f 6e 74 2d lay-unplug-dont-
72b0: 70 6c 61 79 2f 20 3b 20 68 74 74 70 73 3a 2f 2f play/ ; https://
72c0: 77 77 77 2e 62 6c 65 65 70 69 6e 67 63 6f 6d 70 www.bleepingcomp
72d0: 75 74 65 72 2e 63 6f 6d 2f 6e 65 77 73 2f 73 65 uter.com/news/se
72e0: 63 75 72 69 74 79 2f 6f 76 65 72 2d 36 35 2d 30 curity/over-65-0
72f0: 30 30 2d 68 6f 6d 65 2d 72 6f 75 74 65 72 73 2d 00-home-routers-
7300: 61 72 65 2d 70 72 6f 78 79 69 6e 67 2d 62 61 64 are-proxying-bad
7310: 2d 74 72 61 66 66 69 63 2d 66 6f 72 2d 62 6f 74 -traffic-for-bot
7320: 6e 65 74 73 2d 61 70 74 73 2f 20 3b 20 68 74 74 nets-apts/ ; htt
7330: 70 73 3a 2f 2f 6b 62 2e 63 65 72 74 2e 6f 72 67 ps://kb.cert.org
7340: 2f 76 75 6c 73 2f 69 64 2f 33 33 39 32 37 35 22 /vuls/id/339275"
7350: 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c . },. {. "cl
7360: 61 69 6d 22 3a 20 22 54 68 65 20 63 6c 69 65 6e aim": "The clien
7370: 74 20 73 69 64 65 20 69 73 20 61 20 72 69 73 6b t side is a risk
7380: 20 74 6f 6f 2c 20 61 73 20 42 69 74 63 6f 69 6e too, as Bitcoin
7390: 20 43 6f 72 65 20 66 6f 75 6e 64 2e 20 6d 69 6e Core found. min
73a0: 69 75 70 6e 70 63 20 63 61 75 73 65 64 20 61 20 iupnpc caused a
73b0: 72 65 6d 6f 74 65 2d 63 6f 64 65 2d 65 78 65 63 remote-code-exec
73c0: 75 74 69 6f 6e 20 62 75 67 20 69 6e 20 42 69 74 ution bug in Bit
73d0: 63 6f 69 6e 20 43 6f 72 65 20 28 32 30 31 35 29 coin Core (2015)
73e0: 20 61 6e 64 20 61 6e 20 6f 75 74 2d 6f 66 2d 6d and an out-of-m
73f0: 65 6d 6f 72 79 20 62 75 67 20 28 32 30 32 30 29 emory bug (2020)
7400: 2e 20 41 20 42 69 74 63 6f 69 6e 20 43 6f 72 65 . A Bitcoin Core
7410: 20 6d 61 69 6e 74 61 69 6e 65 72 20 28 6c 61 61 maintainer (laa
7420: 6e 77 6a 29 20 63 61 6c 6c 65 64 20 69 74 20 27 nwj) called it '
7430: 62 72 69 74 74 6c 65 20 43 2d 62 61 73 65 64 20 brittle C-based
7440: 73 74 72 69 6e 67 20 6d 61 6e 69 70 75 6c 61 74 string manipulat
7450: 69 6f 6e 20 74 6f 20 67 65 6e 65 72 61 74 65 20 ion to generate
7460: 61 6e 64 20 70 61 72 73 65 20 58 4d 4c 20 61 6e and parse XML an
7470: 64 20 48 54 54 50 27 2e 20 42 69 74 63 6f 69 6e d HTTP'. Bitcoin
7480: 20 43 6f 72 65 20 32 39 2e 30 20 64 72 6f 70 70 Core 29.0 dropp
7490: 65 64 20 55 50 6e 50 20 61 6e 64 20 72 65 70 6c ed UPnP and repl
74a0: 61 63 65 64 20 6c 69 62 6e 61 74 70 6d 70 20 77 aced libnatpmp w
74b0: 69 74 68 20 27 61 20 62 75 69 6c 74 2d 69 6e 20 ith 'a built-in
74c0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f implementation o
74d0: 66 20 50 43 50 20 61 6e 64 20 4e 41 54 2d 50 4d f PCP and NAT-PM
74e0: 50 20 2e 2e 2e 20 54 68 69 73 20 73 75 70 70 6f P ... This suppo
74f0: 72 74 73 20 61 75 74 6f 6d 61 74 69 63 20 49 50 rts automatic IP
7500: 76 34 20 70 6f 72 74 20 66 6f 72 77 61 72 64 69 v4 port forwardi
7510: 6e 67 20 61 73 20 77 65 6c 6c 20 61 73 20 49 50 ng as well as IP
7520: 76 36 20 70 69 6e 68 6f 6c 69 6e 67 2e 27 20 42 v6 pinholing.' B
7530: 69 74 63 6f 69 6e 20 43 6f 72 65 20 33 30 2e 30 itcoin Core 30.0
7540: 20 6d 61 64 65 20 2d 6e 61 74 70 6d 70 3d 31 20 made -natpmp=1
7550: 74 68 65 20 64 65 66 61 75 6c 74 2e 20 54 68 65 the default. The
7560: 20 6c 65 73 73 6f 6e 3a 20 4e 41 54 2d 50 4d 50 lesson: NAT-PMP
7570: 20 61 6e 64 20 50 43 50 20 61 72 65 20 73 6d 61 and PCP are sma
7580: 6c 6c 20 62 69 6e 61 72 79 20 55 44 50 20 70 72 ll binary UDP pr
7590: 6f 74 6f 63 6f 6c 73 20 74 68 61 74 20 61 72 65 otocols that are
75a0: 20 65 61 73 79 20 74 6f 20 77 72 69 74 65 20 64 easy to write d
75b0: 69 72 65 63 74 6c 79 2c 20 77 68 69 6c 65 20 55 irectly, while U
75c0: 50 6e 50 20 6d 65 61 6e 73 20 70 61 72 73 69 6e PnP means parsin
75d0: 67 20 58 4d 4c 20 61 6e 64 20 48 54 54 50 20 73 g XML and HTTP s
75e0: 65 6e 74 20 62 79 20 77 68 61 74 65 76 65 72 20 ent by whatever
75f0: 64 65 76 69 63 65 20 6f 6e 20 74 68 65 20 4c 41 device on the LA
7600: 4e 20 61 6e 73 77 65 72 73 20 64 69 73 63 6f 76 N answers discov
7610: 65 72 79 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 ery.",. "sourc
7620: 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 67 69 74 e": "https://git
7630: 68 75 62 2e 63 6f 6d 2f 62 69 74 63 6f 69 6e 2f hub.com/bitcoin/
7640: 62 69 74 63 6f 69 6e 2f 70 75 6c 6c 2f 33 31 31 bitcoin/pull/311
7650: 33 30 20 3b 20 68 74 74 70 73 3a 2f 2f 62 69 74 30 ; https://bit
7660: 63 6f 69 6e 63 6f 72 65 2e 6f 72 67 2f 65 6e 2f coincore.org/en/
7670: 72 65 6c 65 61 73 65 73 2f 32 39 2e 30 2f 20 3b releases/29.0/ ;
7680: 20 68 74 74 70 73 3a 2f 2f 62 69 74 63 6f 69 6e https://bitcoin
7690: 63 6f 72 65 2e 6f 72 67 2f 65 6e 2f 72 65 6c 65 core.org/en/rele
76a0: 61 73 65 73 2f 33 30 2e 30 2f 22 0a 20 20 7d 2c ases/30.0/". },
76b0: 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a . {. "claim":
76c0: 20 22 4c 69 62 72 61 72 69 65 73 20 61 20 73 6d "Libraries a sm
76d0: 61 6c 6c 20 70 72 6f 67 72 61 6d 20 63 6f 75 6c all program coul
76e0: 64 20 75 73 65 3a 20 28 61 29 20 6d 69 6e 69 75 d use: (a) miniu
76f0: 70 6e 70 63 3a 20 43 2c 20 42 53 44 20 33 2d 43 pnpc: C, BSD 3-C
7700: 6c 61 75 73 65 2c 20 75 6e 64 65 72 20 35 30 20 lause, under 50
7710: 4b 42 20 63 6f 6d 70 69 6c 65 64 2e 20 49 74 20 KB compiled. It
7720: 70 72 6f 76 69 64 65 73 20 75 70 6e 70 44 69 73 provides upnpDis
7730: 63 6f 76 65 72 2c 20 55 50 4e 50 5f 47 65 74 56 cover, UPNP_GetV
7740: 61 6c 69 64 49 47 44 20 61 6e 64 20 55 50 4e 50 alidIGD and UPNP
7750: 5f 41 64 64 50 6f 72 74 4d 61 70 70 69 6e 67 2c _AddPortMapping,
7760: 20 61 6e 64 20 73 68 69 70 73 20 74 68 65 20 60 and ships the `
7770: 75 70 6e 70 63 60 20 63 6f 6d 6d 61 6e 64 2d 6c upnpc` command-l
7780: 69 6e 65 20 74 6f 6f 6c 20 28 60 2d 61 60 20 61 ine tool (`-a` a
7790: 64 64 73 20 61 20 6d 61 70 70 69 6e 67 2c 20 60 dds a mapping, `
77a0: 2d 64 60 20 64 65 6c 65 74 65 73 2c 20 60 2d 6c -d` deletes, `-l
77b0: 60 20 6c 69 73 74 73 2c 20 60 2d 41 60 20 61 64 ` lists, `-A` ad
77c0: 64 73 20 61 6e 20 49 50 76 36 20 70 69 6e 68 6f ds an IPv6 pinho
77d0: 6c 65 29 2e 20 28 62 29 20 6c 69 62 6e 61 74 70 le). (b) libnatp
77e0: 6d 70 3a 20 43 2c 20 42 53 44 20 33 2d 43 6c 61 mp: C, BSD 3-Cla
77f0: 75 73 65 2e 20 49 74 20 73 68 69 70 73 20 60 6e use. It ships `n
7800: 61 74 70 6d 70 63 20 2d 61 20 3c 70 75 62 6c 69 atpmpc -a <publi
7810: 63 20 70 6f 72 74 3e 20 3c 70 72 69 76 61 74 65 c port> <private
7820: 20 70 6f 72 74 3e 20 3c 70 72 6f 74 6f 63 6f 6c port> <protocol
7830: 3e 20 5b 6c 69 66 65 74 69 6d 65 5d 60 3b 20 74 > [lifetime]`; t
7840: 68 65 20 64 65 66 61 75 6c 74 20 6c 69 66 65 74 he default lifet
7850: 69 6d 65 20 69 73 20 33 36 30 30 20 73 20 61 6e ime is 3600 s an
7860: 64 20 60 2d 67 60 20 6e 61 6d 65 73 20 74 68 65 d `-g` names the
7870: 20 67 61 74 65 77 61 79 2e 20 28 63 29 20 6c 69 gateway. (c) li
7880: 62 70 63 70 6e 61 74 70 6d 70 3a 20 61 20 43 20 bpcpnatpmp: a C
7890: 63 6c 69 65 6e 74 20 66 6f 72 20 50 43 50 20 74 client for PCP t
78a0: 68 61 74 20 66 61 6c 6c 73 20 62 61 63 6b 20 74 hat falls back t
78b0: 6f 20 4e 41 54 2d 50 4d 50 2c 20 77 69 74 68 20 o NAT-PMP, with
78c0: 61 20 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 74 a command-line t
78d0: 6f 6f 6c 2c 20 66 6f 72 20 4c 69 6e 75 78 2c 20 ool, for Linux,
78e0: 57 69 6e 64 6f 77 73 20 61 6e 64 20 6d 61 63 4f Windows and macO
78f0: 53 2e 20 28 64 29 20 47 6f 3a 20 74 61 69 6c 73 S. (d) Go: tails
7900: 63 61 6c 65 2e 63 6f 6d 2f 6e 65 74 2f 70 6f 72 cale.com/net/por
7910: 74 6d 61 70 70 65 72 20 28 42 53 44 2d 33 2d 43 tmapper (BSD-3-C
7920: 6c 61 75 73 65 29 20 73 70 65 61 6b 73 20 61 6c lause) speaks al
7930: 6c 20 74 68 72 65 65 20 70 72 6f 74 6f 63 6f 6c l three protocol
7940: 73 20 62 75 74 20 64 65 73 63 72 69 62 65 73 20 s but describes
7950: 69 74 73 65 6c 66 20 61 73 20 27 61 20 55 44 50 itself as 'a UDP
7960: 20 70 6f 72 74 20 6d 61 70 70 69 6e 67 20 63 6c port mapping cl
7970: 69 65 6e 74 27 2c 20 61 6e 64 20 46 6f 73 73 69 ient', and Fossi
7980: 6c 20 6e 65 65 64 73 20 54 43 50 2e 20 28 65 29 l needs TCP. (e)
7990: 20 43 72 79 73 74 61 6c 3a 20 6e 61 74 70 6d 70 Crystal: natpmp
79a0: 2d 63 72 79 73 74 61 6c 20 28 4d 49 54 29 20 69 -crystal (MIT) i
79b0: 73 20 4e 41 54 2d 50 4d 50 20 6f 6e 6c 79 20 61 s NAT-PMP only a
79c0: 6e 64 20 63 61 6e 20 64 6f 20 54 43 50 2c 20 62 nd can do TCP, b
79d0: 75 74 20 69 74 20 69 73 20 6c 61 62 65 6c 65 64 ut it is labeled
79e0: 20 27 57 6f 72 6b 20 69 6e 20 70 72 6f 67 72 65 'Work in progre
79f0: 73 73 27 20 61 6e 64 20 68 61 73 20 33 20 63 6f ss' and has 3 co
7a00: 6d 6d 69 74 73 2e 22 2c 0a 20 20 20 22 73 6f 75 mmits.",. "sou
7a10: 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 6d rce": "https://m
7a20: 69 6e 69 75 70 6e 70 2e 74 75 78 66 61 6d 69 6c iniupnp.tuxfamil
7a30: 79 2e 6f 72 67 2f 20 3b 20 68 74 74 70 73 3a 2f y.org/ ; https:/
7a40: 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 /raw.githubuserc
7a50: 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 6d 69 6e 69 75 ontent.com/miniu
7a60: 70 6e 70 2f 6d 69 6e 69 75 70 6e 70 2f 6d 61 73 pnp/miniupnp/mas
7a70: 74 65 72 2f 4c 49 43 45 4e 53 45 20 3b 20 68 74 ter/LICENSE ; ht
7a80: 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 75 62 tps://raw.github
7a90: 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f 6d 2f usercontent.com/
7aa0: 6d 69 6e 69 75 70 6e 70 2f 6d 69 6e 69 75 70 6e miniupnp/miniupn
7ab0: 70 2f 6d 61 73 74 65 72 2f 6d 69 6e 69 75 70 6e p/master/miniupn
7ac0: 70 63 2f 52 45 41 44 4d 45 20 3b 20 68 74 74 70 pc/README ; http
7ad0: 73 3a 2f 2f 72 61 77 2e 67 69 74 68 75 62 75 73 s://raw.githubus
7ae0: 65 72 63 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 6d 69 ercontent.com/mi
7af0: 6e 69 75 70 6e 70 2f 6c 69 62 6e 61 74 70 6d 70 niupnp/libnatpmp
7b00: 2f 6d 61 73 74 65 72 2f 6e 61 74 70 6d 70 63 2e /master/natpmpc.
7b10: 63 20 3b 20 68 74 74 70 73 3a 2f 2f 67 69 74 68 c ; https://gith
7b20: 75 62 2e 63 6f 6d 2f 6c 69 62 70 63 70 6e 61 74 ub.com/libpcpnat
7b30: 70 6d 70 2f 6c 69 62 70 63 70 6e 61 74 70 6d 70 pmp/libpcpnatpmp
7b40: 20 3b 20 68 74 74 70 73 3a 2f 2f 70 6b 67 2e 67 ; https://pkg.g
7b50: 6f 2e 64 65 76 2f 74 61 69 6c 73 63 61 6c 65 2e o.dev/tailscale.
7b60: 63 6f 6d 2f 6e 65 74 2f 70 6f 72 74 6d 61 70 70 com/net/portmapp
7b70: 65 72 20 3b 20 68 74 74 70 73 3a 2f 2f 67 69 74 er ; https://git
7b80: 68 75 62 2e 63 6f 6d 2f 46 69 6a 78 75 2f 6e 61 hub.com/Fijxu/na
7b90: 74 70 6d 70 2d 63 72 79 73 74 61 6c 22 0a 20 20 tpmp-crystal".
7ba0: 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d },. {. "claim
7bb0: 22 3a 20 22 45 76 65 6e 20 77 68 65 6e 20 61 20 ": "Even when a
7bc0: 6d 61 70 70 69 6e 67 20 69 73 20 67 72 61 6e 74 mapping is grant
7bd0: 65 64 2c 20 74 68 65 20 6e 6f 64 65 20 73 74 69 ed, the node sti
7be0: 6c 6c 20 68 61 73 20 77 6f 72 6b 20 74 6f 20 64 ll has work to d
7bf0: 6f 2e 20 54 68 65 20 6d 61 70 70 69 6e 67 20 6d o. The mapping m
7c00: 75 73 74 20 62 65 20 72 65 6e 65 77 65 64 20 62 ust be renewed b
7c10: 65 66 6f 72 65 20 69 74 20 65 78 70 69 72 65 73 efore it expires
7c20: 20 61 6e 64 20 72 65 63 72 65 61 74 65 64 20 61 and recreated a
7c30: 66 74 65 72 20 74 68 65 20 72 6f 75 74 65 72 20 fter the router
7c40: 72 65 62 6f 6f 74 73 2e 20 54 68 65 20 65 78 74 reboots. The ext
7c50: 65 72 6e 61 6c 20 70 6f 72 74 20 67 72 61 6e 74 ernal port grant
7c60: 65 64 20 63 61 6e 20 64 69 66 66 65 72 20 66 72 ed can differ fr
7c70: 6f 6d 20 74 68 65 20 6f 6e 65 20 72 65 71 75 65 om the one reque
7c80: 73 74 65 64 2e 20 54 68 65 20 65 78 74 65 72 6e sted. The extern
7c90: 61 6c 20 61 64 64 72 65 73 73 20 63 61 6e 20 63 al address can c
7ca0: 68 61 6e 67 65 3a 20 4e 41 54 2d 50 4d 50 20 6d hange: NAT-PMP m
7cb0: 75 6c 74 69 63 61 73 74 73 20 61 6e 20 61 6e 6e ulticasts an ann
7cc0: 6f 75 6e 63 65 6d 65 6e 74 20 77 68 65 6e 20 69 ouncement when i
7cd0: 74 20 64 6f 65 73 2c 20 61 6e 64 20 52 46 43 20 t does, and RFC
7ce0: 36 38 38 36 20 77 61 72 6e 73 20 74 68 6f 73 65 6886 warns those
7cf0: 20 61 6e 6e 6f 75 6e 63 65 6d 65 6e 74 73 20 63 announcements c
7d00: 61 6e 20 62 65 20 73 70 6f 6f 66 65 64 2e 20 41 an be spoofed. A
7d10: 20 6c 61 72 67 65 20 49 50 46 53 20 73 74 75 64 large IPFS stud
7d20: 79 20 28 32 30 32 36 29 20 63 61 6c 6c 73 20 70 y (2026) calls p
7d30: 6f 72 74 20 6d 61 70 70 69 6e 67 20 27 6f 6e 6c ort mapping 'onl
7d40: 79 20 61 64 76 69 73 6f 72 79 2c 20 73 69 6e 63 y advisory, sinc
7d50: 65 3a 20 28 69 29 20 72 6f 75 74 65 72 73 20 6d e: (i) routers m
7d60: 61 79 20 6e 6f 74 20 72 65 6c 69 61 62 6c 79 20 ay not reliably
7d70: 72 65 70 6f 72 74 20 74 68 65 20 6d 61 70 70 69 report the mappi
7d80: 6e 67 27 73 20 73 74 61 74 75 73 2c 20 61 6e 64 ng's status, and
7d90: 20 28 69 69 29 20 6d 61 70 70 69 6e 67 73 20 6d (ii) mappings m
7da0: 61 79 20 73 69 6c 65 6e 74 6c 79 20 65 78 70 69 ay silently expi
7db0: 72 65 20 61 74 20 61 6e 79 20 74 69 6d 65 2e 27 re at any time.'
7dc0: 20 4d 79 20 69 6e 66 65 72 65 6e 63 65 20 66 72 My inference fr
7dd0: 6f 6d 20 74 68 69 73 3a 20 74 68 65 20 6e 6f 64 om this: the nod
7de0: 65 20 77 6f 75 6c 64 20 68 61 76 65 20 74 6f 20 e would have to
7df0: 72 65 70 6f 72 74 20 69 74 73 20 63 75 72 72 65 report its curre
7e00: 6e 74 20 65 78 74 65 72 6e 61 6c 20 61 64 64 72 nt external addr
7e10: 65 73 73 20 61 6e 64 20 70 6f 72 74 20 74 6f 20 ess and port to
7e20: 74 68 65 20 70 75 62 6c 69 63 20 73 65 72 76 65 the public serve
7e30: 72 2c 20 61 6e 64 20 74 68 65 20 73 65 72 76 65 r, and the serve
7e40: 72 20 73 68 6f 75 6c 64 20 74 65 73 74 20 74 68 r should test th
7e50: 61 74 20 69 74 20 63 61 6e 20 72 65 61 63 68 20 at it can reach
7e60: 74 68 61 74 20 61 64 64 72 65 73 73 20 62 65 66 that address bef
7e70: 6f 72 65 20 72 65 6c 79 69 6e 67 20 6f 6e 20 69 ore relying on i
7e80: 74 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 t.",. "source"
7e90: 3a 20 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 72 : "https://www.r
7ea0: 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f 72 66 fc-editor.org/rf
7eb0: 63 2f 72 66 63 36 38 38 36 2e 68 74 6d 6c 20 28 c/rfc6886.html (
7ec0: 73 65 63 74 69 6f 6e 73 20 33 2e 32 2e 31 2c 20 sections 3.2.1,
7ed0: 33 2e 33 2c 20 33 2e 37 2c 20 35 29 20 3b 20 68 3.3, 3.7, 5) ; h
7ee0: 74 74 70 73 3a 2f 2f 61 72 78 69 76 2e 6f 72 67 ttps://arxiv.org
7ef0: 2f 68 74 6d 6c 2f 32 36 30 34 2e 31 32 34 38 34 /html/2604.12484
7f00: 20 28 73 65 63 74 69 6f 6e 20 33 2e 31 2e 32 29 (section 3.1.2)
7f10: 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 ". },. {. "c
7f20: 6c 61 69 6d 22 3a 20 22 49 50 76 36 20 69 73 20 laim": "IPv6 is
7f30: 61 20 70 6f 73 73 69 62 6c 65 20 77 61 79 20 61 a possible way a
7f40: 72 6f 75 6e 64 20 63 61 72 72 69 65 72 2d 67 72 round carrier-gr
7f50: 61 64 65 20 4e 41 54 2c 20 62 75 74 20 49 20 64 ade NAT, but I d
7f60: 69 64 20 6e 6f 74 20 63 6f 6e 66 69 72 6d 20 68 id not confirm h
7f70: 6f 77 20 6f 66 74 65 6e 20 72 6f 75 74 65 72 73 ow often routers
7f80: 20 73 75 70 70 6f 72 74 20 69 74 2e 20 4f 6e 20 support it. On
7f90: 49 50 76 36 20 74 68 65 72 65 20 69 73 20 75 73 IPv6 there is us
7fa0: 75 61 6c 6c 79 20 6e 6f 20 4e 41 54 2c 20 6f 6e ually no NAT, on
7fb0: 6c 79 20 74 68 65 20 72 6f 75 74 65 72 27 73 20 ly the router's
7fc0: 66 69 72 65 77 61 6c 6c 2e 20 50 43 50 20 61 6e firewall. PCP an
7fd0: 64 20 55 50 6e 50 20 49 47 44 20 63 61 6e 20 62 d UPnP IGD can b
7fe0: 6f 74 68 20 72 65 71 75 65 73 74 20 61 6e 20 49 oth request an I
7ff0: 50 76 36 20 27 70 69 6e 68 6f 6c 65 27 20 69 6e Pv6 'pinhole' in
8000: 20 74 68 61 74 20 66 69 72 65 77 61 6c 6c 20 28 that firewall (
8010: 69 6e 20 6d 69 6e 69 75 70 6e 70 63 2c 20 60 75 in miniupnpc, `u
8020: 70 6e 70 63 20 2d 41 20 2e 2e 2e 20 41 64 64 20 pnpc -A ... Add
8030: 50 69 6e 68 6f 6c 65 60 29 2c 20 61 6e 64 20 42 Pinhole`), and B
8040: 69 74 63 6f 69 6e 20 43 6f 72 65 20 32 39 20 64 itcoin Core 29 d
8050: 6f 65 73 20 49 50 76 36 20 70 69 6e 68 6f 6c 69 oes IPv6 pinholi
8060: 6e 67 20 74 68 72 6f 75 67 68 20 50 43 50 2e 20 ng through PCP.
8070: 54 68 69 73 20 77 6f 75 6c 64 20 6f 6e 6c 79 20 This would only
8080: 68 65 6c 70 20 69 66 20 74 68 65 20 70 75 62 6c help if the publ
8090: 69 63 20 73 65 72 76 65 72 20 63 61 6e 20 72 65 ic server can re
80a0: 61 63 68 20 74 68 65 20 6e 6f 64 65 20 6f 76 65 ach the node ove
80b0: 72 20 49 50 76 36 2e 22 2c 0a 20 20 20 22 73 6f r IPv6.",. "so
80c0: 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f urce": "https://
80d0: 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f www.rfc-editor.o
80e0: 72 67 2f 72 66 63 2f 72 66 63 36 38 38 37 2e 68 rg/rfc/rfc6887.h
80f0: 74 6d 6c 20 28 73 65 63 74 69 6f 6e 20 32 2e 31 tml (section 2.1
8100: 29 20 3b 20 68 74 74 70 73 3a 2f 2f 72 61 77 2e ) ; https://raw.
8110: 67 69 74 68 75 62 75 73 65 72 63 6f 6e 74 65 6e githubuserconten
8120: 74 2e 63 6f 6d 2f 6d 69 6e 69 75 70 6e 70 2f 6d t.com/miniupnp/m
8130: 69 6e 69 75 70 6e 70 2f 6d 61 73 74 65 72 2f 6d iniupnp/master/m
8140: 69 6e 69 75 70 6e 70 63 2f 73 72 63 2f 75 70 6e iniupnpc/src/upn
8150: 70 63 2e 63 20 3b 20 68 74 74 70 73 3a 2f 2f 62 pc.c ; https://b
8160: 69 74 63 6f 69 6e 63 6f 72 65 2e 6f 72 67 2f 65 itcoincore.org/e
8170: 6e 2f 72 65 6c 65 61 73 65 73 2f 32 39 2e 30 2f n/releases/29.0/
8180: 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 ". },. {. "c
8190: 6c 61 69 6d 22 3a 20 22 49 6e 66 65 72 65 6e 63 laim": "Inferenc
81a0: 65 2c 20 6e 6f 74 20 66 72 6f 6d 20 61 20 73 6f e, not from a so
81b0: 75 72 63 65 3a 20 74 68 65 20 6d 61 70 70 69 6e urce: the mappin
81c0: 67 20 64 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 g does not have
81d0: 74 6f 20 65 78 70 6f 73 65 20 74 68 65 20 6e 6f to expose the no
81e0: 64 65 27 73 20 77 68 6f 6c 65 20 66 6f 73 73 69 de's whole fossi
81f0: 6c 20 73 65 72 76 65 72 2e 20 49 74 20 63 6f 75 l server. It cou
8200: 6c 64 20 6f 70 65 6e 20 61 20 73 69 6e 67 6c 65 ld open a single
8210: 20 70 6f 72 74 20 77 68 65 72 65 20 74 68 65 20 port where the
8220: 70 75 62 6c 69 63 20 73 65 72 76 65 72 27 73 20 public server's
8230: 61 66 74 65 72 2d 72 65 63 65 69 76 65 20 68 6f after-receive ho
8240: 6f 6b 20 73 65 6e 64 73 20 6f 6e 6c 79 20 61 20 ok sends only a
8250: 27 73 79 6e 63 20 6e 6f 77 27 20 73 69 67 6e 61 'sync now' signa
8260: 6c 2c 20 61 6e 64 20 74 68 65 20 6e 6f 64 65 20 l, and the node
8270: 74 68 65 6e 20 70 75 6c 6c 73 20 65 78 61 63 74 then pulls exact
8280: 6c 79 20 61 73 20 69 74 20 64 6f 65 73 20 74 6f ly as it does to
8290: 64 61 79 2e 20 41 20 66 61 6b 65 20 73 69 67 6e day. A fake sign
82a0: 61 6c 20 77 6f 75 6c 64 20 63 6f 73 74 20 6f 6e al would cost on
82b0: 65 20 65 78 74 72 61 20 70 75 6c 6c 2c 20 61 6e e extra pull, an
82c0: 64 20 77 68 65 6e 20 74 68 65 20 6d 61 70 70 69 d when the mappi
82d0: 6e 67 20 69 73 20 6d 69 73 73 69 6e 67 2c 20 70 ng is missing, p
82e0: 6f 6c 6c 69 6e 67 20 63 6f 76 65 72 73 20 69 74 olling covers it
82f0: 2e 20 54 68 69 73 20 6e 65 65 64 73 20 74 68 65 . This needs the
8300: 20 73 61 6d 65 20 74 68 72 65 65 20 72 6f 75 74 same three rout
8310: 65 72 20 63 6f 6e 64 69 74 69 6f 6e 73 20 61 62 er conditions ab
8320: 6f 76 65 20 61 6e 64 20 69 73 20 6e 6f 20 6d 6f ove and is no mo
8330: 72 65 20 72 65 6c 69 61 62 6c 65 20 74 68 61 6e re reliable than
8340: 20 6d 61 70 70 69 6e 67 20 74 68 65 20 66 6f 73 mapping the fos
8350: 73 69 6c 20 73 65 72 76 65 72 27 73 20 70 6f 72 sil server's por
8360: 74 2c 20 62 75 74 20 6c 65 73 73 20 69 73 20 65 t, but less is e
8370: 78 70 6f 73 65 64 2e 22 2c 0a 20 20 20 22 73 6f xposed.",. "so
8380: 75 72 63 65 22 3a 20 22 69 6e 66 65 72 65 6e 63 urce": "inferenc
8390: 65 20 66 72 6f 6d 20 74 68 65 20 73 6f 75 72 63 e from the sourc
83a0: 65 73 20 61 62 6f 76 65 3b 20 6e 6f 20 73 6f 75 es above; no sou
83b0: 72 63 65 20 73 74 61 74 65 73 20 74 68 69 73 22 rce states this"
83c0: 0a 20 20 7d 0a 20 5d 2c 0a 20 22 75 6e 63 6f 6e . }. ],. "uncon
83d0: 66 69 72 6d 65 64 22 3a 20 22 28 31 29 20 49 20 firmed": "(1) I
83e0: 66 6f 75 6e 64 20 6e 6f 20 72 65 63 65 6e 74 20 found no recent
83f0: 6c 61 72 67 65 2d 73 63 61 6c 65 20 6d 65 61 73 large-scale meas
8400: 75 72 65 6d 65 6e 74 20 6f 66 20 68 6f 77 20 6f urement of how o
8410: 66 74 65 6e 20 61 20 68 6f 6d 65 20 6e 6f 64 65 ften a home node
8420: 20 61 63 74 75 61 6c 6c 79 20 67 65 74 73 20 61 actually gets a
8430: 20 77 6f 72 6b 69 6e 67 20 69 6e 62 6f 75 6e 64 working inbound
8440: 20 70 6f 72 74 20 74 68 72 6f 75 67 68 20 55 50 port through UP
8450: 6e 50 2c 20 4e 41 54 2d 50 4d 50 20 6f 72 20 50 nP, NAT-PMP or P
8460: 43 50 2e 20 54 68 65 20 6e 65 61 72 65 73 74 20 CP. The nearest
8470: 66 69 67 75 72 65 73 20 61 72 65 20 4e 65 74 61 figures are Neta
8480: 6c 79 7a 72 20 64 61 74 61 20 66 72 6f 6d 20 32 lyzr data from 2
8490: 30 31 34 e2 80 93 32 30 31 35 20 28 55 50 6e 50 014–2015 (UPnP
84a0: 20 61 6e 73 77 65 72 65 64 20 69 6e 20 34 30 25 answered in 40%
84b0: 20 6f 66 20 6e 6f 6e 2d 63 65 6c 6c 75 6c 61 72 of non-cellular
84c0: 20 73 65 73 73 69 6f 6e 73 2c 20 61 6e 64 20 31 sessions, and 1
84d0: 37 25 20 6f 66 20 74 68 6f 73 65 20 77 65 72 65 7% of those were
84e0: 20 62 65 68 69 6e 64 20 6d 6f 72 65 20 74 68 61 behind more tha
84f0: 6e 20 6f 6e 65 20 4e 41 54 29 20 61 6e 64 20 61 n one NAT) and a
8500: 20 31 36 2d 72 6f 75 74 65 72 20 74 65 73 74 20 16-router test
8510: 74 61 62 6c 65 20 66 72 6f 6d 20 42 69 74 63 6f table from Bitco
8520: 69 6e 20 43 6f 72 65 20 75 73 65 72 73 2e 20 54 in Core users. T
8530: 72 65 61 74 20 61 6e 79 20 70 65 72 63 65 6e 74 reat any percent
8540: 61 67 65 20 61 73 20 72 6f 75 67 68 2e 20 28 32 age as rough. (2
8550: 29 20 54 68 65 20 4e 53 41 27 73 20 32 30 32 33 ) The NSA's 2023
8560: 20 68 6f 6d 65 2d 6e 65 74 77 6f 72 6b 20 67 75 home-network gu
8570: 69 64 65 20 72 65 70 6f 72 74 65 64 6c 79 20 61 ide reportedly a
8580: 64 76 69 73 65 73 20 64 69 73 61 62 6c 69 6e 67 dvises disabling
8590: 20 55 50 6e 50 2c 20 62 75 74 20 74 68 65 20 50 UPnP, but the P
85a0: 44 46 20 61 6e 64 20 74 68 65 20 6e 73 61 2e 67 DF and the nsa.g
85b0: 6f 76 20 70 61 67 65 20 62 6f 74 68 20 72 65 74 ov page both ret
85c0: 75 72 6e 65 64 20 48 54 54 50 20 34 30 33 2c 20 urned HTTP 403,
85d0: 73 6f 20 49 20 6e 65 76 65 72 20 73 61 77 20 69 so I never saw i
85e0: 74 73 20 77 6f 72 64 69 6e 67 2e 20 28 33 29 20 ts wording. (3)
85f0: 49 20 63 6f 75 6c 64 20 6e 6f 74 20 65 78 74 72 I could not extr
8600: 61 63 74 20 74 65 78 74 20 66 72 6f 6d 20 74 68 act text from th
8610: 65 20 55 50 6e 50 20 46 6f 72 75 6d 27 73 20 49 e UPnP Forum's I
8620: 47 44 3a 32 20 61 6e 64 20 57 41 4e 49 50 43 6f GD:2 and WANIPCo
8630: 6e 6e 65 63 74 69 6f 6e 3a 32 20 73 70 65 63 69 nnection:2 speci
8640: 66 69 63 61 74 69 6f 6e 20 50 44 46 73 2e 20 54 fication PDFs. T
8650: 68 65 20 6c 65 61 73 65 20 72 75 6c 65 73 20 61 he lease rules a
8660: 62 6f 76 65 20 63 6f 6d 65 20 66 72 6f 6d 20 52 bove come from R
8670: 46 43 20 36 39 37 30 2c 20 61 6e 64 20 74 68 65 FC 6970, and the
8680: 20 72 65 71 75 65 73 74 20 66 69 65 6c 64 73 20 request fields
8690: 63 6f 6d 65 20 66 72 6f 6d 20 74 68 65 20 75 70 come from the up
86a0: 6e 70 63 20 75 73 61 67 65 20 74 65 78 74 2c 20 npc usage text,
86b0: 6e 6f 74 20 66 72 6f 6d 20 74 68 65 20 73 70 65 not from the spe
86c0: 63 69 66 69 63 61 74 69 6f 6e 20 69 74 73 65 6c cification itsel
86d0: 66 2e 20 28 34 29 20 49 20 66 6f 75 6e 64 20 6e f. (4) I found n
86e0: 6f 20 6e 61 6d 65 64 20 49 53 50 20 74 68 61 74 o named ISP that
86f0: 20 64 6f 63 75 6d 65 6e 74 73 20 61 20 50 43 50 documents a PCP
8700: 20 73 65 72 76 65 72 20 6f 6e 20 69 74 73 20 63 server on its c
8710: 61 72 72 69 65 72 2d 67 72 61 64 65 20 4e 41 54 arrier-grade NAT
8720: 20 66 6f 72 20 73 75 62 73 63 72 69 62 65 72 73 for subscribers
8730: 2e 20 4f 6e 6c 79 20 74 68 65 20 52 46 43 20 72 . Only the RFC r
8740: 65 71 75 69 72 65 6d 65 6e 74 2c 20 76 65 6e 64 equirement, vend
8750: 6f 72 20 66 65 61 74 75 72 65 73 20 28 4a 75 6e or features (Jun
8760: 69 70 65 72 29 20 61 6e 64 20 73 65 63 6f 6e 64 iper) and second
8770: 61 72 79 20 73 6f 75 72 63 65 73 20 73 61 79 69 ary sources sayi
8780: 6e 67 20 75 70 74 61 6b 65 20 69 73 20 73 6c 6f ng uptake is slo
8790: 77 2e 20 28 35 29 20 49 20 66 6f 75 6e 64 20 6e w. (5) I found n
87a0: 6f 20 73 75 72 76 65 79 20 6f 66 20 77 68 65 74 o survey of whet
87b0: 68 65 72 20 55 50 6e 50 20 69 73 20 6f 6e 20 62 her UPnP is on b
87c0: 79 20 64 65 66 61 75 6c 74 20 61 63 72 6f 73 73 y default across
87d0: 20 74 6f 64 61 79 27 73 20 63 6f 6e 73 75 6d 65 today's consume
87e0: 72 20 72 6f 75 74 65 72 73 2e 20 54 68 65 20 64 r routers. The d
87f0: 65 66 61 75 6c 74 73 20 61 62 6f 76 65 20 63 6f efaults above co
8800: 6d 65 20 66 72 6f 6d 20 6d 69 6e 69 75 70 6e 70 me from miniupnp
8810: 64 27 73 20 63 6f 6e 66 69 67 20 66 69 6c 65 20 d's config file
8820: 61 6e 64 20 74 68 65 20 42 69 74 63 6f 69 6e 20 and the Bitcoin
8830: 43 6f 72 65 20 74 61 62 6c 65 2e 20 28 36 29 20 Core table. (6)
8840: 41 20 73 65 61 72 63 68 20 72 65 73 75 6c 74 20 A search result
8850: 63 6c 61 69 6d 65 64 20 41 56 4d 27 73 20 46 52 claimed AVM's FR
8860: 49 54 5a 21 42 6f 78 20 55 50 6e 50 20 49 47 44 ITZ!Box UPnP IGD
8870: 76 32 20 61 6e 64 20 50 43 50 20 73 75 70 70 6f v2 and PCP suppo
8880: 72 74 20 69 73 20 27 76 65 72 79 20 62 75 67 67 rt is 'very bugg
8890: 79 27 3b 20 49 20 63 6f 75 6c 64 20 6e 6f 74 20 y'; I could not
88a0: 76 65 72 69 66 79 20 74 68 69 73 2c 20 61 6e 64 verify this, and
88b0: 20 74 68 65 20 46 52 49 54 5a 21 20 6b 6e 6f 77 the FRITZ! know
88c0: 6c 65 64 67 65 2d 62 61 73 65 20 70 61 67 65 20 ledge-base page
88d0: 64 69 64 20 6e 6f 74 20 6c 6f 61 64 2e 20 28 37 did not load. (7
88e0: 29 20 49 20 64 69 64 20 6e 6f 74 20 72 65 73 65 ) I did not rese
88f0: 61 72 63 68 20 77 68 65 74 68 65 72 20 72 65 73 arch whether res
8900: 69 64 65 6e 74 69 61 6c 20 49 53 50 73 20 62 6c idential ISPs bl
8910: 6f 63 6b 20 69 6e 62 6f 75 6e 64 20 54 43 50 20 ock inbound TCP
8920: 6f 72 20 66 6f 72 62 69 64 20 72 75 6e 6e 69 6e or forbid runnin
8930: 67 20 73 65 72 76 65 72 73 2c 20 77 68 69 63 68 g servers, which
8940: 20 77 6f 75 6c 64 20 64 65 66 65 61 74 20 61 20 would defeat a
8950: 67 72 61 6e 74 65 64 20 6d 61 70 70 69 6e 67 2e granted mapping.
8960: 20 28 38 29 20 49 20 66 6f 75 6e 64 20 6e 6f 20 (8) I found no
8970: 46 6f 73 73 69 6c 20 66 65 61 74 75 72 65 20 6f Fossil feature o
8980: 72 20 66 6f 72 75 6d 20 64 69 73 63 75 73 73 69 r forum discussi
8990: 6f 6e 20 6f 66 20 55 50 6e 50 2c 20 4e 41 54 2d on of UPnP, NAT-
89a0: 50 4d 50 20 6f 72 20 50 43 50 2e 20 28 39 29 20 PMP or PCP. (9)
89b0: 54 68 65 20 63 61 72 72 69 65 72 2d 67 72 61 64 The carrier-grad
89c0: 65 20 4e 41 54 20 66 69 67 75 72 65 73 20 28 52 e NAT figures (R
89d0: 69 63 68 74 65 72 20 65 74 20 61 6c 2e 29 20 63 ichter et al.) c
89e0: 6f 75 6e 74 20 6e 65 74 77 6f 72 6b 73 2c 20 6e ount networks, n
89f0: 6f 74 20 75 73 65 72 73 2c 20 61 6e 64 20 64 61 ot users, and da
8a00: 74 65 20 66 72 6f 6d 20 32 30 31 36 2e 20 28 31 te from 2016. (1
8a10: 30 29 20 49 20 74 65 73 74 65 64 20 6e 6f 74 68 0) I tested noth
8a20: 69 6e 67 20 6f 6e 20 61 20 72 65 61 6c 20 72 6f ing on a real ro
8a30: 75 74 65 72 3a 20 6e 6f 20 73 65 72 76 65 72 73 uter: no servers
8a40: 20 72 75 6e 2c 20 6e 6f 74 68 69 6e 67 20 63 6f run, nothing co
8a50: 6e 74 61 63 74 65 64 20 62 65 79 6f 6e 64 20 70 ntacted beyond p
8a60: 75 62 6c 69 63 20 77 65 62 20 70 61 67 65 73 2e ublic web pages.
8a70: 22 0a 7d 00 00 00 00 00 00 00 00 00 00 00 00 00 ".}.............
8a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8a90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8aa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8ab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8ac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8af0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8c00: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
8c10: 65 61 72 63 68 2f 72 65 61 64 2d 66 6f 73 73 69 earch/read-fossi
8c20: 6c 2e 6a 73 6f 6e 00 00 00 00 00 00 00 00 00 00 l.json..........
8c30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8c40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8c50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8c60: 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
8c70: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
8c80: 30 30 34 35 34 33 32 00 31 35 32 36 35 34 31 31 0045432.15265411
8c90: 33 37 31 00 30 31 37 31 30 33 00 20 30 00 00 00 371.017103. 0...
8ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8cf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d00: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
8d10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d20: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
8d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8d90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8da0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8db0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8dc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8dd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8de0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8df0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
8e00: 7b 0a 20 22 70 6f 69 6e 74 73 22 3a 20 5b 0a 20 {. "points": [.
8e10: 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 {. "claim": "
8e20: 42 61 73 69 73 3a 20 65 76 65 72 79 20 73 6f 75 Basis: every sou
8e30: 72 63 65 20 71 75 6f 74 65 20 62 65 6c 6f 77 20 rce quote below
8e40: 63 6f 6d 65 73 20 66 72 6f 6d 20 46 6f 73 73 69 comes from Fossi
8e50: 6c 20 74 72 75 6e 6b 20 63 68 65 63 6b 2d 69 6e l trunk check-in
8e60: 20 32 63 66 63 33 39 38 65 20 28 32 30 32 36 2d 2cfc398e (2026-
8e70: 31 30 2d 31 39 29 2e 20 49 20 64 6f 77 6e 6c 6f 10-19). I downlo
8e80: 61 64 65 64 20 69 74 20 66 72 6f 6d 20 66 6f 73 aded it from fos
8e90: 73 69 6c 2d 73 63 6d 2e 6f 72 67 20 77 69 74 68 sil-scm.org with
8ea0: 20 2f 72 61 77 2f 3c 70 61 74 68 3e 3f 63 69 3d /raw/<path>?ci=
8eb0: 74 72 75 6e 6b 20 61 6e 64 20 77 69 74 68 20 74 trunk and with t
8ec0: 68 65 20 74 61 72 62 61 6c 6c 20 6f 66 20 74 68 he tarball of th
8ed0: 61 74 20 63 68 65 63 6b 2d 69 6e 2c 20 61 6e 64 at check-in, and
8ee0: 20 63 68 65 63 6b 65 64 20 74 68 65 20 66 69 6c checked the fil
8ef0: 65 73 20 61 67 61 69 6e 73 74 20 65 61 63 68 20 es against each
8f00: 6f 74 68 65 72 2e 20 54 68 65 20 6c 6f 63 61 6c other. The local
8f10: 20 2f 75 73 72 2f 62 69 6e 2f 66 6f 73 73 69 6c /usr/bin/fossil
8f20: 20 69 73 20 32 2e 32 37 2e 20 49 74 73 20 68 65 is 2.27. Its he
8f30: 6c 70 20 74 65 78 74 20 6d 61 74 63 68 65 73 20 lp text matches
8f40: 74 68 65 20 74 72 75 6e 6b 20 77 6f 72 64 69 6e the trunk wordin
8f50: 67 20 71 75 6f 74 65 64 20 68 65 72 65 20 66 6f g quoted here fo
8f60: 72 20 73 79 6e 63 2c 20 73 65 72 76 65 72 2c 20 r sync, server,
8f70: 68 74 74 70 2c 20 72 65 6d 6f 74 65 2c 20 61 75 http, remote, au
8f80: 74 6f 73 79 6e 63 20 61 6e 64 20 63 68 61 74 2d tosync and chat-
8f90: 70 6f 6c 6c 2d 74 69 6d 65 6f 75 74 2e 22 2c 0a poll-timeout.",.
8fa0: 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 "source": "ht
8fb0: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
8fc0: 2e 6f 72 67 2f 68 6f 6d 65 2f 69 6e 66 6f 2f 32 .org/home/info/2
8fd0: 63 66 63 33 39 38 65 20 3b 20 68 74 74 70 73 3a cfc398e ; https:
8fe0: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
8ff0: 2f 68 6f 6d 65 2f 74 61 72 62 61 6c 6c 2f 32 63 /home/tarball/2c
9000: 66 63 33 39 38 65 2f 66 6f 73 73 69 6c 2e 74 61 fc398e/fossil.ta
9010: 72 2e 67 7a 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 r.gz". },. {.
9020: 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 31 29 20 "claim": "(1)
9030: 53 79 6e 63 20 69 73 20 61 6c 77 61 79 73 20 73 Sync is always s
9040: 74 61 72 74 65 64 20 62 79 20 74 68 65 20 63 6c tarted by the cl
9050: 69 65 6e 74 20 6f 76 65 72 20 48 54 54 50 2e 20 ient over HTTP.
9060: 57 68 69 63 68 65 76 65 72 20 72 65 70 6f 73 69 Whichever reposi
9070: 74 6f 72 79 20 6c 69 73 74 65 6e 73 20 69 73 20 tory listens is
9080: 74 68 65 20 27 73 65 72 76 65 72 27 2e 20 73 79 the 'server'. sy
9090: 6e 63 2e 77 69 6b 69 20 73 65 63 74 69 6f 6e 20 nc.wiki section
90a0: 32 2e 30 20 73 61 79 73 3a 20 5c 22 41 6c 6c 20 2.0 says: \"All
90b0: 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 62 65 communication be
90c0: 74 77 65 65 6e 20 63 6c 69 65 6e 74 20 61 6e 64 tween client and
90d0: 20 73 65 72 76 65 72 20 69 73 20 76 69 61 20 48 server is via H
90e0: 54 54 50 20 72 65 71 75 65 73 74 73 2e 20 54 68 TTP requests. Th
90f0: 65 20 73 65 72 76 65 72 20 69 73 20 6c 69 73 74 e server is list
9100: 65 6e 69 6e 67 20 66 6f 72 20 69 6e 63 6f 6d 69 ening for incomi
9110: 6e 67 20 48 54 54 50 20 72 65 71 75 65 73 74 73 ng HTTP requests
9120: 2e 5c 22 20 61 6e 64 20 5c 22 54 68 65 20 69 6d .\" and \"The im
9130: 70 6f 72 74 61 6e 74 20 70 6f 69 6e 74 20 69 73 portant point is
9140: 20 74 68 61 74 20 74 68 65 20 73 65 72 76 65 72 that the server
9150: 20 69 73 20 6c 69 73 74 65 6e 69 6e 67 20 66 6f is listening fo
9160: 72 20 72 65 71 75 65 73 74 73 20 61 6e 64 20 74 r requests and t
9170: 68 65 20 63 6c 69 65 6e 74 20 69 73 20 74 68 65 he client is the
9180: 20 69 73 73 75 65 72 20 6f 66 20 74 68 65 20 72 issuer of the r
9190: 65 71 75 65 73 74 73 2e 5c 22 20 54 68 65 20 73 equests.\" The s
91a0: 65 72 76 65 72 20 6b 65 65 70 73 20 6e 6f 20 72 erver keeps no r
91b0: 65 63 6f 72 64 20 6f 66 20 74 68 65 20 63 6c 69 ecord of the cli
91c0: 65 6e 74 20 62 65 74 77 65 65 6e 20 72 65 71 75 ent between requ
91d0: 65 73 74 73 3a 20 5c 22 65 61 63 68 20 72 65 71 ests: \"each req
91e0: 75 65 73 74 20 69 73 20 69 6e 64 65 70 65 6e 64 uest is independ
91f0: 65 6e 74 2e 20 54 68 65 20 73 65 72 76 65 72 20 ent. The server
9200: 64 6f 65 73 20 6e 6f 74 20 70 72 65 73 65 72 76 does not preserv
9210: 65 20 61 6e 79 20 69 6e 66 6f 72 6d 61 74 69 6f e any informatio
9220: 6e 20 61 62 6f 75 74 20 74 68 65 20 63 6c 69 65 n about the clie
9230: 6e 74 20 66 72 6f 6d 20 6f 6e 65 20 72 65 71 75 nt from one requ
9240: 65 73 74 20 74 6f 20 74 68 65 20 6e 65 78 74 2e est to the next.
9250: 5c 22 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 \"",. "source"
9260: 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 : "https://fossi
9270: 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 64 l-scm.org/home/d
9280: 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f 73 79 6e oc/trunk/www/syn
9290: 63 2e 77 69 6b 69 23 74 72 61 6e 73 70 6f 72 74 c.wiki#transport
92a0: 20 28 73 65 63 74 69 6f 6e 20 32 2e 30 20 54 72 (section 2.0 Tr
92b0: 61 6e 73 70 6f 72 74 2c 20 6c 69 6e 65 73 20 35 ansport, lines 5
92c0: 35 2d 37 37 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 5-77)". },. {.
92d0: 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 31 29 "claim": "(1)
92e0: 20 41 6e 79 20 72 65 70 6f 73 69 74 6f 72 79 20 Any repository
92f0: 63 61 6e 20 70 6c 61 79 20 74 68 65 20 73 65 72 can play the ser
9300: 76 65 72 2c 20 73 6f 20 74 77 6f 20 63 6c 6f 6e ver, so two clon
9310: 65 73 20 63 61 6e 20 73 79 6e 63 20 77 69 74 68 es can sync with
9320: 20 65 61 63 68 20 6f 74 68 65 72 20 64 69 72 65 each other dire
9330: 63 74 6c 79 20 61 73 20 6c 6f 6e 67 20 61 73 20 ctly as long as
9340: 6f 6e 65 20 63 61 6e 20 72 65 61 63 68 20 74 68 one can reach th
9350: 65 20 6f 74 68 65 72 2e 20 73 79 6e 63 2e 77 69 e other. sync.wi
9360: 6b 69 20 73 65 63 74 69 6f 6e 20 32 2e 30 20 73 ki section 2.0 s
9370: 61 79 73 3a 20 5c 22 4e 6f 74 68 69 6e 67 20 69 ays: \"Nothing i
9380: 6e 20 74 68 69 73 20 70 72 6f 74 6f 63 6f 6c 20 n this protocol
9390: 72 65 71 75 69 72 65 73 20 74 68 61 74 20 74 68 requires that th
93a0: 65 20 73 65 72 76 65 72 20 61 63 74 75 61 6c 6c e server actuall
93b0: 79 20 62 65 20 61 20 62 61 63 6b 2d 72 6f 6f 6d y be a back-room
93c0: 20 70 72 6f 63 65 73 73 6f 72 20 68 6f 75 73 65 processor house
93d0: 64 20 69 6e 20 61 20 64 61 74 61 63 65 6e 74 65 d in a datacente
93e0: 72 20 2e 2e 2e 20 27 63 6c 69 65 6e 74 27 20 73 r ... 'client' s
93f0: 69 6d 70 6c 79 20 6d 65 61 6e 73 20 74 68 65 20 imply means the
9400: 72 65 70 6f 73 69 74 6f 72 79 20 74 68 61 74 20 repository that
9410: 69 6e 69 74 69 61 74 65 73 20 74 68 65 20 63 6f initiates the co
9420: 6e 76 65 72 73 61 74 69 6f 6e 20 61 6e 64 20 27 nversation and '
9430: 73 65 72 76 65 72 27 20 69 73 20 74 68 65 20 72 server' is the r
9440: 65 70 6f 73 69 74 6f 72 79 20 74 68 61 74 20 72 epository that r
9450: 65 73 70 6f 6e 64 73 2e 20 4e 6f 74 68 69 6e 67 esponds. Nothing
9460: 20 6d 6f 72 65 2e 5c 22 20 53 65 63 74 69 6f 6e more.\" Section
9470: 20 31 2e 31 20 61 64 64 73 20 74 68 61 74 20 74 1.1 adds that t
9480: 68 65 20 64 61 74 61 20 6d 6f 64 65 6c 20 5c 22 he data model \"
9490: 63 61 6e 20 70 72 6f 76 69 64 65 20 73 74 72 6f can provide stro
94a0: 6e 67 6c 79 2d 63 6f 6e 73 69 73 74 65 6e 74 20 ngly-consistent
94b0: 72 65 70 6c 69 63 61 73 20 75 73 69 6e 67 20 6f replicas using o
94c0: 6e 6c 79 20 70 65 65 72 2d 74 6f 2d 70 65 65 72 nly peer-to-peer
94d0: 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 61 communication a
94e0: 6e 64 20 77 69 74 68 6f 75 74 20 61 6e 79 20 6b nd without any k
94f0: 69 6e 64 20 6f 66 20 63 65 6e 74 72 61 6c 20 61 ind of central a
9500: 75 74 68 6f 72 69 74 79 2e 5c 22 20 54 68 65 20 uthority.\" The
9510: 73 65 72 76 69 6e 67 20 63 6c 6f 6e 65 20 6e 65 serving clone ne
9520: 65 64 73 20 61 20 6c 69 73 74 65 6e 65 72 3a 20 eds a listener:
9530: 27 66 6f 73 73 69 6c 20 73 65 72 76 65 72 27 2c 'fossil server',
9540: 20 27 66 6f 73 73 69 6c 20 68 74 74 70 27 20 72 'fossil http' r
9550: 75 6e 20 66 72 6f 6d 20 69 6e 65 74 64 20 6f 72 un from inetd or
9560: 20 73 73 68 2c 20 6f 72 20 43 47 49 2e 22 2c 0a ssh, or CGI.",.
9570: 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 "source": "ht
9580: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
9590: 2e 6f 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 .org/home/doc/tr
95a0: 75 6e 6b 2f 77 77 77 2f 73 79 6e 63 2e 77 69 6b unk/www/sync.wik
95b0: 69 23 63 72 64 74 20 28 31 2e 31 29 20 61 6e 64 i#crdt (1.1) and
95c0: 20 23 74 72 61 6e 73 70 6f 72 74 20 28 32 2e 30 #transport (2.0
95d0: 2c 20 74 68 65 20 27 4e 6f 74 65 3a 27 20 70 61 , the 'Note:' pa
95e0: 72 61 67 72 61 70 68 29 22 0a 20 20 7d 2c 0a 20 ragraph)". },.
95f0: 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 {. "claim": "
9600: 28 31 29 20 54 68 65 20 73 65 72 76 69 6e 67 20 (1) The serving
9610: 63 6c 6f 6e 65 27 73 20 6f 77 6e 20 75 73 65 72 clone's own user
9620: 20 74 61 62 6c 65 20 64 65 63 69 64 65 73 20 77 table decides w
9630: 68 6f 20 6d 61 79 20 70 75 6c 6c 20 6f 72 20 70 ho may pull or p
9640: 75 73 68 2e 20 55 73 65 72 20 61 63 63 6f 75 6e ush. User accoun
9650: 74 73 20 61 72 65 20 6c 6f 63 61 6c 20 73 74 61 ts are local sta
9660: 74 65 2c 20 77 68 69 63 68 20 69 73 20 5c 22 6e te, which is \"n
9670: 6f 74 20 75 73 75 61 6c 6c 79 20 74 72 61 6e 73 ot usually trans
9680: 66 65 72 72 65 64 20 64 75 72 69 6e 67 20 61 20 ferred during a
9690: 73 79 6e 63 5c 22 2e 20 4f 6e 20 74 68 65 20 73 sync\". On the s
96a0: 65 72 76 69 6e 67 20 73 69 64 65 2c 20 61 20 70 erving side, a p
96b0: 75 73 68 20 77 69 74 68 6f 75 74 20 57 72 69 74 ush without Writ
96c0: 65 20 70 65 72 6d 69 73 73 69 6f 6e 20 69 73 20 e permission is
96d0: 72 65 66 75 73 65 64 20 77 69 74 68 20 5c 22 6e refused with \"n
96e0: 6f 74 20 61 75 74 68 6f 72 69 7a 65 64 20 74 6f ot authorized to
96f0: 20 77 72 69 74 65 5c 22 2e 20 43 61 70 61 62 69 write\". Capabi
9700: 6c 69 74 79 20 27 69 27 20 67 72 61 6e 74 73 20 lity 'i' grants
9710: 52 65 61 64 20 61 6e 64 20 57 72 69 74 65 2e 22 Read and Write."
9720: 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
9730: 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 https://fossil-s
9740: 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f cm.org/home/doc/
9750: 74 72 75 6e 6b 2f 77 77 77 2f 73 79 6e 63 2e 77 trunk/www/sync.w
9760: 69 6b 69 20 28 73 65 63 74 69 6f 6e 20 31 2e 30 iki (section 1.0
9770: 2c 20 6c 6f 63 61 6c 20 73 74 61 74 65 20 70 61 , local state pa
9780: 72 61 67 72 61 70 68 29 3b 20 68 74 74 70 73 3a ragraph); https:
9790: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
97a0: 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d /home/file?name=
97b0: 73 72 63 2f 78 66 65 72 2e 63 26 63 69 3d 32 63 src/xfer.c&ci=2c
97c0: 66 63 33 39 38 65 26 6c 6e 3d 31 35 31 37 2d 31 fc398e&ln=1517-1
97d0: 35 32 35 20 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 525 ; https://fo
97e0: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
97f0: 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f e/file?name=src/
9800: 6c 6f 67 69 6e 2e 63 26 63 69 3d 32 63 66 63 33 login.c&ci=2cfc3
9810: 39 38 65 26 6c 6e 3d 31 37 32 33 22 0a 20 20 7d 98e&ln=1723". }
9820: 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 ,. {. "claim"
9830: 3a 20 22 28 31 29 20 41 20 63 6c 6f 6e 65 20 63 : "(1) A clone c
9840: 61 6e 20 6b 65 65 70 20 73 65 76 65 72 61 6c 20 an keep several
9850: 70 65 65 72 73 2e 20 27 66 6f 73 73 69 6c 20 72 peers. 'fossil r
9860: 65 6d 6f 74 65 20 61 64 64 20 4e 41 4d 45 20 55 emote add NAME U
9870: 52 4c 27 20 73 74 6f 72 65 73 20 6e 61 6d 65 64 RL' stores named
9880: 20 72 65 6d 6f 74 65 73 2c 20 27 66 6f 73 73 69 remotes, 'fossi
9890: 6c 20 73 79 6e 63 20 2d 2d 61 6c 6c 27 20 6d 65 l sync --all' me
98a0: 61 6e 73 20 5c 22 53 79 6e 63 20 77 69 74 68 20 ans \"Sync with
98b0: 61 6c 6c 20 72 65 6d 6f 74 65 73 2c 20 6e 6f 74 all remotes, not
98c0: 20 6a 75 73 74 20 74 68 65 20 64 65 66 61 75 6c just the defaul
98d0: 74 5c 22 2c 20 61 6e 64 20 74 68 65 20 61 75 74 t\", and the aut
98e0: 6f 73 79 6e 63 20 73 65 74 74 69 6e 67 20 76 61 osync setting va
98f0: 6c 75 65 20 27 61 6c 6c 27 20 6d 65 61 6e 73 20 lue 'all' means
9900: 5c 22 53 79 6e 63 20 77 69 74 68 20 61 6c 6c 20 \"Sync with all
9910: 72 65 6d 6f 74 65 73 5c 22 20 61 6e 64 20 5c 22 remotes\" and \"
9920: 61 70 70 6c 69 65 73 20 74 6f 20 74 68 65 20 27 applies to the '
9930: 73 79 6e 63 27 20 63 6f 6d 6d 61 6e 64 20 69 6e sync' command in
9940: 20 61 64 64 69 74 69 6f 6e 20 74 6f 20 27 63 6f addition to 'co
9950: 6d 6d 69 74 27 2c 20 27 6d 65 72 67 65 27 2c 20 mmit', 'merge',
9960: 27 6f 70 65 6e 27 2c 20 61 6e 64 20 27 75 70 64 'open', and 'upd
9970: 61 74 65 27 5c 22 2e 20 45 76 65 72 79 20 6f 6e ate'\". Every on
9980: 65 20 6f 66 20 74 68 65 73 65 20 69 73 20 73 74 e of these is st
9990: 69 6c 6c 20 74 68 65 20 6c 6f 63 61 6c 20 73 69 ill the local si
99a0: 64 65 20 63 61 6c 6c 69 6e 67 20 6f 75 74 2e 22 de calling out."
99b0: 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
99c0: 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 https://fossil-s
99d0: 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 68 65 6c 70 cm.org/home/help
99e0: 2f 72 65 6d 6f 74 65 20 3b 20 68 74 74 70 73 3a /remote ; https:
99f0: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
9a00: 2f 68 6f 6d 65 2f 68 65 6c 70 2f 73 79 6e 63 20 /home/help/sync
9a10: 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c ; https://fossil
9a20: 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 68 65 -scm.org/home/he
9a30: 6c 70 2f 61 75 74 6f 73 79 6e 63 22 0a 20 20 7d lp/autosync". }
9a40: 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 ,. {. "claim"
9a50: 3a 20 22 28 31 29 20 46 6f 73 73 69 6c 20 68 61 : "(1) Fossil ha
9a60: 73 20 6e 6f 20 4e 41 54 20 74 72 61 76 65 72 73 s no NAT travers
9a70: 61 6c 2e 20 49 20 73 65 61 72 63 68 65 64 20 61 al. I searched a
9a80: 6c 6c 20 6f 66 20 74 72 75 6e 6b 20 73 72 63 2f ll of trunk src/
9a90: 20 66 6f 72 20 55 44 50 20 73 6f 63 6b 65 74 73 for UDP sockets
9aa0: 20 28 53 4f 43 4b 5f 44 47 52 41 4d 29 2c 20 55 (SOCK_DGRAM), U
9ab0: 50 6e 50 2c 20 53 54 55 4e 2c 20 73 65 72 76 65 PnP, STUN, serve
9ac0: 72 2d 73 65 6e 74 20 65 76 65 6e 74 73 20 61 6e r-sent events an
9ad0: 64 20 57 65 62 53 6f 63 6b 65 74 73 20 61 6e 64 d WebSockets and
9ae0: 20 66 6f 75 6e 64 20 6e 6f 74 68 69 6e 67 2e 20 found nothing.
9af0: 54 68 65 20 6f 6e 6c 79 20 73 6f 63 6b 65 74 73 The only sockets
9b00: 20 61 72 65 20 54 43 50 20 6c 69 73 74 65 6e 65 are TCP listene
9b10: 72 73 20 69 6e 20 63 67 69 2e 63 20 61 6e 64 20 rs in cgi.c and
9b20: 54 43 50 20 63 6c 69 65 6e 74 20 73 6f 63 6b 65 TCP client socke
9b30: 74 73 20 69 6e 20 68 74 74 70 5f 73 6f 63 6b 65 ts in http_socke
9b40: 74 2e 63 2e 20 63 68 61 74 2e 63 20 65 78 70 6c t.c. chat.c expl
9b50: 61 69 6e 73 20 74 68 65 20 64 65 73 69 67 6e 20 ains the design
9b60: 63 68 6f 69 63 65 3a 20 5c 22 4e 65 77 65 72 20 choice: \"Newer
9b70: 57 65 62 20 53 6f 63 6b 65 74 73 20 61 6e 64 20 Web Sockets and
9b80: 53 65 72 76 65 72 20 53 65 6e 74 20 45 76 65 6e Server Sent Even
9b90: 74 20 70 72 6f 74 6f 63 6f 6c 73 20 61 72 65 20 t protocols are
9ba0: 6d 6f 72 65 20 65 6c 65 67 61 6e 74 2c 20 62 75 more elegant, bu
9bb0: 74 20 61 72 65 20 6e 6f 74 20 63 6f 6d 70 61 74 t are not compat
9bc0: 69 62 6c 65 20 77 69 74 68 20 43 47 49 2c 20 61 ible with CGI, a
9bd0: 6e 64 20 77 6f 75 6c 64 20 74 68 75 73 20 63 6f nd would thus co
9be0: 6d 70 6c 69 63 61 74 65 20 63 6f 6e 66 69 67 75 mplicate configu
9bf0: 72 61 74 69 6f 6e 2e 5c 22 22 2c 0a 20 20 20 22 ration.\"",. "
9c00: 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a source": "https:
9c10: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
9c20: 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d /home/file?name=
9c30: 73 72 63 2f 63 68 61 74 2e 63 26 63 69 3d 32 63 src/chat.c&ci=2c
9c40: 66 63 33 39 38 65 26 6c 6e 3d 33 35 2d 33 39 20 fc398e&ln=35-39
9c50: 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c ; https://fossil
9c60: 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 -scm.org/home/fi
9c70: 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 63 67 69 2e le?name=src/cgi.
9c80: 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e c&ci=2cfc398e&ln
9c90: 3d 32 36 35 34 2d 32 37 38 36 20 3b 20 68 74 74 =2654-2786 ; htt
9ca0: 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e ps://fossil-scm.
9cb0: 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 org/home/file?na
9cc0: 6d 65 3d 73 72 63 2f 68 74 74 70 5f 73 6f 63 6b me=src/http_sock
9cd0: 65 74 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 et.c&ci=2cfc398e
9ce0: 26 6c 6e 3d 31 37 30 22 0a 20 20 7d 2c 0a 20 20 &ln=170". },.
9cf0: 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 {. "claim": "(
9d00: 31 29 20 46 6f 73 73 69 6c 20 63 61 6e 20 61 6c 1) Fossil can al
9d10: 72 65 61 64 79 20 68 61 6e 64 20 61 20 73 79 6e ready hand a syn
9d20: 63 20 6d 65 73 73 61 67 65 20 74 6f 20 61 6e 79 c message to any
9d30: 20 65 78 74 65 72 6e 61 6c 20 63 61 72 72 69 65 external carrie
9d40: 72 2e 20 73 79 6e 63 2e 63 2c 20 6f 6e 20 2d 2d r. sync.c, on --
9d50: 74 72 61 6e 73 70 6f 72 74 2d 63 6f 6d 6d 61 6e transport-comman
9d60: 64 3a 20 5c 22 43 61 75 73 65 73 20 43 4f 4d 4d d: \"Causes COMM
9d70: 41 4e 44 20 74 6f 20 62 65 20 72 75 6e 20 77 69 AND to be run wi
9d80: 74 68 20 74 68 72 65 65 20 61 72 67 75 6d 65 6e th three argumen
9d90: 74 73 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 74 ts in order to t
9da0: 61 6c 6b 20 74 6f 20 74 68 65 20 73 65 72 76 65 alk to the serve
9db0: 72 2e 20 43 4f 4d 4d 41 4e 44 20 55 52 4c 20 50 r. COMMAND URL P
9dc0: 41 59 4c 4f 41 44 20 52 45 50 4c 59 20 2e 2e 2e AYLOAD REPLY ...
9dd0: 20 50 41 59 4c 4f 41 44 20 69 73 20 74 68 65 20 PAYLOAD is the
9de0: 6e 61 6d 65 20 6f 66 20 61 20 74 65 6d 70 6f 72 name of a tempor
9df0: 61 72 79 20 66 69 6c 65 20 74 68 61 74 20 77 69 ary file that wi
9e00: 6c 6c 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 78 ll contain the x
9e10: 66 65 72 2d 70 72 6f 74 6f 63 6f 6c 20 70 61 79 fer-protocol pay
9e20: 6c 6f 61 64 20 2e 2e 2e 20 52 45 50 4c 59 20 69 load ... REPLY i
9e30: 73 20 61 20 74 65 6d 70 6f 72 61 72 79 20 66 69 s a temporary fi
9e40: 6c 65 6e 61 6d 65 20 69 6e 20 77 68 69 63 68 20 lename in which
9e50: 43 4f 4d 4d 41 4e 44 20 73 68 6f 75 6c 64 20 77 COMMAND should w
9e60: 72 69 74 65 20 74 68 65 20 63 6f 6e 74 65 6e 74 rite the content
9e70: 20 6f 66 20 74 68 65 20 72 65 70 6c 79 5c 22 2e of the reply\".
9e80: 20 68 74 74 70 2e 63 20 69 6d 70 6c 65 6d 65 6e http.c implemen
9e90: 74 73 20 74 68 69 73 20 61 73 20 68 74 74 70 5f ts this as http_
9ea0: 65 78 63 68 61 6e 67 65 5f 65 78 74 65 72 6e 61 exchange_externa
9eb0: 6c 28 29 2e 20 4f 6e 20 74 68 65 20 6f 74 68 65 l(). On the othe
9ec0: 72 20 73 69 64 65 2c 20 27 66 6f 73 73 69 6c 20 r side, 'fossil
9ed0: 68 74 74 70 27 20 77 69 6c 6c 20 5c 22 48 61 6e http' will \"Han
9ee0: 64 6c 65 20 61 20 73 69 6e 67 6c 65 20 48 54 54 dle a single HTT
9ef0: 50 20 72 65 71 75 65 73 74 5c 22 20 61 6e 64 20 P request\" and
9f00: 74 61 6b 65 73 20 27 2d 2d 69 6e 20 46 49 4c 45 takes '--in FILE
9f10: 27 20 61 6e 64 20 27 2d 2d 6f 75 74 20 46 49 4c ' and '--out FIL
9f20: 45 27 2c 20 73 6f 20 6e 6f 20 6c 69 73 74 65 6e E', so no listen
9f30: 69 6e 67 20 73 6f 63 6b 65 74 20 69 73 20 6e 65 ing socket is ne
9f40: 65 64 65 64 2e 20 4d 79 20 69 6e 66 65 72 65 6e eded. My inferen
9f50: 63 65 2c 20 6e 6f 74 20 74 65 73 74 65 64 3a 20 ce, not tested:
9f60: 74 6f 67 65 74 68 65 72 20 74 68 65 73 65 20 6c together these l
9f70: 65 74 20 74 77 6f 20 70 65 65 72 73 20 73 79 6e et two peers syn
9f80: 63 20 6f 76 65 72 20 61 6e 79 20 63 68 61 6e 6e c over any chann
9f90: 65 6c 20 4f 43 58 20 73 75 70 70 6c 69 65 73 2c el OCX supplies,
9fa0: 20 73 75 63 68 20 61 73 20 61 20 72 65 6c 61 79 such as a relay
9fb0: 20 6f 72 20 61 20 68 6f 6c 65 2d 70 75 6e 63 68 or a hole-punch
9fc0: 65 64 20 74 75 6e 6e 65 6c 2c 20 77 69 74 68 6f ed tunnel, witho
9fd0: 75 74 20 63 68 61 6e 67 69 6e 67 20 46 6f 73 73 ut changing Foss
9fe0: 69 6c 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 il.",. "source
9ff0: 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f 73 73 ": "https://foss
a000: 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
a010: 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 73 79 file?name=src/sy
a020: 6e 63 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 nc.c&ci=2cfc398e
a030: 26 6c 6e 3d 33 30 32 2d 33 31 39 20 3b 20 68 74 &ln=302-319 ; ht
a040: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
a050: 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e .org/home/file?n
a060: 61 6d 65 3d 73 72 63 2f 68 74 74 70 2e 63 26 63 ame=src/http.c&c
a070: 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 32 37 i=2cfc398e&ln=27
a080: 30 2d 33 30 30 20 3b 20 68 74 74 70 73 3a 2f 2f 0-300 ; https://
a090: 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 fossil-scm.org/h
a0a0: 6f 6d 65 2f 68 65 6c 70 2f 68 74 74 70 20 28 2d ome/help/http (-
a0b0: 2d 69 6e 2c 20 2d 2d 6f 75 74 3b 20 73 72 63 2f -in, --out; src/
a0c0: 6d 61 69 6e 2e 63 20 6c 69 6e 65 73 20 32 38 36 main.c lines 286
a0d0: 39 2d 32 39 33 31 29 22 0a 20 20 7d 2c 0a 20 20 9-2931)". },.
a0e0: 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 {. "claim": "(
a0f0: 32 29 20 48 6f 77 20 2f 63 68 61 74 2d 70 6f 6c 2) How /chat-pol
a100: 6c 20 77 61 69 74 73 3a 20 74 68 65 20 72 65 71 l waits: the req
a110: 75 65 73 74 20 6e 61 6d 65 73 20 74 68 65 20 6c uest names the l
a120: 61 72 67 65 73 74 20 6d 73 67 69 64 20 74 68 65 argest msgid the
a130: 20 63 61 6c 6c 65 72 20 68 6f 6c 64 73 20 28 2f caller holds (/
a140: 63 68 61 74 2d 70 6f 6c 6c 2f 4e 20 6f 72 20 3f chat-poll/N or ?
a150: 6e 61 6d 65 3d 4e 29 2e 20 4e 65 77 65 72 20 72 name=N). Newer r
a160: 6f 77 73 20 61 72 65 20 72 65 74 75 72 6e 65 64 ows are returned
a170: 20 61 74 20 6f 6e 63 65 2e 20 4f 74 68 65 72 77 at once. Otherw
a180: 69 73 65 20 74 68 65 20 70 61 67 65 20 73 6c 65 ise the page sle
a190: 65 70 73 20 31 30 30 30 20 6d 73 20 61 74 20 61 eps 1000 ms at a
a1a0: 20 74 69 6d 65 20 61 6e 64 2c 20 61 66 74 65 72 time and, after
a1b0: 20 65 61 63 68 20 73 6c 65 65 70 2c 20 63 6f 6d each sleep, com
a1c0: 70 61 72 65 73 20 27 50 52 41 47 4d 41 20 72 65 pares 'PRAGMA re
a1d0: 70 6f 73 69 74 6f 72 79 2e 64 61 74 61 5f 76 65 pository.data_ve
a1e0: 72 73 69 6f 6e 27 2e 20 57 68 65 6e 20 74 68 65 rsion'. When the
a1f0: 20 76 61 6c 75 65 20 63 68 61 6e 67 65 73 20 69 value changes i
a200: 74 20 72 65 2d 72 75 6e 73 20 74 68 65 20 63 68 t re-runs the ch
a210: 61 74 20 71 75 65 72 79 2c 20 61 6e 64 20 69 74 at query, and it
a220: 20 67 69 76 65 73 20 75 70 20 61 66 74 65 72 20 gives up after
a230: 63 68 61 74 2d 70 6f 6c 6c 2d 74 69 6d 65 6f 75 chat-poll-timeou
a240: 74 20 70 61 73 73 65 73 2e 20 43 6f 64 65 3a 20 t passes. Code:
a250: 5c 22 63 6f 6e 73 74 20 69 6e 74 20 69 44 65 6c \"const int iDel
a260: 61 79 20 3d 20 31 30 30 30 3b 20 20 20 20 2f 2a ay = 1000; /*
a270: 20 44 65 6c 61 79 20 75 6e 74 69 6c 20 6e 65 78 Delay until nex
a280: 74 20 70 6f 6c 6c 20 28 6d 69 6c 6c 69 73 65 63 t poll (millisec
a290: 6f 6e 64 73 29 20 2a 2f 5c 22 20 2e 2e 2e 20 5c onds) */\" ... \
a2a0: 22 6e 44 65 6c 61 79 20 3d 20 64 62 5f 67 65 74 "nDelay = db_get
a2b0: 5f 69 6e 74 28 5c 5c 5c 22 63 68 61 74 2d 70 6f _int(\\\"chat-po
a2c0: 6c 6c 2d 74 69 6d 65 6f 75 74 5c 5c 5c 22 2c 34 ll-timeout\\\",4
a2d0: 32 30 29 3b 20 20 2f 2a 20 44 65 66 61 75 6c 74 20); /* Default
a2e0: 20 61 62 6f 75 74 20 37 20 6d 69 6e 75 74 65 73 about 7 minutes
a2f0: 20 2a 2f 5c 22 20 2e 2e 2e 20 5c 22 73 71 6c 69 */\" ... \"sqli
a300: 74 65 33 5f 73 6c 65 65 70 28 69 44 65 6c 61 79 te3_sleep(iDelay
a310: 29 3b 20 6e 44 65 6c 61 79 2d 2d 3b 20 77 68 69 ); nDelay--; whi
a320: 6c 65 28 20 6e 44 65 6c 61 79 3e 30 20 29 7b 20 le( nDelay>0 ){
a330: 73 71 6c 69 74 65 33 5f 69 6e 74 36 34 20 6e 65 sqlite3_int64 ne
a340: 77 44 61 74 61 56 65 72 73 20 3d 20 64 62 5f 69 wDataVers = db_i
a350: 6e 74 36 34 28 30 2c 5c 5c 5c 22 50 52 41 47 4d nt64(0,\\\"PRAGM
a360: 41 20 72 65 70 6f 73 69 74 6f 72 79 2e 64 61 74 A repository.dat
a370: 61 5f 76 65 72 73 69 6f 6e 5c 5c 5c 22 29 3b 20 a_version\\\");
a380: 69 66 28 20 6e 65 77 44 61 74 61 56 65 72 73 21 if( newDataVers!
a390: 3d 64 61 74 61 56 65 72 73 69 6f 6e 20 29 7b 20 =dataVersion ){
a3a0: 64 61 74 61 56 65 72 73 69 6f 6e 20 3d 20 6e 65 dataVersion = ne
a3b0: 77 44 61 74 61 56 65 72 73 3b 20 62 72 65 61 6b wDataVers; break
a3c0: 3b 20 7d 20 73 71 6c 69 74 65 33 5f 73 6c 65 65 ; } sqlite3_slee
a3d0: 70 28 69 44 65 6c 61 79 29 3b 20 6e 44 65 6c 61 p(iDelay); nDela
a3e0: 79 2d 2d 3b 20 7d 5c 22 2e 20 4f 6e 20 74 69 6d y--; }\". On tim
a3f0: 65 6f 75 74 20 74 68 65 20 72 65 70 6c 79 20 68 eout the reply h
a400: 61 73 20 61 6e 20 65 6d 70 74 79 20 5c 22 6d 73 as an empty \"ms
a410: 67 73 5c 22 20 61 72 72 61 79 2e 20 54 68 65 20 gs\" array. The
a420: 63 61 6c 6c 65 72 20 6e 65 65 64 73 20 43 68 61 caller needs Cha
a430: 74 20 63 61 70 61 62 69 6c 69 74 79 3a 20 5c 22 t capability: \"
a440: 69 66 28 20 21 67 2e 70 65 72 6d 2e 43 68 61 74 if( !g.perm.Chat
a450: 20 29 20 7b 20 63 68 61 74 5f 65 6d 69 74 5f 70 ) { chat_emit_p
a460: 65 72 6d 69 73 73 69 6f 6e 73 5f 65 72 72 6f 72 ermissions_error
a470: 28 31 29 3b 20 72 65 74 75 72 6e 3b 20 7d 5c 22 (1); return; }\"
a480: 2e 20 54 68 65 20 70 61 67 65 20 69 73 20 66 6c . The page is fl
a490: 61 67 67 65 64 20 27 6c 6f 61 64 61 76 67 2d 65 agged 'loadavg-e
a4a0: 78 65 6d 70 74 27 2e 22 2c 0a 20 20 20 22 73 6f xempt'.",. "so
a4b0: 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f urce": "https://
a4c0: 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 fossil-scm.org/h
a4d0: 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 ome/file?name=sr
a4e0: 63 2f 63 68 61 74 2e 63 26 63 69 3d 32 63 66 63 c/chat.c&ci=2cfc
a4f0: 33 39 38 65 26 6c 6e 3d 36 32 39 2d 37 39 31 20 398e&ln=629-791
a500: 28 57 45 42 50 41 47 45 3a 20 63 68 61 74 2d 70 (WEBPAGE: chat-p
a510: 6f 6c 6c 20 61 6e 64 20 63 68 61 74 5f 70 6f 6c oll and chat_pol
a520: 6c 5f 77 65 62 70 61 67 65 29 20 3b 20 68 74 74 l_webpage) ; htt
a530: 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e ps://fossil-scm.
a540: 6f 72 67 2f 68 6f 6d 65 2f 68 65 6c 70 2f 77 77 org/home/help/ww
a550: 77 2f 63 68 61 74 2d 70 6f 6c 6c 22 0a 20 20 7d w/chat-poll". }
a560: 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 ,. {. "claim"
a570: 3a 20 22 28 32 29 20 54 68 65 20 63 68 61 74 2d : "(2) The chat-
a580: 70 6f 6c 6c 2d 74 69 6d 65 6f 75 74 20 73 65 74 poll-timeout set
a590: 74 69 6e 67 20 28 64 65 66 61 75 6c 74 20 34 32 ting (default 42
a5a0: 30 29 20 69 73 20 64 6f 63 75 6d 65 6e 74 65 64 0) is documented
a5b0: 20 61 73 3a 20 5c 22 64 65 74 65 72 6d 69 6e 65 as: \"determine
a5c0: 73 20 61 70 70 72 6f 78 69 6d 61 74 65 6c 79 20 s approximately
a5d0: 68 6f 77 20 6c 6f 6e 67 20 2f 63 68 61 74 2d 70 how long /chat-p
a5e0: 6f 6c 6c 20 77 69 6c 6c 20 64 65 6c 61 79 20 62 oll will delay b
a5f0: 65 66 6f 72 65 20 67 69 76 69 6e 67 20 75 70 20 efore giving up
a600: 61 6e 64 20 72 65 74 75 72 6e 69 6e 67 20 61 6e and returning an
a610: 20 65 6d 70 74 79 20 72 65 70 6c 79 2e 20 54 68 empty reply. Th
a620: 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 20 e default value
a630: 69 73 20 61 62 6f 75 74 20 37 20 6d 69 6e 75 74 is about 7 minut
a640: 65 73 2c 20 77 68 69 63 68 20 77 6f 72 6b 73 20 es, which works
a650: 77 65 6c 6c 20 66 6f 72 20 46 6f 73 73 69 6c 20 well for Fossil
a660: 62 65 68 69 6e 64 20 74 68 65 20 61 6c 74 68 74 behind the altht
a670: 74 70 64 20 77 65 62 20 73 65 72 76 65 72 2e 20 tpd web server.
a680: 4f 74 68 65 72 20 73 65 72 76 65 72 20 65 6e 76 Other server env
a690: 69 72 6f 6e 6d 65 6e 74 73 20 6d 61 79 20 63 68 ironments may ch
a6a0: 6f 6f 73 65 20 61 20 6c 6f 6e 67 65 72 20 6f 72 oose a longer or
a6b0: 20 73 68 6f 72 74 65 72 20 64 65 6c 61 79 2e 20 shorter delay.
a6c0: 46 6f 72 20 6d 61 78 69 6d 75 6d 20 65 66 66 69 For maximum effi
a6d0: 63 69 65 6e 63 79 2c 20 69 74 20 69 73 20 62 65 ciency, it is be
a6e0: 73 74 20 74 6f 20 63 68 6f 6f 73 65 20 74 68 65 st to choose the
a6f0: 20 6c 6f 6e 67 65 73 74 20 64 65 6c 61 79 20 74 longest delay t
a700: 68 61 74 20 64 6f 65 73 20 6e 6f 74 20 63 61 75 hat does not cau
a710: 73 65 20 74 69 6d 65 6f 75 74 73 20 69 6e 20 69 se timeouts in i
a720: 6e 74 65 72 6d 65 64 69 61 74 65 20 70 72 6f 78 ntermediate prox
a730: 69 65 73 20 6f 72 20 77 65 62 20 73 65 72 76 65 ies or web serve
a740: 72 2e 5c 22 20 54 68 65 20 31 2d 73 65 63 6f 6e r.\" The 1-secon
a750: 64 20 63 68 65 63 6b 20 69 6e 74 65 72 76 61 6c d check interval
a760: 20 69 73 20 61 20 63 6f 6e 73 74 61 6e 74 20 69 is a constant i
a770: 6e 20 74 68 65 20 63 6f 64 65 2c 20 6e 6f 74 20 n the code, not
a780: 61 20 73 65 74 74 69 6e 67 2e 20 63 68 61 74 2d a setting. chat-
a790: 69 6e 69 74 69 61 6c 2d 68 69 73 74 6f 72 79 20 initial-history
a7a0: 28 64 65 66 61 75 6c 74 20 35 30 29 20 6f 6e 6c (default 50) onl
a7b0: 79 20 61 66 66 65 63 74 73 20 68 69 73 74 6f 72 y affects histor
a7c0: 79 20 72 65 71 75 65 73 74 73 2e 22 2c 0a 20 20 y requests.",.
a7d0: 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
a7e0: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
a7f0: 72 67 2f 68 6f 6d 65 2f 68 65 6c 70 2f 63 68 61 rg/home/help/cha
a800: 74 2d 70 6f 6c 6c 2d 74 69 6d 65 6f 75 74 20 3b t-poll-timeout ;
a810: 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d https://fossil-
a820: 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c scm.org/home/fil
a830: 65 3f 6e 61 6d 65 3d 73 72 63 2f 63 68 61 74 2e e?name=src/chat.
a840: 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e c&ci=2cfc398e&ln
a850: 3d 37 38 2d 31 32 35 22 0a 20 20 7d 2c 0a 20 20 =78-125". },.
a860: 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 {. "claim": "(
a870: 32 29 20 57 68 79 20 64 61 74 61 5f 76 65 72 73 2) Why data_vers
a880: 69 6f 6e 20 77 6f 72 6b 73 20 61 73 20 74 68 65 ion works as the
a890: 20 77 61 6b 65 2d 75 70 20 73 69 67 6e 61 6c 2c wake-up signal,
a8a0: 20 70 65 72 20 53 51 4c 69 74 65 27 73 20 64 6f per SQLite's do
a8b0: 63 73 3a 20 5c 22 54 68 65 20 69 6e 74 65 67 65 cs: \"The intege
a8c0: 72 20 76 61 6c 75 65 73 20 72 65 74 75 72 6e 65 r values returne
a8d0: 64 20 62 79 20 74 77 6f 20 69 6e 76 6f 63 61 74 d by two invocat
a8e0: 69 6f 6e 73 20 6f 66 20 27 50 52 41 47 4d 41 20 ions of 'PRAGMA
a8f0: 64 61 74 61 5f 76 65 72 73 69 6f 6e 27 20 66 72 data_version' fr
a900: 6f 6d 20 74 68 65 20 73 61 6d 65 20 63 6f 6e 6e om the same conn
a910: 65 63 74 69 6f 6e 20 77 69 6c 6c 20 62 65 20 64 ection will be d
a920: 69 66 66 65 72 65 6e 74 20 69 66 20 63 68 61 6e ifferent if chan
a930: 67 65 73 20 77 65 72 65 20 63 6f 6d 6d 69 74 74 ges were committ
a940: 65 64 20 74 6f 20 74 68 65 20 64 61 74 61 62 61 ed to the databa
a950: 73 65 20 62 79 20 61 6e 79 20 6f 74 68 65 72 20 se by any other
a960: 63 6f 6e 6e 65 63 74 69 6f 6e 20 69 6e 20 74 68 connection in th
a970: 65 20 69 6e 74 65 72 69 6d 5c 22 2c 20 69 6e 63 e interim\", inc
a980: 6c 75 64 69 6e 67 20 63 6f 6e 6e 65 63 74 69 6f luding connectio
a990: 6e 73 20 69 6e 20 73 65 70 61 72 61 74 65 20 70 ns in separate p
a9a0: 72 6f 63 65 73 73 65 73 2e 20 42 65 63 61 75 73 rocesses. Becaus
a9b0: 65 20 6f 66 20 74 68 69 73 2c 20 61 6e 79 20 63 e of this, any c
a9c0: 6f 6d 6d 69 74 20 74 6f 20 74 68 65 20 72 65 70 ommit to the rep
a9d0: 6f 73 69 74 6f 72 79 20 77 61 6b 65 73 20 74 68 ository wakes th
a9e0: 65 20 70 6f 6c 6c 2c 20 69 6e 63 6c 75 64 69 6e e poll, includin
a9f0: 67 20 61 20 73 79 6e 63 20 61 72 72 69 76 69 6e g a sync arrivin
aa00: 67 2e 20 63 68 61 74 5f 70 6f 6c 6c 5f 72 6f 77 g. chat_poll_row
aa10: 73 74 6f 6a 73 6f 6e 28 29 20 63 61 6c 6c 73 20 stojson() calls
aa20: 64 62 5f 72 65 73 65 74 28 29 20 61 66 74 65 72 db_reset() after
aa30: 20 65 61 63 68 20 70 61 73 73 2c 20 73 6f 20 6e each pass, so n
aa40: 6f 20 72 65 61 64 20 6c 6f 63 6b 20 69 73 20 68 o read lock is h
aa50: 65 6c 64 20 77 68 69 6c 65 20 73 6c 65 65 70 69 eld while sleepi
aa60: 6e 67 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 ng.",. "source
aa70: 22 3a 20 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e ": "https://www.
aa80: 73 71 6c 69 74 65 2e 6f 72 67 2f 70 72 61 67 6d sqlite.org/pragm
aa90: 61 2e 68 74 6d 6c 23 70 72 61 67 6d 61 5f 64 61 a.html#pragma_da
aaa0: 74 61 5f 76 65 72 73 69 6f 6e 20 3b 20 68 74 74 ta_version ; htt
aab0: 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e ps://fossil-scm.
aac0: 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 org/home/file?na
aad0: 6d 65 3d 73 72 63 2f 63 68 61 74 2e 63 26 63 69 me=src/chat.c&ci
aae0: 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 35 36 33 =2cfc398e&ln=563
aaf0: 2d 36 32 37 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 -627". },. {.
ab00: 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 33 29 20 "claim": "(3)
ab10: 4e 6f 74 68 69 6e 67 20 69 6e 20 74 68 65 20 73 Nothing in the s
ab20: 79 6e 63 20 70 72 6f 74 6f 63 6f 6c 20 6c 65 74 ync protocol let
ab30: 73 20 61 20 73 65 72 76 65 72 20 63 6f 6e 74 61 s a server conta
ab40: 63 74 20 61 20 63 6c 6f 6e 65 2e 20 54 68 65 20 ct a clone. The
ab50: 6e 65 61 72 65 73 74 20 74 68 69 6e 67 20 69 73 nearest thing is
ab60: 20 74 68 65 20 27 70 72 61 67 6d 61 20 63 6c 69 the 'pragma cli
ab70: 65 6e 74 2d 75 72 6c 27 20 63 61 72 64 2e 20 49 ent-url' card. I
ab80: 74 73 20 63 6f 6d 6d 65 6e 74 3a 20 5c 22 61 6e ts comment: \"an
ab90: 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 61 6c 20 6e informational n
aba0: 6f 74 69 66 69 63 61 74 69 6f 6e 20 74 6f 20 74 otification to t
abb0: 68 65 20 73 65 72 76 65 72 20 74 68 61 74 20 74 he server that t
abc0: 68 65 69 72 20 72 65 6c 61 74 69 6f 6e 73 68 69 heir relationshi
abd0: 70 20 63 6f 75 6c 64 2c 20 69 6e 20 74 68 65 6f p could, in theo
abe0: 72 79 2c 20 62 65 20 69 6e 76 65 72 74 65 64 20 ry, be inverted
abf0: 62 79 20 68 61 76 69 6e 67 20 74 68 65 20 73 65 by having the se
ac00: 72 76 65 72 20 63 61 6c 6c 20 74 68 65 20 63 6c rver call the cl
ac10: 69 65 6e 74 20 61 74 20 55 52 4c 2e 5c 22 20 54 ient at URL.\" T
ac20: 68 65 20 73 65 72 76 65 72 20 6f 6e 6c 79 20 72 he server only r
ac30: 65 63 6f 72 64 73 20 69 74 20 61 73 20 61 20 27 ecords it as a '
ac40: 73 79 6e 63 66 72 6f 6d 3a 55 52 4c 27 20 63 6f syncfrom:URL' co
ac50: 6e 66 69 67 20 72 6f 77 2e 20 54 68 61 74 20 72 nfig row. That r
ac60: 6f 77 20 69 73 20 75 73 65 64 20 74 6f 20 6c 69 ow is used to li
ac70: 73 74 20 6f 74 68 65 72 20 72 65 70 6f 73 69 74 st other reposit
ac80: 6f 72 69 65 73 20 28 74 68 65 20 27 70 72 61 67 ories (the 'prag
ac90: 6d 61 20 6c 69 6e 6b 27 20 72 65 70 6c 79 20 61 ma link' reply a
aca0: 6e 64 20 74 68 65 20 2f 75 72 6c 6c 69 73 74 20 nd the /urllist
acb0: 70 61 67 65 29 2c 20 6e 6f 74 20 74 6f 20 63 61 page), not to ca
acc0: 6c 6c 20 62 61 63 6b 2e 20 54 68 65 20 63 6c 69 ll back. The cli
acd0: 65 6e 74 20 73 65 6e 64 73 20 74 68 69 73 20 63 ent sends this c
ace0: 61 72 64 20 6f 6e 6c 79 20 69 66 20 69 74 73 20 ard only if its
acf0: 6f 77 6e 20 65 6d 61 69 6c 2d 75 72 6c 20 73 65 own email-url se
ad00: 74 74 69 6e 67 20 69 73 20 73 65 74 20 61 6e 64 tting is set and
ad10: 20 74 68 61 74 20 55 52 4c 20 68 61 73 20 62 65 that URL has be
ad20: 65 6e 20 75 73 65 64 20 74 6f 20 72 65 61 63 68 en used to reach
ad30: 20 69 74 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 it.",. "sourc
ad40: 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f 73 e": "https://fos
ad50: 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 sil-scm.org/home
ad60: 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 78 /file?name=src/x
ad70: 66 65 72 2e 63 26 63 69 3d 32 63 66 63 33 39 38 fer.c&ci=2cfc398
ad80: 65 26 6c 6e 3d 31 38 36 31 2d 31 38 37 32 20 3b e&ln=1861-1872 ;
ad90: 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d https://fossil-
ada0: 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c scm.org/home/fil
adb0: 65 3f 6e 61 6d 65 3d 73 72 63 2f 78 66 65 72 2e e?name=src/xfer.
adc0: 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e c&ci=2cfc398e&ln
add0: 3d 31 39 33 36 2d 31 39 37 30 20 3b 20 68 74 74 =1936-1970 ; htt
ade0: 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e ps://fossil-scm.
adf0: 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 org/home/file?na
ae00: 6d 65 3d 73 72 63 2f 73 74 61 74 2e 63 26 63 69 me=src/stat.c&ci
ae10: 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 35 30 39 =2cfc398e&ln=509
ae20: 2d 35 32 36 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 -526". },. {.
ae30: 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 33 29 20 "claim": "(3)
ae40: 41 75 74 6f 6d 61 74 69 63 20 73 79 6e 63 69 6e Automatic syncin
ae50: 67 20 6f 66 20 70 65 65 72 20 72 65 70 6f 73 69 g of peer reposi
ae60: 74 6f 72 69 65 73 20 69 73 20 70 6c 61 6e 6e 65 tories is planne
ae70: 64 20 62 75 74 20 6e 6f 74 20 62 75 69 6c 74 2e d but not built.
ae80: 20 54 68 65 20 68 65 61 64 65 72 20 6f 66 20 62 The header of b
ae90: 61 63 6b 6f 66 66 69 63 65 2e 63 20 6c 69 73 74 ackoffice.c list
aea0: 73 20 5c 22 41 75 74 6f 6d 61 74 69 63 61 6c 6c s \"Automaticall
aeb0: 79 20 73 79 6e 63 69 6e 67 20 74 6f 20 70 65 65 y syncing to pee
aec0: 72 20 72 65 70 6f 73 69 74 6f 72 69 65 73 5c 22 r repositories\"
aed0: 2c 20 62 75 74 20 74 68 65 20 62 61 63 6b 6f 66 , but the backof
aee0: 66 69 63 65 20 77 6f 72 6b 20 72 6f 75 74 69 6e fice work routin
aef0: 65 20 63 61 6c 6c 73 20 6f 6e 6c 79 20 61 6c 65 e calls only ale
af00: 72 74 5f 62 61 63 6b 6f 66 66 69 63 65 28 30 29 rt_backoffice(0)
af10: 20 61 6e 64 20 68 6f 6f 6b 5f 62 61 63 6b 6f 66 and hook_backof
af20: 66 69 63 65 28 29 2e 20 62 61 63 6b 6f 66 66 69 fice(). backoffi
af30: 63 65 2e 6d 64 20 73 61 79 73 20 5c 22 28 41 73 ce.md says \"(As
af40: 20 6f 66 20 32 30 31 38 2d 30 38 2d 30 37 2c 20 of 2018-08-07,
af50: 6f 6e 6c 79 20 69 74 65 6d 73 20 31 20 61 6e 64 only items 1 and
af60: 20 32 20 68 61 76 65 20 61 63 74 75 61 6c 6c 79 2 have actually
af70: 20 62 65 65 6e 20 69 6d 70 6c 65 6d 65 6e 74 65 been implemente
af80: 64 2e 29 5c 22 2c 20 6d 65 61 6e 69 6e 67 20 65 d.)\", meaning e
af90: 6d 61 69 6c 20 61 6c 65 72 74 73 20 61 6e 64 20 mail alerts and
afa0: 64 69 67 65 73 74 73 2e 22 2c 0a 20 20 20 22 73 digests.",. "s
afb0: 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f ource": "https:/
afc0: 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f /fossil-scm.org/
afd0: 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 home/file?name=s
afe0: 72 63 2f 62 61 63 6b 6f 66 66 69 63 65 2e 63 26 rc/backoffice.c&
aff0: 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 32 ci=2cfc398e&ln=2
b000: 32 2d 32 35 20 61 6e 64 20 6c 6e 3d 36 34 32 2d 2-25 and ln=642-
b010: 36 34 37 20 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 647 ; https://fo
b020: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
b030: 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f e/doc/trunk/www/
b040: 62 61 63 6b 6f 66 66 69 63 65 2e 6d 64 20 28 27 backoffice.md ('
b050: 57 68 61 74 20 49 73 20 54 68 65 20 42 61 63 6b What Is The Back
b060: 6f 66 66 69 63 65 27 29 22 0a 20 20 7d 2c 0a 20 office')". },.
b070: 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 {. "claim": "
b080: 28 33 29 20 54 68 65 20 63 6c 6f 73 65 73 74 20 (3) The closest
b090: 62 75 69 6c 74 2d 69 6e 20 73 65 72 76 65 72 2d built-in server-
b0a0: 74 6f 2d 63 6c 6f 6e 65 20 73 69 67 6e 61 6c 3a to-clone signal:
b0b0: 20 73 65 74 20 63 68 61 74 2d 74 69 6d 65 6c 69 set chat-timeli
b0c0: 6e 65 2d 75 73 65 72 2e 20 49 74 73 20 68 65 6c ne-user. Its hel
b0d0: 70 20 73 61 79 73 3a 20 5c 22 74 69 6d 65 6c 69 p says: \"timeli
b0e0: 6e 65 20 65 76 65 6e 74 73 20 61 72 65 20 70 6f ne events are po
b0f0: 73 74 65 64 20 74 6f 20 74 68 65 20 63 68 61 74 sted to the chat
b100: 20 61 73 20 74 68 65 79 20 61 72 72 69 76 65 2e as they arrive.
b110: 5c 22 20 49 6e 20 63 6f 64 65 2c 20 70 61 67 65 \" In code, page
b120: 5f 78 66 65 72 28 29 20 63 61 6c 6c 73 20 6d 61 _xfer() calls ma
b130: 6e 69 66 65 73 74 5f 63 72 6f 73 73 6c 69 6e 6b nifest_crosslink
b140: 5f 62 65 67 69 6e 28 29 20 6f 6e 20 65 76 65 72 _begin() on ever
b150: 79 20 2f 78 66 65 72 20 72 65 71 75 65 73 74 2e y /xfer request.
b160: 20 54 68 61 74 20 63 61 6c 6c 73 20 61 6c 65 72 That calls aler
b170: 74 5f 63 72 65 61 74 65 5f 74 72 69 67 67 65 72 t_create_trigger
b180: 28 29 2c 20 77 68 69 63 68 20 61 64 64 73 20 27 (), which adds '
b190: 74 65 6d 70 2e 63 68 61 74 5f 74 72 69 67 67 65 temp.chat_trigge
b1a0: 72 31 20 41 46 54 45 52 20 49 4e 53 45 52 54 20 r1 AFTER INSERT
b1b0: 4f 4e 20 72 65 70 6f 73 69 74 6f 72 79 2e 65 76 ON repository.ev
b1c0: 65 6e 74 27 20 61 6e 64 20 69 6e 73 65 72 74 73 ent' and inserts
b1d0: 20 74 68 65 20 63 68 61 74 20 72 6f 77 73 20 77 the chat rows w
b1e0: 68 65 6e 20 74 68 65 20 74 72 61 6e 73 61 63 74 hen the transact
b1f0: 69 6f 6e 20 63 6f 6d 6d 69 74 73 20 28 64 62 5f ion commits (db_
b200: 63 6f 6d 6d 69 74 5f 68 6f 6f 6b 29 2e 20 4d 79 commit_hook). My
b210: 20 69 6e 66 65 72 65 6e 63 65 20 66 72 6f 6d 20 inference from
b220: 74 68 65 20 63 6f 64 65 2c 20 6e 6f 74 20 74 65 the code, not te
b230: 73 74 65 64 3a 20 61 20 63 6c 6f 6e 65 20 68 6f sted: a clone ho
b240: 6c 64 69 6e 67 20 61 20 2f 63 68 61 74 2d 70 6f lding a /chat-po
b250: 6c 6c 20 72 65 71 75 65 73 74 20 6f 70 65 6e 20 ll request open
b260: 6f 6e 20 74 68 65 20 70 75 62 6c 69 63 20 73 65 on the public se
b270: 72 76 65 72 20 77 6f 75 6c 64 20 67 65 74 20 69 rver would get i
b280: 74 73 20 72 65 70 6c 79 20 61 62 6f 75 74 20 31 ts reply about 1
b290: 20 73 20 61 66 74 65 72 20 73 6f 6d 65 6f 6e 65 s after someone
b2a0: 27 73 20 70 75 73 68 20 63 6f 6d 6d 69 74 73 20 's push commits
b2b0: 74 68 65 72 65 2c 20 77 69 74 68 20 6e 6f 20 62 there, with no b
b2c0: 61 63 6b 6f 66 66 69 63 65 20 64 65 6c 61 79 2e ackoffice delay.
b2d0: 20 4c 69 6d 69 74 73 3a 20 74 68 65 20 63 6c 6f Limits: the clo
b2e0: 6e 65 20 6e 65 65 64 73 20 61 20 6c 6f 67 69 6e ne needs a login
b2f0: 20 77 69 74 68 20 43 68 61 74 20 28 27 43 27 29 with Chat ('C')
b300: 3b 20 6f 6e 6c 79 20 63 68 61 6e 67 65 73 20 74 ; only changes t
b310: 68 61 74 20 6d 61 6b 65 20 74 69 6d 65 6c 69 6e hat make timelin
b320: 65 20 65 6e 74 72 69 65 73 20 61 6e 6e 6f 75 6e e entries announ
b330: 63 65 3b 20 61 6e 64 20 63 68 61 74 20 5c 22 6c ce; and chat \"l
b340: 69 76 65 73 20 69 6e 20 61 20 73 69 6e 67 6c 65 ives in a single
b350: 20 72 65 70 6f 73 69 74 6f 72 79 2e 20 49 74 20 repository. It
b360: 69 73 20 6e 65 76 65 72 20 73 79 6e 63 65 64 5c is never synced\
b370: 22 20 61 6e 64 20 65 78 70 69 72 65 73 20 28 63 " and expires (c
b380: 68 61 74 2d 6b 65 65 70 2d 63 6f 75 6e 74 20 35 hat-keep-count 5
b390: 30 2c 20 63 68 61 74 2d 6b 65 65 70 2d 64 61 79 0, chat-keep-day
b3a0: 73 20 37 29 2e 22 2c 0a 20 20 20 22 73 6f 75 72 s 7).",. "sour
b3b0: 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f ce": "https://fo
b3c0: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
b3d0: 65 2f 68 65 6c 70 2f 63 68 61 74 2d 74 69 6d 65 e/help/chat-time
b3e0: 6c 69 6e 65 2d 75 73 65 72 20 3b 20 68 74 74 70 line-user ; http
b3f0: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
b400: 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 6e rg/home/doc/trun
b410: 6b 2f 77 77 77 2f 63 68 61 74 2e 6d 64 23 63 68 k/www/chat.md#ch
b420: 61 74 2d 72 6f 62 6f 74 20 3b 20 68 74 74 70 73 at-robot ; https
b430: 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 ://fossil-scm.or
b440: 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 g/home/file?name
b450: 3d 73 72 63 2f 61 6c 65 72 74 73 2e 63 26 63 69 =src/alerts.c&ci
b460: 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 31 35 38 =2cfc398e&ln=158
b470: 2d 32 32 36 20 3b 20 68 74 74 70 73 3a 2f 2f 66 -226 ; https://f
b480: 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f ossil-scm.org/ho
b490: 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 me/file?name=src
b4a0: 2f 6d 61 6e 69 66 65 73 74 2e 63 26 63 69 3d 32 /manifest.c&ci=2
b4b0: 63 66 63 33 39 38 65 26 6c 6e 3d 31 39 38 36 2d cfc398e&ln=1986-
b4c0: 31 39 39 30 20 3b 20 68 74 74 70 73 3a 2f 2f 66 1990 ; https://f
b4d0: 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f ossil-scm.org/ho
b4e0: 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 me/file?name=src
b4f0: 2f 78 66 65 72 2e 63 26 63 69 3d 32 63 66 63 33 /xfer.c&ci=2cfc3
b500: 39 38 65 26 6c 6e 3d 31 33 32 37 20 3b 20 68 74 98e&ln=1327 ; ht
b510: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
b520: 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e .org/home/file?n
b530: 61 6d 65 3d 73 72 63 2f 63 68 61 74 2e 63 26 63 ame=src/chat.c&c
b540: 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 33 30 i=2cfc398e&ln=30
b550: 2d 33 33 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 -33". },. {.
b560: 20 22 63 6c 61 69 6d 22 3a 20 22 28 33 29 20 54 "claim": "(3) T
b570: 68 65 20 61 66 74 65 72 2d 72 65 63 65 69 76 65 he after-receive
b580: 20 68 6f 6f 6b 20 72 75 6e 73 20 6f 6e 20 74 68 hook runs on th
b590: 65 20 73 65 72 76 65 72 20 61 6e 64 20 63 61 6e e server and can
b5a0: 6e 6f 74 20 72 65 61 63 68 20 61 20 4e 41 54 65 not reach a NATe
b5b0: 64 20 63 6c 6f 6e 65 20 62 79 20 69 74 73 65 6c d clone by itsel
b5c0: 66 2e 20 49 74 20 63 61 6e 20 61 6c 73 6f 20 62 f. It can also b
b5d0: 65 20 73 6c 6f 77 2e 20 68 6f 6f 6b 73 2e 6d 64 e slow. hooks.md
b5e0: 3a 20 69 74 20 5c 22 69 73 20 72 75 6e 20 62 79 : it \"is run by
b5f0: 20 74 68 65 20 62 61 63 6b 6f 66 66 69 63 65 20 the backoffice
b600: 77 68 65 6e 65 76 65 72 20 6e 65 77 20 61 72 74 whenever new art
b610: 69 66 61 63 74 73 20 61 72 65 20 72 65 63 65 69 ifacts are recei
b620: 76 65 64 5c 22 3b 20 5c 22 46 6f 73 73 69 6c 20 ved\"; \"Fossil
b630: 68 6f 6c 64 73 20 61 20 77 72 69 74 65 20 74 72 holds a write tr
b640: 61 6e 73 61 63 74 69 6f 6e 20 6f 6e 20 74 68 65 ansaction on the
b650: 20 72 65 70 6f 73 69 74 6f 72 79 20 77 68 69 6c repository whil
b660: 65 20 74 68 65 20 61 66 74 65 72 2d 72 65 63 65 e the after-rece
b670: 69 76 65 20 68 6f 6f 6b 20 69 73 20 72 75 6e 6e ive hook is runn
b680: 69 6e 67 5c 22 3b 20 61 6e 64 20 69 66 20 61 6e ing\"; and if an
b690: 20 2f 78 66 65 72 20 72 65 71 75 65 73 74 20 69 /xfer request i
b6a0: 73 20 69 6e 63 6f 6d 70 6c 65 74 65 20 5c 22 69 s incomplete \"i
b6b0: 74 20 77 69 6c 6c 20 64 65 66 65 72 20 72 75 6e t will defer run
b6c0: 6e 69 6e 67 20 74 68 65 20 61 66 74 65 72 2d 72 ning the after-r
b6d0: 65 63 65 69 76 65 20 70 75 73 68 20 66 6f 72 20 eceive push for
b6e0: 36 30 20 73 65 63 6f 6e 64 73 5c 22 2e 20 62 61 60 seconds\". ba
b6f0: 63 6b 6f 66 66 69 63 65 2e 6d 64 3a 20 72 75 6e ckoffice.md: run
b700: 73 20 5c 22 77 69 6c 6c 20 6e 6f 74 20 6f 63 63 s \"will not occ
b710: 75 72 20 6d 6f 72 65 20 66 72 65 71 75 65 6e 74 ur more frequent
b720: 6c 79 20 74 68 61 6e 20 6f 6e 63 65 20 65 76 65 ly than once eve
b730: 72 79 20 36 30 20 73 65 63 6f 6e 64 73 5c 22 20 ry 60 seconds\"
b740: 28 42 4b 4f 46 43 45 5f 4c 45 41 53 45 5f 54 49 (BKOFCE_LEASE_TI
b750: 4d 45 20 36 30 29 2e 20 53 6f 20 61 20 68 6f 6f ME 60). So a hoo
b760: 6b 20 63 61 6e 20 66 69 72 65 20 66 72 6f 6d 20 k can fire from
b770: 61 62 6f 75 74 20 30 20 74 6f 20 36 30 20 73 20 about 0 to 60 s
b780: 61 66 74 65 72 20 61 20 72 65 63 65 69 70 74 2c after a receipt,
b790: 20 6f 72 20 6c 61 74 65 72 20 64 75 72 69 6e 67 or later during
b7a0: 20 74 68 65 20 65 6d 62 61 72 67 6f 2e 22 2c 0a the embargo.",.
b7b0: 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 "source": "ht
b7c0: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
b7d0: 2e 6f 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 .org/home/doc/tr
b7e0: 75 6e 6b 2f 77 77 77 2f 68 6f 6f 6b 73 2e 6d 64 unk/www/hooks.md
b7f0: 20 28 27 41 66 74 65 72 2d 52 65 63 65 69 76 65 ('After-Receive
b800: 20 48 6f 6f 6b 73 27 29 20 3b 20 68 74 74 70 73 Hooks') ; https
b810: 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 ://fossil-scm.or
b820: 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 6e 6b g/home/doc/trunk
b830: 2f 77 77 77 2f 62 61 63 6b 6f 66 66 69 63 65 2e /www/backoffice.
b840: 6d 64 20 28 27 54 68 65 20 62 61 63 6b 6f 66 66 md ('The backoff
b850: 69 63 65 20 69 73 20 73 65 72 69 61 6c 69 7a 65 ice is serialize
b860: 64 20 61 6e 64 20 72 61 74 65 20 6c 69 6d 69 74 d and rate limit
b870: 65 64 27 29 20 3b 20 68 74 74 70 73 3a 2f 2f 66 ed') ; https://f
b880: 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f ossil-scm.org/ho
b890: 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 me/file?name=src
b8a0: 2f 62 61 63 6b 6f 66 66 69 63 65 2e 63 26 63 69 /backoffice.c&ci
b8b0: 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 39 38 20 =2cfc398e&ln=98
b8c0: 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c ; https://fossil
b8d0: 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 -scm.org/home/fi
b8e0: 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 68 6f 6f 6b le?name=src/hook
b8f0: 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c .c&ci=2cfc398e&l
b900: 6e 3d 31 34 30 2d 31 35 34 22 0a 20 20 7d 2c 0a n=140-154". },.
b910: 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 {. "claim":
b920: 22 28 33 29 20 45 6d 61 69 6c 20 61 6c 65 72 74 "(3) Email alert
b930: 73 20 61 72 65 20 74 68 65 20 6f 74 68 65 72 20 s are the other
b940: 62 75 69 6c 74 2d 69 6e 20 6e 6f 74 69 66 69 65 built-in notifie
b950: 72 2e 20 54 68 65 79 20 67 6f 20 74 6f 20 73 75 r. They go to su
b960: 62 73 63 72 69 62 65 72 73 27 20 65 6d 61 69 6c bscribers' email
b970: 20 61 64 64 72 65 73 73 65 73 2c 20 6e 6f 74 20 addresses, not
b980: 74 6f 20 63 6c 6f 6e 65 73 2e 20 54 68 65 20 62 to clones. The b
b990: 61 63 6b 6f 66 66 69 63 65 20 73 65 6e 64 73 20 ackoffice sends
b9a0: 74 68 65 6d 2c 20 65 69 74 68 65 72 20 61 74 20 them, either at
b9b0: 6f 6e 63 65 20 6f 72 20 61 73 20 61 20 64 61 69 once or as a dai
b9c0: 6c 79 20 64 69 67 65 73 74 2c 20 74 68 72 6f 75 ly digest, throu
b9d0: 67 68 20 61 20 70 69 70 65 64 20 63 6f 6d 6d 61 gh a piped comma
b9e0: 6e 64 2c 20 61 6e 20 53 51 4c 69 74 65 20 64 61 nd, an SQLite da
b9f0: 74 61 62 61 73 65 2c 20 61 20 64 69 72 65 63 74 tabase, a direct
ba00: 6f 72 79 20 6f 66 20 66 69 6c 65 73 2c 20 61 6e ory of files, an
ba10: 20 53 4d 54 50 20 72 65 6c 61 79 20 6f 72 20 64 SMTP relay or d
ba20: 69 72 65 63 74 20 53 4d 54 50 2e 22 2c 0a 20 20 irect SMTP.",.
ba30: 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
ba40: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
ba50: 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 6e rg/home/doc/trun
ba60: 6b 2f 77 77 77 2f 61 6c 65 72 74 73 2e 6d 64 20 k/www/alerts.md
ba70: 28 69 6e 74 72 6f 3b 20 27 41 64 76 61 6e 63 65 (intro; 'Advance
ba80: 64 20 45 6d 61 69 6c 20 53 65 74 75 70 73 27 3b d Email Setups';
ba90: 20 27 49 6e 74 65 72 6e 61 6c 20 50 72 6f 63 65 'Internal Proce
baa0: 73 73 69 6e 67 20 46 6c 6f 77 27 29 22 0a 20 20 ssing Flow')".
bab0: 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d },. {. "claim
bac0: 22 3a 20 22 28 34 29 20 41 20 6e 61 74 75 72 61 ": "(4) A natura
bad0: 6c 20 27 72 65 63 65 69 70 74 20 4e 27 20 63 75 l 'receipt N' cu
bae0: 72 73 6f 72 20 61 6c 72 65 61 64 79 20 65 78 69 rsor already exi
baf0: 73 74 73 3a 20 74 68 65 20 72 63 76 66 72 6f 6d sts: the rcvfrom
bb00: 20 74 61 62 6c 65 20 28 5c 22 72 63 76 69 64 20 table (\"rcvid
bb10: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 INTEGER PRIMARY
bb20: 4b 45 59 5c 22 29 2e 20 54 68 65 20 73 63 68 65 KEY\"). The sche
bb30: 6d 61 20 63 6f 6d 6d 65 6e 74 3a 20 5c 22 57 68 ma comment: \"Wh
bb40: 65 6e 65 76 65 72 20 6e 65 77 20 62 6c 6f 62 73 enever new blobs
bb50: 20 61 72 65 20 72 65 63 65 69 76 65 64 20 69 6e are received in
bb60: 74 6f 20 74 68 65 20 72 65 70 6f 73 69 74 6f 72 to the repositor
bb70: 79 2c 20 61 6e 20 65 6e 74 72 79 20 69 6e 20 74 y, an entry in t
bb80: 68 69 73 20 74 61 62 6c 65 20 72 65 63 6f 72 64 his table record
bb90: 73 20 74 68 65 20 73 6f 75 72 63 65 5c 22 2e 20 s the source\".
bba0: 63 6f 6e 74 65 6e 74 5f 72 63 76 69 64 5f 69 6e content_rcvid_in
bbb0: 69 74 28 29 20 61 64 64 73 20 6f 6e 65 20 72 6f it() adds one ro
bbc0: 77 20 70 65 72 20 70 72 6f 63 65 73 73 20 74 68 w per process th
bbd0: 61 74 20 73 74 6f 72 65 73 20 63 6f 6e 74 65 6e at stores conten
bbe0: 74 2e 20 69 70 61 64 64 72 20 69 73 20 4e 55 4c t. ipaddr is NUL
bbf0: 4c 20 66 6f 72 20 6c 6f 63 61 6c 20 63 6f 6d 6d L for local comm
bc00: 69 74 73 2c 20 73 6f 20 74 68 6f 73 65 20 63 6f its, so those co
bc10: 75 6e 74 20 74 6f 6f 2e 20 54 68 65 20 61 66 74 unt too. The aft
bc20: 65 72 2d 72 65 63 65 69 76 65 20 68 6f 6f 6b 20 er-receive hook
bc30: 75 73 65 73 20 74 68 69 73 20 73 61 6d 65 20 63 uses this same c
bc40: 75 72 73 6f 72 3a 20 5c 22 7a 4e 65 77 52 63 76 ursor: \"zNewRcv
bc50: 69 64 20 3d 20 64 62 5f 74 65 78 74 28 5c 5c 5c id = db_text(\\\
bc60: 22 30 5c 5c 5c 22 2c 5c 5c 5c 22 53 45 4c 45 43 "0\\\",\\\"SELEC
bc70: 54 20 6d 61 78 28 72 63 76 69 64 29 20 46 52 4f T max(rcvid) FRO
bc80: 4d 20 72 63 76 66 72 6f 6d 5c 5c 5c 22 29 5c 22 M rcvfrom\\\")\"
bc90: 20 63 6f 6d 70 61 72 65 64 20 77 69 74 68 20 74 compared with t
bca0: 68 65 20 27 68 6f 6f 6b 2d 6c 61 73 74 2d 72 63 he 'hook-last-rc
bcb0: 76 69 64 27 20 73 65 74 74 69 6e 67 2e 22 2c 0a vid' setting.",.
bcc0: 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 "source": "ht
bcd0: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
bce0: 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e .org/home/file?n
bcf0: 61 6d 65 3d 73 72 63 2f 73 63 68 65 6d 61 2e 63 ame=src/schema.c
bd00: 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d &ci=2cfc398e&ln=
bd10: 31 30 31 2d 31 31 30 20 3b 20 68 74 74 70 73 3a 101-110 ; https:
bd20: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
bd30: 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d /home/file?name=
bd40: 73 72 63 2f 63 6f 6e 74 65 6e 74 2e 63 26 63 69 src/content.c&ci
bd50: 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 34 36 39 =2cfc398e&ln=469
bd60: 2d 34 38 32 20 3b 20 68 74 74 70 73 3a 2f 2f 66 -482 ; https://f
bd70: 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f ossil-scm.org/ho
bd80: 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 me/file?name=src
bd90: 2f 68 6f 6f 6b 2e 63 26 63 69 3d 32 63 66 63 33 /hook.c&ci=2cfc3
bda0: 39 38 65 26 6c 6e 3d 34 34 35 2d 34 36 33 22 0a 98e&ln=445-463".
bdb0: 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 },. {. "cla
bdc0: 69 6d 22 3a 20 22 28 34 29 20 54 69 6d 65 20 6c im": "(4) Time l
bdd0: 69 6d 69 74 20 75 6e 64 65 72 20 27 66 6f 73 73 imit under 'foss
bde0: 69 6c 20 73 65 72 76 65 72 27 3a 20 36 30 30 20 il server': 600
bdf0: 73 20 62 79 20 64 65 66 61 75 6c 74 2c 20 6f 72 s by default, or
be00: 20 2d 2d 6d 61 78 2d 6c 61 74 65 6e 63 79 20 4e --max-latency N
be10: 2c 20 61 6e 64 20 69 74 20 65 6e 64 73 20 61 6e , and it ends an
be20: 20 2f 65 78 74 20 72 65 71 75 65 73 74 2e 20 54 /ext request. T
be30: 68 65 20 73 65 72 76 65 72 20 66 6f 72 6b 73 20 he server forks
be40: 6f 6e 65 20 63 68 69 6c 64 20 70 65 72 20 63 6f one child per co
be50: 6e 6e 65 63 74 69 6f 6e 2c 20 61 6e 64 20 74 68 nnection, and th
be60: 65 20 63 68 69 6c 64 20 72 75 6e 73 20 5c 22 69 e child runs \"i
be70: 66 28 20 7a 54 69 6d 65 6f 75 74 20 29 7b 20 66 f( zTimeout ){ f
be80: 6f 73 73 69 6c 5f 73 65 74 5f 74 69 6d 65 6f 75 ossil_set_timeou
be90: 74 28 61 74 6f 69 28 7a 54 69 6d 65 6f 75 74 29 t(atoi(zTimeout)
bea0: 29 3b 20 7d 65 6c 73 65 7b 20 66 6f 73 73 69 6c ); }else{ fossil
beb0: 5f 73 65 74 5f 74 69 6d 65 6f 75 74 28 46 4f 53 _set_timeout(FOS
bec0: 53 49 4c 5f 44 45 46 41 55 4c 54 5f 54 49 4d 45 SIL_DEFAULT_TIME
bed0: 4f 55 54 29 3b 20 7d 5c 22 20 77 69 74 68 20 5c OUT); }\" with \
bee0: 22 23 20 64 65 66 69 6e 65 20 46 4f 53 53 49 4c "# define FOSSIL
bef0: 5f 44 45 46 41 55 4c 54 5f 54 49 4d 45 4f 55 54 _DEFAULT_TIMEOUT
bf00: 20 36 30 30 20 20 2f 2a 20 31 30 20 6d 69 6e 75 600 /* 10 minu
bf10: 74 65 73 20 2a 2f 5c 22 2e 20 7a 54 69 6d 65 6f tes */\". zTimeo
bf20: 75 74 20 63 6f 6d 65 73 20 66 72 6f 6d 20 66 69 ut comes from fi
bf30: 6e 64 5f 6f 70 74 69 6f 6e 28 5c 22 6d 61 78 2d nd_option(\"max-
bf40: 6c 61 74 65 6e 63 79 5c 22 2c 30 2c 31 29 2c 20 latency\",0,1),
bf50: 77 68 6f 73 65 20 68 65 6c 70 20 73 61 79 73 20 whose help says
bf60: 5c 22 44 6f 20 6e 6f 74 20 6c 65 74 20 61 6e 79 \"Do not let any
bf70: 20 73 69 6e 67 6c 65 20 48 54 54 50 20 72 65 71 single HTTP req
bf80: 75 65 73 74 20 72 75 6e 20 66 6f 72 20 6d 6f 72 uest run for mor
bf90: 65 20 74 68 61 6e 20 4e 20 73 65 63 6f 6e 64 73 e than N seconds
bfa0: 20 28 6f 6e 6c 79 20 77 6f 72 6b 73 20 6f 6e 20 (only works on
bfb0: 75 6e 69 78 29 5c 22 2e 20 66 6f 73 73 69 6c 5f unix)\". fossil_
bfc0: 73 65 74 5f 74 69 6d 65 6f 75 74 28 29 20 69 73 set_timeout() is
bfd0: 20 61 6c 61 72 6d 28 4e 29 2e 20 54 68 65 20 53 alarm(N). The S
bfe0: 49 47 41 4c 52 4d 20 68 61 6e 64 6c 65 72 20 73 IGALRM handler s
bff0: 6b 69 70 73 20 74 68 65 20 6b 69 6c 6c 20 6f 6e kips the kill on
c000: 6c 79 20 77 68 65 6e 20 67 2e 7a 50 68 61 73 65 ly when g.zPhase
c010: 20 69 73 20 5c 22 77 65 62 2d 70 61 67 65 20 72 is \"web-page r
c020: 65 70 6c 79 5c 22 20 61 6e 64 20 6c 65 73 73 20 eply\" and less
c030: 74 68 61 6e 20 31 30 20 73 20 6f 66 20 43 50 55 than 10 s of CPU
c040: 20 68 61 73 20 62 65 65 6e 20 75 73 65 64 3b 20 has been used;
c050: 6f 74 68 65 72 77 69 73 65 20 69 74 20 63 61 6c otherwise it cal
c060: 6c 73 20 66 6f 73 73 69 6c 5f 70 61 6e 69 63 28 ls fossil_panic(
c070: 5c 22 54 69 6d 65 6f 75 74 20 61 66 74 65 72 20 \"Timeout after
c080: 25 64 20 73 65 63 6f 6e 64 73 20 64 75 72 69 6e %d seconds durin
c090: 67 20 25 73 5c 22 2e 2e 2e 29 2e 20 57 68 69 6c g %s\"...). Whil
c0a0: 65 20 61 20 70 61 67 65 20 66 75 6e 63 74 69 6f e a page functio
c0b0: 6e 20 73 75 63 68 20 61 73 20 2f 65 78 74 20 72 n such as /ext r
c0c0: 75 6e 73 2c 20 67 2e 7a 50 68 61 73 65 20 69 73 uns, g.zPhase is
c0d0: 20 74 68 65 20 70 61 67 65 20 6e 61 6d 65 2c 20 the page name,
c0e0: 73 6f 20 61 6e 20 2f 65 78 74 20 72 65 71 75 65 so an /ext reque
c0f0: 73 74 20 74 68 61 74 20 72 75 6e 73 20 70 61 73 st that runs pas
c100: 74 20 74 68 65 20 6c 69 6d 69 74 20 69 73 20 65 t the limit is e
c110: 6e 64 65 64 2e 22 2c 0a 20 20 20 22 73 6f 75 72 nded.",. "sour
c120: 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f ce": "https://fo
c130: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
c140: 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f e/file?name=src/
c150: 6d 61 69 6e 2e 63 26 63 69 3d 32 63 66 63 33 39 main.c&ci=2cfc39
c160: 38 65 26 6c 6e 3d 36 37 2d 37 34 20 3b 20 68 74 8e&ln=67-74 ; ht
c170: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
c180: 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e .org/home/file?n
c190: 61 6d 65 3d 73 72 63 2f 6d 61 69 6e 2e 63 26 63 ame=src/main.c&c
c1a0: 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 33 31 i=2cfc398e&ln=31
c1b0: 37 32 2d 33 32 30 37 20 3b 20 68 74 74 70 73 3a 72-3207 ; https:
c1c0: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
c1d0: 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d /home/file?name=
c1e0: 73 72 63 2f 6d 61 69 6e 2e 63 26 63 69 3d 32 63 src/main.c&ci=2c
c1f0: 66 63 33 39 38 65 26 6c 6e 3d 33 33 39 30 20 3b fc398e&ln=3390 ;
c200: 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d https://fossil-
c210: 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c scm.org/home/fil
c220: 65 3f 6e 61 6d 65 3d 73 72 63 2f 6d 61 69 6e 2e e?name=src/main.
c230: 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e c&ci=2cfc398e&ln
c240: 3d 33 36 36 39 2d 33 36 37 35 20 3b 20 68 74 74 =3669-3675 ; htt
c250: 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e ps://fossil-scm.
c260: 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 org/home/file?na
c270: 6d 65 3d 73 72 63 2f 6d 61 69 6e 2e 63 26 63 69 me=src/main.c&ci
c280: 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 32 32 35 =2cfc398e&ln=225
c290: 30 2d 32 32 36 38 22 0a 20 20 7d 2c 0a 20 20 7b 0-2268". },. {
c2a0: 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 34 . "claim": "(4
c2b0: 29 20 55 6e 64 65 72 20 74 68 65 20 6f 74 68 65 ) Under the othe
c2c0: 72 20 6c 61 75 6e 63 68 20 6d 6f 64 65 73 3a 20 r launch modes:
c2d0: 27 66 6f 73 73 69 6c 20 63 67 69 27 20 61 6c 73 'fossil cgi' als
c2e0: 6f 20 64 65 66 61 75 6c 74 73 20 74 6f 20 36 30 o defaults to 60
c2f0: 30 20 73 20 61 6e 64 20 74 61 6b 65 73 20 61 20 0 s and takes a
c300: 5c 22 74 69 6d 65 6f 75 74 3a 20 53 45 43 4f 4e \"timeout: SECON
c310: 44 53 5c 22 20 6c 69 6e 65 20 69 6e 20 74 68 65 DS\" line in the
c320: 20 43 47 49 20 73 63 72 69 70 74 2e 20 46 6f 72 CGI script. For
c330: 20 27 66 6f 73 73 69 6c 20 68 74 74 70 27 20 28 'fossil http' (
c340: 69 6e 65 74 64 20 6f 72 20 73 73 68 29 20 49 20 inetd or ssh) I
c350: 66 6f 75 6e 64 20 6e 6f 20 74 69 6d 65 20 6c 69 found no time li
c360: 6d 69 74 3a 20 61 63 72 6f 73 73 20 61 6c 6c 20 mit: across all
c370: 6f 66 20 74 72 75 6e 6b 20 73 72 63 2f 2a 2e 63 of trunk src/*.c
c380: 2c 20 66 6f 73 73 69 6c 5f 73 65 74 5f 74 69 6d , fossil_set_tim
c390: 65 6f 75 74 28 29 2f 61 6c 61 72 6d 28 29 20 69 eout()/alarm() i
c3a0: 73 20 63 61 6c 6c 65 64 20 6f 6e 6c 79 20 66 6f s called only fo
c3b0: 72 20 63 67 69 20 28 6d 61 69 6e 2e 63 20 32 34 r cgi (main.c 24
c3c0: 39 35 2c 20 32 36 34 36 29 2c 20 66 6f 72 20 73 95, 2646), for s
c3d0: 65 72 76 65 72 20 28 33 36 37 32 2c 20 33 36 37 erver (3672, 367
c3e0: 34 29 2c 20 61 6e 64 20 69 6e 20 61 20 74 65 73 4), and in a tes
c3f0: 74 20 70 61 67 65 20 28 33 38 33 31 29 2e 20 54 t page (3831). T
c400: 68 65 20 6f 6e 6c 79 20 6f 74 68 65 72 20 74 69 he only other ti
c410: 6d 65 20 6c 69 6d 69 74 20 49 20 66 6f 75 6e 64 me limit I found
c420: 20 6f 6e 20 74 68 65 20 72 65 71 75 65 73 74 20 on the request
c430: 70 61 74 68 20 69 73 20 27 6d 61 78 2d 64 6f 77 path is 'max-dow
c440: 6e 6c 6f 61 64 2d 74 69 6d 65 27 20 28 64 65 66 nload-time' (def
c450: 61 75 6c 74 20 33 30 20 73 29 2c 20 61 6e 64 20 ault 30 s), and
c460: 69 74 20 63 6f 76 65 72 73 20 6f 6e 6c 79 20 68 it covers only h
c470: 6f 77 20 6c 6f 6e 67 20 2f 78 66 65 72 20 73 70 ow long /xfer sp
c480: 65 6e 64 73 20 62 75 69 6c 64 69 6e 67 20 61 20 ends building a
c490: 72 65 70 6c 79 3a 20 5c 22 78 66 65 72 2e 6d 61 reply: \"xfer.ma
c4a0: 78 54 69 6d 65 20 3d 20 64 62 5f 67 65 74 5f 69 xTime = db_get_i
c4b0: 6e 74 28 5c 5c 5c 22 6d 61 78 2d 64 6f 77 6e 6c nt(\\\"max-downl
c4c0: 6f 61 64 2d 74 69 6d 65 5c 5c 5c 22 2c 20 33 30 oad-time\\\", 30
c4d0: 29 3b 5c 22 2e 22 2c 0a 20 20 20 22 73 6f 75 72 );\".",. "sour
c4e0: 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f ce": "https://fo
c4f0: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
c500: 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f e/file?name=src/
c510: 6d 61 69 6e 2e 63 26 63 69 3d 32 63 66 63 33 39 main.c&ci=2cfc39
c520: 38 65 26 6c 6e 3d 32 34 34 30 2d 32 34 39 35 20 8e&ln=2440-2495
c530: 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c ; https://fossil
c540: 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 -scm.org/home/fi
c550: 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 6d 61 69 6e le?name=src/main
c560: 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c .c&ci=2cfc398e&l
c570: 6e 3d 32 36 34 30 2d 32 36 34 37 20 3b 20 68 74 n=2640-2647 ; ht
c580: 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d tps://fossil-scm
c590: 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e .org/home/file?n
c5a0: 61 6d 65 3d 73 72 63 2f 78 66 65 72 2e 63 26 63 ame=src/xfer.c&c
c5b0: 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d 31 33 i=2cfc398e&ln=13
c5c0: 31 36 2d 31 33 31 39 22 0a 20 20 7d 2c 0a 20 20 16-1319". },.
c5d0: 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 {. "claim": "(
c5e0: 34 29 20 2f 65 78 74 20 68 6f 6c 64 73 20 62 61 4) /ext holds ba
c5f0: 63 6b 20 74 68 65 20 73 63 72 69 70 74 27 73 20 ck the script's
c600: 77 68 6f 6c 65 20 72 65 70 6c 79 20 75 6e 74 69 whole reply unti
c610: 6c 20 74 68 65 20 73 63 72 69 70 74 20 66 69 6e l the script fin
c620: 69 73 68 65 73 2c 20 73 6f 20 61 20 77 61 69 74 ishes, so a wait
c630: 20 73 63 72 69 70 74 20 63 61 6e 6e 6f 74 20 73 script cannot s
c640: 74 72 65 61 6d 20 6f 72 20 73 65 6e 64 20 6b 65 tream or send ke
c650: 65 70 2d 61 6c 69 76 65 20 62 79 74 65 73 2e 20 ep-alive bytes.
c660: 65 78 74 5f 70 61 67 65 28 29 20 73 74 61 72 74 ext_page() start
c670: 73 20 74 68 65 20 73 63 72 69 70 74 20 77 69 74 s the script wit
c680: 68 20 70 6f 70 65 6e 32 28 29 2c 20 72 65 61 64 h popen2(), read
c690: 73 20 68 65 61 64 65 72 73 20 6c 69 6e 65 20 62 s headers line b
c6a0: 79 20 6c 69 6e 65 2c 20 74 68 65 6e 20 63 61 6c y line, then cal
c6b0: 6c 73 20 5c 22 62 6c 6f 62 5f 72 65 61 64 5f 66 ls \"blob_read_f
c6c0: 72 6f 6d 5f 63 68 61 6e 6e 65 6c 28 26 72 65 70 rom_channel(&rep
c6d0: 6c 79 2c 20 66 72 6f 6d 43 68 69 6c 64 2c 20 6e ly, fromChild, n
c6e0: 43 6f 6e 74 65 6e 74 29 3b 5c 22 2e 20 57 69 74 Content);\". Wit
c6f0: 68 20 6e 6f 20 43 6f 6e 74 65 6e 74 2d 4c 65 6e h no Content-Len
c700: 67 74 68 20 28 6e 43 6f 6e 74 65 6e 74 20 3d 20 gth (nContent =
c710: 2d 31 29 20 74 68 61 74 20 6c 6f 6f 70 73 20 5c -1) that loops \
c720: 22 77 68 69 6c 65 28 20 21 66 65 6f 66 28 69 6e "while( !feof(in
c730: 29 20 29 5c 22 2e 20 4f 6e 6c 79 20 61 66 74 65 ) )\". Only afte
c740: 72 20 74 68 61 74 20 64 6f 65 73 20 69 74 20 63 r that does it c
c750: 61 6c 6c 20 64 6f 63 75 6d 65 6e 74 5f 72 65 6e all document_ren
c760: 64 65 72 28 29 2e 20 54 68 65 20 63 6c 69 65 6e der(). The clien
c770: 74 20 73 65 65 73 20 6e 6f 74 68 69 6e 67 20 75 t sees nothing u
c780: 6e 74 69 6c 20 74 68 65 20 73 63 72 69 70 74 20 ntil the script
c790: 65 78 69 74 73 20 6f 72 20 68 61 73 20 77 72 69 exits or has wri
c7a0: 74 74 65 6e 20 43 6f 6e 74 65 6e 74 2d 4c 65 6e tten Content-Len
c7b0: 67 74 68 20 62 79 74 65 73 2e 20 41 20 77 61 69 gth bytes. A wai
c7c0: 74 69 6e 67 20 72 65 71 75 65 73 74 20 74 68 65 ting request the
c7d0: 72 65 66 6f 72 65 20 6f 63 63 75 70 69 65 73 20 refore occupies
c7e0: 74 77 6f 20 70 72 6f 63 65 73 73 65 73 3a 20 74 two processes: t
c7f0: 68 65 20 46 6f 73 73 69 6c 20 63 68 69 6c 64 20 he Fossil child
c800: 61 6e 64 20 74 68 65 20 73 63 72 69 70 74 2e 22 and the script."
c810: 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
c820: 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 https://fossil-s
c830: 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 cm.org/home/file
c840: 3f 6e 61 6d 65 3d 73 72 63 2f 65 78 74 63 67 69 ?name=src/extcgi
c850: 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c .c&ci=2cfc398e&l
c860: 6e 3d 32 39 32 2d 33 36 36 20 3b 20 68 74 74 70 n=292-366 ; http
c870: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
c880: 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d rg/home/file?nam
c890: 65 3d 73 72 63 2f 62 6c 6f 62 2e 63 26 63 69 3d e=src/blob.c&ci=
c8a0: 32 63 66 63 33 39 38 65 26 6c 6e 3d 31 31 39 33 2cfc398e&ln=1193
c8b0: 2d 31 32 30 39 22 0a 20 20 7d 2c 0a 20 20 7b 0a -1209". },. {.
c8c0: 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 34 29 "claim": "(4)
c8d0: 20 57 68 61 74 20 2f 65 78 74 20 67 69 76 65 73 What /ext gives
c8e0: 20 61 20 73 63 72 69 70 74 3a 20 69 74 20 69 73 a script: it is
c8f0: 20 65 6e 61 62 6c 65 64 20 77 69 74 68 20 27 2d enabled with '-
c900: 2d 65 78 74 72 6f 6f 74 20 44 49 52 27 2c 20 61 -extroot DIR', a
c910: 6e 64 20 5c 22 46 69 6c 65 73 20 74 68 61 74 20 nd \"Files that
c920: 61 72 65 20 65 78 65 63 75 74 61 62 6c 65 20 61 are executable a
c930: 72 65 20 72 75 6e 20 61 73 20 43 47 49 5c 22 2e re run as CGI\".
c940: 20 54 68 65 20 73 63 72 69 70 74 20 72 65 63 65 The script rece
c950: 69 76 65 73 20 46 4f 53 53 49 4c 5f 52 45 50 4f ives FOSSIL_REPO
c960: 53 49 54 4f 52 59 20 28 5c 22 74 68 65 20 66 69 SITORY (\"the fi
c970: 6c 65 6e 61 6d 65 20 6f 66 20 74 68 65 20 46 6f lename of the Fo
c980: 73 73 69 6c 20 72 65 70 6f 73 69 74 6f 72 79 20 ssil repository
c990: 74 68 61 74 20 69 73 20 72 75 6e 6e 69 6e 67 5c that is running\
c9a0: 22 29 2c 20 46 4f 53 53 49 4c 5f 55 53 45 52 20 "), FOSSIL_USER
c9b0: 61 6e 64 20 46 4f 53 53 49 4c 5f 43 41 50 41 42 and FOSSIL_CAPAB
c9c0: 49 4c 49 54 49 45 53 2c 20 73 6f 20 69 74 20 73 ILITIES, so it s
c9d0: 68 61 72 65 73 20 46 6f 73 73 69 6c 27 73 20 6c hares Fossil's l
c9e0: 6f 67 69 6e 20 61 6e 64 20 63 61 6e 20 72 65 66 ogin and can ref
c9f0: 75 73 65 20 63 61 6c 6c 65 72 73 20 77 69 74 68 use callers with
ca00: 6f 75 74 20 72 65 61 64 20 61 63 63 65 73 73 2e out read access.
ca10: 20 43 61 76 65 61 74 3a 20 5c 22 46 6f 73 73 69 Caveat: \"Fossi
ca20: 6c 20 6c 69 6b 65 73 20 74 6f 20 72 75 6e 20 69 l likes to run i
ca30: 6e 73 69 64 65 20 61 20 63 68 72 6f 6f 74 20 6a nside a chroot j
ca40: 61 69 6c 20 2e 2e 2e 20 54 68 65 20 73 75 62 2d ail ... The sub-
ca50: 43 47 49 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c CGI program will
ca60: 20 61 6c 73 6f 20 72 75 6e 20 69 6e 73 69 64 65 also run inside
ca70: 20 74 68 69 73 20 73 61 6d 65 20 63 68 72 6f 6f this same chroo
ca80: 74 20 6a 61 69 6c 5c 22 2e 20 49 66 20 27 66 6f t jail\". If 'fo
ca90: 73 73 69 6c 20 73 65 72 76 65 72 27 20 69 73 20 ssil server' is
caa0: 73 74 61 72 74 65 64 20 61 73 20 72 6f 6f 74 2c started as root,
cab0: 20 74 68 65 20 73 63 72 69 70 74 27 73 20 69 6e the script's in
cac0: 74 65 72 70 72 65 74 65 72 20 61 6e 64 20 6c 69 terpreter and li
cad0: 62 72 61 72 69 65 73 20 6d 75 73 74 20 65 78 69 braries must exi
cae0: 73 74 20 69 6e 73 69 64 65 20 74 68 65 20 6a 61 st inside the ja
caf0: 69 6c 2c 20 6f 72 20 74 68 65 20 73 65 72 76 65 il, or the serve
cb00: 72 20 6d 75 73 74 20 72 75 6e 20 77 69 74 68 20 r must run with
cb10: 2d 2d 6e 6f 6a 61 69 6c 2e 22 2c 0a 20 20 20 22 --nojail.",. "
cb20: 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a source": "https:
cb30: 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 //fossil-scm.org
cb40: 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f /home/doc/trunk/
cb50: 77 77 77 2f 73 65 72 76 65 72 65 78 74 2e 77 69 www/serverext.wi
cb60: 6b 69 20 28 32 2e 30 20 48 6f 77 20 49 74 20 57 ki (2.0 How It W
cb70: 6f 72 6b 73 3b 20 43 47 49 20 49 6e 70 75 74 73 orks; CGI Inputs
cb80: 20 73 65 63 74 69 6f 6e 2c 20 46 4f 53 53 49 4c section, FOSSIL
cb90: 5f 2a 20 76 61 72 69 61 62 6c 65 73 3b 20 37 2e _* variables; 7.
cba0: 30 20 54 72 6f 75 62 6c 65 2d 53 68 6f 6f 74 69 0 Trouble-Shooti
cbb0: 6e 67 20 48 69 6e 74 73 29 20 3b 20 68 74 74 70 ng Hints) ; http
cbc0: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
cbd0: 72 67 2f 68 6f 6d 65 2f 68 65 6c 70 2f 77 77 77 rg/home/help/www
cbe0: 2f 65 78 74 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 /ext". },. {.
cbf0: 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 34 29 20 "claim": "(4)
cc00: 43 6f 6e 63 75 72 72 65 6e 63 79 20 63 61 70 3a Concurrency cap:
cc10: 20 27 66 6f 73 73 69 6c 20 73 65 72 76 65 72 27 'fossil server'
cc20: 20 61 6c 6c 6f 77 73 20 61 74 20 6d 6f 73 74 20 allows at most
cc30: 46 4f 53 53 49 4c 5f 4d 41 58 5f 43 4f 4e 4e 45 FOSSIL_MAX_CONNE
cc40: 43 54 49 4f 4e 53 20 28 31 30 30 30 29 20 63 68 CTIONS (1000) ch
cc50: 69 6c 64 20 70 72 6f 63 65 73 73 65 73 20 61 74 ild processes at
cc60: 20 6f 6e 63 65 2e 20 41 74 20 74 68 65 20 63 61 once. At the ca
cc70: 70 20 74 68 65 20 70 61 72 65 6e 74 20 73 74 6f p the parent sto
cc80: 70 73 20 61 63 63 65 70 74 69 6e 67 3a 20 5c 22 ps accepting: \"
cc90: 77 68 69 6c 65 28 20 6e 63 68 69 6c 64 72 65 6e while( nchildren
cca0: 3e 3d 46 4f 53 53 49 4c 5f 4d 41 58 5f 43 4f 4e >=FOSSIL_MAX_CON
ccb0: 4e 45 43 54 49 4f 4e 53 20 29 7b 20 69 66 28 20 NECTIONS ){ if(
ccc0: 77 61 69 74 28 30 29 3e 3d 30 20 29 20 6e 63 68 wait(0)>=0 ) nch
ccd0: 69 6c 64 72 65 6e 2d 2d 3b 20 7d 5c 22 2e 20 2f ildren--; }\". /
cce0: 65 78 74 20 69 73 20 6e 6f 74 20 66 6c 61 67 67 ext is not flagg
ccf0: 65 64 20 6c 6f 61 64 61 76 67 2d 65 78 65 6d 70 ed loadavg-exemp
cd00: 74 2c 20 62 75 74 20 6d 61 78 2d 6c 6f 61 64 61 t, but max-loada
cd10: 76 67 20 64 65 66 61 75 6c 74 73 20 74 6f 20 30 vg defaults to 0
cd20: 2e 30 2c 20 6d 65 61 6e 69 6e 67 20 6e 6f 20 6c .0, meaning no l
cd30: 69 6d 69 74 2e 22 2c 0a 20 20 20 22 73 6f 75 72 imit.",. "sour
cd40: 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f ce": "https://fo
cd50: 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
cd60: 65 2f 66 69 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f e/file?name=src/
cd70: 63 67 69 2e 63 26 63 69 3d 32 63 66 63 33 39 38 cgi.c&ci=2cfc398
cd80: 65 26 6c 6e 3d 32 35 37 38 2d 32 35 38 34 20 3b e&ln=2578-2584 ;
cd90: 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c 2d https://fossil-
cda0: 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 6c scm.org/home/fil
cdb0: 65 3f 6e 61 6d 65 3d 73 72 63 2f 63 67 69 2e 63 e?name=src/cgi.c
cdc0: 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d &ci=2cfc398e&ln=
cdd0: 32 38 33 36 2d 32 38 34 35 20 3b 20 68 74 74 70 2836-2845 ; http
cde0: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
cdf0: 72 67 2f 68 6f 6d 65 2f 66 69 6c 65 3f 6e 61 6d rg/home/file?nam
ce00: 65 3d 73 72 63 2f 6c 6f 61 64 63 74 72 6c 2e 63 e=src/loadctrl.c
ce10: 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c 6e 3d &ci=2cfc398e&ln=
ce20: 37 34 2d 38 36 22 0a 20 20 7d 2c 0a 20 20 7b 0a 74-86". },. {.
ce30: 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 28 34 29 "claim": "(4)
ce40: 20 4d 79 20 69 6e 66 65 72 65 6e 63 65 2c 20 6e My inference, n
ce50: 6f 74 20 62 75 69 6c 74 20 6f 72 20 74 65 73 74 ot built or test
ce60: 65 64 3a 20 61 20 6d 69 6e 69 6d 61 6c 20 27 77 ed: a minimal 'w
ce70: 61 69 74 20 75 6e 74 69 6c 20 72 63 76 69 64 20 ait until rcvid
ce80: 3e 20 4e 27 20 65 6e 64 70 6f 69 6e 74 20 63 61 > N' endpoint ca
ce90: 6e 20 63 6f 70 79 20 63 68 61 74 2d 70 6f 6c 6c n copy chat-poll
cea0: 27 73 20 61 70 70 72 6f 61 63 68 2e 20 54 68 65 's approach. The
ceb0: 20 73 63 72 69 70 74 20 77 6f 75 6c 64 3a 20 63 script would: c
cec0: 68 65 63 6b 20 46 4f 53 53 49 4c 5f 43 41 50 41 heck FOSSIL_CAPA
ced0: 42 49 4c 49 54 49 45 53 3b 20 6f 70 65 6e 20 46 BILITIES; open F
cee0: 4f 53 53 49 4c 5f 52 45 50 4f 53 49 54 4f 52 59 OSSIL_REPOSITORY
cef0: 20 72 65 61 64 2d 6f 6e 6c 79 20 6f 6e 20 6f 6e read-only on on
cf00: 65 20 53 51 4c 69 74 65 20 63 6f 6e 6e 65 63 74 e SQLite connect
cf10: 69 6f 6e 20 77 69 74 68 20 61 20 62 75 73 79 20 ion with a busy
cf20: 74 69 6d 65 6f 75 74 3b 20 72 65 74 75 72 6e 20 timeout; return
cf30: 61 74 20 6f 6e 63 65 20 69 66 20 53 45 4c 45 43 at once if SELEC
cf40: 54 20 6d 61 78 28 72 63 76 69 64 29 20 46 52 4f T max(rcvid) FRO
cf50: 4d 20 72 63 76 66 72 6f 6d 20 3e 20 4e 3b 20 6f M rcvfrom > N; o
cf60: 74 68 65 72 77 69 73 65 20 73 6c 65 65 70 20 31 therwise sleep 1
cf70: 20 73 20 61 6e 64 20 63 68 65 63 6b 20 50 52 41 s and check PRA
cf80: 47 4d 41 20 64 61 74 61 5f 76 65 72 73 69 6f 6e GMA data_version
cf90: 2c 20 68 6f 6c 64 69 6e 67 20 6e 6f 20 74 72 61 , holding no tra
cfa0: 6e 73 61 63 74 69 6f 6e 20 77 68 69 6c 65 20 69 nsaction while i
cfb0: 74 20 73 6c 65 65 70 73 2e 20 48 6f 6c 64 69 6e t sleeps. Holdin
cfc0: 67 20 6e 6f 6e 65 20 6d 61 74 74 65 72 73 20 62 g none matters b
cfd0: 65 63 61 75 73 65 20 74 68 65 20 68 6f 6f 6b 20 ecause the hook
cfe0: 64 6f 63 73 20 73 61 79 20 72 65 61 64 65 72 73 docs say readers
cff0: 20 61 6c 6f 6e 67 73 69 64 65 20 46 6f 73 73 69 alongside Fossi
d000: 6c 27 73 20 77 72 69 74 65 72 20 6e 65 65 64 20 l's writer need
d010: 57 41 4c 20 6d 6f 64 65 2e 20 49 74 20 77 6f 75 WAL mode. It wou
d020: 6c 64 20 61 6e 73 77 65 72 20 77 69 74 68 20 74 ld answer with t
d030: 68 65 20 6e 65 77 20 6d 61 78 28 72 63 76 69 64 he new max(rcvid
d040: 29 2c 20 6f 72 20 74 68 65 20 75 6e 63 68 61 6e ), or the unchan
d050: 67 65 64 20 6f 6e 65 20 61 66 74 65 72 20 54 20 ged one after T
d060: 73 65 63 6f 6e 64 73 2c 20 77 69 74 68 20 54 20 seconds, with T
d070: 77 65 6c 6c 20 75 6e 64 65 72 20 74 68 65 20 73 well under the s
d080: 65 72 76 65 72 27 73 20 36 30 30 20 73 20 6f 72 erver's 600 s or
d090: 20 2d 2d 6d 61 78 2d 6c 61 74 65 6e 63 79 20 6c --max-latency l
d0a0: 69 6d 69 74 20 28 63 68 61 74 20 75 73 65 73 20 imit (chat uses
d0b0: 34 32 30 29 2c 20 61 6e 64 20 73 65 6e 64 20 61 420), and send a
d0c0: 20 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 20 Content-Length
d0d0: 68 65 61 64 65 72 2e 20 41 20 7a 65 72 6f 2d 63 header. A zero-c
d0e0: 6f 64 65 20 61 6c 74 65 72 6e 61 74 69 76 65 3a ode alternative:
d0f0: 20 73 65 74 20 63 68 61 74 2d 74 69 6d 65 6c 69 set chat-timeli
d100: 6e 65 2d 75 73 65 72 20 6f 6e 20 74 68 65 20 70 ne-user on the p
d110: 75 62 6c 69 63 20 73 65 72 76 65 72 20 61 6e 64 ublic server and
d120: 20 68 61 76 65 20 6e 6f 64 65 73 20 6c 6f 6e 67 have nodes long
d130: 2d 70 6f 6c 6c 20 2f 63 68 61 74 2d 70 6f 6c 6c -poll /chat-poll
d140: 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a .",. "source":
d150: 20 22 68 74 74 70 73 3a 2f 2f 66 6f 73 73 69 6c "https://fossil
d160: 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f 66 69 -scm.org/home/fi
d170: 6c 65 3f 6e 61 6d 65 3d 73 72 63 2f 63 68 61 74 le?name=src/chat
d180: 2e 63 26 63 69 3d 32 63 66 63 33 39 38 65 26 6c .c&ci=2cfc398e&l
d190: 6e 3d 37 32 30 2d 37 39 31 20 3b 20 68 74 74 70 n=720-791 ; http
d1a0: 73 3a 2f 2f 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f s://fossil-scm.o
d1b0: 72 67 2f 68 6f 6d 65 2f 64 6f 63 2f 74 72 75 6e rg/home/doc/trun
d1c0: 6b 2f 77 77 77 2f 68 6f 6f 6b 73 2e 6d 64 20 28 k/www/hooks.md (
d1d0: 27 46 6f 73 73 69 6c 20 68 6f 6c 64 73 20 61 20 'Fossil holds a
d1e0: 77 72 69 74 65 20 74 72 61 6e 73 61 63 74 69 6f write transactio
d1f0: 6e 2e 2e 2e 57 41 4c 20 6d 6f 64 65 27 29 20 3b n...WAL mode') ;
d200: 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 73 71 6c https://www.sql
d210: 69 74 65 2e 6f 72 67 2f 70 72 61 67 6d 61 2e 68 ite.org/pragma.h
d220: 74 6d 6c 23 70 72 61 67 6d 61 5f 64 61 74 61 5f tml#pragma_data_
d230: 76 65 72 73 69 6f 6e 22 0a 20 20 7d 0a 20 5d 2c version". }. ],
d240: 0a 20 22 75 6e 63 6f 6e 66 69 72 6d 65 64 22 3a . "unconfirmed":
d250: 20 22 4e 6f 74 20 74 65 73 74 65 64 3b 20 49 20 "Not tested; I
d260: 72 61 6e 20 6e 6f 74 68 69 6e 67 20 65 78 63 65 ran nothing exce
d270: 70 74 20 6c 6f 63 61 6c 20 27 66 6f 73 73 69 6c pt local 'fossil
d280: 20 68 65 6c 70 27 20 61 6e 64 20 67 72 65 70 73 help' and greps
d290: 20 6f 66 20 74 68 65 20 64 6f 77 6e 6c 6f 61 64 of the download
d2a0: 65 64 20 73 6f 75 72 63 65 2e 20 28 61 29 20 54 ed source. (a) T
d2b0: 68 61 74 20 2f 63 68 61 74 2d 70 6f 6c 6c 20 77 hat /chat-poll w
d2c0: 69 74 68 20 63 68 61 74 2d 74 69 6d 65 6c 69 6e ith chat-timelin
d2d0: 65 2d 75 73 65 72 20 73 65 74 20 61 6e 73 77 65 e-user set answe
d2e0: 72 73 20 61 62 6f 75 74 20 31 20 73 20 61 66 74 rs about 1 s aft
d2f0: 65 72 20 61 20 70 75 73 68 20 69 73 20 6d 79 20 er a push is my
d300: 72 65 61 64 69 6e 67 20 6f 66 20 61 6c 65 72 74 reading of alert
d310: 73 2e 63 2c 20 6d 61 6e 69 66 65 73 74 2e 63 20 s.c, manifest.c
d320: 61 6e 64 20 78 66 65 72 2e 63 3b 20 49 20 64 69 and xfer.c; I di
d330: 64 20 6e 6f 74 20 72 75 6e 20 69 74 2e 20 49 20 d not run it. I
d340: 61 6c 73 6f 20 64 69 64 20 6e 6f 74 20 63 68 65 also did not che
d350: 63 6b 20 77 68 69 63 68 20 61 72 74 69 66 61 63 ck which artifac
d360: 74 20 6b 69 6e 64 73 20 6d 61 6b 65 20 45 56 45 t kinds make EVE
d370: 4e 54 20 72 6f 77 73 2c 20 61 6e 64 20 73 6f 20 NT rows, and so
d380: 67 65 74 20 61 6e 6e 6f 75 6e 63 65 64 2c 20 62 get announced, b
d390: 65 79 6f 6e 64 20 74 68 65 20 63 68 65 63 6b 2d eyond the check-
d3a0: 69 6e 2c 20 77 69 6b 69 20 61 6e 64 20 66 6f 72 in, wiki and for
d3b0: 75 6d 20 63 61 73 65 73 20 69 6e 20 63 68 61 74 um cases in chat
d3c0: 5f 6d 73 67 5f 66 72 6f 6d 5f 65 76 65 6e 74 28 _msg_from_event(
d3d0: 29 3b 20 75 6e 76 65 72 73 69 6f 6e 65 64 20 66 ); unversioned f
d3e0: 69 6c 65 73 20 70 72 6f 62 61 62 6c 79 20 64 6f iles probably do
d3f0: 20 6e 6f 74 2e 20 28 62 29 20 6d 61 69 6e 2e 63 not. (b) main.c
d400: 27 73 20 63 6f 6d 6d 65 6e 74 20 73 61 79 73 20 's comment says
d410: 5c 22 41 6e 79 20 63 61 6c 6c 20 74 6f 20 73 6c \"Any call to sl
d420: 65 65 70 28 29 20 6f 72 20 73 71 6c 69 74 65 33 eep() or sqlite3
d430: 5f 73 6c 65 65 70 28 29 20 77 69 6c 6c 20 63 61 _sleep() will ca
d440: 6e 63 65 6c 20 74 68 65 20 61 6c 61 72 6d 5c 22 ncel the alarm\"
d450: 2e 20 49 20 63 6f 75 6c 64 20 6e 6f 74 20 63 6f . I could not co
d460: 6e 66 69 72 6d 20 74 68 61 74 20 6f 6e 20 4c 69 nfirm that on Li
d470: 6e 75 78 2f 67 6c 69 62 63 2c 20 77 68 65 72 65 nux/glibc, where
d480: 20 73 6c 65 65 70 20 69 73 20 62 75 69 6c 74 20 sleep is built
d490: 6f 6e 20 6e 61 6e 6f 73 6c 65 65 70 20 61 6e 64 on nanosleep and
d4a0: 20 73 68 6f 75 6c 64 20 6e 6f 74 20 74 6f 75 63 should not touc
d4b0: 68 20 61 6c 61 72 6d 28 29 2e 20 49 66 20 74 68 h alarm(). If th
d4c0: 65 20 63 6f 6d 6d 65 6e 74 20 77 65 72 65 20 74 e comment were t
d4d0: 72 75 65 2c 20 2f 63 68 61 74 2d 70 6f 6c 6c 20 rue, /chat-poll
d4e0: 69 74 73 65 6c 66 20 77 6f 75 6c 64 20 6e 65 76 itself would nev
d4f0: 65 72 20 68 69 74 20 74 68 65 20 36 30 30 20 73 er hit the 600 s
d500: 20 6c 69 6d 69 74 2e 20 49 74 20 64 6f 65 73 20 limit. It does
d510: 6e 6f 74 20 61 66 66 65 63 74 20 74 68 65 20 2f not affect the /
d520: 65 78 74 20 63 61 73 65 2c 20 62 65 63 61 75 73 ext case, becaus
d530: 65 20 74 68 65 72 65 20 74 68 65 20 73 6c 65 65 e there the slee
d540: 70 69 6e 67 20 68 61 70 70 65 6e 73 20 69 6e 20 ping happens in
d550: 74 68 65 20 73 63 72 69 70 74 27 73 20 70 72 6f the script's pro
d560: 63 65 73 73 20 77 68 69 6c 65 20 46 6f 73 73 69 cess while Fossi
d570: 6c 20 77 61 69 74 73 20 6f 6e 20 74 68 65 20 70 l waits on the p
d580: 69 70 65 2e 20 28 63 29 20 49 20 64 69 64 20 6e ipe. (c) I did n
d590: 6f 74 20 63 68 65 63 6b 20 77 68 61 74 20 68 61 ot check what ha
d5a0: 70 70 65 6e 73 20 74 6f 20 74 68 65 20 73 63 72 ppens to the scr
d5b0: 69 70 74 27 73 20 70 72 6f 63 65 73 73 20 77 68 ipt's process wh
d5c0: 65 6e 20 46 6f 73 73 69 6c 27 73 20 61 6c 61 72 en Fossil's alar
d5d0: 6d 20 65 6e 64 73 20 74 68 65 20 2f 65 78 74 20 m ends the /ext
d5e0: 72 65 71 75 65 73 74 2c 20 77 68 65 74 68 65 72 request, whether
d5f0: 20 69 74 20 69 73 20 6b 69 6c 6c 65 64 20 6f 72 it is killed or
d600: 20 6c 65 66 74 20 72 75 6e 6e 69 6e 67 2e 20 49 left running. I
d610: 20 61 6c 73 6f 20 64 69 64 20 6e 6f 74 20 63 68 also did not ch
d620: 65 63 6b 20 77 68 65 74 68 65 72 20 46 6f 73 73 eck whether Foss
d630: 69 6c 20 6e 6f 74 69 63 65 73 20 61 20 63 6c 69 il notices a cli
d640: 65 6e 74 20 74 68 61 74 20 68 61 6e 67 73 20 75 ent that hangs u
d650: 70 20 6d 69 64 2d 77 61 69 74 2e 20 50 72 6f 62 p mid-wait. Prob
d660: 61 62 6c 79 20 6e 6f 74 20 75 6e 74 69 6c 20 69 ably not until i
d670: 74 20 77 72 69 74 65 73 2c 20 73 6f 20 74 68 65 t writes, so the
d680: 20 73 63 72 69 70 74 27 73 20 6f 77 6e 20 74 69 script's own ti
d690: 6d 65 6f 75 74 20 69 73 20 77 68 61 74 20 66 72 meout is what fr
d6a0: 65 65 73 20 74 68 65 20 70 72 6f 63 65 73 73 65 ees the processe
d6b0: 73 2e 20 28 64 29 20 54 68 65 20 72 75 6c 65 20 s. (d) The rule
d6c0: 74 68 61 74 20 61 20 73 63 72 69 70 74 20 6d 75 that a script mu
d6d0: 73 74 20 6e 6f 74 20 68 6f 6c 64 20 61 20 72 65 st not hold a re
d6e0: 61 64 20 74 72 61 6e 73 61 63 74 69 6f 6e 20 77 ad transaction w
d6f0: 68 69 6c 65 20 73 6c 65 65 70 69 6e 67 20 63 6f hile sleeping co
d700: 6d 65 73 20 66 72 6f 6d 20 53 51 4c 69 74 65 27 mes from SQLite'
d710: 73 20 72 6f 6c 6c 62 61 63 6b 2d 6a 6f 75 72 6e s rollback-journ
d720: 61 6c 20 6c 6f 63 6b 69 6e 67 20 61 6e 64 20 68 al locking and h
d730: 6f 6f 6b 73 2e 6d 64 2c 20 6e 6f 74 20 66 72 6f ooks.md, not fro
d740: 6d 20 61 20 74 65 73 74 2e 20 28 65 29 20 49 20 m a test. (e) I
d750: 64 69 64 20 6e 6f 74 20 63 68 65 63 6b 20 70 72 did not check pr
d760: 6f 78 79 20 6f 72 20 61 6c 74 68 74 74 70 64 20 oxy or althttpd
d770: 74 69 6d 65 6f 75 74 73 20 69 6e 20 66 72 6f 6e timeouts in fron
d780: 74 20 6f 66 20 74 68 65 20 70 75 62 6c 69 63 20 t of the public
d790: 73 65 72 76 65 72 2c 20 6f 72 20 68 6f 77 20 61 server, or how a
d7a0: 20 6e 6f 64 65 20 77 6f 75 6c 64 20 6c 6f 67 20 node would log
d7b0: 69 6e 20 74 6f 20 2f 63 68 61 74 2d 70 6f 6c 6c in to /chat-poll
d7c0: 20 28 63 6f 6f 6b 69 65 20 68 61 6e 64 6c 69 6e (cookie handlin
d7d0: 67 29 20 66 72 6f 6d 20 61 20 73 63 72 69 70 74 g) from a script
d7e0: 2e 20 28 66 29 20 54 68 65 20 73 6f 75 72 63 65 . (f) The source
d7f0: 2d 6c 69 6e 65 20 55 52 4c 73 20 28 66 69 6c 65 -line URLs (file
d800: 3f 6e 61 6d 65 3d 2e 2e 2e 26 6c 6e 3d 2e 2e 2e ?name=...&ln=...
d810: 29 20 73 65 6e 64 20 61 75 74 6f 6d 61 74 65 64 ) send automated
d820: 20 66 65 74 63 68 65 72 73 20 6c 69 6b 65 20 63 fetchers like c
d830: 75 72 6c 20 74 6f 20 61 20 72 6f 62 6f 74 20 63 url to a robot c
d840: 68 65 63 6b 20 62 75 74 20 73 68 6f 75 6c 64 20 heck but should
d850: 6f 70 65 6e 20 69 6e 20 61 20 62 72 6f 77 73 65 open in a browse
d860: 72 2e 20 49 20 72 65 61 64 20 74 68 65 20 73 61 r. I read the sa
d870: 6d 65 20 66 69 6c 65 73 20 74 68 72 6f 75 67 68 me files through
d880: 20 2f 72 61 77 2f 3c 70 61 74 68 3e 3f 63 69 3d /raw/<path>?ci=
d890: 74 72 75 6e 6b 20 61 6e 64 20 74 68 65 20 32 63 trunk and the 2c
d8a0: 66 63 33 39 38 65 20 74 61 72 62 61 6c 6c 2e 20 fc398e tarball.
d8b0: 28 67 29 20 54 68 65 20 53 79 6e 63 74 68 69 6e (g) The Syncthin
d8c0: 67 20 66 6f 72 75 6d 20 74 68 72 65 61 64 2c 20 g forum thread,
d8d0: 54 61 69 6c 73 63 61 6c 65 20 61 6e 64 20 55 50 Tailscale and UP
d8e0: 6e 50 20 71 75 65 73 74 69 6f 6e 73 20 77 65 72 nP questions wer
d8f0: 65 20 6f 75 74 73 69 64 65 20 6d 79 20 70 61 72 e outside my par
d900: 74 3b 20 49 20 64 69 64 20 6e 6f 74 20 72 65 61 t; I did not rea
d910: 64 20 74 68 65 6d 2e 22 0a 7d 00 00 00 00 00 00 d them.".}......
d920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d960: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d970: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d990: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d9a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d9b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d9c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d9d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d9e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
d9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
da00: 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
da10: 65 61 72 63 68 2f 72 65 61 64 2d 68 6f 6c 65 70 earch/read-holep
da20: 75 6e 63 68 2e 6a 73 6f 6e 00 00 00 00 00 00 00 unch.json.......
da30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
da40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
da50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
da60: 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
da70: 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
da80: 30 30 34 31 35 36 37 00 31 35 32 36 35 34 31 31 0041567.15265411
da90: 33 37 31 00 30 31 37 35 37 36 00 20 30 00 00 00 371.017576. 0...
daa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
daf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db00: 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
db10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db20: 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
db30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
db90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dbb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dbc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dbd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dbe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dbf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
dc00: 7b 0a 20 22 70 6f 69 6e 74 73 22 3a 20 5b 0a 20 {. "points": [.
dc10: 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 {. "claim": "
dc20: 53 68 6f 72 74 20 61 6e 73 77 65 72 3a 20 74 77 Short answer: tw
dc30: 6f 20 70 65 65 72 73 20 74 68 61 74 20 61 72 65 o peers that are
dc40: 20 62 6f 74 68 20 62 65 68 69 6e 64 20 4e 41 54 both behind NAT
dc50: 20 67 65 6e 65 72 61 6c 6c 79 20 63 61 6e 6e 6f generally canno
dc60: 74 20 66 69 6e 64 20 65 61 63 68 20 6f 74 68 65 t find each othe
dc70: 72 20 75 6e 6c 65 73 73 20 73 6f 6d 65 20 74 68 r unless some th
dc80: 69 72 64 20 70 61 72 74 79 20 74 68 61 74 20 62 ird party that b
dc90: 6f 74 68 20 63 61 6e 20 72 65 61 63 68 20 69 73 oth can reach is
dca0: 20 69 6e 76 6f 6c 76 65 64 2e 20 48 6f 6c 65 20 involved. Hole
dcb0: 70 75 6e 63 68 69 6e 67 20 6f 6e 6c 79 20 77 6f punching only wo
dcc0: 72 6b 73 20 61 66 74 65 72 20 65 61 63 68 20 70 rks after each p
dcd0: 65 65 72 20 68 61 73 20 6c 65 61 72 6e 65 64 20 eer has learned
dce0: 74 68 65 20 6f 74 68 65 72 27 73 20 63 75 72 72 the other's curr
dcf0: 65 6e 74 20 70 75 62 6c 69 63 20 69 70 3a 70 6f ent public ip:po
dd00: 72 74 20 74 68 72 6f 75 67 68 20 61 20 73 65 72 rt through a ser
dd10: 76 65 72 20 62 6f 74 68 20 63 61 6e 20 72 65 61 ver both can rea
dd20: 63 68 2c 20 61 6e 64 20 62 6f 74 68 20 74 68 65 ch, and both the
dd30: 6e 20 73 65 6e 64 20 61 74 20 61 62 6f 75 74 20 n send at about
dd40: 74 68 65 20 73 61 6d 65 20 74 69 6d 65 2e 22 2c the same time.",
dd50: 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 52 . "source": "R
dd60: 46 43 20 35 31 32 38 20 c2 a7 33 2e 33 2c 20 68 FC 5128 §3.3, h
dd70: 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 ttps://www.rfc-e
dd80: 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 2f 72 66 ditor.org/rfc/rf
dd90: 63 35 31 32 38 2e 68 74 6d 6c 3a 20 5c 22 52 65 c5128.html: \"Re
dda0: 6e 64 65 7a 76 6f 75 73 20 53 65 72 76 65 72 20 ndezvous Server
ddb0: 53 20 68 61 73 20 61 20 70 75 62 6c 69 63 6c 79 S has a publicly
ddc0: 20 61 64 64 72 65 73 73 61 62 6c 65 20 49 50 20 addressable IP
ddd0: 61 64 64 72 65 73 73 20 61 6e 64 20 69 73 20 75 address and is u
dde0: 73 65 64 20 66 6f 72 20 74 68 65 20 70 75 72 70 sed for the purp
ddf0: 6f 73 65 73 20 6f 66 20 72 65 67 69 73 74 72 61 oses of registra
de00: 74 69 6f 6e 2c 20 64 69 73 63 6f 76 65 72 79 2c tion, discovery,
de10: 20 61 6e 64 20 6c 69 6d 69 74 65 64 20 72 65 6c and limited rel
de20: 61 79 2e 5c 22 20 46 6f 72 64 2f 53 72 69 73 75 ay.\" Ford/Srisu
de30: 72 65 73 68 2f 4b 65 67 65 6c 2c 20 68 74 74 70 resh/Kegel, http
de40: 73 3a 2f 2f 62 66 6f 72 64 2e 69 6e 66 6f 2f 70 s://bford.info/p
de50: 75 62 2f 6e 65 74 2f 70 32 70 6e 61 74 2f 3a 20 ub/net/p2pnat/:
de60: 62 6f 74 68 20 63 6c 69 65 6e 74 73 20 6d 75 73 both clients mus
de70: 74 20 61 6c 72 65 61 64 79 20 68 6f 6c 64 20 5c t already hold \
de80: 22 61 63 74 69 76 65 20 55 44 50 20 73 65 73 73 "active UDP sess
de90: 69 6f 6e 73 20 77 69 74 68 20 61 20 72 65 6e 64 ions with a rend
dea0: 65 7a 76 6f 75 73 20 73 65 72 76 65 72 5c 22 2e ezvous server\".
deb0: 20 54 61 69 6c 73 63 61 6c 65 2c 20 68 74 74 70 Tailscale, http
dec0: 73 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e 63 6f s://tailscale.co
ded0: 6d 2f 62 6c 6f 67 2f 68 6f 77 2d 6e 61 74 2d 74 m/blog/how-nat-t
dee0: 72 61 76 65 72 73 61 6c 2d 77 6f 72 6b 73 20 28 raversal-works (
def0: 73 65 63 74 69 6f 6e 20 5c 22 46 69 6e 65 73 73 section \"Finess
df00: 69 6e 67 20 66 69 6e 69 63 6b 79 20 66 69 72 65 ing finicky fire
df10: 77 61 6c 6c 73 5c 22 29 3a 20 5c 22 42 6f 74 68 walls\"): \"Both
df20: 20 65 6e 64 70 6f 69 6e 74 73 20 6d 75 73 74 20 endpoints must
df30: 61 74 74 65 6d 70 74 20 63 6f 6d 6d 75 6e 69 63 attempt communic
df40: 61 74 69 6f 6e 20 61 74 20 72 6f 75 67 68 6c 79 ation at roughly
df50: 20 74 68 65 20 73 61 6d 65 20 74 69 6d 65 2c 20 the same time,
df60: 73 6f 20 74 68 61 74 20 61 6c 6c 20 74 68 65 20 so that all the
df70: 69 6e 74 65 72 6d 65 64 69 61 74 65 20 66 69 72 intermediate fir
df80: 65 77 61 6c 6c 73 20 6f 70 65 6e 20 75 70 20 77 ewalls open up w
df90: 68 69 6c 65 20 62 6f 74 68 20 70 65 65 72 73 20 hile both peers
dfa0: 61 72 65 20 73 74 69 6c 6c 20 61 72 6f 75 6e 64 are still around
dfb0: 2e 5c 22 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 .\"". },. {.
dfc0: 20 22 63 6c 61 69 6d 22 3a 20 22 54 68 65 20 73 "claim": "The s
dfd0: 74 61 6e 64 61 72 64 73 20 6c 65 61 76 65 20 61 tandards leave a
dfe0: 64 64 72 65 73 73 20 65 78 63 68 61 6e 67 65 20 ddress exchange
dff0: 74 6f 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c 73 to something els
e000: 65 2e 20 49 43 45 20 64 6f 65 73 20 6e 6f 74 20 e. ICE does not
e010: 70 72 6f 76 69 64 65 20 69 74 2c 20 61 6e 64 20 provide it, and
e020: 53 54 55 4e 20 6f 6e 20 69 74 73 20 6f 77 6e 20 STUN on its own
e030: 69 73 20 6e 6f 74 20 61 20 4e 41 54 20 74 72 61 is not a NAT tra
e040: 76 65 72 73 61 6c 20 6d 65 74 68 6f 64 2e 20 41 versal method. A
e050: 6e 79 20 68 6f 6c 65 2d 70 75 6e 63 68 69 6e 67 ny hole-punching
e060: 20 64 65 73 69 67 6e 20 66 6f 72 20 4f 43 58 20 design for OCX
e070: 68 61 73 20 74 6f 20 73 75 70 70 6c 79 20 69 74 has to supply it
e080: 73 20 6f 77 6e 20 63 68 61 6e 6e 65 6c 20 66 6f s own channel fo
e090: 72 20 65 78 63 68 61 6e 67 69 6e 67 20 61 64 64 r exchanging add
e0a0: 72 65 73 73 65 73 2e 22 2c 0a 20 20 20 22 73 6f resses.",. "so
e0b0: 75 72 63 65 22 3a 20 22 52 46 43 20 38 34 34 35 urce": "RFC 8445
e0c0: 20 c2 a7 31 2c 20 68 74 74 70 73 3a 2f 2f 77 77 §1, https://ww
e0d0: 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 67 w.rfc-editor.org
e0e0: 2f 72 66 63 2f 72 66 63 38 34 34 35 2e 68 74 6d /rfc/rfc8445.htm
e0f0: 6c 3a 20 5c 22 49 43 45 20 69 73 20 6e 6f 74 20 l: \"ICE is not
e100: 69 6e 74 65 6e 64 65 64 20 66 6f 72 20 4e 41 54 intended for NAT
e110: 20 74 72 61 76 65 72 73 61 6c 20 66 6f 72 20 74 traversal for t
e120: 68 65 20 73 69 67 6e 61 6c 69 6e 67 20 70 72 6f he signaling pro
e130: 74 6f 63 6f 6c 2c 20 77 68 69 63 68 20 69 73 20 tocol, which is
e140: 61 73 73 75 6d 65 64 20 74 6f 20 62 65 20 70 72 assumed to be pr
e150: 6f 76 69 64 65 64 20 76 69 61 20 61 6e 6f 74 68 ovided via anoth
e160: 65 72 20 6d 65 63 68 61 6e 69 73 6d 5c 22 20 61 er mechanism\" a
e170: 6e 64 20 5c 22 45 61 63 68 20 49 43 45 20 75 73 nd \"Each ICE us
e180: 61 67 65 20 4d 55 53 54 20 64 65 66 69 6e 65 20 age MUST define
e190: 68 6f 77 20 74 68 65 20 69 6e 66 6f 72 6d 61 74 how the informat
e1a0: 69 6f 6e 20 69 73 20 65 78 63 68 61 6e 67 65 64 ion is exchanged
e1b0: 5c 22 2e 20 52 46 43 20 38 34 38 39 20 41 62 73 \". RFC 8489 Abs
e1c0: 74 72 61 63 74 2c 20 68 74 74 70 73 3a 2f 2f 77 tract, https://w
e1d0: 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 ww.rfc-editor.or
e1e0: 67 2f 72 66 63 2f 72 66 63 38 34 38 39 2e 68 74 g/rfc/rfc8489.ht
e1f0: 6d 6c 3a 20 5c 22 53 54 55 4e 20 69 73 20 6e 6f ml: \"STUN is no
e200: 74 20 61 20 4e 41 54 20 74 72 61 76 65 72 73 61 t a NAT traversa
e210: 6c 20 73 6f 6c 75 74 69 6f 6e 20 62 79 20 69 74 l solution by it
e220: 73 65 6c 66 2e 20 52 61 74 68 65 72 2c 20 69 74 self. Rather, it
e230: 20 69 73 20 61 20 74 6f 6f 6c 20 74 6f 20 62 65 is a tool to be
e240: 20 75 73 65 64 20 69 6e 20 74 68 65 20 63 6f 6e used in the con
e250: 74 65 78 74 20 6f 66 20 61 20 4e 41 54 20 74 72 text of a NAT tr
e260: 61 76 65 72 73 61 6c 20 73 6f 6c 75 74 69 6f 6e aversal solution
e270: 2e 5c 22 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 .\"". },. {.
e280: 20 22 63 6c 61 69 6d 22 3a 20 22 54 68 65 20 63 "claim": "The c
e290: 61 73 65 73 20 74 68 61 74 20 6e 65 65 64 20 6e ases that need n
e2a0: 6f 20 6c 69 76 65 20 74 68 69 72 64 20 70 61 72 o live third par
e2b0: 74 79 20 61 72 65 20 6e 61 72 72 6f 77 2e 20 28 ty are narrow. (
e2c0: 61 29 20 4f 6e 65 20 70 65 65 72 20 69 73 20 64 a) One peer is d
e2d0: 69 72 65 63 74 6c 79 20 72 65 61 63 68 61 62 6c irectly reachabl
e2e0: 65 20 28 61 20 70 75 62 6c 69 63 20 61 64 64 72 e (a public addr
e2f0: 65 73 73 20 77 69 74 68 20 69 6e 62 6f 75 6e 64 ess with inbound
e300: 20 74 72 61 66 66 69 63 20 61 6c 6c 6f 77 65 64 traffic allowed
e310: 2c 20 6f 72 20 61 20 70 6f 72 74 20 66 6f 72 77 , or a port forw
e320: 61 72 64 29 20 61 6e 64 20 74 68 65 20 6f 74 68 ard) and the oth
e330: 65 72 20 61 6c 72 65 61 64 79 20 6b 6e 6f 77 73 er already knows
e340: 20 74 68 61 74 20 61 64 64 72 65 73 73 2e 20 54 that address. T
e350: 68 61 74 20 69 73 20 6f 72 64 69 6e 61 72 79 20 hat is ordinary
e360: 63 6c 69 65 6e 74 20 61 6e 64 20 73 65 72 76 65 client and serve
e370: 72 2e 20 28 62 29 20 70 77 6e 61 74 20 63 6c 61 r. (b) pwnat cla
e380: 69 6d 73 20 68 6f 6c 65 20 70 75 6e 63 68 69 6e ims hole punchin
e390: 67 20 77 69 74 68 20 5c 22 6e 6f 20 33 72 64 20 g with \"no 3rd
e3a0: 70 61 72 74 79 5c 22 2c 20 62 75 74 20 6f 6e 6c party\", but onl
e3b0: 79 20 77 68 65 6e 20 74 68 65 20 63 6c 69 65 6e y when the clien
e3c0: 74 20 61 6c 72 65 61 64 79 20 6b 6e 6f 77 73 20 t already knows
e3d0: 74 68 65 20 73 65 72 76 65 72 27 73 20 70 75 62 the server's pub
e3e0: 6c 69 63 20 49 50 2e 20 49 74 20 75 73 65 73 20 lic IP. It uses
e3f0: 61 6e 20 49 43 4d 50 20 74 72 69 63 6b 20 61 6e an ICMP trick an
e400: 64 20 77 6f 72 6b 73 20 62 65 68 69 6e 64 20 5c d works behind \
e410: 22 6d 61 6e 79 20 4e 41 54 73 20 61 6e 64 20 66 "many NATs and f
e420: 69 72 65 77 61 6c 6c 73 2c 20 62 75 74 20 6e 6f irewalls, but no
e430: 74 20 61 6c 6c 5c 22 2e 20 49 6e 20 62 6f 74 68 t all\". In both
e440: 20 63 61 73 65 73 20 74 68 65 20 61 64 64 72 65 cases the addre
e450: 73 73 20 73 74 69 6c 6c 20 68 61 64 20 74 6f 20 ss still had to
e460: 62 65 20 6c 65 61 72 6e 65 64 20 62 65 66 6f 72 be learned befor
e470: 65 68 61 6e 64 2e 22 2c 0a 20 20 20 22 73 6f 75 ehand.",. "sou
e480: 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 67 rce": "https://g
e490: 69 74 68 75 62 2e 63 6f 6d 2f 73 61 6d 79 6b 2f ithub.com/samyk/
e4a0: 70 77 6e 61 74 20 28 52 45 41 44 4d 45 29 3a 20 pwnat (README):
e4b0: 5c 22 54 68 65 20 6f 6e 6c 79 20 74 6f 6f 6c 2f \"The only tool/
e4c0: 74 65 63 68 6e 69 71 75 65 20 74 6f 20 70 75 6e technique to pun
e4d0: 63 68 20 68 6f 6c 65 73 20 74 68 72 6f 75 67 68 ch holes through
e4e0: 20 66 69 72 65 77 61 6c 6c 73 2f 4e 41 54 73 20 firewalls/NATs
e4f0: 77 68 65 72 65 20 6d 75 6c 74 69 70 6c 65 20 63 where multiple c
e500: 6c 69 65 6e 74 73 20 26 20 73 65 72 76 65 72 20 lients & server
e510: 63 61 6e 20 62 65 20 62 65 68 69 6e 64 20 73 65 can be behind se
e520: 70 61 72 61 74 65 20 4e 41 54 73 20 77 69 74 68 parate NATs with
e530: 6f 75 74 20 61 6e 79 20 33 72 64 20 70 61 72 74 out any 3rd part
e540: 79 20 69 6e 76 6f 6c 76 65 6d 65 6e 74 5c 22 2e y involvement\".
e550: 20 49 74 20 72 65 71 75 69 72 65 73 20 74 68 65 It requires the
e560: 20 63 6c 69 65 6e 74 20 74 6f 20 6b 6e 6f 77 20 client to know
e570: 74 68 65 20 73 65 72 76 65 72 27 73 20 70 75 62 the server's pub
e580: 6c 69 63 20 49 50 20 61 6e 64 20 77 6f 72 6b 73 lic IP and works
e590: 20 5c 22 62 65 68 69 6e 64 20 6d 61 6e 79 20 4e \"behind many N
e5a0: 41 54 73 20 61 6e 64 20 66 69 72 65 77 61 6c 6c ATs and firewall
e5b0: 73 2c 20 62 75 74 20 6e 6f 74 20 61 6c 6c 5c 22 s, but not all\"
e5c0: 2e 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 .". },. {. "
e5d0: 63 6c 61 69 6d 22 3a 20 22 54 68 65 20 74 68 69 claim": "The thi
e5e0: 72 64 20 70 61 72 74 79 20 6d 75 73 74 20 64 6f rd party must do
e5f0: 20 74 77 6f 20 74 68 69 6e 67 73 20 61 74 20 6d two things at m
e600: 69 6e 69 6d 75 6d 2e 20 28 31 29 20 43 61 72 72 inimum. (1) Carr
e610: 79 20 61 20 66 65 77 20 6b 69 6c 6f 62 79 74 65 y a few kilobyte
e620: 73 20 6f 66 20 61 64 64 72 65 73 73 20 6c 69 73 s of address lis
e630: 74 73 20 62 65 74 77 65 65 6e 20 74 68 65 20 70 ts between the p
e640: 65 65 72 73 2c 20 77 69 74 68 20 61 20 66 65 77 eers, with a few
e650: 20 73 65 63 6f 6e 64 73 20 6f 66 20 64 65 6c 61 seconds of dela
e660: 79 20 61 74 20 6d 6f 73 74 2e 20 28 32 29 20 54 y at most. (2) T
e670: 65 6c 6c 20 65 61 63 68 20 70 65 65 72 20 74 68 ell each peer th
e680: 65 20 70 75 62 6c 69 63 20 69 70 3a 70 6f 72 74 e public ip:port
e690: 20 69 74 73 20 4e 41 54 20 67 61 76 65 20 69 74 its NAT gave it
e6a0: 2e 20 54 68 61 74 20 73 65 63 6f 6e 64 20 6a 6f . That second jo
e6b0: 62 20 69 73 20 61 20 53 54 55 4e 20 42 69 6e 64 b is a STUN Bind
e6c0: 69 6e 67 3a 20 74 68 65 20 73 65 72 76 65 72 20 ing: the server
e6d0: 63 6f 70 69 65 73 20 74 68 65 20 73 6f 75 72 63 copies the sourc
e6e0: 65 20 61 64 64 72 65 73 73 20 69 74 20 73 65 65 e address it see
e6f0: 73 20 69 6e 74 6f 20 74 68 65 20 72 65 70 6c 79 s into the reply
e700: 2e 20 41 20 62 61 73 69 63 20 53 54 55 4e 20 73 . A basic STUN s
e710: 65 72 76 65 72 20 6e 65 65 64 73 20 6f 6e 6c 79 erver needs only
e720: 20 74 68 65 20 42 69 6e 64 69 6e 67 20 6d 65 74 the Binding met
e730: 68 6f 64 20 61 6e 64 20 6e 6f 20 63 72 65 64 65 hod and no crede
e740: 6e 74 69 61 6c 73 2e 20 52 65 6c 61 79 69 6e 67 ntials. Relaying
e750: 20 74 68 65 20 64 61 74 61 20 69 74 73 65 6c 66 the data itself
e760: 20 69 73 20 6f 70 74 69 6f 6e 61 6c 20 61 6e 64 is optional and
e770: 20 69 73 20 6e 65 65 64 65 64 20 6f 6e 6c 79 20 is needed only
e780: 77 68 65 6e 20 68 6f 6c 65 20 70 75 6e 63 68 69 when hole punchi
e790: 6e 67 20 66 61 69 6c 73 2e 22 2c 0a 20 20 20 22 ng fails.",. "
e7a0: 73 6f 75 72 63 65 22 3a 20 22 54 61 69 6c 73 63 source": "Tailsc
e7b0: 61 6c 65 2c 20 68 74 74 70 73 3a 2f 2f 74 61 69 ale, https://tai
e7c0: 6c 73 63 61 6c 65 2e 63 6f 6d 2f 62 6c 6f 67 2f lscale.com/blog/
e7d0: 68 6f 77 2d 6e 61 74 2d 74 72 61 76 65 72 73 61 how-nat-traversa
e7e0: 6c 2d 77 6f 72 6b 73 3a 20 74 68 65 20 73 69 64 l-works: the sid
e7f0: 65 20 63 68 61 6e 6e 65 6c 20 5c 22 64 6f 65 73 e channel \"does
e800: 6e 27 74 20 6e 65 65 64 20 74 6f 20 62 65 20 76 n't need to be v
e810: 65 72 79 20 66 61 6e 63 79 3a 20 69 74 20 63 61 ery fancy: it ca
e820: 6e 20 68 61 76 65 20 61 20 66 65 77 20 73 65 63 n have a few sec
e830: 6f 6e 64 73 20 6f 66 20 6c 61 74 65 6e 63 79 2c onds of latency,
e840: 20 61 6e 64 20 6f 6e 6c 79 20 6e 65 65 64 73 20 and only needs
e850: 74 6f 20 64 65 6c 69 76 65 72 20 61 20 66 65 77 to deliver a few
e860: 20 74 68 6f 75 73 61 6e 64 20 62 79 74 65 73 20 thousand bytes
e870: 69 6e 20 74 6f 74 61 6c 2c 20 73 6f 20 61 20 74 in total, so a t
e880: 69 6e 79 20 56 4d 20 63 61 6e 20 65 61 73 69 6c iny VM can easil
e890: 79 20 62 65 20 61 20 6d 61 74 63 68 6d 61 6b 65 y be a matchmake
e8a0: 72 20 66 6f 72 20 74 68 6f 75 73 61 6e 64 73 20 r for thousands
e8b0: 6f 66 20 6d 61 63 68 69 6e 65 73 2e 5c 22 20 52 of machines.\" R
e8c0: 46 43 20 38 34 38 39 20 c2 a7 32 20 28 58 4f 52 FC 8489 §2 (XOR
e8d0: 2d 4d 41 50 50 45 44 2d 41 44 44 52 45 53 53 20 -MAPPED-ADDRESS
e8e0: 63 61 72 72 69 65 73 20 5c 22 74 68 65 20 73 6f carries \"the so
e8f0: 75 72 63 65 20 74 72 61 6e 73 70 6f 72 74 20 61 urce transport a
e900: 64 64 72 65 73 73 20 6f 66 20 74 68 65 20 72 65 ddress of the re
e910: 71 75 65 73 74 20 6d 65 73 73 61 67 65 5c 22 29 quest message\")
e920: 20 61 6e 64 20 c2 a7 31 32 20 28 61 20 62 61 73 and §12 (a bas
e930: 69 63 20 73 65 72 76 65 72 20 5c 22 4d 55 53 54 ic server \"MUST
e940: 20 73 75 70 70 6f 72 74 20 74 68 65 20 42 69 6e support the Bin
e950: 64 69 6e 67 20 6d 65 74 68 6f 64 5c 22 20 61 6e ding method\" an
e960: 64 20 5c 22 53 48 4f 55 4c 44 20 4e 4f 54 20 75 d \"SHOULD NOT u
e970: 74 69 6c 69 7a 65 20 74 68 65 20 73 68 6f 72 74 tilize the short
e980: 2d 74 65 72 6d 20 6f 72 20 6c 6f 6e 67 2d 74 65 -term or long-te
e990: 72 6d 20 63 72 65 64 65 6e 74 69 61 6c 20 6d 65 rm credential me
e9a0: 63 68 61 6e 69 73 6d 5c 22 29 2e 20 52 46 43 20 chanism\"). RFC
e9b0: 38 36 35 36 20 c2 a7 31 2c 20 68 74 74 70 73 3a 8656 §1, https:
e9c0: 2f 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 //www.rfc-editor
e9d0: 2e 6f 72 67 2f 72 66 63 2f 72 66 63 38 36 35 36 .org/rfc/rfc8656
e9e0: 2e 68 74 6d 6c 3a 20 5c 22 49 74 20 69 73 20 62 .html: \"It is b
e9f0: 65 73 74 20 74 6f 20 75 73 65 20 61 20 54 55 52 est to use a TUR
ea00: 4e 20 73 65 72 76 65 72 20 6f 6e 6c 79 20 77 68 N server only wh
ea10: 65 6e 20 61 20 64 69 72 65 63 74 20 63 6f 6d 6d en a direct comm
ea20: 75 6e 69 63 61 74 69 6f 6e 20 70 61 74 68 20 63 unication path c
ea30: 61 6e 6e 6f 74 20 62 65 20 66 6f 75 6e 64 2e 5c annot be found.\
ea40: 22 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 "". },. {. "
ea50: 63 6c 61 69 6d 22 3a 20 22 57 68 65 6e 20 62 6f claim": "When bo
ea60: 74 68 20 4e 41 54 73 20 67 69 76 65 20 61 20 64 th NATs give a d
ea70: 69 66 66 65 72 65 6e 74 20 70 75 62 6c 69 63 20 ifferent public
ea80: 70 6f 72 74 20 66 6f 72 20 65 61 63 68 20 64 65 port for each de
ea90: 73 74 69 6e 61 74 69 6f 6e 20 28 74 68 65 20 6f stination (the o
eaa0: 6c 64 20 6e 61 6d 65 20 77 61 73 20 27 73 79 6d ld name was 'sym
eab0: 6d 65 74 72 69 63 27 3b 20 52 46 43 20 34 37 38 metric'; RFC 478
eac0: 37 20 63 61 6c 6c 73 20 69 74 20 61 64 64 72 65 7 calls it addre
ead0: 73 73 2d 64 65 70 65 6e 64 65 6e 74 20 6f 72 20 ss-dependent or
eae0: 61 64 64 72 65 73 73 2d 61 6e 64 2d 70 6f 72 74 address-and-port
eaf0: 2d 64 65 70 65 6e 64 65 6e 74 20 6d 61 70 70 69 -dependent mappi
eb00: 6e 67 29 2c 20 68 6f 6c 65 20 70 75 6e 63 68 69 ng), hole punchi
eb10: 6e 67 20 70 72 61 63 74 69 63 61 6c 6c 79 20 66 ng practically f
eb20: 61 69 6c 73 20 61 6e 64 20 64 61 74 61 20 6d 75 ails and data mu
eb30: 73 74 20 67 6f 20 74 68 72 6f 75 67 68 20 61 20 st go through a
eb40: 72 65 6c 61 79 2e 20 49 66 20 6f 6e 6c 79 20 6f relay. If only o
eb50: 6e 65 20 73 69 64 65 20 69 73 20 6c 69 6b 65 20 ne side is like
eb60: 74 68 69 73 2c 20 61 20 70 72 6f 62 69 6e 67 20 this, a probing
eb70: 74 72 69 63 6b 20 74 68 61 74 20 75 73 65 73 20 trick that uses
eb80: 74 68 65 20 62 69 72 74 68 64 61 79 20 70 61 72 the birthday par
eb90: 61 64 6f 78 20 75 73 75 61 6c 6c 79 20 67 65 74 adox usually get
eba0: 73 20 74 68 72 6f 75 67 68 20 69 6e 20 73 65 63 s through in sec
ebb0: 6f 6e 64 73 2e 20 49 66 20 62 6f 74 68 20 73 69 onds. If both si
ebc0: 64 65 73 20 61 72 65 2c 20 69 74 20 74 61 6b 65 des are, it take
ebd0: 73 20 61 62 6f 75 74 20 31 37 30 2c 30 30 30 20 s about 170,000
ebe0: 70 72 6f 62 65 73 20 6f 6e 20 65 61 63 68 20 73 probes on each s
ebf0: 69 64 65 2c 20 72 6f 75 67 68 6c 79 20 32 38 20 ide, roughly 28
ec00: 6d 69 6e 75 74 65 73 2e 22 2c 0a 20 20 20 22 73 minutes.",. "s
ec10: 6f 75 72 63 65 22 3a 20 22 52 46 43 20 38 36 35 ource": "RFC 865
ec20: 36 20 c2 a7 31 3a 20 5c 22 49 66 20 62 6f 74 68 6 §1: \"If both
ec30: 20 68 6f 73 74 73 20 61 72 65 20 62 65 68 69 6e hosts are behin
ec40: 64 20 4e 41 54 73 20 74 68 61 74 20 68 61 76 65 d NATs that have
ec50: 20 61 20 6d 61 70 70 69 6e 67 20 62 65 68 61 76 a mapping behav
ec60: 69 6f 72 20 6f 66 20 27 61 64 64 72 65 73 73 2d ior of 'address-
ec70: 64 65 70 65 6e 64 65 6e 74 20 6d 61 70 70 69 6e dependent mappin
ec80: 67 27 20 6f 72 20 27 61 64 64 72 65 73 73 2d 20 g' or 'address-
ec90: 61 6e 64 20 70 6f 72 74 2d 64 65 70 65 6e 64 65 and port-depende
eca0: 6e 74 20 6d 61 70 70 69 6e 67 27 2e 2e 2e 20 68 nt mapping'... h
ecb0: 6f 6c 65 20 70 75 6e 63 68 69 6e 67 20 74 65 63 ole punching tec
ecc0: 68 6e 69 71 75 65 73 20 67 65 6e 65 72 61 6c 6c hniques generall
ecd0: 79 20 66 61 69 6c 2e 5c 22 20 52 46 43 20 34 37 y fail.\" RFC 47
ece0: 38 37 20 52 45 51 2d 31 2c 20 68 74 74 70 73 3a 87 REQ-1, https:
ecf0: 2f 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 //www.rfc-editor
ed00: 2e 6f 72 67 2f 72 66 63 2f 72 66 63 34 37 38 37 .org/rfc/rfc4787
ed10: 2e 68 74 6d 6c 3a 20 5c 22 46 61 69 6c 75 72 65 .html: \"Failure
ed20: 20 74 6f 20 6d 65 65 74 20 52 45 51 2d 31 20 77 to meet REQ-1 w
ed30: 69 6c 6c 20 66 6f 72 63 65 20 74 68 65 20 75 73 ill force the us
ed40: 65 20 6f 66 20 61 20 55 44 50 20 72 65 6c 61 79 e of a UDP relay
ed50: 5c 22 2e 20 54 61 69 6c 73 63 61 6c 65 20 28 5c \". Tailscale (\
ed60: 22 54 68 65 20 62 65 6e 65 66 69 74 73 20 6f 66 "The benefits of
ed70: 20 62 69 72 74 68 64 61 79 73 5c 22 29 3a 20 77 birthdays\"): w
ed80: 69 74 68 20 6f 6e 65 20 68 61 72 64 20 73 69 64 ith one hard sid
ed90: 65 2c 20 5c 22 68 61 6c 66 20 74 68 65 20 74 69 e, \"half the ti
eda0: 6d 65 20 77 65 27 6c 6c 20 67 65 74 20 74 68 72 me we'll get thr
edb0: 6f 75 67 68 20 69 6e 20 75 6e 64 65 72 20 32 20 ough in under 2
edc0: 73 65 63 6f 6e 64 73 5c 22 2e 20 57 69 74 68 20 seconds\". With
edd0: 62 6f 74 68 20 73 69 64 65 73 20 68 61 72 64 2c both sides hard,
ede0: 20 5c 22 54 6f 20 68 69 74 20 61 20 39 39 2e 39 \"To hit a 99.9
edf0: 25 20 63 68 61 6e 63 65 20 6f 66 20 73 75 63 63 % chance of succ
ee00: 65 73 73 2c 20 77 65 20 6e 65 65 64 20 65 61 63 ess, we need eac
ee10: 68 20 73 69 64 65 20 74 6f 20 73 65 6e 64 20 31 h side to send 1
ee20: 37 30 2c 30 30 30 20 70 72 6f 62 65 73 2e 20 41 70,000 probes. A
ee30: 74 20 31 30 30 20 70 61 63 6b 65 74 73 2f 73 65 t 100 packets/se
ee40: 63 2c 20 74 68 61 74 27 73 20 32 38 20 6d 69 6e c, that's 28 min
ee50: 75 74 65 73 5c 22 2e 22 0a 20 20 7d 2c 0a 20 20 utes\".". },.
ee60: 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 48 {. "claim": "H
ee70: 6f 77 20 6f 66 74 65 6e 20 68 6f 6c 65 20 70 75 ow often hole pu
ee80: 6e 63 68 69 6e 67 20 66 61 69 6c 73 3a 20 74 68 nching fails: th
ee90: 65 20 6f 6e 65 20 6c 61 72 67 65 2c 20 72 65 63 e one large, rec
eea0: 65 6e 74 20 6d 65 61 73 75 72 65 6d 65 6e 74 20 ent measurement
eeb0: 28 6c 69 62 70 32 70 20 69 6e 20 49 50 46 53 29 (libp2p in IPFS)
eec0: 20 66 6f 75 6e 64 20 61 62 6f 75 74 20 37 30 25 found about 70%
eed0: 20 73 75 63 63 65 73 73 2c 20 70 6c 75 73 20 6f success, plus o
eee0: 72 20 6d 69 6e 75 73 20 37 25 2e 20 4f 6c 64 65 r minus 7%. Olde
eef0: 72 20 61 6e 64 20 69 6e 66 6f 72 6d 61 6c 20 66 r and informal f
ef00: 69 67 75 72 65 73 20 61 72 65 20 68 69 67 68 65 igures are highe
ef10: 72 2e 20 50 6c 61 6e 20 6f 6e 20 72 6f 75 67 68 r. Plan on rough
ef20: 6c 79 20 31 20 69 6e 20 31 30 20 74 6f 20 31 20 ly 1 in 10 to 1
ef30: 69 6e 20 33 20 70 61 69 72 73 20 6f 66 20 6e 6f in 3 pairs of no
ef40: 64 65 73 20 6e 65 65 64 69 6e 67 20 61 20 72 65 des needing a re
ef50: 6c 61 79 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 lay.",. "sourc
ef60: 65 22 3a 20 22 54 72 61 75 74 77 65 69 6e 20 65 e": "Trautwein e
ef70: 74 20 61 6c 2e 2c 20 61 72 58 69 76 20 32 35 31 t al., arXiv 251
ef80: 30 2e 32 37 35 30 30 20 28 32 30 32 35 2d 31 30 0.27500 (2025-10
ef90: 2d 33 31 29 2c 20 68 74 74 70 73 3a 2f 2f 61 72 -31), https://ar
efa0: 78 69 76 2e 6f 72 67 2f 61 62 73 2f 32 35 31 30 xiv.org/abs/2510
efb0: 2e 32 37 35 30 30 2c 20 61 6e 64 20 61 72 58 69 .27500, and arXi
efc0: 76 20 32 36 30 34 2e 31 32 34 38 34 20 28 32 30 v 2604.12484 (20
efd0: 32 36 2d 30 34 2d 31 34 29 2c 20 68 74 74 70 73 26-04-14), https
efe0: 3a 2f 2f 61 72 78 69 76 2e 6f 72 67 2f 61 62 73 ://arxiv.org/abs
eff0: 2f 32 36 30 34 2e 31 32 34 38 34 3a 20 5c 22 61 /2604.12484: \"a
f000: 20 63 6f 6e 64 69 74 69 6f 6e 61 6c 20 73 75 63 conditional suc
f010: 63 65 73 73 20 72 61 74 65 20 6f 66 20 37 30 25 cess rate of 70%
f020: 20 c2 b1 20 37 2e 31 25 20 66 6f 72 20 74 68 65 ± 7.1% for the
f030: 20 68 6f 6c 65 2d 70 75 6e 63 68 69 6e 67 20 73 hole-punching s
f040: 74 61 67 65 2c 20 67 69 76 65 6e 20 74 68 61 74 tage, given that
f050: 20 70 72 65 72 65 71 75 69 73 69 74 65 20 72 65 prerequisite re
f060: 6c 61 79 20 72 65 73 65 72 76 61 74 69 6f 6e 20 lay reservation
f070: 61 6e 64 20 70 75 62 6c 69 63 20 61 64 64 72 65 and public addre
f080: 73 73 20 64 69 73 63 6f 76 65 72 79 20 73 75 63 ss discovery suc
f090: 63 65 65 64 5c 22 2c 20 66 72 6f 6d 20 34 2e 34 ceed\", from 4.4
f0a0: 20 6d 69 6c 6c 69 6f 6e 20 61 74 74 65 6d 70 74 million attempt
f0b0: 73 2c 20 77 69 74 68 20 54 43 50 20 61 6e 64 20 s, with TCP and
f0c0: 51 55 49 43 20 5c 22 73 74 61 74 69 73 74 69 63 QUIC \"statistic
f0d0: 61 6c 6c 79 20 69 6e 64 69 73 74 69 6e 67 75 69 ally indistingui
f0e0: 73 68 61 62 6c 65 20 28 7e 37 30 25 29 5c 22 2e shable (~70%)\".
f0f0: 20 46 6f 72 64 20 65 74 20 61 6c 2e 2c 20 68 74 Ford et al., ht
f100: 74 70 73 3a 2f 2f 62 66 6f 72 64 2e 69 6e 66 6f tps://bford.info
f110: 2f 70 75 62 2f 6e 65 74 2f 70 32 70 6e 61 74 2f /pub/net/p2pnat/
f120: 3a 20 5c 22 41 62 6f 75 74 20 38 32 25 20 6f 66 : \"About 82% of
f130: 20 74 68 65 20 4e 41 54 73 20 74 65 73 74 65 64 the NATs tested
f140: 20 73 75 70 70 6f 72 74 20 68 6f 6c 65 20 70 75 support hole pu
f150: 6e 63 68 69 6e 67 20 66 6f 72 20 55 44 50 2c 20 nching for UDP,
f160: 61 6e 64 20 61 62 6f 75 74 20 36 34 25 20 73 75 and about 64% su
f170: 70 70 6f 72 74 20 68 6f 6c 65 20 70 75 6e 63 68 pport hole punch
f180: 69 6e 67 20 66 6f 72 20 54 43 50 20 73 74 72 65 ing for TCP stre
f190: 61 6d 73 2e 5c 22 20 54 61 69 6c 73 63 61 6c 65 ams.\" Tailscale
f1a0: 3a 20 5c 22 49 27 64 20 65 73 74 69 6d 61 74 65 : \"I'd estimate
f1b0: 20 79 6f 75 20 63 6f 75 6c 64 20 67 65 74 20 61 you could get a
f1c0: 20 64 69 72 65 63 74 20 63 6f 6e 6e 65 63 74 69 direct connecti
f1d0: 6f 6e 20 6f 76 65 72 20 39 30 25 20 6f 66 20 74 on over 90% of t
f1e0: 68 65 20 74 69 6d 65 5c 22 20 28 61 6e 20 65 73 he time\" (an es
f1f0: 74 69 6d 61 74 65 2c 20 6e 6f 74 20 61 20 6d 65 timate, not a me
f200: 61 73 75 72 65 6d 65 6e 74 29 2e 22 0a 20 20 7d asurement).". }
f210: 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 ,. {. "claim"
f220: 3a 20 22 43 61 72 72 69 65 72 2d 67 72 61 64 65 : "Carrier-grade
f230: 20 4e 41 54 20 28 61 6e 20 49 53 50 20 73 68 61 NAT (an ISP sha
f240: 72 69 6e 67 20 6f 6e 65 20 49 50 76 34 20 61 64 ring one IPv4 ad
f250: 64 72 65 73 73 20 61 6d 6f 6e 67 20 6d 61 6e 79 dress among many
f260: 20 63 75 73 74 6f 6d 65 72 73 29 20 69 73 20 63 customers) is c
f270: 6f 6d 6d 6f 6e 2c 20 65 73 70 65 63 69 61 6c 6c ommon, especiall
f280: 79 20 6f 6e 20 6d 6f 62 69 6c 65 20 6e 65 74 77 y on mobile netw
f290: 6f 72 6b 73 2e 20 49 74 20 6d 61 69 6e 6c 79 20 orks. It mainly
f2a0: 62 72 65 61 6b 73 20 70 6f 72 74 20 6d 61 70 70 breaks port mapp
f2b0: 69 6e 67 20 28 55 50 6e 50 20 61 6e 64 20 73 69 ing (UPnP and si
f2c0: 6d 69 6c 61 72 29 2c 20 62 65 63 61 75 73 65 20 milar), because
f2d0: 74 68 61 74 20 6f 6e 6c 79 20 72 65 61 63 68 65 that only reache
f2e0: 73 20 74 68 65 20 68 6f 6d 65 20 72 6f 75 74 65 s the home route
f2f0: 72 2e 20 54 68 65 20 6f 74 68 65 72 20 68 6f 6c r. The other hol
f300: 65 2d 70 75 6e 63 68 69 6e 67 20 74 72 69 63 6b e-punching trick
f310: 73 20 73 74 69 6c 6c 20 77 6f 72 6b 20 75 6e 64 s still work und
f320: 65 72 20 69 74 2e 20 54 68 65 20 43 47 4e 20 73 er it. The CGN s
f330: 74 61 6e 64 61 72 64 20 64 6f 65 73 20 61 73 6b tandard does ask
f340: 20 43 47 4e 73 20 74 6f 20 73 75 70 70 6f 72 74 CGNs to support
f350: 20 50 43 50 20 73 6f 20 74 68 61 74 20 63 75 73 PCP so that cus
f360: 74 6f 6d 65 72 73 20 63 61 6e 20 63 72 65 61 74 tomers can creat
f370: 65 20 6d 61 70 70 69 6e 67 73 2e 22 2c 0a 20 20 e mappings.",.
f380: 20 22 73 6f 75 72 63 65 22 3a 20 22 52 69 63 68 "source": "Rich
f390: 74 65 72 20 65 74 20 61 6c 2e 2c 20 49 4d 43 20 ter et al., IMC
f3a0: 32 30 31 36 2c 20 61 72 58 69 76 20 31 36 30 35 2016, arXiv 1605
f3b0: 2e 30 35 36 30 36 20 28 74 65 78 74 20 72 65 61 .05606 (text rea
f3c0: 64 20 66 72 6f 6d 20 74 68 65 20 50 44 46 29 3a d from the PDF):
f3d0: 20 5c 22 57 65 20 66 69 6e 64 20 74 68 65 20 43 \"We find the C
f3e0: 47 4e 20 70 65 6e 65 74 72 61 74 69 6f 6e 20 72 GN penetration r
f3f0: 61 74 65 20 74 6f 20 62 65 20 31 37 e2 80 93 31 ate to be 17–1
f400: 38 25 20 6f 66 20 61 6c 6c 20 45 79 65 62 61 6c 8% of all Eyebal
f410: 6c 20 41 53 65 73 2e 2e 2e 20 6d 6f 72 65 20 74 l ASes... more t
f420: 68 61 6e 20 39 30 25 20 6f 66 20 61 6c 6c 20 63 han 90% of all c
f430: 65 6c 6c 75 6c 61 72 20 41 53 65 73 20 64 65 70 ellular ASes dep
f440: 6c 6f 79 69 6e 67 20 43 47 4e 73 2e 5c 22 20 52 loying CGNs.\" R
f450: 46 43 20 36 38 38 38 2c 20 68 74 74 70 73 3a 2f FC 6888, https:/
f460: 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e /www.rfc-editor.
f470: 6f 72 67 2f 72 66 63 2f 72 66 63 36 38 38 38 2e org/rfc/rfc6888.
f480: 68 74 6d 6c 3a 20 52 45 51 2d 31 20 28 61 20 43 html: REQ-1 (a C
f490: 47 4e 20 6d 75 73 74 20 6d 65 65 74 20 65 61 63 GN must meet eac
f4a0: 68 20 70 72 6f 74 6f 63 6f 6c 27 73 20 4e 41 54 h protocol's NAT
f4b0: 20 62 65 68 61 76 69 6f 72 20 72 65 71 75 69 72 behavior requir
f4c0: 65 6d 65 6e 74 73 29 20 61 6e 64 20 52 45 51 2d ements) and REQ-
f4d0: 39 3a 20 5c 22 41 20 43 47 4e 20 4d 55 53 54 20 9: \"A CGN MUST
f4e0: 69 6d 70 6c 65 6d 65 6e 74 20 61 20 70 72 6f 74 implement a prot
f4f0: 6f 63 6f 6c 20 67 69 76 69 6e 67 20 73 75 62 73 ocol giving subs
f500: 63 72 69 62 65 72 73 20 65 78 70 6c 69 63 69 74 cribers explicit
f510: 20 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20 4e 41 control over NA
f520: 54 20 6d 61 70 70 69 6e 67 73 2e 20 54 68 61 74 T mappings. That
f530: 20 70 72 6f 74 6f 63 6f 6c 20 53 48 4f 55 4c 44 protocol SHOULD
f540: 20 62 65 20 74 68 65 20 50 6f 72 74 20 43 6f 6e be the Port Con
f550: 74 72 6f 6c 20 50 72 6f 74 6f 63 6f 6c 5c 22 2e trol Protocol\".
f560: 20 54 61 69 6c 73 63 61 6c 65 20 28 5c 22 43 6f Tailscale (\"Co
f570: 6e 63 65 72 6e 69 6e 67 20 43 47 4e 41 54 73 5c ncerning CGNATs\
f580: 22 29 3a 20 70 6f 72 74 20 6d 61 70 70 69 6e 67 "): port mapping
f590: 20 70 72 6f 74 6f 63 6f 6c 73 20 5c 22 61 63 74 protocols \"act
f5a0: 20 75 70 6f 6e 20 74 68 65 20 6c 61 79 65 72 20 upon the layer
f5b0: 6f 66 20 4e 41 54 20 63 6c 6f 73 65 73 74 20 74 of NAT closest t
f5c0: 6f 20 74 68 65 20 63 6c 69 65 6e 74 2c 20 77 68 o the client, wh
f5d0: 65 72 65 61 73 20 74 68 65 20 6f 6e 65 20 77 65 ereas the one we
f5e0: 20 6e 65 65 64 20 74 6f 20 69 6e 66 6c 75 65 6e need to influen
f5f0: 63 65 20 69 73 20 74 68 65 20 6f 6e 65 20 66 75 ce is the one fu
f600: 72 74 68 65 73 74 20 61 77 61 79 5c 22 2c 20 61 rthest away\", a
f610: 6e 64 20 5c 22 41 73 69 64 65 20 66 72 6f 6d 20 nd \"Aside from
f620: 74 68 65 20 70 6f 72 74 20 6d 61 70 70 69 6e 67 the port mapping
f630: 20 70 72 6f 74 6f 63 6f 6c 73 2c 20 65 76 65 72 protocols, ever
f640: 79 74 68 69 6e 67 20 66 72 6f 6d 20 6f 75 72 20 ything from our
f650: 63 75 72 72 65 6e 74 20 62 61 67 20 6f 66 20 74 current bag of t
f660: 72 69 63 6b 73 20 77 6f 72 6b 73 20 66 69 6e 65 ricks works fine
f670: 20 69 6e 20 61 20 43 47 4e 41 54 20 77 6f 72 6c in a CGNAT worl
f680: 64 2e 5c 22 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 d.\"". },. {.
f690: 20 20 22 63 6c 61 69 6d 22 3a 20 22 55 50 6e 50 "claim": "UPnP
f6a0: 2c 20 4e 41 54 2d 50 4d 50 20 61 6e 64 20 50 43 , NAT-PMP and PC
f6b0: 50 20 64 6f 20 6e 6f 74 20 70 75 6e 63 68 20 68 P do not punch h
f6c0: 6f 6c 65 73 2e 20 54 68 65 79 20 61 73 6b 20 74 oles. They ask t
f6d0: 68 65 20 72 6f 75 74 65 72 20 66 6f 72 20 61 20 he router for a
f6e0: 70 6f 72 74 20 66 6f 72 77 61 72 64 20 61 6e 64 port forward and
f6f0: 20 72 65 70 6f 72 74 20 74 68 65 20 6f 75 74 73 report the outs
f700: 69 64 65 20 61 64 64 72 65 73 73 2e 20 54 68 65 ide address. The
f710: 79 20 61 72 65 20 6f 66 74 65 6e 20 6d 69 73 73 y are often miss
f720: 69 6e 67 20 6f 72 20 74 75 72 6e 65 64 20 6f 66 ing or turned of
f730: 66 2c 20 4e 41 54 2d 50 4d 50 20 77 6f 72 6b 73 f, NAT-PMP works
f740: 20 6f 6e 6c 79 20 74 68 72 6f 75 67 68 20 61 20 only through a
f750: 73 69 6e 67 6c 65 20 4e 41 54 2c 20 61 6e 64 20 single NAT, and
f760: 50 43 50 20 67 65 74 73 20 70 61 73 74 20 61 20 PCP gets past a
f770: 43 47 4e 20 6f 6e 6c 79 20 69 66 20 74 68 65 20 CGN only if the
f780: 43 47 4e 20 73 75 70 70 6f 72 74 73 20 69 74 2e CGN supports it.
f790: 20 45 76 65 6e 20 77 68 65 6e 20 61 20 6d 61 70 Even when a map
f7a0: 70 69 6e 67 20 73 75 63 63 65 65 64 73 2c 20 74 ping succeeds, t
f7b0: 68 65 20 6f 74 68 65 72 20 70 65 65 72 20 73 74 he other peer st
f7c0: 69 6c 6c 20 68 61 73 20 74 6f 20 62 65 20 74 6f ill has to be to
f7d0: 6c 64 20 74 68 65 20 61 64 64 72 65 73 73 2c 20 ld the address,
f7e0: 73 6f 20 74 68 65 20 61 64 64 72 65 73 73 2d 65 so the address-e
f7f0: 78 63 68 61 6e 67 65 20 6a 6f 62 20 72 65 6d 61 xchange job rema
f800: 69 6e 73 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 ins.",. "sourc
f810: 65 22 3a 20 22 54 61 69 6c 73 63 61 6c 65 3a 20 e": "Tailscale:
f820: 5c 22 59 6f 75 20 63 61 6e 27 74 20 72 65 6c 79 \"You can't rely
f830: 20 6f 6e 20 74 68 65 73 65 20 70 72 6f 74 6f 63 on these protoc
f840: 6f 6c 73 20 62 65 69 6e 67 20 70 72 65 73 65 6e ols being presen
f850: 74 2e 2e 2e 20 44 69 73 61 62 6c 69 6e 67 20 62 t... Disabling b
f860: 79 20 70 6f 6c 69 63 79 20 69 73 20 66 61 69 72 y policy is fair
f870: 6c 79 20 63 6f 6d 6d 6f 6e 20 62 65 63 61 75 73 ly common becaus
f880: 65 20 55 50 6e 50 20 73 75 66 66 65 72 65 64 20 e UPnP suffered
f890: 66 72 6f 6d 20 61 20 6e 75 6d 62 65 72 20 6f 66 from a number of
f8a0: 20 68 69 67 68 2d 70 72 6f 66 69 6c 65 20 76 75 high-profile vu
f8b0: 6c 6e 65 72 61 62 69 6c 69 74 69 65 73 2e 5c 22 lnerabilities.\"
f8c0: 20 52 46 43 20 36 38 38 36 2c 20 68 74 74 70 73 RFC 6886, https
f8d0: 3a 2f 2f 77 77 77 2e 72 66 63 2d 65 64 69 74 6f ://www.rfc-edito
f8e0: 72 2e 6f 72 67 2f 72 66 63 2f 72 66 63 36 38 38 r.org/rfc/rfc688
f8f0: 36 2e 68 74 6d 6c 3a 20 4e 41 54 2d 50 4d 50 20 6.html: NAT-PMP
f900: 69 73 20 6d 65 61 6e 74 20 66 6f 72 20 6e 65 74 is meant for net
f910: 77 6f 72 6b 73 20 5c 22 77 68 65 72 65 20 74 68 works \"where th
f920: 65 20 63 6c 69 65 6e 74 27 73 20 64 65 66 61 75 e client's defau
f930: 6c 74 20 67 61 74 65 77 61 79 20 69 73 20 61 6c lt gateway is al
f940: 73 6f 20 74 68 65 20 4e 41 54 5c 22 20 61 6e 64 so the NAT\" and
f950: 20 77 61 73 20 73 75 70 65 72 73 65 64 65 64 20 was superseded
f960: 62 79 20 50 43 50 2e 20 52 46 43 20 36 38 38 37 by PCP. RFC 6887
f970: 2c 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 72 66 , https://www.rf
f980: 63 2d 65 64 69 74 6f 72 2e 6f 72 67 2f 72 66 63 c-editor.org/rfc
f990: 2f 72 66 63 36 38 38 37 2e 68 74 6d 6c 3a 20 50 /rfc6887.html: P
f9a0: 43 50 20 66 69 6e 64 73 20 69 74 73 20 73 65 72 CP finds its ser
f9b0: 76 65 72 20 74 68 72 6f 75 67 68 20 5c 22 74 68 ver through \"th
f9c0: 65 20 64 65 66 61 75 6c 74 20 72 6f 75 74 65 72 e default router
f9d0: 20 6c 69 73 74 5c 22 2c 20 61 6e 64 20 61 20 6e list\", and a n
f9e0: 65 73 74 65 64 20 4e 41 54 20 5c 22 6d 61 79 20 ested NAT \"may
f9f0: 69 74 73 65 6c 66 20 61 63 74 20 61 73 20 61 20 itself act as a
fa00: 50 43 50 20 63 6c 69 65 6e 74 20 74 6f 20 74 68 PCP client to th
fa10: 65 20 75 70 73 74 72 65 61 6d 20 4e 41 54 5c 22 e upstream NAT\"
fa20: 2e 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 .". },. {. "
fa30: 63 6c 61 69 6d 22 3a 20 22 49 50 76 36 20 72 65 claim": "IPv6 re
fa40: 6d 6f 76 65 73 20 61 64 64 72 65 73 73 20 74 72 moves address tr
fa50: 61 6e 73 6c 61 74 69 6f 6e 20 62 75 74 20 6e 6f anslation but no
fa60: 74 20 74 68 65 20 66 69 72 65 77 61 6c 6c 2e 20 t the firewall.
fa70: 48 6f 6d 65 20 72 6f 75 74 65 72 73 20 62 79 20 Home routers by
fa80: 64 65 66 61 75 6c 74 20 62 6c 6f 63 6b 20 69 6e default block in
fa90: 62 6f 75 6e 64 20 74 72 61 66 66 69 63 20 74 68 bound traffic th
faa0: 61 74 20 77 61 73 20 6e 6f 74 20 61 73 6b 65 64 at was not asked
fab0: 20 66 6f 72 2c 20 73 6f 20 70 65 65 72 73 20 73 for, so peers s
fac0: 74 69 6c 6c 20 6e 65 65 64 20 74 6f 20 73 65 6e till need to sen
fad0: 64 20 61 74 20 61 62 6f 75 74 20 74 68 65 20 73 d at about the s
fae0: 61 6d 65 20 74 69 6d 65 20 61 6e 64 20 73 74 69 ame time and sti
faf0: 6c 6c 20 6e 65 65 64 20 61 20 63 68 61 6e 6e 65 ll need a channe
fb00: 6c 20 74 6f 20 65 78 63 68 61 6e 67 65 20 61 64 l to exchange ad
fb10: 64 72 65 73 73 65 73 2e 20 50 75 6e 63 68 69 6e dresses. Punchin
fb20: 67 20 69 73 20 73 69 6d 70 6c 65 72 2c 20 62 65 g is simpler, be
fb30: 63 61 75 73 65 20 70 6f 72 74 73 20 61 72 65 20 cause ports are
fb40: 6e 6f 74 20 72 65 77 72 69 74 74 65 6e 2e 20 41 not rewritten. A
fb50: 62 6f 75 74 20 34 32 25 20 74 6f 20 35 30 25 20 bout 42% to 50%
fb60: 6f 66 20 75 73 65 72 73 20 68 61 64 20 49 50 76 of users had IPv
fb70: 36 20 69 6e 20 41 70 72 69 6c 20 32 30 32 36 2c 6 in April 2026,
fb80: 20 73 6f 20 69 74 20 63 61 6e 6e 6f 74 20 62 65 so it cannot be
fb90: 20 61 73 73 75 6d 65 64 20 6f 6e 20 62 6f 74 68 assumed on both
fba0: 20 65 6e 64 73 2e 22 2c 0a 20 20 20 22 73 6f 75 ends.",. "sou
fbb0: 72 63 65 22 3a 20 22 52 46 43 20 36 30 39 32 20 rce": "RFC 6092
fbc0: c2 a7 32 2e 33 2c 20 68 74 74 70 73 3a 2f 2f 77 §2.3, https://w
fbd0: 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 ww.rfc-editor.or
fbe0: 67 2f 72 66 63 2f 72 66 63 36 30 39 32 2e 68 74 g/rfc/rfc6092.ht
fbf0: 6d 6c 3a 20 74 72 61 66 66 69 63 20 5c 22 69 73 ml: traffic \"is
fc00: 20 6e 6f 74 20 66 6f 72 77 61 72 64 65 64 20 69 not forwarded i
fc10: 6e 74 6f 20 74 68 65 20 69 6e 74 65 72 69 6f 72 nto the interior
fc20: 20 6e 65 74 77 6f 72 6b 20 2e 2e 2e 20 75 6e 6c network ... unl
fc30: 65 73 73 20 69 74 20 68 61 73 20 62 65 65 6e 20 ess it has been
fc40: 73 6f 6c 69 63 69 74 65 64 20 65 78 70 6c 69 63 solicited explic
fc50: 69 74 6c 79 20 62 79 20 69 6e 74 65 72 69 6f 72 itly by interior
fc60: 20 74 72 61 6e 73 70 6f 72 74 20 65 6e 64 70 6f transport endpo
fc70: 69 6e 74 73 5c 22 2e 20 52 45 43 2d 31 37 3a 20 ints\". REC-17:
fc80: 65 6e 64 70 6f 69 6e 74 2d 69 6e 64 65 70 65 6e endpoint-indepen
fc90: 64 65 6e 74 20 66 69 6c 74 65 72 69 6e 67 20 66 dent filtering f
fca0: 6f 72 20 55 44 50 20 69 73 20 61 20 53 48 4f 55 or UDP is a SHOU
fcb0: 4c 44 20 77 68 65 6e 20 74 72 61 6e 73 70 61 72 LD when transpar
fcc0: 65 6e 63 79 20 6d 61 74 74 65 72 73 2e 20 54 61 ency matters. Ta
fcd0: 69 6c 73 63 61 6c 65 20 28 5c 22 49 64 65 61 6c ilscale (\"Ideal
fce0: 6c 79 20 49 50 76 36 2c 20 4e 41 54 36 34 20 6e ly IPv6, NAT64 n
fcf0: 6f 74 77 69 74 68 73 74 61 6e 64 69 6e 67 5c 22 otwithstanding\"
fd00: 29 3a 20 5c 22 61 6c 6c 20 6f 66 20 74 68 69 73 ): \"all of this
fd10: 20 62 65 63 6f 6d 65 73 20 6d 75 63 68 20 73 69 becomes much si
fd20: 6d 70 6c 65 72 2e 20 4e 6f 74 20 74 72 69 76 69 mpler. Not trivi
fd30: 61 6c 2c 20 6d 69 6e 64 20 79 6f 75 2c 20 62 65 al, mind you, be
fd40: 63 61 75 73 65 20 77 65 27 72 65 20 73 74 69 6c cause we're stil
fd50: 6c 20 73 74 75 63 6b 20 77 69 74 68 20 73 74 61 l stuck with sta
fd60: 74 65 66 75 6c 20 66 69 72 65 77 61 6c 6c 73 2e teful firewalls.
fd70: 5c 22 20 41 50 4e 49 43 20 62 6c 6f 67 2c 20 68 \" APNIC blog, h
fd80: 74 74 70 73 3a 2f 2f 62 6c 6f 67 2e 61 70 6e 69 ttps://blog.apni
fd90: 63 2e 6e 65 74 2f 32 30 32 36 2f 30 34 2f 32 38 c.net/2026/04/28
fda0: 2f 67 6f 6f 67 6c 65 2d 68 69 74 73 2d 35 30 2d /google-hits-50-
fdb0: 69 70 76 36 2f 3a 20 47 6f 6f 67 6c 65 20 6d 65 ipv6/: Google me
fdc0: 61 73 75 72 65 64 20 35 30 25 20 61 6e 64 20 41 asured 50% and A
fdd0: 50 4e 49 43 20 34 32 25 2e 22 0a 20 20 7d 2c 0a PNIC 42%.". },.
fde0: 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 {. "claim":
fdf0: 22 54 68 65 20 6d 61 69 6e 74 61 69 6e 65 72 20 "The maintainer
fe00: 69 73 20 72 69 67 68 74 20 74 68 61 74 20 54 61 is right that Ta
fe10: 69 6c 73 63 61 6c 65 20 64 65 70 65 6e 64 73 20 ilscale depends
fe20: 6f 6e 20 68 6f 73 74 65 64 20 73 65 72 76 69 63 on hosted servic
fe30: 65 73 2e 20 49 74 73 20 63 6f 6f 72 64 69 6e 61 es. Its coordina
fe40: 74 69 6f 6e 20 73 65 72 76 65 72 20 65 78 63 68 tion server exch
fe50: 61 6e 67 65 73 20 6b 65 79 73 20 61 6e 64 20 61 anges keys and a
fe60: 64 64 72 65 73 73 65 73 2e 20 49 74 73 20 44 45 ddresses. Its DE
fe70: 52 50 20 72 65 6c 61 79 73 20 63 61 72 72 79 20 RP relays carry
fe80: 74 68 65 20 73 65 74 75 70 20 6d 65 73 73 61 67 the setup messag
fe90: 65 73 20 61 6e 64 20 61 72 65 20 74 68 65 20 66 es and are the f
fea0: 61 6c 6c 62 61 63 6b 20 77 68 65 6e 20 61 20 64 allback when a d
feb0: 69 72 65 63 74 20 70 61 74 68 20 66 61 69 6c 73 irect path fails
fec0: 2e 20 54 68 65 79 20 66 6f 72 77 61 72 64 20 65 . They forward e
fed0: 6e 63 72 79 70 74 65 64 20 70 61 63 6b 65 74 73 ncrypted packets
fee0: 20 74 68 65 79 20 63 61 6e 6e 6f 74 20 72 65 61 they cannot rea
fef0: 64 2e 20 42 6f 74 68 20 63 61 6e 20 62 65 20 72 d. Both can be r
ff00: 75 6e 20 70 72 69 76 61 74 65 6c 79 3a 20 79 6f un privately: yo
ff10: 75 72 20 6f 77 6e 20 44 45 52 50 20 73 65 72 76 ur own DERP serv
ff20: 65 72 73 2c 20 6f 72 20 27 70 65 65 72 20 72 65 ers, or 'peer re
ff30: 6c 61 79 73 27 20 6f 6e 20 79 6f 75 72 20 6f 77 lays' on your ow
ff40: 6e 20 6d 61 63 68 69 6e 65 73 20 28 67 65 6e 65 n machines (gene
ff50: 72 61 6c 6c 79 20 61 76 61 69 6c 61 62 6c 65 20 rally available
ff60: 46 65 62 72 75 61 72 79 20 32 30 32 36 29 2e 22 February 2026)."
ff70: 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
ff80: 68 74 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 6c https://tailscal
ff90: 65 2e 63 6f 6d 2f 62 6c 6f 67 2f 68 6f 77 2d 74 e.com/blog/how-t
ffa0: 61 69 6c 73 63 61 6c 65 2d 77 6f 72 6b 73 3a 20 ailscale-works:
ffb0: 74 68 65 20 63 6f 6f 72 64 69 6e 61 74 69 6f 6e the coordination
ffc0: 20 73 65 72 76 65 72 20 69 73 20 5c 22 61 20 73 server is \"a s
ffd0: 68 61 72 65 64 20 64 72 6f 70 20 62 6f 78 20 66 hared drop box f
ffe0: 6f 72 20 70 75 62 6c 69 63 20 6b 65 79 73 5c 22 or public keys\"
fff0: 20 74 68 61 74 20 5c 22 63 61 72 72 69 65 73 20 that \"carries
10000 76 69 72 74 75 61 6c 6c 79 20 6e 6f 20 74 72 61 virtually no tra
10010 66 66 69 63 5c 22 2e 20 68 74 74 70 73 3a 2f 2f ffic\". https://
10020 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d 2f 6b 62 tailscale.com/kb
10030 2f 31 32 33 32 2f 64 65 72 70 2d 73 65 72 76 65 /1232/derp-serve
10040 72 73 3a 20 44 45 52 50 20 69 73 20 66 6f 72 20 rs: DERP is for
10050 5c 22 31 29 20 4e 65 67 6f 74 69 61 74 69 6e 67 \"1) Negotiating
10060 20 61 6e 64 20 65 73 74 61 62 6c 69 73 68 69 6e and establishin
10070 67 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 2e 2e g connections ..
10080 2e 20 32 29 20 53 65 72 76 69 6e 67 20 61 73 20 . 2) Serving as
10090 61 20 66 61 6c 6c 62 61 63 6b 5c 22 2c 20 61 6e a fallback\", an
100a0 64 20 5c 22 69 74 27 73 20 69 6d 70 6f 73 73 69 d \"it's impossi
100b0 62 6c 65 20 66 6f 72 20 61 20 44 45 52 50 20 73 ble for a DERP s
100c0 65 72 76 65 72 20 74 6f 20 64 65 63 72 79 70 74 erver to decrypt
100d0 20 79 6f 75 72 20 74 72 61 66 66 69 63 5c 22 2e your traffic\".
100e0 20 54 61 69 6c 73 63 61 6c 65 20 62 6c 6f 67 20 Tailscale blog
100f0 28 5c 22 48 61 76 65 20 79 6f 75 20 63 6f 6e 73 (\"Have you cons
10100 69 64 65 72 65 64 20 67 69 76 69 6e 67 20 75 70 idered giving up
10110 3f 5c 22 29 3a 20 44 45 52 50 20 5c 22 72 75 6e ?\"): DERP \"run
10120 73 20 6f 76 65 72 20 48 54 54 50 5c 22 2e 20 68 s over HTTP\". h
10130 74 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 ttps://tailscale
10140 2e 63 6f 6d 2f 62 6c 6f 67 2f 70 65 65 72 2d 72 .com/blog/peer-r
10150 65 6c 61 79 73 2d 67 61 20 28 32 30 32 36 2d 30 elays-ga (2026-0
10160 32 2d 31 38 29 3a 20 5c 22 63 75 73 74 6f 6d 65 2-18): \"custome
10170 72 2d 64 65 70 6c 6f 79 65 64 2c 20 68 69 67 68 r-deployed, high
10180 2d 74 68 72 6f 75 67 68 70 75 74 20 72 65 6c 61 -throughput rela
10190 79 69 6e 67 20 2e 2e 2e 20 74 68 61 74 20 79 6f ying ... that yo
101a0 75 20 63 61 6e 20 72 75 6e 20 6f 6e 20 61 6e 79 u can run on any
101b0 20 54 61 69 6c 73 63 61 6c 65 20 6e 6f 64 65 5c Tailscale node\
101c0 22 2e 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 ".". },. {.
101d0 22 63 6c 61 69 6d 22 3a 20 22 6c 69 62 70 32 70 "claim": "libp2p
101e0 20 68 61 73 20 74 75 72 6e 65 64 20 74 68 65 20 has turned the
101f0 73 6d 61 6c 6c 65 73 74 20 68 6f 73 74 65 64 20 smallest hosted
10200 72 6f 6c 65 20 69 6e 74 6f 20 61 20 66 6f 72 6d role into a form
10210 61 6c 20 70 72 6f 74 6f 63 6f 6c 2e 20 44 43 55 al protocol. DCU
10220 74 52 20 66 69 72 73 74 20 63 6f 6e 6e 65 63 74 tR first connect
10230 73 20 74 77 6f 20 70 65 65 72 73 20 74 68 72 6f s two peers thro
10240 75 67 68 20 61 20 72 65 6c 61 79 2c 20 74 68 65 ugh a relay, the
10250 6e 20 75 73 65 73 20 74 68 61 74 20 6c 69 6e 6b n uses that link
10260 20 74 6f 20 73 77 61 70 20 6f 62 73 65 72 76 65 to swap observe
10270 64 20 61 64 64 72 65 73 73 65 73 20 61 6e 64 20 d addresses and
10280 74 69 6d 65 20 61 20 73 69 6d 75 6c 74 61 6e 65 time a simultane
10290 6f 75 73 20 64 69 61 6c 20 61 74 20 68 61 6c 66 ous dial at half
102a0 20 74 68 65 20 72 6f 75 6e 64 2d 74 72 69 70 20 the round-trip
102b0 74 69 6d 65 2c 20 74 72 79 69 6e 67 20 33 20 74 time, trying 3 t
102c0 69 6d 65 73 2e 20 43 69 72 63 75 69 74 20 72 65 imes. Circuit re
102d0 6c 61 79 20 76 32 20 72 65 6c 61 79 73 20 63 61 lay v2 relays ca
102e0 72 72 79 20 6f 6e 6c 79 20 73 68 6f 72 74 20 65 rry only short e
102f0 78 63 68 61 6e 67 65 73 20 6c 69 6b 65 20 74 68 xchanges like th
10300 69 73 3a 20 67 6f 2d 6c 69 62 70 32 70 27 73 20 is: go-libp2p's
10310 64 65 66 61 75 6c 74 20 6c 69 6d 69 74 20 69 73 default limit is
10320 20 32 20 6d 69 6e 75 74 65 73 20 61 6e 64 20 31 2 minutes and 1
10330 32 38 20 4b 69 42 20 70 65 72 20 72 65 6c 61 79 28 KiB per relay
10340 65 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 2c 20 61 ed connection, a
10350 6e 64 20 61 6e 79 20 70 75 62 6c 69 63 6c 79 20 nd any publicly
10360 72 65 61 63 68 61 62 6c 65 20 70 65 65 72 20 63 reachable peer c
10370 61 6e 20 62 65 20 61 20 72 65 6c 61 79 2e 22 2c an be a relay.",
10380 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 . "source": "h
10390 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f ttps://github.co
103a0 6d 2f 6c 69 62 70 32 70 2f 73 70 65 63 73 2f 62 m/libp2p/specs/b
103b0 6c 6f 62 2f 6d 61 73 74 65 72 2f 72 65 6c 61 79 lob/master/relay
103c0 2f 44 43 55 74 52 2e 6d 64 3a 20 69 74 20 61 73 /DCUtR.md: it as
103d0 73 75 6d 65 73 20 5c 22 74 68 65 20 63 6f 6d 70 sumes \"the comp
103e0 6c 65 74 69 6f 6e 20 6f 66 20 61 20 72 65 6c 61 letion of a rela
103f0 79 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 72 6f y connection fro
10400 6d 20 41 20 74 6f 20 42 5c 22 3b 20 42 20 5c 22 m A to B\"; B \"
10410 73 74 61 72 74 73 20 61 20 74 69 6d 65 72 20 66 starts a timer f
10420 6f 72 20 68 61 6c 66 20 74 68 65 20 52 54 54 5c or half the RTT\
10430 22 3b 20 61 6e 64 20 42 20 5c 22 53 48 4f 55 4c "; and B \"SHOUL
10440 44 20 72 65 74 72 79 20 74 77 69 63 65 20 28 74 D retry twice (t
10450 68 75 73 20 61 20 74 6f 74 61 6c 20 6f 66 20 33 hus a total of 3
10460 20 61 74 74 65 6d 70 74 73 29 5c 22 2e 20 68 74 attempts)\". ht
10470 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com
10480 2f 6c 69 62 70 32 70 2f 73 70 65 63 73 2f 62 6c /libp2p/specs/bl
10490 6f 62 2f 6d 61 73 74 65 72 2f 72 65 6c 61 79 2f ob/master/relay/
104a0 63 69 72 63 75 69 74 2d 76 32 2e 6d 64 3a 20 5c circuit-v2.md: \
104b0 22 6c 69 6d 69 74 65 64 20 72 65 6c 61 79 73 20 "limited relays
104c0 61 6e 64 20 73 6c 6f 74 20 72 65 73 65 72 76 61 and slot reserva
104d0 74 69 6f 6e 73 5c 22 2e 20 67 6f 2d 6c 69 62 70 tions\". go-libp
104e0 32 70 20 72 65 73 6f 75 72 63 65 73 2e 67 6f 2c 2p resources.go,
104f0 20 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 https://raw.git
10500 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 hubusercontent.c
10510 6f 6d 2f 6c 69 62 70 32 70 2f 67 6f 2d 6c 69 62 om/libp2p/go-lib
10520 70 32 70 2f 6d 61 73 74 65 72 2f 70 32 70 2f 70 p2p/master/p2p/p
10530 72 6f 74 6f 63 6f 6c 2f 63 69 72 63 75 69 74 76 rotocol/circuitv
10540 32 2f 72 65 6c 61 79 2f 72 65 73 6f 75 72 63 65 2/relay/resource
10550 73 2e 67 6f 3a 20 44 65 66 61 75 6c 74 4c 69 6d s.go: DefaultLim
10560 69 74 20 44 75 72 61 74 69 6f 6e 20 5c 22 32 20 it Duration \"2
10570 2a 20 74 69 6d 65 2e 4d 69 6e 75 74 65 5c 22 2c * time.Minute\",
10580 20 44 61 74 61 20 5c 22 31 20 3c 3c 20 31 37 20 Data \"1 << 17
10590 2f 2f 20 31 32 38 4b 5c 22 2e 22 0a 20 20 7d 2c // 128K\".". },
105a0 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a . {. "claim":
105b0 20 22 54 68 65 20 53 79 6e 63 74 68 69 6e 67 20 "The Syncthing
105c0 74 68 72 65 61 64 20 73 61 79 73 20 53 79 6e 63 thread says Sync
105d0 74 68 69 6e 67 20 61 6c 72 65 61 64 79 20 64 6f thing already do
105e0 65 73 20 68 6f 6c 65 20 70 75 6e 63 68 69 6e 67 es hole punching
105f0 2e 20 54 68 65 20 6f 6e 6c 79 20 67 61 70 20 6e . The only gap n
10600 61 6d 65 64 20 69 73 20 54 61 69 6c 73 63 61 6c amed is Tailscal
10610 65 27 73 20 65 78 74 72 61 20 74 72 69 63 6b 73 e's extra tricks
10620 20 66 6f 72 20 4e 41 54 73 20 74 68 61 74 20 67 for NATs that g
10630 69 76 65 20 61 20 64 69 66 66 65 72 65 6e 74 20 ive a different
10640 70 6f 72 74 20 70 65 72 20 64 65 73 74 69 6e 61 port per destina
10650 74 69 6f 6e 2e 20 4e 6f 74 68 69 6e 67 20 77 61 tion. Nothing wa
10660 73 20 64 65 63 69 64 65 64 2e 20 53 79 6e 63 74 s decided. Synct
10670 68 69 6e 67 20 61 6c 73 6f 20 66 61 6c 6c 73 20 hing also falls
10680 62 61 63 6b 20 74 6f 20 72 65 6c 61 79 73 2c 20 back to relays,
10690 77 68 69 63 68 20 66 6f 72 77 61 72 64 20 65 6e which forward en
106a0 64 2d 74 6f 2d 65 6e 64 20 65 6e 63 72 79 70 74 d-to-end encrypt
106b0 65 64 20 74 72 61 66 66 69 63 2e 22 2c 0a 20 20 ed traffic.",.
106c0 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
106d0 73 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 s://forum.syncth
106e0 69 6e 67 2e 6e 65 74 2f 74 2f 75 73 65 2d 74 61 ing.net/t/use-ta
106f0 69 6c 73 63 61 6c 65 73 2d 74 65 63 68 6e 69 71 ilscales-techniq
10700 75 65 73 2d 66 6f 72 2d 6e 61 74 2d 74 72 61 76 ues-for-nat-trav
10710 65 72 73 61 6c 2f 32 32 34 37 31 2c 20 62 74 39 ersal/22471, bt9
10720 30 20 28 32 30 32 34 2d 30 37 2d 32 33 29 3a 20 0 (2024-07-23):
10730 5c 22 57 65 27 72 65 20 61 6c 72 65 61 64 79 20 \"We're already
10740 75 73 69 6e 67 20 68 6f 6c 65 70 75 6e 63 68 69 using holepunchi
10750 6e 67 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 ng to establish
10760 54 43 50 2f 55 44 50 20 63 6f 6e 6e 65 63 74 69 TCP/UDP connecti
10770 6f 6e 73 2c 20 69 66 20 70 6f 73 73 69 62 6c 65 ons, if possible
10780 2e 20 54 68 65 20 6f 6e 6c 79 20 72 65 61 6c 20 . The only real
10790 64 69 66 66 65 72 65 6e 63 65 20 69 73 20 74 68 difference is th
107a0 61 74 20 54 61 69 6c 73 63 61 6c 65 20 69 73 20 at Tailscale is
107b0 70 75 6c 6c 69 6e 67 20 61 20 66 65 77 20 6d 6f pulling a few mo
107c0 72 65 20 74 72 69 63 6b 73 20 74 6f 20 64 65 61 re tricks to dea
107d0 6c 20 77 69 74 68 20 45 6e 64 70 6f 69 6e 74 2d l with Endpoint-
107e0 44 65 70 65 6e 64 65 6e 74 20 4e 41 54 73 2e 5c Dependent NATs.\
107f0 22 20 4e 75 6d 6d 65 72 33 37 38 20 28 32 30 32 " Nummer378 (202
10800 35 2d 30 32 2d 30 34 29 3a 20 5c 22 69 74 27 73 5-02-04): \"it's
10810 20 6d 6f 73 74 6c 79 20 62 61 73 65 64 20 6f 6e mostly based on
10820 20 74 68 65 20 69 64 65 61 20 74 68 61 74 20 74 the idea that t
10830 77 6f 20 64 65 76 69 63 65 73 20 64 69 61 6c 20 wo devices dial
10840 65 61 63 68 20 6f 74 68 65 72 20 6f 6e 20 74 68 each other on th
10850 65 20 73 61 6d 65 20 70 6f 72 74 73 20 61 74 20 e same ports at
10860 74 68 65 20 73 61 6d 65 20 74 69 6d 65 2e 5c 22 the same time.\"
10870 20 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e 73 79 https://docs.sy
10880 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 65 72 ncthing.net/user
10890 73 2f 72 65 6c 61 79 69 6e 67 2e 68 74 6d 6c 3a s/relaying.html:
108a0 20 72 65 6c 61 79 69 6e 67 20 5c 22 77 69 6c 6c relaying \"will
108b0 20 6f 6e 6c 79 20 62 65 20 75 73 65 64 20 69 66 only be used if
108c0 20 74 77 6f 20 64 65 76 69 63 65 73 20 61 72 65 two devices are
108d0 20 75 6e 61 62 6c 65 20 74 6f 20 63 6f 6d 6d 75 unable to commu
108e0 6e 69 63 61 74 65 20 64 69 72 65 63 74 6c 79 5c nicate directly\
108f0 22 2e 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 ".". },. {.
10900 22 63 6c 61 69 6d 22 3a 20 22 43 61 6e 20 74 68 "claim": "Can th
10910 65 20 70 75 62 6c 69 63 20 46 6f 73 73 69 6c 20 e public Fossil
10920 73 65 72 76 65 72 20 62 65 20 74 68 65 20 74 68 server be the th
10930 69 72 64 20 70 61 72 74 79 3f 20 46 6f 72 20 65 ird party? For e
10940 78 63 68 61 6e 67 69 6e 67 20 61 64 64 72 65 73 xchanging addres
10950 73 65 73 2c 20 79 65 73 20 69 6e 20 70 72 69 6e ses, yes in prin
10960 63 69 70 6c 65 3a 20 69 74 20 69 73 20 74 68 65 ciple: it is the
10970 20 6f 6e 65 20 6d 61 63 68 69 6e 65 20 65 76 65 one machine eve
10980 72 79 20 6e 6f 64 65 20 63 61 6e 20 72 65 61 63 ry node can reac
10990 68 2c 20 61 6e 64 20 69 74 20 61 6c 72 65 61 64 h, and it alread
109a0 79 20 72 65 63 6f 72 64 73 20 74 68 65 20 49 50 y records the IP
109b0 20 61 64 64 72 65 73 73 20 65 61 63 68 20 70 75 address each pu
109c0 73 68 20 63 61 6d 65 20 66 72 6f 6d 2e 20 49 74 sh came from. It
109d0 20 63 61 6e 6e 6f 74 20 64 6f 20 74 68 65 20 53 cannot do the S
109e0 54 55 4e 20 70 61 72 74 20 61 73 20 73 74 6f 63 TUN part as stoc
109f0 6b 20 46 6f 73 73 69 6c 3a 20 69 74 20 73 70 65 k Fossil: it spe
10a00 61 6b 73 20 6f 6e 6c 79 20 48 54 54 50 20 6f 76 aks only HTTP ov
10a10 65 72 20 54 43 50 2c 20 69 74 20 72 65 63 6f 72 er TCP, it recor
10a20 64 73 20 74 68 65 20 49 50 20 62 75 74 20 6e 6f ds the IP but no
10a30 74 20 74 68 65 20 70 6f 72 74 2c 20 61 6e 64 20 t the port, and
10a40 61 20 70 75 6e 63 68 20 6e 65 65 64 73 20 74 68 a punch needs th
10a50 65 20 6d 61 70 70 69 6e 67 20 6f 66 20 74 68 65 e mapping of the
10a60 20 65 78 61 63 74 20 55 44 50 20 73 6f 63 6b 65 exact UDP socke
10a70 74 20 74 68 61 74 20 77 69 6c 6c 20 62 65 20 75 t that will be u
10a80 73 65 64 2e 20 41 20 53 54 55 4e 20 72 65 73 70 sed. A STUN resp
10a90 6f 6e 64 65 72 20 69 73 20 61 20 74 69 6e 79 20 onder is a tiny
10aa0 73 65 70 61 72 61 74 65 20 55 44 50 20 73 65 72 separate UDP ser
10ab0 76 69 63 65 20 74 68 61 74 20 63 6f 75 6c 64 20 vice that could
10ac0 72 75 6e 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 run on the same
10ad0 68 6f 73 74 20 69 66 20 61 20 55 44 50 20 70 6f host if a UDP po
10ae0 72 74 20 69 73 20 6f 70 65 6e 65 64 20 74 68 65 rt is opened the
10af0 72 65 2e 20 41 73 20 61 20 72 65 6c 61 79 20 69 re. As a relay i
10b00 74 20 61 6c 72 65 61 64 79 20 73 65 72 76 65 73 t already serves
10b10 3a 20 73 74 6f 72 65 2d 61 6e 64 2d 66 6f 72 77 : store-and-forw
10b20 61 72 64 20 73 79 6e 63 20 69 73 20 74 68 65 20 ard sync is the
10b30 66 61 6c 6c 62 61 63 6b 20 70 61 74 68 20 74 6f fallback path to
10b40 64 61 79 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 day.",. "sourc
10b50 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f 73 e": "https://fos
10b60 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 sil-scm.org/home
10b70 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f 73 /doc/trunk/www/s
10b80 79 6e 63 2e 77 69 6b 69 20 c2 a7 32 2e 30 3a 20 ync.wiki §2.0:
10b90 5c 22 41 6c 6c 20 63 6f 6d 6d 75 6e 69 63 61 74 \"All communicat
10ba0 69 6f 6e 20 62 65 74 77 65 65 6e 20 63 6c 69 65 ion between clie
10bb0 6e 74 20 61 6e 64 20 73 65 72 76 65 72 20 69 73 nt and server is
10bc0 20 76 69 61 20 48 54 54 50 20 72 65 71 75 65 73 via HTTP reques
10bd0 74 73 5c 22 20 61 6e 64 20 5c 22 54 68 65 20 73 ts\" and \"The s
10be0 65 72 76 65 72 20 69 73 20 6c 69 73 74 65 6e 69 erver is listeni
10bf0 6e 67 20 66 6f 72 20 69 6e 63 6f 6d 69 6e 67 20 ng for incoming
10c00 48 54 54 50 20 72 65 71 75 65 73 74 73 5c 22 2e HTTP requests\".
10c10 20 54 68 65 20 66 6f 73 73 69 6c 20 32 2e 32 37 The fossil 2.27
10c20 20 62 69 6e 61 72 79 20 6f 6e 20 74 68 69 73 20 binary on this
10c30 68 6f 73 74 20 68 61 73 20 74 68 65 20 65 6d 62 host has the emb
10c40 65 64 64 65 64 20 73 63 68 65 6d 61 20 5c 22 43 edded schema \"C
10c50 52 45 41 54 45 20 54 41 42 4c 45 20 72 63 76 66 REATE TABLE rcvf
10c60 72 6f 6d 28 20 72 63 76 69 64 20 2e 2e 2e 2c 20 rom( rcvid ...,
10c70 75 69 64 20 2e 2e 2e 2c 20 6d 74 69 6d 65 20 2e uid ..., mtime .
10c80 2e 2e 2c 20 6e 6f 6e 63 65 20 2e 2e 2e 2c 20 69 .., nonce ..., i
10c90 70 61 64 64 72 20 54 45 58 54 5c 22 2e 20 52 46 paddr TEXT\". RF
10ca0 43 20 38 34 38 39 20 c2 a7 31 32 20 28 61 20 62 C 8489 §12 (a b
10cb0 61 73 69 63 20 53 54 55 4e 20 73 65 72 76 65 72 asic STUN server
10cc0 20 69 73 20 74 68 65 20 42 69 6e 64 69 6e 67 20 is the Binding
10cd0 6d 65 74 68 6f 64 20 6f 6e 6c 79 29 2e 22 0a 20 method only).".
10ce0 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 },. {. "clai
10cf0 6d 22 3a 20 22 54 68 65 20 64 65 63 69 73 69 6f m": "The decisio
10d00 6e 20 74 68 69 73 20 66 6f 72 63 65 73 3a 20 65 n this forces: e
10d10 76 65 72 79 20 68 6f 6c 65 2d 70 75 6e 63 68 69 very hole-punchi
10d20 6e 67 20 73 63 68 65 6d 65 20 6e 65 65 64 73 20 ng scheme needs
10d30 65 61 63 68 20 70 65 65 72 20 74 6f 20 68 6f 6c each peer to hol
10d40 64 20 61 20 6c 69 76 65 20 6f 75 74 62 6f 75 6e d a live outboun
10d50 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 74 6f 20 d connection to
10d60 74 68 65 20 72 65 6e 64 65 7a 76 6f 75 73 20 73 the rendezvous s
10d70 65 72 76 65 72 20 66 69 72 73 74 2e 20 42 75 74 erver first. But
10d80 20 6f 6e 63 65 20 61 20 6e 6f 64 65 20 62 65 68 once a node beh
10d90 69 6e 64 20 4e 41 54 20 68 6f 6c 64 73 20 61 6e ind NAT holds an
10da0 20 6f 75 74 62 6f 75 6e 64 20 63 6f 6e 6e 65 63 outbound connec
10db0 74 69 6f 6e 20 74 6f 20 74 68 65 20 70 75 62 6c tion to the publ
10dc0 69 63 20 73 65 72 76 65 72 2c 20 74 68 65 20 73 ic server, the s
10dd0 65 72 76 65 72 20 63 61 6e 20 6e 6f 74 69 66 79 erver can notify
10de0 20 74 68 61 74 20 6e 6f 64 65 20 64 69 72 65 63 that node direc
10df0 74 6c 79 2c 20 77 69 74 68 20 6e 6f 20 4e 41 54 tly, with no NAT
10e00 20 74 72 61 76 65 72 73 61 6c 20 61 74 20 61 6c traversal at al
10e10 6c 2c 20 62 65 63 61 75 73 65 20 6f 75 74 62 6f l, because outbo
10e20 75 6e 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 und connections
10e30 70 61 73 73 20 74 68 72 6f 75 67 68 20 61 6e 79 pass through any
10e40 20 4e 41 54 2c 20 69 6e 63 6c 75 64 69 6e 67 20 NAT, including
10e50 61 20 43 47 4e 2e 20 53 6f 20 74 68 65 20 6d 69 a CGN. So the mi
10e60 73 73 69 6e 67 20 74 72 69 67 67 65 72 20 69 73 ssing trigger is
10e70 20 73 6f 6c 76 65 64 20 62 79 20 61 20 68 65 6c solved by a hel
10e80 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 72 6f d connection fro
10e90 6d 20 65 61 63 68 20 6e 6f 64 65 20 74 6f 20 74 m each node to t
10ea0 68 65 20 73 65 72 76 65 72 2e 20 4e 41 54 20 74 he server. NAT t
10eb0 72 61 76 65 72 73 61 6c 20 77 6f 75 6c 64 20 6f raversal would o
10ec0 6e 6c 79 20 61 64 64 20 64 69 72 65 63 74 20 6e nly add direct n
10ed0 6f 64 65 2d 74 6f 2d 6e 6f 64 65 20 70 61 74 68 ode-to-node path
10ee0 73 2c 20 61 6e 64 20 73 65 74 74 69 6e 67 20 74 s, and setting t
10ef0 68 6f 73 65 20 75 70 20 73 74 69 6c 6c 20 6e 65 hose up still ne
10f00 65 64 73 20 74 68 65 20 73 65 72 76 65 72 2e 20 eds the server.
10f10 46 6f 73 73 69 6c 20 61 6c 72 65 61 64 79 20 68 Fossil already h
10f20 61 73 20 73 75 63 68 20 61 20 68 65 6c 64 20 63 as such a held c
10f30 6f 6e 6e 65 63 74 69 6f 6e 3a 20 63 68 61 74 27 onnection: chat'
10f40 73 20 2f 63 68 61 74 2d 70 6f 6c 6c 20 77 61 69 s /chat-poll wai
10f50 74 73 20 75 6e 74 69 6c 20 61 20 6e 65 77 20 6d ts until a new m
10f60 65 73 73 61 67 65 20 61 72 72 69 76 65 73 20 28 essage arrives (
10f70 61 62 6f 75 74 20 37 20 6d 69 6e 75 74 65 73 20 about 7 minutes
10f80 62 79 20 64 65 66 61 75 6c 74 29 2c 20 61 6e 64 by default), and
10f90 20 61 20 73 63 72 69 70 74 20 63 61 6e 20 70 6f a script can po
10fa0 73 74 20 77 69 74 68 20 60 66 6f 73 73 69 6c 20 st with `fossil
10fb0 63 68 61 74 20 73 65 6e 64 60 2e 22 2c 0a 20 20 chat send`.",.
10fc0 20 22 73 6f 75 72 63 65 22 3a 20 22 46 6f 72 64 "source": "Ford
10fd0 20 65 74 20 61 6c 2e 20 28 62 6f 74 68 20 70 65 et al. (both pe
10fe0 65 72 73 20 6b 65 65 70 20 5c 22 61 63 74 69 76 ers keep \"activ
10ff0 65 20 55 44 50 20 73 65 73 73 69 6f 6e 73 20 77 e UDP sessions w
11000 69 74 68 20 61 20 72 65 6e 64 65 7a 76 6f 75 73 ith a rendezvous
11010 20 73 65 72 76 65 72 5c 22 29 3b 20 44 43 55 74 server\"); DCUt
11020 52 20 73 70 65 63 20 28 72 65 6c 61 79 20 63 6f R spec (relay co
11030 6e 6e 65 63 74 69 6f 6e 20 66 69 72 73 74 29 3b nnection first);
11040 20 54 61 69 6c 73 63 61 6c 65 20 44 45 52 50 20 Tailscale DERP
11050 4b 42 20 28 44 45 52 50 20 63 61 72 72 69 65 73 KB (DERP carries
11060 20 74 68 65 20 73 65 74 75 70 20 6d 65 73 73 61 the setup messa
11070 67 65 73 29 2e 20 68 74 74 70 73 3a 2f 2f 66 6f ges). https://fo
11080 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d ssil-scm.org/hom
11090 65 2f 64 6f 63 2f 74 72 75 6e 6b 2f 77 77 77 2f e/doc/trunk/www/
110a0 63 68 61 74 2e 6d 64 3a 20 5c 22 74 68 65 20 2f chat.md: \"the /
110b0 63 68 61 74 2d 70 6f 6c 6c 20 70 61 67 65 20 62 chat-poll page b
110c0 6c 6f 63 6b 73 20 75 6e 74 69 6c 20 6e 65 77 20 locks until new
110d0 6d 65 73 73 61 67 65 73 20 61 72 65 20 61 76 61 messages are ava
110e0 69 6c 61 62 6c 65 5c 22 20 61 6e 64 20 5c 22 54 ilable\" and \"T
110f0 68 65 20 66 6f 73 73 69 6c 20 63 68 61 74 20 73 he fossil chat s
11100 65 6e 64 20 63 61 6e 20 62 65 20 75 73 65 64 20 end can be used
11110 62 79 20 70 72 6f 6a 65 63 74 2d 73 70 65 63 69 by project-speci
11120 66 69 63 20 72 6f 62 6f 74 73 20 74 6f 20 73 65 fic robots to se
11130 6e 64 20 6e 6f 74 69 66 69 63 61 74 69 6f 6e 73 nd notifications
11140 20 74 6f 20 74 68 65 20 63 68 61 74 72 6f 6f 6d to the chatroom
11150 5c 22 2e 20 68 74 74 70 73 3a 2f 2f 66 6f 73 73 \". https://foss
11160 69 6c 2d 73 63 6d 2e 6f 72 67 2f 68 6f 6d 65 2f il-scm.org/home/
11170 68 65 6c 70 2f 63 68 61 74 2d 70 6f 6c 6c 2d 74 help/chat-poll-t
11180 69 6d 65 6f 75 74 20 61 6e 64 20 60 66 6f 73 73 imeout and `foss
11190 69 6c 20 68 65 6c 70 20 63 68 61 74 2d 70 6f 6c il help chat-pol
111a0 6c 2d 74 69 6d 65 6f 75 74 60 20 28 32 2e 32 37 l-timeout` (2.27
111b0 2c 20 72 75 6e 20 6f 6e 20 74 68 69 73 20 68 6f , run on this ho
111c0 73 74 29 3a 20 64 65 66 61 75 6c 74 20 34 32 30 st): default 420
111d0 2c 20 5c 22 61 62 6f 75 74 20 37 20 6d 69 6e 75 , \"about 7 minu
111e0 74 65 73 5c 22 2e 20 52 46 43 20 35 33 38 32 20 tes\". RFC 5382
111f0 52 45 51 2d 35 2c 20 68 74 74 70 73 3a 2f 2f 77 REQ-5, https://w
11200 77 77 2e 72 66 63 2d 65 64 69 74 6f 72 2e 6f 72 ww.rfc-editor.or
11210 67 2f 72 66 63 2f 72 66 63 35 33 38 32 2e 68 74 g/rfc/rfc5382.ht
11220 6d 6c 3a 20 61 20 4e 41 54 20 6d 75 73 74 20 6e ml: a NAT must n
11230 6f 74 20 64 72 6f 70 20 61 6e 20 69 64 6c 65 20 ot drop an idle
11240 65 73 74 61 62 6c 69 73 68 65 64 20 54 43 50 20 established TCP
11250 63 6f 6e 6e 65 63 74 69 6f 6e 20 69 6e 20 5c 22 connection in \"
11260 6c 65 73 73 20 74 68 61 6e 20 32 20 68 6f 75 72 less than 2 hour
11270 73 20 34 20 6d 69 6e 75 74 65 73 5c 22 2e 20 52 s 4 minutes\". R
11280 46 43 20 34 37 38 37 20 52 45 51 2d 35 3a 20 55 FC 4787 REQ-5: U
11290 44 50 20 6d 61 70 70 69 6e 67 73 20 6c 61 73 74 DP mappings last
112a0 20 5c 22 6e 6f 74 20 2e 2e 2e 20 6c 65 73 73 20 \"not ... less
112b0 74 68 61 6e 20 74 77 6f 20 6d 69 6e 75 74 65 73 than two minutes
112c0 5c 22 2e 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 \".". },. {.
112d0 20 22 63 6c 61 69 6d 22 3a 20 22 41 20 6d 69 6e "claim": "A min
112e0 69 6d 61 6c 20 68 6f 6c 65 20 70 75 6e 63 68 65 imal hole punche
112f0 72 20 73 70 65 63 69 66 69 63 20 74 6f 20 46 6f r specific to Fo
11300 73 73 69 6c 20 77 6f 75 6c 64 20 6e 65 65 64 20 ssil would need
11310 66 6f 75 72 20 70 61 72 74 73 3a 20 28 31 29 20 four parts: (1)
11320 61 64 64 72 65 73 73 20 65 78 63 68 61 6e 67 65 address exchange
11330 20 74 68 72 6f 75 67 68 20 74 68 65 20 46 6f 73 through the Fos
11340 73 69 6c 20 73 65 72 76 65 72 2c 20 28 32 29 20 sil server, (2)
11350 61 20 53 54 55 4e 20 72 65 73 70 6f 6e 64 65 72 a STUN responder
11360 2c 20 6f 72 20 74 68 65 20 72 6f 75 74 65 72 27 , or the router'
11370 73 20 65 78 74 65 72 6e 61 6c 20 61 64 64 72 65 s external addre
11380 73 73 20 76 69 61 20 50 43 50 2f 4e 41 54 2d 50 ss via PCP/NAT-P
11390 4d 50 20 77 68 65 72 65 20 74 68 61 74 20 77 6f MP where that wo
113a0 72 6b 73 2c 20 28 33 29 20 6f 6e 20 65 61 63 68 rks, (3) on each
113b0 20 6e 6f 64 65 2c 20 61 20 68 65 6c 70 65 72 20 node, a helper
113c0 74 68 61 74 20 6f 77 6e 73 20 61 20 73 6f 63 6b that owns a sock
113d0 65 74 2c 20 70 75 6e 63 68 65 73 20 69 74 20 61 et, punches it a
113e0 6e 64 20 63 61 72 72 69 65 73 20 46 6f 73 73 69 nd carries Fossi
113f0 6c 27 73 20 48 54 54 50 20 73 79 6e 63 20 74 68 l's HTTP sync th
11400 72 6f 75 67 68 20 69 74 20 77 69 74 68 20 69 74 rough it with it
11410 73 20 6f 77 6e 20 65 6e 63 72 79 70 74 69 6f 6e s own encryption
11420 20 61 6e 64 20 61 75 74 68 65 6e 74 69 63 61 74 and authenticat
11430 69 6f 6e 2c 20 61 6e 64 20 28 34 29 20 74 6f 64 ion, and (4) tod
11440 61 79 27 73 20 73 79 6e 63 20 74 68 72 6f 75 67 ay's sync throug
11450 68 20 74 68 65 20 73 65 72 76 65 72 20 61 73 20 h the server as
11460 74 68 65 20 66 61 6c 6c 62 61 63 6b 2e 20 46 6f the fallback. Fo
11470 73 73 69 6c 27 73 20 6f 77 6e 20 63 6c 69 65 6e ssil's own clien
11480 74 20 63 61 6e 6e 6f 74 20 70 75 6e 63 68 20 62 t cannot punch b
11490 65 63 61 75 73 65 20 69 74 20 6f 70 65 6e 73 20 ecause it opens
114a0 69 74 73 20 6f 77 6e 20 54 43 50 20 63 6f 6e 6e its own TCP conn
114b0 65 63 74 69 6f 6e 73 2e 20 45 76 65 6e 20 74 68 ections. Even th
114c0 65 6e 2c 20 72 6f 75 67 68 6c 79 20 31 30 25 20 en, roughly 10%
114d0 74 6f 20 33 30 25 20 6f 66 20 6e 6f 64 65 20 70 to 30% of node p
114e0 61 69 72 73 20 77 6f 75 6c 64 20 73 74 61 79 20 airs would stay
114f0 6f 6e 20 74 68 65 20 66 61 6c 6c 62 61 63 6b 2e on the fallback.
11500 20 54 68 69 73 20 69 73 20 6d 79 20 69 6e 66 65 This is my infe
11510 72 65 6e 63 65 20 66 72 6f 6d 20 74 68 65 20 73 rence from the s
11520 6f 75 72 63 65 73 2c 20 6e 6f 74 20 61 20 74 65 ources, not a te
11530 73 74 65 64 20 64 65 73 69 67 6e 2e 22 2c 0a 20 sted design.",.
11540 20 20 22 73 6f 75 72 63 65 22 3a 20 22 54 61 69 "source": "Tai
11550 6c 73 63 61 6c 65 2c 20 63 6f 6e 63 6c 75 73 69 lscale, conclusi
11560 6f 6e 20 6c 69 73 74 3a 20 5c 22 44 69 72 65 63 on list: \"Direc
11570 74 20 61 63 63 65 73 73 20 74 6f 20 61 20 73 6f t access to a so
11580 63 6b 65 74 20 69 6e 20 79 6f 75 72 20 70 72 6f cket in your pro
11590 67 72 61 6d 5c 22 2c 20 5c 22 41 20 63 6f 6d 6d gram\", \"A comm
115a0 75 6e 69 63 61 74 69 6f 6e 20 73 69 64 65 20 63 unication side c
115b0 68 61 6e 6e 65 6c 20 77 69 74 68 20 79 6f 75 72 hannel with your
115c0 20 70 65 65 72 73 5c 22 2c 20 5c 22 41 20 63 6f peers\", \"A co
115d0 75 70 6c 65 20 6f 66 20 53 54 55 4e 20 73 65 72 uple of STUN ser
115e0 76 65 72 73 5c 22 2c 20 5c 22 41 20 6e 65 74 77 vers\", \"A netw
115f0 6f 72 6b 20 6f 66 20 66 61 6c 6c 62 61 63 6b 20 ork of fallback
11600 72 65 6c 61 79 73 20 28 6f 70 74 69 6f 6e 61 6c relays (optional
11610 2c 20 62 75 74 20 68 69 67 68 6c 79 20 72 65 63 , but highly rec
11620 6f 6d 6d 65 6e 64 65 64 29 5c 22 2c 20 61 6e 64 ommended)\", and
11630 20 5c 22 4d 61 6b 65 20 73 75 72 65 20 65 76 65 \"Make sure eve
11640 72 79 74 68 69 6e 67 20 69 73 20 65 6e 63 72 79 rything is encry
11650 70 74 65 64 20 61 6e 64 20 61 75 74 68 65 6e 74 pted and authent
11660 69 63 61 74 65 64 20 65 6e 64 2d 74 6f 2d 65 6e icated end-to-en
11670 64 5c 22 2e 20 52 46 43 20 35 33 38 32 20 52 45 d\". RFC 5382 RE
11680 51 2d 32 3a 20 5c 22 41 20 4e 41 54 20 4d 55 53 Q-2: \"A NAT MUS
11690 54 20 68 61 6e 64 6c 65 20 74 68 65 20 54 43 50 T handle the TCP
116a0 20 73 69 6d 75 6c 74 61 6e 65 6f 75 73 2d 6f 70 simultaneous-op
116b0 65 6e 20 6d 6f 64 65 20 6f 66 20 63 6f 6e 6e 65 en mode of conne
116c0 63 74 69 6f 6e 20 69 6e 69 74 69 61 74 69 6f 6e ction initiation
116d0 2e 5c 22 20 46 61 69 6c 75 72 65 20 72 61 74 65 .\" Failure rate
116e0 73 20 61 72 65 20 66 72 6f 6d 20 74 68 65 20 6c s are from the l
116f0 69 62 70 32 70 2c 20 46 6f 72 64 20 61 6e 64 20 ibp2p, Ford and
11700 54 61 69 6c 73 63 61 6c 65 20 73 6f 75 72 63 65 Tailscale source
11710 73 20 61 62 6f 76 65 2e 22 0a 20 20 7d 0a 20 5d s above.". }. ]
11720 2c 0a 20 22 75 6e 63 6f 6e 66 69 72 6d 65 64 22 ,. "unconfirmed"
11730 3a 20 22 4e 6f 74 68 69 6e 67 20 77 61 73 20 74 : "Nothing was t
11740 65 73 74 65 64 2c 20 61 6e 64 20 49 20 63 6f 6e ested, and I con
11750 74 61 63 74 65 64 20 6e 6f 20 73 65 72 76 65 72 tacted no server
11760 20 6f 74 68 65 72 20 74 68 61 6e 20 70 75 62 6c other than publ
11770 69 63 20 77 65 62 20 70 61 67 65 73 2e 20 49 20 ic web pages. I
11780 64 6f 20 6e 6f 74 20 6b 6e 6f 77 20 77 68 61 74 do not know what
11790 20 4e 41 54 20 74 79 70 65 73 20 74 68 65 20 4f NAT types the O
117a0 43 58 20 6e 6f 64 65 73 20 61 72 65 20 61 63 74 CX nodes are act
117b0 75 61 6c 6c 79 20 62 65 68 69 6e 64 2e 5c 6e 2d ually behind.\n-
117c0 20 4d 65 61 73 75 72 65 6d 65 6e 74 73 3a 20 74 Measurements: t
117d0 68 65 20 43 47 4e 20 70 72 65 76 61 6c 65 6e 63 he CGN prevalenc
117e0 65 20 66 69 67 75 72 65 73 20 63 6f 6d 65 20 66 e figures come f
117f0 72 6f 6d 20 32 30 31 36 20 64 61 74 61 2c 20 61 rom 2016 data, a
11800 6e 64 20 49 20 66 6f 75 6e 64 20 6e 6f 20 6e 65 nd I found no ne
11810 77 65 72 20 66 69 67 75 72 65 2e 20 54 61 69 6c wer figure. Tail
11820 73 63 61 6c 65 27 73 20 5c 22 6f 76 65 72 20 39 scale's \"over 9
11830 30 25 5c 22 20 69 73 20 74 68 65 20 61 75 74 68 0%\" is the auth
11840 6f 72 27 73 20 65 73 74 69 6d 61 74 65 2e 20 54 or's estimate. T
11850 68 65 20 6c 69 62 70 32 70 20 37 30 25 20 61 70 he libp2p 70% ap
11860 70 6c 69 65 73 20 6f 6e 6c 79 20 61 66 74 65 72 plies only after
11870 20 72 65 6c 61 79 20 72 65 73 65 72 76 61 74 69 relay reservati
11880 6f 6e 20 61 6e 64 20 70 75 62 6c 69 63 20 61 64 on and public ad
11890 64 72 65 73 73 20 64 69 73 63 6f 76 65 72 79 20 dress discovery
118a0 68 61 76 65 20 73 75 63 63 65 65 64 65 64 2c 20 have succeeded,
118b0 73 6f 20 74 68 65 20 66 75 6c 6c 20 65 6e 64 2d so the full end-
118c0 74 6f 2d 65 6e 64 20 72 61 74 65 20 69 73 20 6c to-end rate is l
118d0 6f 77 65 72 2e 20 49 20 64 69 64 20 6e 6f 74 20 ower. I did not
118e0 66 69 6e 64 20 61 20 62 72 65 61 6b 64 6f 77 6e find a breakdown
118f0 20 6f 66 20 66 61 69 6c 75 72 65 73 20 62 79 20 of failures by
11900 4e 41 54 20 74 79 70 65 2e 5c 6e 2d 20 50 43 50 NAT type.\n- PCP
11910 20 6f 6e 20 43 47 4e 73 3a 20 52 46 43 20 36 38 on CGNs: RFC 68
11920 38 38 20 73 61 79 73 20 61 20 43 47 4e 20 4d 55 88 says a CGN MU
11930 53 54 20 6f 66 66 65 72 20 61 20 6d 61 70 70 69 ST offer a mappi
11940 6e 67 20 70 72 6f 74 6f 63 6f 6c 2c 20 70 72 65 ng protocol, pre
11950 66 65 72 61 62 6c 79 20 50 43 50 2e 20 49 20 66 ferably PCP. I f
11960 6f 75 6e 64 20 6e 6f 20 64 61 74 61 20 6f 6e 20 ound no data on
11970 77 68 65 74 68 65 72 20 72 65 61 6c 20 49 53 50 whether real ISP
11980 20 43 47 4e 73 20 61 63 74 75 61 6c 6c 79 20 64 CGNs actually d
11990 6f 2e 5c 6e 2d 20 70 77 6e 61 74 3a 20 49 20 63 o.\n- pwnat: I c
119a0 6f 75 6c 64 20 6e 6f 74 20 63 6f 6e 66 69 72 6d ould not confirm
119b0 20 69 74 73 20 6d 61 69 6e 74 65 6e 61 6e 63 65 its maintenance
119c0 20 73 74 61 74 75 73 20 6f 72 20 61 6e 79 20 73 status or any s
119d0 75 63 63 65 73 73 20 72 61 74 65 2e 20 49 20 61 uccess rate. I a
119e0 6c 73 6f 20 63 6f 75 6c 64 20 6e 6f 74 20 63 6f lso could not co
119f0 6e 66 69 72 6d 20 77 68 65 74 68 65 72 20 69 74 nfirm whether it
11a00 73 20 49 43 4d 50 20 74 72 69 63 6b 20 67 65 74 s ICMP trick get
11a10 73 20 74 68 72 6f 75 67 68 20 63 6f 6d 6d 6f 6e s through common
11a20 20 43 47 4e 73 2e 5c 6e 2d 20 46 6f 73 73 69 6c CGNs.\n- Fossil
11a30 20 61 6e 64 20 4f 43 58 20 64 65 74 61 69 6c 73 and OCX details
11a40 3a 5c 6e 20 20 2d 20 57 68 65 74 68 65 72 20 74 :\n - Whether t
11a50 68 65 20 72 63 76 66 72 6f 6d 2e 69 70 61 64 64 he rcvfrom.ipadd
11a60 72 20 63 6f 6c 75 6d 6e 20 72 65 63 6f 72 64 73 r column records
11a70 20 74 68 65 20 63 6c 69 65 6e 74 27 73 20 72 65 the client's re
11a80 61 6c 20 61 64 64 72 65 73 73 20 77 68 65 6e 20 al address when
11a90 74 68 65 20 70 75 62 6c 69 63 20 73 65 72 76 65 the public serve
11aa0 72 20 73 69 74 73 20 62 65 68 69 6e 64 20 61 20 r sits behind a
11ab0 72 65 76 65 72 73 65 20 70 72 6f 78 79 2c 20 61 reverse proxy, a
11ac0 6e 64 20 77 68 65 74 68 65 72 20 74 68 65 20 4f nd whether the O
11ad0 43 58 20 73 65 72 76 65 72 20 64 6f 65 73 2e 5c CX server does.\
11ae0 6e 20 20 2d 20 57 68 65 74 68 65 72 20 74 68 65 n - Whether the
11af0 20 61 66 74 65 72 2d 72 65 63 65 69 76 65 20 68 after-receive h
11b00 6f 6f 6b 20 63 61 6e 20 70 6f 73 74 20 74 6f 20 ook can post to
11b10 74 68 65 20 73 65 72 76 65 72 27 73 20 6f 77 6e the server's own
11b20 20 63 68 61 74 20 77 69 74 68 20 60 66 6f 73 73 chat with `foss
11b30 69 6c 20 63 68 61 74 20 73 65 6e 64 60 2e 5c 6e il chat send`.\n
11b40 20 20 2d 20 57 68 61 74 20 65 61 63 68 20 68 65 - What each he
11b50 6c 64 20 2f 63 68 61 74 2d 70 6f 6c 6c 20 63 6f ld /chat-poll co
11b60 73 74 73 20 74 68 65 20 73 65 72 76 65 72 20 75 sts the server u
11b70 6e 64 65 72 20 43 47 49 2c 20 61 6e 64 20 77 68 nder CGI, and wh
11b80 65 74 68 65 72 20 70 72 6f 78 69 65 73 20 6f 6e ether proxies on
11b90 20 74 68 65 20 70 61 74 68 20 6b 65 65 70 20 61 the path keep a
11ba0 20 34 32 30 2d 73 65 63 6f 6e 64 20 72 65 71 75 420-second requ
11bb0 65 73 74 20 6f 70 65 6e 2e 5c 6e 20 20 2d 20 43 est open.\n - C
11bc0 68 61 74 20 6e 65 65 64 73 20 74 68 65 20 43 20 hat needs the C
11bd0 63 61 70 61 62 69 6c 69 74 79 2e 20 4e 6f 64 65 capability. Node
11be0 20 6c 6f 67 69 6e 73 20 68 6f 6c 64 20 67 2c 20 logins hold g,
11bf0 6f 20 61 6e 64 20 69 20 62 79 20 64 65 66 61 75 o and i by defau
11c00 6c 74 2c 20 73 6f 20 61 6e 20 61 64 6d 69 6e 20 lt, so an admin
11c10 77 6f 75 6c 64 20 68 61 76 65 20 74 6f 20 67 72 would have to gr
11c20 61 6e 74 20 43 20 62 79 20 68 61 6e 64 2e 5c 6e ant C by hand.\n
11c30 2d 20 41 20 70 75 6e 63 68 20 74 69 6d 65 64 20 - A punch timed
11c40 74 68 72 6f 75 67 68 20 73 74 6f 72 65 2d 61 6e through store-an
11c50 64 2d 66 6f 72 77 61 72 64 20 73 79 6e 63 20 61 d-forward sync a
11c60 6c 6f 6e 65 20 28 61 67 72 65 65 20 6f 6e 20 61 lone (agree on a
11c70 20 66 75 74 75 72 65 20 74 69 6d 65 2c 20 77 69 future time, wi
11c80 74 68 20 6e 6f 20 6c 69 76 65 20 63 68 61 6e 6e th no live chann
11c90 65 6c 29 20 69 73 20 6d 79 20 6f 77 6e 20 72 65 el) is my own re
11ca0 61 73 6f 6e 69 6e 67 3b 20 49 20 66 6f 75 6e 64 asoning; I found
11cb0 20 6e 6f 20 73 6f 75 72 63 65 20 6f 72 20 6d 65 no source or me
11cc0 61 73 75 72 65 6d 65 6e 74 20 66 6f 72 20 69 74 asurement for it
11cd0 2e 5c 6e 2d 20 49 20 64 69 64 20 6e 6f 74 20 66 .\n- I did not f
11ce0 65 74 63 68 20 53 79 6e 63 74 68 69 6e 67 27 73 etch Syncthing's
11cf0 20 67 6c 6f 62 61 6c 20 64 69 73 63 6f 76 65 72 global discover
11d00 79 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 2c y documentation,
11d10 20 73 6f 20 49 20 68 61 76 65 20 6e 6f 74 20 63 so I have not c
11d20 6f 6e 66 69 72 6d 65 64 20 74 68 61 74 20 69 74 onfirmed that it
11d30 73 20 64 69 73 63 6f 76 65 72 79 20 69 73 20 61 s discovery is a
11d40 6c 73 6f 20 68 6f 73 74 65 64 2e 5c 6e 2d 20 47 lso hosted.\n- G
11d50 6f 6f 67 6c 65 27 73 20 49 50 76 36 20 70 61 67 oogle's IPv6 pag
11d60 65 20 72 65 74 75 72 6e 65 64 20 6e 6f 20 6e 75 e returned no nu
11d70 6d 62 65 72 20 77 68 65 6e 20 66 65 74 63 68 65 mber when fetche
11d80 64 3b 20 74 68 65 20 35 30 25 20 66 69 67 75 72 d; the 50% figur
11d90 65 20 63 6f 6d 65 73 20 66 72 6f 6d 20 74 68 65 e comes from the
11da0 20 41 50 4e 49 43 20 62 6c 6f 67 27 73 20 72 65 APNIC blog's re
11db0 70 6f 72 74 20 6f 66 20 47 6f 6f 67 6c 65 27 73 port of Google's
11dc0 20 64 61 74 61 2e 5c 6e 2d 20 54 68 65 20 70 61 data.\n- The pa
11dd0 74 68 73 20 43 47 4e 20 70 72 65 76 61 6c 65 6e ths CGN prevalen
11de0 63 65 20 77 61 73 20 72 65 61 64 20 66 72 6f 6d ce was read from
11df0 3a 20 2f 76 61 72 2f 6c 69 62 2f 6f 63 78 2f 61 : /var/lib/ocx/a
11e00 67 65 6e 74 73 2f 6f 70 75 73 2d 6f 63 78 32 2f gents/opus-ocx2/
11e10 70 72 6f 6a 65 63 74 73 2f 6f 6c 6c 61 6d 61 2f projects/ollama/
11e20 62 32 64 65 38 62 30 63 32 63 36 37 30 30 65 62 b2de8b0c2c6700eb
11e30 35 63 36 38 36 62 31 37 34 37 62 35 61 61 61 31 5c686b1747b5aaa1
11e40 65 32 64 32 64 30 31 33 37 30 61 63 35 35 66 32 e2d2d01370ac55f2
11e50 65 35 61 31 35 31 61 36 37 65 30 33 62 34 38 61 e5a151a67e03b48a
11e60 2f 2e 63 6c 61 75 64 65 2f 70 72 6f 6a 65 63 74 /.claude/project
11e70 73 2f 2d 76 61 72 2d 6c 69 62 2d 6f 63 78 2d 61 s/-var-lib-ocx-a
11e80 67 65 6e 74 73 2d 6f 70 75 73 2d 6f 63 78 32 2d gents-opus-ocx2-
11e90 70 72 6f 6a 65 63 74 73 2d 6f 6c 6c 61 6d 61 2d projects-ollama-
11ea0 62 32 64 65 38 62 30 63 32 63 36 37 30 30 65 62 b2de8b0c2c6700eb
11eb0 35 63 36 38 36 62 31 37 34 37 62 35 61 61 61 31 5c686b1747b5aaa1
11ec0 65 32 64 32 64 30 31 33 37 30 61 63 35 35 66 32 e2d2d01370ac55f2
11ed0 65 35 61 31 35 31 61 36 37 65 30 33 62 34 38 61 e5a151a67e03b48a
11ee0 2f 33 66 37 63 66 65 32 35 2d 32 38 61 61 2d 34 /3f7cfe25-28aa-4
11ef0 63 35 35 2d 38 32 37 63 2d 62 63 30 36 31 38 64 c55-827c-bc0618d
11f00 61 38 31 65 36 2f 74 6f 6f 6c 2d 72 65 73 75 6c a81e6/tool-resul
11f10 74 73 2f 77 65 62 66 65 74 63 68 2d 31 37 39 32 ts/webfetch-1792
11f20 34 31 33 31 33 38 38 36 38 2d 38 34 68 6f 71 36 413138868-84hoq6
11f30 2e 70 64 66 20 28 61 72 58 69 76 20 31 36 30 35 .pdf (arXiv 1605
11f40 2e 30 35 36 30 36 29 20 61 6e 64 20 74 68 65 20 .05606) and the
11f50 6c 6f 63 61 6c 20 62 69 6e 61 72 79 20 2f 75 73 local binary /us
11f60 72 2f 62 69 6e 2f 66 6f 73 73 69 6c 20 28 32 2e r/bin/fossil (2.
11f70 32 37 29 2e 22 0a 7d 00 00 00 00 00 00 00 00 00 27).".}.........
11f80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11f90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11fb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11fd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
11ff0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12000 73 79 6e 63 2d 74 72 69 67 67 65 72 2d 72 65 73 sync-trigger-res
12010 65 61 72 63 68 2f 72 65 61 64 2d 73 79 6e 63 74 earch/read-synct
12020 68 69 6e 67 2e 6a 73 6f 6e 00 00 00 00 00 00 00 hing.json.......
12030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12060 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 30 ....0000644.0000
12070 30 30 30 00 30 30 30 30 30 30 30 00 30 30 30 30 000.0000000.0000
12080 30 30 33 32 30 34 34 00 31 35 32 36 35 34 31 31 0032044.15265411
12090 33 37 31 00 30 31 37 36 30 35 00 20 30 00 00 00 371.017605. 0...
120a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
120b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
120c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
120d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
120e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
120f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12100 00 75 73 74 61 72 20 20 00 72 6f 6f 74 00 00 00 .ustar .root...
12110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12120 00 00 00 00 00 00 00 00 00 72 6f 6f 74 00 00 00 .........root...
12130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
121a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
121b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
121c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
121d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
121e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
121f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
12200 7b 0a 20 22 70 6f 69 6e 74 73 22 3a 20 5b 0a 20 {. "points": [.
12210 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 {. "claim": "
12220 54 68 65 20 74 68 72 65 61 64 20 69 73 20 73 68 The thread is sh
12230 6f 72 74 3a 20 34 20 70 6f 73 74 73 20 69 6e 20 ort: 4 posts in
12240 61 6c 6c 20 28 70 6f 73 74 20 69 64 73 20 31 30 all (post ids 10
12250 33 30 34 31 2c 20 31 30 33 30 34 34 2c 20 31 30 3041, 103044, 10
12260 38 33 31 34 2c 20 31 30 38 33 31 35 29 2c 20 69 8314, 108315), i
12270 6e 20 74 68 65 20 46 65 61 74 75 72 65 20 63 61 n the Feature ca
12280 74 65 67 6f 72 79 2c 20 66 72 6f 6d 20 32 30 32 tegory, from 202
12290 34 2d 30 37 2d 32 33 20 74 6f 20 32 30 32 35 2d 4-07-23 to 2025-
122a0 30 32 2d 30 34 2e 20 49 20 72 65 61 64 20 74 68 02-04. I read th
122b0 65 20 77 68 6f 6c 65 20 74 68 72 65 61 64 20 66 e whole thread f
122c0 72 6f 6d 20 69 74 73 20 4a 53 4f 4e 20 61 6e 64 rom its JSON and
122d0 20 72 61 77 20 74 65 78 74 20 66 6f 72 6d 73 2e raw text forms.
122e0 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
122f0 22 68 74 74 70 73 3a 2f 2f 66 6f 72 75 6d 2e 73 "https://forum.s
12300 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 74 2f 32 yncthing.net/t/2
12310 32 34 37 31 2e 6a 73 6f 6e 20 28 70 6f 73 74 73 2471.json (posts
12320 5f 63 6f 75 6e 74 20 34 2c 20 70 6f 73 74 5f 73 _count 4, post_s
12330 74 72 65 61 6d 2e 73 74 72 65 61 6d 29 3b 20 68 tream.stream); h
12340 74 74 70 73 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e ttps://forum.syn
12350 63 74 68 69 6e 67 2e 6e 65 74 2f 72 61 77 2f 32 cthing.net/raw/2
12360 32 34 37 31 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 2471". },. {.
12370 20 20 22 63 6c 61 69 6d 22 3a 20 22 50 6f 73 74 "claim": "Post
12380 20 31 20 69 73 20 62 79 20 55 70 74 69 67 68 74 1 is by Uptight
12390 48 79 70 65 72 74 65 78 74 2c 20 32 30 32 34 2d Hypertext, 2024-
123a0 30 37 2d 32 33 2e 20 49 74 20 6c 69 6e 6b 73 20 07-23. It links
123b0 54 61 69 6c 73 63 61 6c 65 27 73 20 74 77 6f 20 Tailscale's two
123c0 62 6c 6f 67 20 70 6f 73 74 73 20 61 6e 64 20 73 blog posts and s
123d0 61 79 73 20 54 61 69 6c 73 63 61 6c 65 20 27 61 ays Tailscale 'a
123e0 70 70 61 72 65 6e 74 6c 79 20 68 61 76 65 20 73 pparently have s
123f0 6f 6d 65 20 61 64 76 61 6e 63 65 64 20 61 6e 64 ome advanced and
12400 20 6f 70 65 6e 20 73 6f 75 72 63 65 20 6d 65 74 open source met
12410 68 6f 64 73 20 66 6f 72 20 70 75 6e 63 68 69 6e hods for punchin
12420 67 20 74 68 72 6f 75 67 68 20 4e 41 54 73 20 77 g through NATs w
12430 69 74 68 6f 75 74 20 55 50 6e 50 20 61 6e 64 20 ithout UPnP and
12440 4e 41 54 2d 50 4d 50 20 69 6e 63 6c 75 64 69 6e NAT-PMP includin
12450 67 20 70 65 6f 70 6c 65 20 73 74 75 63 6b 20 62 g people stuck b
12460 65 68 69 6e 64 20 43 47 2d 4e 41 54 2e 27 20 49 ehind CG-NAT.' I
12470 74 20 61 73 6b 73 20 77 68 65 74 68 65 72 20 53 t asks whether S
12480 79 6e 63 74 68 69 6e 67 20 63 6f 75 6c 64 20 75 yncthing could u
12490 73 65 20 74 68 65 6d 20 27 74 6f 20 69 6e 63 72 se them 'to incr
124a0 65 61 73 65 20 74 68 65 20 6e 75 6d 62 65 72 20 ease the number
124b0 6f 66 20 63 6c 69 65 6e 74 73 20 61 62 6c 65 20 of clients able
124c0 74 6f 20 67 65 74 20 64 69 72 65 63 74 20 63 6f to get direct co
124d0 6e 6e 65 63 74 69 6f 6e 73 20 69 6e 73 74 65 61 nnections instea
124e0 64 20 6f 66 20 72 65 6c 79 69 6e 67 20 6f 6e 20 d of relying on
124f0 72 65 6c 61 79 69 6e 67 3f 27 22 2c 0a 20 20 20 relaying?'",.
12500 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 "source": "https
12510 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 69 ://forum.syncthi
12520 6e 67 2e 6e 65 74 2f 72 61 77 2f 32 32 34 37 31 ng.net/raw/22471
12530 20 23 31 20 28 6c 69 6e 6b 73 20 68 74 74 70 73 #1 (links https
12540 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e 63 6f 6d ://tailscale.com
12550 2f 62 6c 6f 67 2f 68 6f 77 2d 74 61 69 6c 73 63 /blog/how-tailsc
12560 61 6c 65 2d 77 6f 72 6b 73 20 61 6e 64 20 68 74 ale-works and ht
12570 74 70 73 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e tps://tailscale.
12580 63 6f 6d 2f 62 6c 6f 67 2f 68 6f 77 2d 6e 61 74 com/blog/how-nat
12590 2d 74 72 61 76 65 72 73 61 6c 2d 77 6f 72 6b 73 -traversal-works
125a0 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 )". },. {. "
125b0 63 6c 61 69 6d 22 3a 20 22 50 6f 73 74 20 32 20 claim": "Post 2
125c0 69 73 20 62 79 20 62 74 39 30 2c 20 31 38 20 6d is by bt90, 18 m
125d0 69 6e 75 74 65 73 20 6c 61 74 65 72 2e 20 49 74 inutes later. It
125e0 20 69 73 20 74 68 65 20 6f 6e 6c 79 20 73 75 62 is the only sub
125f0 73 74 61 6e 74 69 76 65 20 61 6e 73 77 65 72 3a stantive answer:
12600 20 27 57 65 27 72 65 20 61 6c 72 65 61 64 79 20 'We're already
12610 75 73 69 6e 67 20 68 6f 6c 65 70 75 6e 63 68 69 using holepunchi
12620 6e 67 20 74 6f 20 65 73 74 61 62 6c 69 73 68 20 ng to establish
12630 54 43 50 2f 55 44 50 20 63 6f 6e 6e 65 63 74 69 TCP/UDP connecti
12640 6f 6e 73 2c 20 69 66 20 70 6f 73 73 69 62 6c 65 ons, if possible
12650 2e 20 54 68 65 20 6f 6e 6c 79 20 72 65 61 6c 20 . The only real
12660 64 69 66 66 65 72 65 6e 63 65 20 69 73 20 74 68 difference is th
12670 61 74 20 54 61 69 6c 73 63 61 6c 65 20 69 73 20 at Tailscale is
12680 70 75 6c 6c 69 6e 67 20 61 20 66 65 77 20 6d 6f pulling a few mo
12690 72 65 20 74 72 69 63 6b 73 20 74 6f 20 64 65 61 re tricks to dea
126a0 6c 20 77 69 74 68 20 45 6e 64 70 6f 69 6e 74 2d l with Endpoint-
126b0 44 65 70 65 6e 64 65 6e 74 20 4e 41 54 73 2e 27 Dependent NATs.'
126c0 20 62 74 39 30 20 69 73 20 61 6e 20 61 63 74 69 bt90 is an acti
126d0 76 65 20 63 6f 6e 74 72 69 62 75 74 6f 72 2c 20 ve contributor,
126e0 66 6f 72 20 65 78 61 6d 70 6c 65 20 74 68 65 20 for example the
126f0 61 75 74 68 6f 72 20 6f 66 20 6d 65 72 67 65 64 author of merged
12700 20 50 52 20 23 31 30 30 33 31 2e 20 49 20 64 69 PR #10031. I di
12710 64 20 6e 6f 74 20 63 6f 6e 66 69 72 6d 20 77 68 d not confirm wh
12720 65 74 68 65 72 20 62 74 39 30 20 69 73 20 61 20 ether bt90 is a
12730 6d 61 69 6e 74 61 69 6e 65 72 2e 22 2c 0a 20 20 maintainer.",.
12740 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
12750 73 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 s://forum.syncth
12760 69 6e 67 2e 6e 65 74 2f 72 61 77 2f 32 32 34 37 ing.net/raw/2247
12770 31 20 23 32 3b 20 68 74 74 70 73 3a 2f 2f 67 69 1 #2; https://gi
12780 74 68 75 62 2e 63 6f 6d 2f 73 79 6e 63 74 68 69 thub.com/syncthi
12790 6e 67 2f 73 79 6e 63 74 68 69 6e 67 2f 70 75 6c ng/syncthing/pul
127a0 6c 2f 31 30 30 33 31 22 0a 20 20 7d 2c 0a 20 20 l/10031". },.
127b0 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 22 50 {. "claim": "P
127c0 6f 73 74 20 33 20 69 73 20 62 79 20 4a 65 73 73 ost 3 is by Jess
127d0 65 54 47 20 28 4a 65 73 73 65 20 54 61 6c 61 76 eTG (Jesse Talav
127e0 65 72 61 29 2c 20 32 30 32 35 2d 30 32 2d 30 34 era), 2025-02-04
127f0 2e 20 48 65 20 61 73 6b 73 20 77 68 65 72 65 20 . He asks where
12800 69 6e 20 74 68 65 20 63 6f 64 65 20 74 68 69 73 in the code this
12810 20 69 73 20 64 6f 6e 65 2c 20 74 6f 20 6c 65 61 is done, to lea
12820 72 6e 20 27 68 6f 77 20 53 79 6e 63 54 68 69 6e rn 'how SyncThin
12830 67 20 74 72 61 6e 73 66 65 72 73 20 66 69 6c 65 g transfers file
12840 73 20 77 69 74 68 6f 75 74 20 6e 65 65 64 69 6e s without needin
12850 67 20 61 20 66 69 72 65 77 61 6c 6c 27 73 20 70 g a firewall's p
12860 65 72 6d 69 73 73 69 6f 6e 2e 27 22 2c 0a 20 20 ermission.'",.
12870 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
12880 73 3a 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 s://forum.syncth
12890 69 6e 67 2e 6e 65 74 2f 72 61 77 2f 32 32 34 37 ing.net/raw/2247
128a0 31 20 23 33 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 1 #3". },. {.
128b0 20 20 22 63 6c 61 69 6d 22 3a 20 22 50 6f 73 74 "claim": "Post
128c0 20 34 20 69 73 20 62 79 20 4e 75 6d 6d 65 72 33 4 is by Nummer3
128d0 37 38 20 28 4d 61 78 29 2c 20 32 30 32 35 2d 30 78 (Max), 2025-0
128e0 32 2d 30 34 2e 20 49 74 20 6c 69 6e 6b 73 20 57 2-04. It links W
128f0 69 6b 69 70 65 64 69 61 27 73 20 68 6f 6c 65 20 ikipedia's hole
12900 70 75 6e 63 68 69 6e 67 20 70 61 67 65 20 61 6e punching page an
12910 64 20 73 61 79 73 20 27 53 79 6e 63 74 68 69 6e d says 'Syncthin
12920 67 20 69 6d 70 6c 65 6d 65 6e 74 73 20 69 74 20 g implements it
12930 66 6f 72 20 62 6f 74 68 20 54 43 50 20 61 6e 64 for both TCP and
12940 20 55 44 50 20 77 68 65 72 65 20 61 70 70 6c 69 UDP where appli
12950 63 61 62 6c 65 2e 20 54 68 65 72 65 27 73 20 6e cable. There's n
12960 6f 74 20 74 68 61 74 20 6d 75 63 68 20 5c 22 73 ot that much \"s
12970 70 65 63 69 61 6c 5c 22 20 63 6f 64 65 20 74 6f pecial\" code to
12980 20 69 6d 70 6c 65 6d 65 6e 74 20 68 6f 6c 65 20 implement hole
12990 70 75 6e 63 68 69 6e 67 20 28 65 78 63 65 70 74 punching (except
129a0 20 66 6f 72 20 53 54 55 4e 20 6d 61 79 62 65 29 for STUN maybe)
129b0 2c 20 69 74 27 73 20 6d 6f 73 74 6c 79 20 62 61 , it's mostly ba
129c0 73 65 64 20 6f 6e 20 74 68 65 20 69 64 65 61 20 sed on the idea
129d0 74 68 61 74 20 74 77 6f 20 64 65 76 69 63 65 73 that two devices
129e0 20 64 69 61 6c 20 65 61 63 68 20 6f 74 68 65 72 dial each other
129f0 20 6f 6e 20 74 68 65 20 73 61 6d 65 20 70 6f 72 on the same por
12a00 74 73 20 61 74 20 74 68 65 20 73 61 6d 65 20 74 ts at the same t
12a10 69 6d 65 2e 27 20 49 74 20 67 69 76 65 73 20 6e ime.' It gives n
12a20 6f 20 63 6f 64 65 20 6c 6f 63 61 74 69 6f 6e 2e o code location.
12a30 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
12a40 22 68 74 74 70 73 3a 2f 2f 66 6f 72 75 6d 2e 73 "https://forum.s
12a50 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 72 61 77 yncthing.net/raw
12a60 2f 32 32 34 37 31 20 23 34 22 0a 20 20 7d 2c 0a /22471 #4". },.
12a70 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a 20 {. "claim":
12a80 22 54 68 65 20 74 68 72 65 61 64 20 72 65 61 63 "The thread reac
12a90 68 65 73 20 6e 6f 20 63 6f 6e 63 6c 75 73 69 6f hes no conclusio
12aa0 6e 20 61 6e 64 20 6d 61 6b 65 73 20 6e 6f 20 64 n and makes no d
12ab0 65 63 69 73 69 6f 6e 2e 20 4e 6f 20 63 6f 72 65 ecision. No core
12ac0 20 6d 61 69 6e 74 61 69 6e 65 72 20 70 6f 73 74 maintainer post
12ad0 73 20 69 6e 20 69 74 20 28 63 61 6c 6d 68 20 61 s in it (calmh a
12ae0 6e 64 20 41 75 64 72 69 75 73 42 75 74 6b 65 76 nd AudriusButkev
12af0 69 63 69 75 73 20 64 6f 20 6e 6f 74 20 61 70 70 icius do not app
12b00 65 61 72 29 2e 20 4e 6f 20 69 73 73 75 65 20 6f ear). No issue o
12b10 72 20 50 52 20 69 73 20 6c 69 6e 6b 65 64 2e 20 r PR is linked.
12b20 54 68 65 20 6f 6e 6c 79 20 61 6e 73 77 65 72 20 The only answer
12b30 6f 66 66 65 72 65 64 20 69 73 20 74 68 61 74 20 offered is that
12b40 53 79 6e 63 74 68 69 6e 67 20 61 6c 72 65 61 64 Syncthing alread
12b50 79 20 68 6f 6c 65 2d 70 75 6e 63 68 65 73 2c 20 y hole-punches,
12b60 61 6e 64 20 74 68 61 74 20 77 68 61 74 20 54 61 and that what Ta
12b70 69 6c 73 63 61 6c 65 20 61 64 64 73 20 69 73 20 ilscale adds is
12b80 68 61 6e 64 6c 69 6e 67 20 66 6f 72 20 65 6e 64 handling for end
12b90 70 6f 69 6e 74 2d 64 65 70 65 6e 64 65 6e 74 20 point-dependent
12ba0 28 27 68 61 72 64 27 2c 20 73 79 6d 6d 65 74 72 ('hard', symmetr
12bb0 69 63 29 20 4e 41 54 73 2e 22 2c 0a 20 20 20 22 ic) NATs.",. "
12bc0 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a source": "https:
12bd0 2f 2f 66 6f 72 75 6d 2e 73 79 6e 63 74 68 69 6e //forum.syncthin
12be0 67 2e 6e 65 74 2f 74 2f 32 32 34 37 31 2e 6a 73 g.net/t/22471.js
12bf0 6f 6e 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 on". },. {.
12c00 22 63 6c 61 69 6d 22 3a 20 22 53 79 6e 63 74 68 "claim": "Syncth
12c10 69 6e 67 27 73 20 63 6f 64 65 20 61 67 72 65 65 ing's code agree
12c20 73 20 77 69 74 68 20 62 74 39 30 27 73 20 70 6f s with bt90's po
12c30 69 6e 74 2e 20 49 74 73 20 53 54 55 4e 20 73 65 int. Its STUN se
12c40 72 76 69 63 65 20 63 6f 75 6e 74 73 20 4e 41 54 rvice counts NAT
12c50 4e 6f 6e 65 2c 20 4e 41 54 50 6f 72 74 52 65 73 None, NATPortRes
12c60 74 72 69 63 74 65 64 2c 20 4e 41 54 52 65 73 74 tricted, NATRest
12c70 72 69 63 74 65 64 2c 20 4e 41 54 46 75 6c 6c 20 ricted, NATFull
12c80 61 6e 64 20 4e 41 54 53 79 6d 6d 65 74 72 69 63 and NATSymmetric
12c90 55 44 50 46 69 72 65 77 61 6c 6c 20 61 73 20 70 UDPFirewall as p
12ca0 75 6e 63 68 61 62 6c 65 2c 20 62 75 74 20 6e 6f unchable, but no
12cb0 74 20 4e 41 54 53 79 6d 6d 65 74 72 69 63 2e 20 t NATSymmetric.
12cc0 46 6f 72 20 61 20 6e 6f 6e 2d 70 75 6e 63 68 61 For a non-puncha
12cd0 62 6c 65 20 4e 41 54 20 74 68 65 20 63 6f 6d 6d ble NAT the comm
12ce0 65 6e 74 20 72 65 61 64 73 3a 20 27 57 65 20 63 ent reads: 'We c
12cf0 61 6e 27 74 20 70 75 6e 63 68 20 74 68 72 6f 75 an't punch throu
12d00 67 68 20 74 68 69 73 20 6f 6e 65 2c 20 73 6f 20 gh this one, so
12d10 6e 6f 20 70 6f 69 6e 74 20 64 6f 69 6e 67 20 6b no point doing k
12d20 65 65 70 61 6c 69 76 65 73 20 61 6e 64 20 73 75 eepalives and su
12d30 63 68 27 2e 20 54 61 69 6c 73 63 61 6c 65 27 73 ch'. Tailscale's
12d40 20 61 72 74 69 63 6c 65 20 73 61 79 73 20 74 68 article says th
12d50 65 20 6b 65 79 20 73 70 6c 69 74 20 69 73 20 45 e key split is E
12d60 49 4d 20 76 65 72 73 75 73 20 45 44 4d 20 28 27 IM versus EDM ('
12d70 53 79 6d 6d 65 74 72 69 63 20 76 65 72 73 75 73 Symmetric versus
12d80 20 61 6e 79 74 68 69 6e 67 20 65 6c 73 65 27 29 anything else')
12d90 2e 20 49 74 20 68 61 6e 64 6c 65 73 20 68 61 72 . It handles har
12da0 64 20 4e 41 54 73 20 77 69 74 68 20 62 69 72 74 d NATs with birt
12db0 68 64 61 79 2d 70 61 72 61 64 6f 78 20 70 6f 72 hday-paradox por
12dc0 74 20 70 72 6f 62 69 6e 67 2c 20 61 6e 64 20 77 t probing, and w
12dd0 68 65 6e 20 62 6f 74 68 20 73 69 64 65 73 20 61 hen both sides a
12de0 72 65 20 68 61 72 64 20 69 74 20 73 61 79 73 20 re hard it says
12df0 74 68 65 20 6f 64 64 73 20 61 72 65 20 61 62 6f the odds are abo
12e00 75 74 20 30 2e 30 31 25 20 61 66 74 65 72 20 32 ut 0.01% after 2
12e10 30 20 73 65 63 6f 6e 64 73 2c 20 73 6f 20 69 74 0 seconds, so it
12e20 20 66 61 6c 6c 73 20 62 61 63 6b 20 74 6f 20 72 falls back to r
12e30 65 6c 61 79 73 20 28 27 77 65 20 6e 65 65 64 20 elays ('we need
12e40 73 6f 6d 65 20 6b 69 6e 64 20 6f 66 20 72 65 6c some kind of rel
12e50 69 61 62 6c 65 20 66 61 6c 6c 62 61 63 6b 20 6e iable fallback n
12e60 6f 20 6d 61 74 74 65 72 20 77 68 61 74 27 29 2e o matter what').
12e70 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
12e80 22 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 "https://raw.git
12e90 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 hubusercontent.c
12ea0 6f 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 73 79 6e om/syncthing/syn
12eb0 63 74 68 69 6e 67 2f 6d 61 69 6e 2f 6c 69 62 2f cthing/main/lib/
12ec0 73 74 75 6e 2f 73 74 75 6e 2e 67 6f 20 28 69 73 stun/stun.go (is
12ed0 43 75 72 72 65 6e 74 4e 41 54 54 79 70 65 50 75 CurrentNATTypePu
12ee0 6e 63 68 61 62 6c 65 2c 20 72 75 6e 53 74 75 6e nchable, runStun
12ef0 46 6f 72 53 65 72 76 65 72 29 3b 20 68 74 74 70 ForServer); http
12f00 73 3a 2f 2f 74 61 69 6c 73 63 61 6c 65 2e 63 6f s://tailscale.co
12f10 6d 2f 62 6c 6f 67 2f 68 6f 77 2d 6e 61 74 2d 74 m/blog/how-nat-t
12f20 72 61 76 65 72 73 61 6c 2d 77 6f 72 6b 73 22 0a raversal-works".
12f30 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 },. {. "cla
12f40 69 6d 22 3a 20 22 44 65 66 61 75 6c 74 20 74 72 im": "Default tr
12f50 61 6e 73 70 6f 72 74 73 3a 20 6c 69 73 74 65 6e ansports: listen
12f60 20 61 64 64 72 65 73 73 20 27 64 65 66 61 75 6c address 'defaul
12f70 74 27 20 6d 65 61 6e 73 20 27 74 63 70 3a 2f 2f t' means 'tcp://
12f80 30 2e 30 2e 30 2e 30 3a 32 32 30 30 30 2c 20 71 0.0.0.0:22000, q
12f90 75 69 63 3a 2f 2f 30 2e 30 2e 30 2e 30 3a 32 32 uic://0.0.0.0:22
12fa0 30 30 30 20 61 6e 64 20 64 79 6e 61 6d 69 63 2b 000 and dynamic+
12fb0 68 74 74 70 73 3a 2f 2f 72 65 6c 61 79 73 2e 73 https://relays.s
12fc0 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 65 6e 64 yncthing.net/end
12fd0 70 6f 69 6e 74 27 2e 20 54 68 65 20 66 69 72 65 point'. The fire
12fe0 77 61 6c 6c 20 70 61 67 65 20 6c 69 73 74 73 20 wall page lists
12ff0 32 32 30 30 30 2f 54 43 50 20 28 54 43 50 20 73 22000/TCP (TCP s
13000 79 6e 63 29 2c 20 32 32 30 30 30 2f 55 44 50 20 ync), 22000/UDP
13010 28 51 55 49 43 20 73 79 6e 63 29 20 61 6e 64 20 (QUIC sync) and
13020 32 31 30 32 37 2f 55 44 50 20 28 6c 6f 63 61 6c 21027/UDP (local
13030 20 64 69 73 63 6f 76 65 72 79 20 62 72 6f 61 64 discovery broad
13040 63 61 73 74 73 29 2e 22 2c 0a 20 20 20 22 73 6f casts).",. "so
13050 75 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f urce": "https://
13060 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 6f raw.githubuserco
13070 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 68 ntent.com/syncth
13080 69 6e 67 2f 64 6f 63 73 2f 6d 61 69 6e 2f 75 73 ing/docs/main/us
13090 65 72 73 2f 63 6f 6e 66 69 67 2e 72 73 74 20 28 ers/config.rst (
130a0 6c 69 73 74 65 6e 2d 61 64 64 72 65 73 73 65 73 listen-addresses
130b0 29 3b 20 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e ); https://docs.
130c0 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 syncthing.net/us
130d0 65 72 73 2f 66 69 72 65 77 61 6c 6c 2e 68 74 6d ers/firewall.htm
130e0 6c 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 l". },. {. "
130f0 63 6c 61 69 6d 22 3a 20 22 55 50 6e 50 2f 4e 41 claim": "UPnP/NA
13100 54 2d 50 4d 50 3a 20 6e 61 74 45 6e 61 62 6c 65 T-PMP: natEnable
13110 64 20 28 64 65 66 61 75 6c 74 20 74 72 75 65 29 d (default true)
13120 20 6d 65 61 6e 73 20 27 57 68 65 74 68 65 72 20 means 'Whether
13130 74 6f 20 61 74 74 65 6d 70 74 20 74 6f 20 70 65 to attempt to pe
13140 72 66 6f 72 6d 20 61 20 55 50 6e 50 20 61 6e 64 rform a UPnP and
13150 20 4e 41 54 2d 50 4d 50 20 70 6f 72 74 20 6d 61 NAT-PMP port ma
13160 70 70 69 6e 67 20 66 6f 72 20 69 6e 63 6f 6d 69 pping for incomi
13170 6e 67 20 73 79 6e 63 20 63 6f 6e 6e 65 63 74 69 ng sync connecti
13180 6f 6e 73 27 2e 20 54 68 65 20 64 65 66 61 75 6c ons'. The defaul
13190 74 73 20 61 72 65 20 6e 61 74 4c 65 61 73 65 4d ts are natLeaseM
131a0 69 6e 75 74 65 73 20 36 30 2c 20 6e 61 74 52 65 inutes 60, natRe
131b0 6e 65 77 61 6c 4d 69 6e 75 74 65 73 20 33 30 20 newalMinutes 30
131c0 61 6e 64 20 6e 61 74 54 69 6d 65 6f 75 74 53 65 and natTimeoutSe
131d0 63 6f 6e 64 73 20 31 30 2e 20 54 68 65 20 74 75 conds 10. The tu
131e0 6e 69 6e 67 20 70 61 67 65 20 73 61 79 73 20 74 ning page says t
131f0 75 72 6e 69 6e 67 20 69 74 20 6f 66 66 20 64 69 urning it off di
13200 73 61 62 6c 65 73 20 27 55 50 6e 50 20 61 6e 64 sables 'UPnP and
13210 20 4e 41 54 2d 50 4d 50 20 70 6f 72 74 20 6d 61 NAT-PMP port ma
13220 70 70 69 6e 67 73 20 61 6e 64 20 70 69 6e 68 6f ppings and pinho
13230 6c 65 73 2c 20 61 6e 64 20 2e 2e 2e 20 68 6f 6c les, and ... hol
13240 65 20 70 75 6e 63 68 69 6e 67 2e 27 20 54 68 65 e punching.' The
13250 20 63 6f 64 65 20 72 65 71 75 65 73 74 73 20 61 code requests a
13260 20 54 43 50 20 6d 61 70 70 69 6e 67 20 66 6f 72 TCP mapping for
13270 20 74 68 65 20 54 43 50 20 6c 69 73 74 65 6e 65 the TCP listene
13280 72 20 61 6e 64 20 61 20 55 44 50 20 6d 61 70 70 r and a UDP mapp
13290 69 6e 67 20 66 6f 72 20 74 68 65 20 51 55 49 43 ing for the QUIC
132a0 20 6c 69 73 74 65 6e 65 72 2e 20 4f 6e 6c 79 20 listener. Only
132b0 74 68 65 20 6c 6f 63 61 6c 20 72 6f 75 74 65 72 the local router
132c0 20 69 73 20 69 6e 76 6f 6c 76 65 64 3b 20 6e 6f is involved; no
132d0 20 68 6f 73 74 65 64 20 73 65 72 76 69 63 65 2e hosted service.
132e0 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
132f0 22 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 "https://raw.git
13300 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 hubusercontent.c
13310 6f 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 64 6f 63 om/syncthing/doc
13320 73 2f 6d 61 69 6e 2f 75 73 65 72 73 2f 63 6f 6e s/main/users/con
13330 66 69 67 2e 72 73 74 20 28 6f 70 74 69 6f 6e 73 fig.rst (options
13340 2e 6e 61 74 45 6e 61 62 6c 65 64 20 65 74 63 2e .natEnabled etc.
13350 29 3b 20 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e ); https://docs.
13360 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 syncthing.net/us
13370 65 72 73 2f 74 75 6e 69 6e 67 2e 68 74 6d 6c 20 ers/tuning.html
13380 28 27 54 75 6e 69 6e 67 20 66 6f 72 20 4c 41 4e ('Tuning for LAN
13390 2d 6f 6e 6c 79 27 29 3b 20 68 74 74 70 73 3a 2f -only'); https:/
133a0 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 /raw.githubuserc
133b0 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 ontent.com/synct
133c0 68 69 6e 67 2f 73 79 6e 63 74 68 69 6e 67 2f 6d hing/syncthing/m
133d0 61 69 6e 2f 6c 69 62 2f 63 6f 6e 6e 65 63 74 69 ain/lib/connecti
133e0 6f 6e 73 2f 74 63 70 5f 6c 69 73 74 65 6e 2e 67 ons/tcp_listen.g
133f0 6f 20 61 6e 64 20 71 75 69 63 5f 6c 69 73 74 65 o and quic_liste
13400 6e 2e 67 6f 20 28 6e 61 74 53 65 72 76 69 63 65 n.go (natService
13410 2e 4e 65 77 4d 61 70 70 69 6e 67 28 6e 61 74 2e .NewMapping(nat.
13420 54 43 50 2f 6e 61 74 2e 55 44 50 2c 20 2e 2e 2e TCP/nat.UDP, ...
13430 29 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 ))". },. {.
13440 22 63 6c 61 69 6d 22 3a 20 22 4f 6e 65 20 70 6f "claim": "One po
13450 72 74 2d 66 6f 72 77 61 72 64 20 69 73 20 65 6e rt-forward is en
13460 6f 75 67 68 3a 20 27 43 6f 6d 6d 75 6e 69 63 61 ough: 'Communica
13470 74 69 6f 6e 20 69 6e 20 53 79 6e 63 74 68 69 6e tion in Syncthin
13480 67 20 77 6f 72 6b 73 20 62 6f 74 68 20 77 61 79 g works both way
13490 73 2e 20 54 68 65 72 65 66 6f 72 65 20 69 66 20 s. Therefore if
134a0 79 6f 75 20 73 65 74 20 75 70 20 70 6f 72 74 20 you set up port
134b0 66 6f 72 77 61 72 64 73 20 66 6f 72 20 6f 6e 65 forwards for one
134c0 20 64 65 76 69 63 65 2c 20 6f 74 68 65 72 20 64 device, other d
134d0 65 76 69 63 65 73 20 77 69 6c 6c 20 62 65 20 61 evices will be a
134e0 62 6c 65 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 ble to connect t
134f0 6f 20 69 74 20 65 76 65 6e 20 77 68 65 6e 20 74 o it even when t
13500 68 65 79 20 61 72 65 20 62 65 68 69 6e 64 20 61 hey are behind a
13510 20 4e 41 54 20 6e 65 74 77 6f 72 6b 20 6f 72 20 NAT network or
13520 66 69 72 65 77 61 6c 6c 2e 27 20 54 68 65 20 64 firewall.' The d
13530 6f 63 73 20 73 61 79 20 55 50 6e 50 20 69 73 20 ocs say UPnP is
13540 27 74 68 65 20 65 61 73 69 65 73 74 20 77 61 79 'the easiest way
13550 20 74 6f 20 67 65 74 20 61 20 77 6f 72 6b 69 6e to get a workin
13560 67 20 70 6f 72 74 20 66 6f 72 77 61 72 64 27 2e g port forward'.
13570 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 ",. "source":
13580 22 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e 73 79 "https://docs.sy
13590 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 65 72 ncthing.net/user
135a0 73 2f 66 69 72 65 77 61 6c 6c 2e 68 74 6d 6c 22 s/firewall.html"
135b0 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c . },. {. "cl
135c0 61 69 6d 22 3a 20 22 51 55 49 43 20 61 6e 64 20 aim": "QUIC and
135d0 53 54 55 4e 3a 20 51 55 49 43 20 73 75 70 70 6f STUN: QUIC suppo
135e0 72 74 20 77 61 73 20 61 64 64 65 64 20 62 79 20 rt was added by
135f0 41 75 64 72 69 75 73 42 75 74 6b 65 76 69 63 69 AudriusButkevici
13600 75 73 20 69 6e 20 50 52 20 23 35 37 33 37 2c 20 us in PR #5737,
13610 6d 65 72 67 65 64 20 32 30 31 39 2d 30 35 2d 32 merged 2019-05-2
13620 39 2e 20 49 6e 20 74 65 73 74 69 6e 67 2c 20 63 9. In testing, c
13630 61 6c 6d 68 20 72 65 70 6f 72 74 65 64 20 69 74 almh reported it
13640 20 27 63 6f 6e 6e 65 63 74 65 64 20 69 6d 6d 65 'connected imme
13650 64 69 61 74 65 6c 79 20 77 69 74 68 20 4e 41 54 diately with NAT
13660 20 6f 6e 20 62 6f 74 68 20 73 69 64 65 73 27 2e on both sides'.
13670 20 53 54 55 4e 20 72 75 6e 73 20 6f 6e 20 74 68 STUN runs on th
13680 65 20 51 55 49 43 20 70 6f 72 74 20 74 6f 20 6c e QUIC port to l
13690 65 61 72 6e 20 74 68 65 20 65 78 74 65 72 6e 61 earn the externa
136a0 6c 20 49 50 76 34 20 61 64 64 72 65 73 73 20 61 l IPv4 address a
136b0 6e 64 20 70 6f 72 74 20 61 6e 64 20 74 6f 20 64 nd port and to d
136c0 65 74 65 63 74 20 74 68 65 20 4e 41 54 20 74 79 etect the NAT ty
136d0 70 65 2e 20 73 74 75 6e 53 65 72 76 65 72 20 27 pe. stunServer '
136e0 64 65 66 61 75 6c 74 27 20 65 78 70 61 6e 64 73 default' expands
136f0 20 74 6f 20 27 61 20 73 65 74 20 6f 66 20 70 75 to 'a set of pu
13700 62 6c 69 63 20 53 54 55 4e 20 73 65 72 76 65 72 blic STUN server
13710 73 2c 20 77 69 74 68 20 70 72 65 66 65 72 65 6e s, with preferen
13720 63 65 20 67 69 76 65 6e 20 74 6f 20 74 68 6f 73 ce given to thos
13730 65 20 68 6f 73 74 65 64 20 62 79 20 74 68 65 20 e hosted by the
13740 53 79 6e 63 74 68 69 6e 67 20 70 72 6f 6a 65 63 Syncthing projec
13750 74 27 2e 20 73 74 75 6e 4b 65 65 70 61 6c 69 76 t'. stunKeepaliv
13760 65 53 74 61 72 74 53 20 64 65 66 61 75 6c 74 73 eStartS defaults
13770 20 74 6f 20 31 38 30 20 28 30 20 64 69 73 61 62 to 180 (0 disab
13780 6c 65 73 20 53 54 55 4e 29 20 61 6e 64 20 69 73 les STUN) and is
13790 20 63 75 74 20 64 6f 77 6e 20 74 6f 20 73 74 75 cut down to stu
137a0 6e 4b 65 65 70 61 6c 69 76 65 4d 69 6e 53 20 28 nKeepaliveMinS (
137b0 32 30 29 20 69 66 20 74 68 65 20 6d 61 70 70 65 20) if the mappe
137c0 64 20 70 6f 72 74 20 6b 65 65 70 73 20 63 68 61 d port keeps cha
137d0 6e 67 69 6e 67 2e 22 2c 0a 20 20 20 22 73 6f 75 nging.",. "sou
137e0 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 67 rce": "https://g
137f0 69 74 68 75 62 2e 63 6f 6d 2f 73 79 6e 63 74 68 ithub.com/syncth
13800 69 6e 67 2f 73 79 6e 63 74 68 69 6e 67 2f 70 75 ing/syncthing/pu
13810 6c 6c 2f 35 37 33 37 3b 20 68 74 74 70 73 3a 2f ll/5737; https:/
13820 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 /raw.githubuserc
13830 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 ontent.com/synct
13840 68 69 6e 67 2f 64 6f 63 73 2f 6d 61 69 6e 2f 75 hing/docs/main/u
13850 73 65 72 73 2f 63 6f 6e 66 69 67 2e 72 73 74 20 sers/config.rst
13860 28 6f 70 74 69 6f 6e 73 2e 73 74 75 6e 53 65 72 (options.stunSer
13870 76 65 72 2c 20 6f 70 74 69 6f 6e 73 2e 73 74 75 ver, options.stu
13880 6e 4b 65 65 70 61 6c 69 76 65 53 74 61 72 74 53 nKeepaliveStartS
13890 29 3b 20 68 74 74 70 73 3a 2f 2f 66 6f 72 75 6d ); https://forum
138a0 2e 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 72 .syncthing.net/r
138b0 61 77 2f 31 36 34 39 30 20 23 31 20 28 62 74 39 aw/16490 #1 (bt9
138c0 30 20 73 75 6d 6d 61 72 79 29 22 0a 20 20 7d 2c 0 summary)". },
138d0 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a . {. "claim":
138e0 20 22 63 61 6c 6d 68 20 73 61 79 73 20 53 54 55 "calmh says STU
138f0 4e 20 6f 6e 6c 79 20 6b 65 65 70 73 20 74 68 65 N only keeps the
13900 20 4e 41 54 20 6d 61 70 70 69 6e 67 20 73 74 61 NAT mapping sta
13910 62 6c 65 2e 20 49 74 20 64 6f 65 73 20 6e 6f 74 ble. It does not
13920 20 6f 70 65 6e 20 61 20 73 74 61 74 65 66 75 6c open a stateful
13930 20 66 69 72 65 77 61 6c 6c 20 66 6f 72 20 74 68 firewall for th
13940 65 20 70 65 65 72 3a 20 27 74 68 69 73 20 68 61 e peer: 'this ha
13950 73 20 6e 6f 74 68 69 6e 67 20 74 6f 20 64 6f 20 s nothing to do
13960 77 69 74 68 20 61 6c 6c 6f 77 69 6e 67 20 63 6f with allowing co
13970 6e 6e 65 63 74 69 6f 6e 20 70 61 63 6b 65 74 73 nnection packets
13980 20 69 6e 20 74 68 72 6f 75 67 68 20 61 20 73 74 in through a st
13990 61 74 65 66 75 6c 20 66 69 72 65 77 61 6c 6c 20 ateful firewall
139a0 2e 2e 2e 20 53 54 55 4e 20 64 6f 65 73 6e 27 74 ... STUN doesn't
139b0 20 68 65 6c 70 20 77 69 74 68 20 74 68 65 20 6c help with the l
139c0 61 74 74 65 72 20 61 74 20 61 6c 6c 2e 27 20 4f atter at all.' O
139d0 6e 20 49 50 76 36 3a 20 27 54 68 65 72 65 27 73 n IPv6: 'There's
139e0 20 6e 6f 20 53 54 55 4e 20 66 6f 72 20 49 50 76 no STUN for IPv
139f0 36 20 62 75 74 2c 20 69 64 65 61 6c 6c 79 2c 20 6 but, ideally,
13a00 61 6c 73 6f 20 6e 6f 20 4e 41 50 54 2e 20 42 6f also no NAPT. Bo
13a10 74 68 20 6f 75 72 20 71 75 69 63 20 61 6e 64 20 th our quic and
13a20 74 63 70 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 tcp connections
13a30 73 68 6f 75 6c 64 20 61 74 74 65 6d 70 74 20 63 should attempt c
13a40 6f 6e 6e 65 63 74 69 6f 6e 73 20 74 6f 2f 66 72 onnections to/fr
13a50 6f 6d 20 74 68 65 20 73 61 6d 65 20 70 6f 72 74 om the same port
13a60 20 6e 75 6d 62 65 72 73 2c 20 68 6f 70 65 66 75 numbers, hopefu
13a70 6c 6c 79 20 73 6f 6d 65 74 69 6d 65 73 20 72 65 lly sometimes re
13a80 73 75 6c 74 69 6e 67 20 69 6e 20 73 6f 6d 65 20 sulting in some
13a90 77 68 6f 6c 65 20 5b 73 69 63 5d 20 70 75 6e 63 whole [sic] punc
13aa0 68 69 6e 67 27 2e 20 54 68 65 20 74 61 72 67 65 hing'. The targe
13ab0 74 20 69 73 20 27 74 68 65 20 61 76 65 72 61 67 t is 'the averag
13ac0 65 20 70 65 72 73 6f 6e 27 73 20 49 53 50 2d 64 e person's ISP-d
13ad0 65 6c 69 76 65 72 65 64 20 6c 6f 77 65 73 74 2d elivered lowest-
13ae0 62 69 64 64 65 72 20 4e 41 54 20 72 6f 75 74 65 bidder NAT route
13af0 72 27 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 r'.",. "source
13b00 22 3a 20 22 68 74 74 70 73 3a 2f 2f 66 6f 72 75 ": "https://foru
13b10 6d 2e 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f m.syncthing.net/
13b20 72 61 77 2f 31 36 34 39 30 20 28 63 61 6c 6d 68 raw/16490 (calmh
13b30 20 23 32 20 32 30 32 31 2d 30 33 2d 31 31 2c 20 #2 2021-03-11,
13b40 23 31 37 20 32 30 32 31 2d 30 33 2d 31 33 29 22 #17 2021-03-13)"
13b50 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c . },. {. "cl
13b60 61 69 6d 22 3a 20 22 49 73 73 75 65 20 23 37 34 aim": "Issue #74
13b70 37 31 20 28 62 74 39 30 2c 20 32 30 32 31 2d 30 71 (bt90, 2021-0
13b80 33 2d 31 33 2c 20 63 6c 6f 73 65 64 20 32 30 32 3-13, closed 202
13b90 31 2d 30 35 2d 31 34 29 20 6c 6f 77 65 72 65 64 1-05-14) lowered
13ba0 20 74 68 65 20 51 55 49 43 20 72 65 64 69 61 6c the QUIC redial
13bb0 20 69 6e 74 65 72 76 61 6c 20 73 6f 20 55 44 50 interval so UDP
13bc0 20 68 6f 6c 65 73 20 64 6f 20 6e 6f 74 20 74 69 holes do not ti
13bd0 6d 65 20 6f 75 74 2e 20 49 74 20 6e 6f 74 65 73 me out. It notes
13be0 20 74 68 61 74 20 73 79 6d 6d 65 74 72 69 63 20 that symmetric
13bf0 4e 41 54 20 70 6c 75 73 20 61 20 73 74 61 74 65 NAT plus a state
13c00 66 75 6c 20 66 69 72 65 77 61 6c 6c 20 6d 61 6b ful firewall mak
13c10 65 73 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 27 es connections '
13c20 69 6d 70 6f 73 73 69 62 6c 65 27 2c 20 70 61 72 impossible', par
13c30 74 69 63 75 6c 61 72 6c 79 20 6f 6e 20 6d 6f 62 ticularly on mob
13c40 69 6c 65 20 63 61 72 72 69 65 72 73 2e 22 2c 0a ile carriers.",.
13c50 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 "source": "ht
13c60 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com
13c70 2f 73 79 6e 63 74 68 69 6e 67 2f 73 79 6e 63 74 /syncthing/synct
13c80 68 69 6e 67 2f 69 73 73 75 65 73 2f 37 34 37 31 hing/issues/7471
13c90 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 ". },. {. "c
13ca0 6c 61 69 6d 22 3a 20 22 54 43 50 20 68 6f 6c 65 laim": "TCP hole
13cb0 20 70 75 6e 63 68 69 6e 67 20 61 72 72 69 76 65 punching arrive
13cc0 64 20 69 6e 20 76 31 2e 38 2e 30 3a 20 27 61 64 d in v1.8.0: 'ad
13cd0 64 73 20 54 43 50 20 68 6f 6c 65 20 70 75 6e 63 ds TCP hole punc
13ce0 68 69 6e 67 2c 20 75 73 65 64 20 74 6f 20 65 73 hing, used to es
13cf0 74 61 62 6c 69 73 68 20 68 69 67 68 20 70 65 72 tablish high per
13d00 66 6f 72 6d 61 6e 63 65 20 54 43 50 20 63 6f 6e formance TCP con
13d10 6e 65 63 74 69 6f 6e 73 20 69 6e 20 63 65 72 74 nections in cert
13d20 61 69 6e 20 4e 41 54 20 73 63 65 6e 61 72 69 6f ain NAT scenario
13d30 73 20 77 68 65 72 65 20 6f 6e 6c 79 20 72 65 6c s where only rel
13d40 61 79 20 6f 72 20 51 55 49 43 20 63 6f 6e 6e 65 ay or QUIC conne
13d50 63 74 69 6f 6e 73 20 63 6f 75 6c 64 20 62 65 20 ctions could be
13d60 75 73 65 64 20 70 72 65 76 69 6f 75 73 6c 79 2e used previously.
13d70 27 20 49 74 20 63 61 6d 65 20 66 72 6f 6d 20 69 ' It came from i
13d80 73 73 75 65 20 23 34 32 35 39 2c 20 6f 70 65 6e ssue #4259, open
13d90 65 64 20 32 30 31 37 20 61 6e 64 20 63 6c 6f 73 ed 2017 and clos
13da0 65 64 20 32 30 32 30 2d 30 36 2d 31 36 2e 20 45 ed 2020-06-16. E
13db0 61 72 6c 69 65 72 2c 20 63 61 6c 6d 68 20 68 61 arlier, calmh ha
13dc0 64 20 63 61 6c 6c 65 64 20 54 43 50 20 73 69 6d d called TCP sim
13dd0 75 6c 74 61 6e 65 6f 75 73 20 6f 70 65 6e 20 27 ultaneous open '
13de0 74 72 69 63 6b 79 20 74 6f 20 67 65 74 20 74 6f tricky to get to
13df0 20 77 6f 72 6b 20 77 65 6c 6c 20 69 6e 20 70 72 work well in pr
13e00 61 63 74 69 63 65 20 77 69 74 68 20 74 68 65 20 actice with the
13e10 74 69 6d 69 6e 67 20 72 65 71 75 69 72 65 6d 65 timing requireme
13e20 6e 74 73 27 2e 22 2c 0a 20 20 20 22 73 6f 75 72 nts'.",. "sour
13e30 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 67 69 ce": "https://gi
13e40 74 68 75 62 2e 63 6f 6d 2f 73 79 6e 63 74 68 69 thub.com/syncthi
13e50 6e 67 2f 73 79 6e 63 74 68 69 6e 67 2f 72 65 6c ng/syncthing/rel
13e60 65 61 73 65 73 2f 76 31 2e 38 2e 30 3b 20 68 74 eases/v1.8.0; ht
13e70 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com
13e80 2f 73 79 6e 63 74 68 69 6e 67 2f 73 79 6e 63 74 /syncthing/synct
13e90 68 69 6e 67 2f 69 73 73 75 65 73 2f 34 32 35 39 hing/issues/4259
13ea0 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 ". },. {. "c
13eb0 6c 61 69 6d 22 3a 20 22 48 6f 77 20 54 43 50 20 laim": "How TCP
13ec0 70 75 6e 63 68 69 6e 67 20 77 6f 72 6b 73 2c 20 punching works,
13ed0 61 6e 64 20 77 68 79 20 69 74 20 6e 65 65 64 73 and why it needs
13ee0 20 74 68 65 20 64 69 73 63 6f 76 65 72 79 20 73 the discovery s
13ef0 65 72 76 65 72 3a 20 74 68 65 20 6c 69 73 74 65 erver: the liste
13f00 6e 65 72 20 61 6e 64 20 74 68 65 20 64 69 61 6c ner and the dial
13f10 65 72 20 62 6f 74 68 20 75 73 65 20 53 4f 5f 52 er both use SO_R
13f20 45 55 53 45 50 4f 52 54 2c 20 61 6e 64 20 74 68 EUSEPORT, and th
13f30 65 20 67 6c 6f 62 61 6c 2d 64 69 73 63 6f 76 65 e global-discove
13f40 72 79 20 61 6e 6e 6f 75 6e 63 65 20 69 73 20 73 ry announce is s
13f50 65 6e 74 20 66 72 6f 6d 20 74 68 65 20 72 65 75 ent from the reu
13f60 73 65 64 20 6c 69 73 74 65 6e 20 70 6f 72 74 2e sed listen port.
13f70 20 54 68 65 20 6e 6f 64 65 20 61 6e 6e 6f 75 6e The node announ
13f80 63 65 73 20 27 74 63 70 3a 2f 2f 30 2e 30 2e 30 ces 'tcp://0.0.0
13f90 2e 30 3a 30 27 2c 20 63 6f 6d 6d 65 6e 74 65 64 .0:0', commented
13fa0 20 69 6e 20 74 68 65 20 63 6f 64 65 20 61 73 20 in the code as
13fb0 27 72 65 73 6f 6c 76 65 64 20 62 79 20 74 68 65 'resolved by the
13fc0 20 64 69 73 63 6f 76 65 72 79 20 73 65 72 76 65 discovery serve
13fd0 72 20 69 6e 20 68 6f 70 65 73 20 74 68 61 74 20 r in hopes that
13fe0 54 43 50 20 70 75 6e 63 68 20 74 68 72 6f 75 67 TCP punch throug
13ff0 68 20 77 6f 72 6b 73 27 2e 20 73 74 64 69 73 63 h works'. stdisc
14000 6f 73 72 76 27 73 20 66 69 78 75 70 41 64 64 72 osrv's fixupAddr
14010 65 73 73 65 73 20 73 77 61 70 73 20 74 68 65 20 esses swaps the
14020 75 6e 73 70 65 63 69 66 69 65 64 20 49 50 20 66 unspecified IP f
14030 6f 72 20 74 68 65 20 72 65 71 75 65 73 74 27 73 or the request's
14040 20 73 6f 75 72 63 65 20 49 50 2c 20 61 6e 64 20 source IP, and
14050 27 49 66 20 7a 65 72 6f 20 70 6f 72 74 20 77 61 'If zero port wa
14060 73 20 73 70 65 63 69 66 69 65 64 2c 20 75 73 65 s specified, use
14070 20 72 65 6d 6f 74 65 20 70 6f 72 74 27 2e 20 53 remote port'. S
14080 6f 20 74 68 65 20 64 69 73 63 6f 76 65 72 79 20 o the discovery
14090 73 65 72 76 65 72 20 70 75 62 6c 69 73 68 65 73 server publishes
140a0 20 74 68 65 20 4e 41 54 27 73 20 6f 75 74 73 69 the NAT's outsi
140b0 64 65 20 49 50 20 61 6e 64 20 70 6f 72 74 2e 22 de IP and port."
140c0 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
140d0 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 https://raw.gith
140e0 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f ubusercontent.co
140f0 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 73 79 6e 63 m/syncthing/sync
14100 74 68 69 6e 67 2f 6d 61 69 6e 2f 6c 69 62 2f 63 thing/main/lib/c
14110 6f 6e 6e 65 63 74 69 6f 6e 73 2f 74 63 70 5f 6c onnections/tcp_l
14120 69 73 74 65 6e 2e 67 6f 20 28 57 41 4e 41 64 64 isten.go (WANAdd
14130 72 65 73 73 65 73 29 3b 20 68 74 74 70 73 3a 2f resses); https:/
14140 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 /raw.githubuserc
14150 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 ontent.com/synct
14160 68 69 6e 67 2f 73 79 6e 63 74 68 69 6e 67 2f 6d hing/syncthing/m
14170 61 69 6e 2f 6c 69 62 2f 64 69 73 63 6f 76 65 72 ain/lib/discover
14180 2f 67 6c 6f 62 61 6c 2e 67 6f 20 28 64 69 61 6c /global.go (dial
14190 65 72 2e 44 69 61 6c 43 6f 6e 74 65 78 74 52 65 er.DialContextRe
141a0 75 73 65 50 6f 72 74 46 75 6e 63 29 3b 20 68 74 usePortFunc); ht
141b0 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 75 62 tps://raw.github
141c0 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f 6d 2f usercontent.com/
141d0 73 79 6e 63 74 68 69 6e 67 2f 73 79 6e 63 74 68 syncthing/syncth
141e0 69 6e 67 2f 6d 61 69 6e 2f 63 6d 64 2f 73 74 64 ing/main/cmd/std
141f0 69 73 63 6f 73 72 76 2f 61 70 69 73 72 76 2e 67 iscosrv/apisrv.g
14200 6f 20 28 66 69 78 75 70 41 64 64 72 65 73 73 65 o (fixupAddresse
14210 73 29 22 0a 20 20 7d 2c 0a 20 20 7b 0a 20 20 20 s)". },. {.
14220 22 63 6c 61 69 6d 22 3a 20 22 47 6c 6f 62 61 6c "claim": "Global
14230 20 64 69 73 63 6f 76 65 72 79 20 28 68 6f 73 74 discovery (host
14240 65 64 29 3a 20 27 53 79 6e 63 74 68 69 6e 67 20 ed): 'Syncthing
14250 72 65 6c 69 65 73 20 6f 6e 20 61 20 64 69 73 63 relies on a disc
14260 6f 76 65 72 79 20 73 65 72 76 65 72 20 74 6f 20 overy server to
14270 66 69 6e 64 20 70 65 65 72 73 20 6f 6e 20 74 68 find peers on th
14280 65 20 69 6e 74 65 72 6e 65 74 2e 2e 2e 20 54 68 e internet... Th
14290 65 20 53 79 6e 63 74 68 69 6e 67 20 70 72 6f 6a e Syncthing proj
142a0 65 63 74 20 61 6c 73 6f 20 6d 61 69 6e 74 61 69 ect also maintai
142b0 6e 73 20 61 20 67 6c 6f 62 61 6c 20 63 6c 75 73 ns a global clus
142c0 74 65 72 20 66 6f 72 20 70 75 62 6c 69 63 20 75 ter for public u
142d0 73 65 2e 27 20 41 6e 6e 6f 75 6e 63 65 6d 65 6e se.' Announcemen
142e0 74 73 20 61 72 65 20 48 54 54 50 53 20 50 4f 53 ts are HTTPS POS
142f0 54 73 20 77 69 74 68 20 54 4c 53 20 63 6c 69 65 Ts with TLS clie
14300 6e 74 2d 63 65 72 74 69 66 69 63 61 74 65 20 61 nt-certificate a
14310 75 74 68 65 6e 74 69 63 61 74 69 6f 6e 2e 20 55 uthentication. U
14320 6e 73 70 65 63 69 66 69 65 64 20 49 50 73 20 27 nspecified IPs '
14330 61 72 65 20 69 6e 74 65 72 70 72 65 74 65 64 20 are interpreted
14340 61 73 20 72 65 66 65 72 72 69 6e 67 20 74 6f 20 as referring to
14350 74 68 65 20 73 6f 75 72 63 65 20 49 50 20 61 64 the source IP ad
14360 64 72 65 73 73 20 6f 66 20 74 68 65 20 61 6e 6e dress of the ann
14370 6f 75 6e 63 65 6d 65 6e 74 27 2e 20 54 68 65 20 ouncement'. The
14380 63 6c 69 65 6e 74 20 72 65 2d 61 6e 6e 6f 75 6e client re-announ
14390 63 65 73 20 65 76 65 72 79 20 33 30 20 6d 69 6e ces every 30 min
143a0 75 74 65 73 20 62 79 20 64 65 66 61 75 6c 74 20 utes by default
143b0 61 6e 64 20 72 65 74 72 69 65 73 20 61 66 74 65 and retries afte
143c0 72 20 35 20 6d 69 6e 75 74 65 73 20 6f 6e 20 65 r 5 minutes on e
143d0 72 72 6f 72 2e 20 41 6e 79 6f 6e 65 20 63 61 6e rror. Anyone can
143e0 20 72 75 6e 20 73 74 64 69 73 63 6f 73 72 76 20 run stdiscosrv
143f0 28 64 65 66 61 75 6c 74 20 70 6f 72 74 20 38 34 (default port 84
14400 34 33 3b 20 27 46 6f 72 20 64 79 6e 61 6d 69 63 43; 'For dynamic
14410 20 49 50 20 61 64 64 72 65 73 73 65 73 2c 20 61 IP addresses, a
14420 20 64 79 6e 61 6d 69 63 20 44 4e 53 20 73 65 72 dynamic DNS ser
14430 76 69 63 65 20 69 73 20 72 65 71 75 69 72 65 64 vice is required
14440 27 29 20 61 6e 64 20 72 65 6d 6f 76 65 20 27 64 ') and remove 'd
14450 65 66 61 75 6c 74 27 20 66 72 6f 6d 20 74 68 65 efault' from the
14460 20 6c 69 73 74 2e 22 2c 0a 20 20 20 22 73 6f 75 list.",. "sou
14470 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 64 rce": "https://d
14480 6f 63 73 2e 73 79 6e 63 74 68 69 6e 67 2e 6e 65 ocs.syncthing.ne
14490 74 2f 75 73 65 72 73 2f 73 74 64 69 73 63 6f 73 t/users/stdiscos
144a0 72 76 2e 68 74 6d 6c 3b 20 68 74 74 70 73 3a 2f rv.html; https:/
144b0 2f 72 61 77 2e 67 69 74 68 75 62 75 73 65 72 63 /raw.githubuserc
144c0 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 ontent.com/synct
144d0 68 69 6e 67 2f 64 6f 63 73 2f 6d 61 69 6e 2f 73 hing/docs/main/s
144e0 70 65 63 73 2f 67 6c 6f 62 61 6c 64 69 73 63 6f pecs/globaldisco
144f0 2d 76 33 2e 72 73 74 20 28 41 6e 6e 6f 75 6e 63 -v3.rst (Announc
14500 65 6d 65 6e 74 73 29 3b 20 6c 69 62 2f 64 69 73 ements); lib/dis
14510 63 6f 76 65 72 2f 67 6c 6f 62 61 6c 2e 67 6f 20 cover/global.go
14520 28 64 65 66 61 75 6c 74 52 65 61 6e 6e 6f 75 6e (defaultReannoun
14530 63 65 49 6e 74 65 72 76 61 6c 20 3d 20 33 30 2a ceInterval = 30*
14540 74 69 6d 65 2e 4d 69 6e 75 74 65 29 22 0a 20 20 time.Minute)".
14550 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d },. {. "claim
14560 22 3a 20 22 52 65 6c 61 79 73 20 28 68 6f 73 74 ": "Relays (host
14570 65 64 20 66 61 6c 6c 62 61 63 6b 29 3a 20 27 53 ed fallback): 'S
14580 79 6e 63 74 68 69 6e 67 20 63 61 6e 20 62 6f 75 yncthing can bou
14590 6e 63 65 20 74 72 61 66 66 69 63 20 76 69 61 20 nce traffic via
145a0 61 20 72 65 6c 61 79 20 77 68 65 6e 20 69 74 27 a relay when it'
145b0 73 20 6e 6f 74 20 70 6f 73 73 69 62 6c 65 20 74 s not possible t
145c0 6f 20 65 73 74 61 62 6c 69 73 68 20 61 20 64 69 o establish a di
145d0 72 65 63 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 2e rect connection.
145e0 27 20 52 65 6c 61 79 69 6e 67 20 69 73 20 6f 6e ' Relaying is on
145f0 20 62 79 20 64 65 66 61 75 6c 74 20 61 6e 64 20 by default and
14600 75 73 65 64 20 6f 6e 6c 79 20 69 66 20 61 20 64 used only if a d
14610 69 72 65 63 74 20 63 6f 6e 6e 65 63 74 69 6f 6e irect connection
14620 20 66 61 69 6c 73 2c 20 61 6e 64 20 53 79 6e 63 fails, and Sync
14630 74 68 69 6e 67 20 27 77 69 6c 6c 20 70 65 72 69 thing 'will peri
14640 6f 64 69 63 61 6c 6c 79 20 72 65 74 72 79 20 61 odically retry a
14650 20 64 69 72 65 63 74 20 63 6f 6e 6e 65 63 74 69 direct connecti
14660 6f 6e 27 2e 20 44 61 74 61 20 73 74 61 79 73 20 on'. Data stays
14670 65 6e 64 2d 74 6f 2d 65 6e 64 20 65 6e 63 72 79 end-to-end encry
14680 70 74 65 64 2c 20 62 75 74 20 27 74 68 65 20 72 pted, but 'the r
14690 65 6c 61 79 20 6b 6e 6f 77 73 20 79 6f 75 72 20 elay knows your
146a0 49 50 20 61 6e 64 20 64 65 76 69 63 65 20 49 44 IP and device ID
146b0 27 2c 20 61 6e 64 20 27 74 68 65 20 74 72 61 6e ', and 'the tran
146c0 73 66 65 72 20 72 61 74 65 20 69 73 20 6d 75 63 sfer rate is muc
146d0 68 20 6c 6f 77 65 72 20 74 68 61 6e 20 61 20 64 h lower than a d
146e0 69 72 65 63 74 20 63 6f 6e 6e 65 63 74 69 6f 6e irect connection
146f0 20 77 6f 75 6c 64 20 61 6c 6c 6f 77 27 2e 20 54 would allow'. T
14700 68 65 20 70 75 62 6c 69 63 20 70 6f 6f 6c 20 69 he public pool i
14710 73 20 76 6f 6c 75 6e 74 65 65 72 2d 72 75 6e 20 s volunteer-run
14720 28 68 74 74 70 73 3a 2f 2f 72 65 6c 61 79 73 2e (https://relays.
14730 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 65 6e syncthing.net/en
14740 64 70 6f 69 6e 74 29 2e 20 41 20 70 72 69 76 61 dpoint). A priva
14750 74 65 20 73 74 72 65 6c 61 79 73 72 76 20 77 69 te strelaysrv wi
14760 74 68 20 2d 70 6f 6f 6c 73 3d 5c 22 5c 22 20 73 th -pools=\"\" s
14770 74 61 79 73 20 6f 75 74 20 6f 66 20 74 68 65 20 tays out of the
14780 70 6f 6f 6c 20 61 6e 64 20 69 73 20 72 65 61 63 pool and is reac
14790 68 65 64 20 76 69 61 20 72 65 6c 61 79 3a 2f 2f hed via relay://
147a0 68 6f 73 74 3a 70 6f 72 74 2f 3f 69 64 3d 2e 2e host:port/?id=..
147b0 2e 26 74 6f 6b 65 6e 3d 2e 2e 2e 22 2c 0a 20 20 .&token=...",.
147c0 20 22 73 6f 75 72 63 65 22 3a 20 22 68 74 74 70 "source": "http
147d0 73 3a 2f 2f 72 61 77 2e 67 69 74 68 75 62 75 73 s://raw.githubus
147e0 65 72 63 6f 6e 74 65 6e 74 2e 63 6f 6d 2f 73 79 ercontent.com/sy
147f0 6e 63 74 68 69 6e 67 2f 64 6f 63 73 2f 6d 61 69 ncthing/docs/mai
14800 6e 2f 75 73 65 72 73 2f 72 65 6c 61 79 69 6e 67 n/users/relaying
14810 2e 72 73 74 3b 20 68 74 74 70 73 3a 2f 2f 72 61 .rst; https://ra
14820 77 2e 67 69 74 68 75 62 75 73 65 72 63 6f 6e 74 w.githubusercont
14830 65 6e 74 2e 63 6f 6d 2f 73 79 6e 63 74 68 69 6e ent.com/syncthin
14840 67 2f 64 6f 63 73 2f 6d 61 69 6e 2f 75 73 65 72 g/docs/main/user
14850 73 2f 73 74 72 65 6c 61 79 73 72 76 2e 72 73 74 s/strelaysrv.rst
14860 3b 20 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 ; https://raw.gi
14870 74 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e thubusercontent.
14880 63 6f 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 64 6f com/syncthing/do
14890 63 73 2f 6d 61 69 6e 2f 73 70 65 63 73 2f 72 65 cs/main/specs/re
148a0 6c 61 79 2d 76 31 2e 72 73 74 22 0a 20 20 7d 2c lay-v1.rst". },
148b0 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 6d 22 3a . {. "claim":
148c0 20 22 53 54 55 4e 20 73 74 69 6c 6c 20 64 65 70 "STUN still dep
148d0 65 6e 64 73 20 6f 6e 20 74 68 69 72 64 2d 70 61 ends on third-pa
148e0 72 74 79 20 68 6f 73 74 73 2e 20 73 74 75 6e 2e rty hosts. stun.
148f0 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 20 77 61 syncthing.net wa
14900 73 20 73 68 75 74 20 64 6f 77 6e 3b 20 69 73 73 s shut down; iss
14910 75 65 20 23 31 30 30 30 38 20 28 32 30 32 35 2d ue #10008 (2025-
14920 30 33 2d 33 30 29 20 72 65 70 6f 72 74 65 64 20 03-30) reported
14930 63 6c 69 65 6e 74 73 20 73 74 69 6c 6c 20 72 65 clients still re
14940 74 72 79 69 6e 67 20 69 74 2c 20 61 6e 64 20 63 trying it, and c
14950 61 6c 6d 68 20 72 65 6d 6f 76 65 64 20 69 74 20 almh removed it
14960 61 6e 64 20 66 69 78 65 64 20 74 68 65 20 66 61 and fixed the fa
14970 6c 6c 62 61 63 6b 2e 20 50 52 20 23 31 30 30 33 llback. PR #1003
14980 31 20 28 62 74 39 30 2c 20 6d 65 72 67 65 64 20 1 (bt90, merged
14990 32 30 32 35 2d 30 34 2d 30 38 29 20 72 65 73 6f 2025-04-08) reso
149a0 6c 76 65 73 20 74 68 65 20 70 72 69 6d 61 72 79 lves the primary
149b0 20 53 54 55 4e 20 73 65 72 76 65 72 73 20 74 68 STUN servers th
149c0 72 6f 75 67 68 20 61 20 44 4e 53 20 53 52 56 20 rough a DNS SRV
149d0 72 65 63 6f 72 64 20 75 6e 64 65 72 20 73 79 6e record under syn
149e0 63 74 68 69 6e 67 2e 6e 65 74 2c 20 77 69 74 68 cthing.net, with
149f0 20 70 75 62 6c 69 63 20 56 6f 49 50 20 53 54 55 public VoIP STU
14a00 4e 20 73 65 72 76 65 72 73 20 61 73 20 66 61 6c N servers as fal
14a10 6c 62 61 63 6b 2e 22 2c 0a 20 20 20 22 73 6f 75 lback.",. "sou
14a20 72 63 65 22 3a 20 22 68 74 74 70 73 3a 2f 2f 67 rce": "https://g
14a30 69 74 68 75 62 2e 63 6f 6d 2f 73 79 6e 63 74 68 ithub.com/syncth
14a40 69 6e 67 2f 73 79 6e 63 74 68 69 6e 67 2f 69 73 ing/syncthing/is
14a50 73 75 65 73 2f 31 30 30 30 38 3b 20 68 74 74 70 sues/10008; http
14a60 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 73 s://github.com/s
14a70 79 6e 63 74 68 69 6e 67 2f 73 79 6e 63 74 68 69 yncthing/syncthi
14a80 6e 67 2f 70 75 6c 6c 2f 31 30 30 33 31 22 0a 20 ng/pull/10031".
14a90 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 },. {. "clai
14aa0 6d 22 3a 20 22 57 68 61 74 20 6e 65 65 64 73 20 m": "What needs
14ab0 68 6f 73 74 65 64 20 73 65 72 76 69 63 65 73 20 hosted services
14ac0 61 6e 64 20 77 68 61 74 20 64 6f 65 73 20 6e 6f and what does no
14ad0 74 2e 20 48 6f 73 74 65 64 3a 20 67 6c 6f 62 61 t. Hosted: globa
14ae0 6c 20 64 69 73 63 6f 76 65 72 79 20 28 6e 65 65 l discovery (nee
14af0 64 65 64 20 74 6f 20 65 78 63 68 61 6e 67 65 20 ded to exchange
14b00 61 64 64 72 65 73 73 65 73 2c 20 61 6e 64 20 66 addresses, and f
14b10 6f 72 20 54 43 50 20 70 75 6e 63 68 69 6e 67 20 or TCP punching
14b20 74 6f 20 6c 65 61 72 6e 20 74 68 65 20 4e 41 54 to learn the NAT
14b30 27 73 20 6f 75 74 73 69 64 65 20 70 6f 72 74 29 's outside port)
14b40 2c 20 53 54 55 4e 20 28 6e 65 65 64 65 64 20 66 , STUN (needed f
14b50 6f 72 20 51 55 49 43 20 4e 41 54 2d 74 79 70 65 or QUIC NAT-type
14b60 20 64 65 74 65 63 74 69 6f 6e 20 61 6e 64 20 74 detection and t
14b70 68 65 20 65 78 74 65 72 6e 61 6c 20 61 64 64 72 he external addr
14b80 65 73 73 29 2c 20 61 6e 64 20 72 65 6c 61 79 73 ess), and relays
14b90 20 28 6e 65 65 64 65 64 20 66 6f 72 20 73 79 6d (needed for sym
14ba0 6d 65 74 72 69 63 20 6f 72 20 62 6c 6f 63 6b 65 metric or blocke
14bb0 64 20 4e 41 54 73 29 2e 20 4e 6f 74 20 68 6f 73 d NATs). Not hos
14bc0 74 65 64 3a 20 6c 6f 63 61 6c 20 64 69 73 63 6f ted: local disco
14bd0 76 65 72 79 20 28 4c 41 4e 20 6f 6e 6c 79 29 2c very (LAN only),
14be0 20 55 50 6e 50 2f 4e 41 54 2d 50 4d 50 20 70 6f UPnP/NAT-PMP po
14bf0 72 74 20 6d 61 70 70 69 6e 67 20 28 6c 6f 63 61 rt mapping (loca
14c00 6c 20 72 6f 75 74 65 72 20 6f 6e 6c 79 29 2c 20 l router only),
14c10 61 6e 64 20 73 74 61 74 69 63 20 64 65 76 69 63 and static devic
14c20 65 20 61 64 64 72 65 73 73 65 73 20 28 27 64 79 e addresses ('dy
14c30 6e 61 6d 69 63 27 20 6d 65 61 6e 73 20 27 75 73 namic' means 'us
14c40 65 20 6c 6f 63 61 6c 20 61 6e 64 20 67 6c 6f 62 e local and glob
14c50 61 6c 20 64 69 73 63 6f 76 65 72 79 27 3b 20 61 al discovery'; a
14c60 20 66 69 78 65 64 20 61 64 64 72 65 73 73 20 73 fixed address s
14c70 6b 69 70 73 20 74 68 65 6d 29 2e 20 41 6c 6c 20 kips them). All
14c80 74 68 72 65 65 20 68 6f 73 74 65 64 20 73 65 72 three hosted ser
14c90 76 69 63 65 73 20 63 61 6e 20 62 65 20 73 65 6c vices can be sel
14ca0 66 2d 72 75 6e 2c 20 62 75 74 20 65 61 63 68 20 f-run, but each
14cb0 6d 75 73 74 20 73 69 74 20 61 74 20 61 6e 20 61 must sit at an a
14cc0 64 64 72 65 73 73 20 62 6f 74 68 20 70 65 65 72 ddress both peer
14cd0 73 20 63 61 6e 20 72 65 61 63 68 2e 20 54 68 65 s can reach. The
14ce0 20 4c 41 4e 2d 6f 6e 6c 79 20 74 75 6e 69 6e 67 LAN-only tuning
14cf0 20 74 75 72 6e 73 20 6f 66 66 20 72 65 6c 61 79 turns off relay
14d00 73 2c 20 4e 41 54 20 74 72 61 76 65 72 73 61 6c s, NAT traversal
14d10 20 61 6e 64 20 67 6c 6f 62 61 6c 20 64 69 73 63 and global disc
14d20 6f 76 65 72 79 20 74 6f 67 65 74 68 65 72 2e 22 overy together."
14d30 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a 20 22 ,. "source": "
14d40 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 69 74 68 https://raw.gith
14d50 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 2e 63 6f ubusercontent.co
14d60 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 64 6f 63 73 m/syncthing/docs
14d70 2f 6d 61 69 6e 2f 75 73 65 72 73 2f 63 6f 6e 66 /main/users/conf
14d80 69 67 2e 72 73 74 20 28 64 65 76 69 63 65 20 61 ig.rst (device a
14d90 64 64 72 65 73 73 20 27 64 79 6e 61 6d 69 63 27 ddress 'dynamic'
14da0 29 3b 20 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e ); https://docs.
14db0 73 79 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 syncthing.net/us
14dc0 65 72 73 2f 74 75 6e 69 6e 67 2e 68 74 6d 6c 3b ers/tuning.html;
14dd0 20 68 74 74 70 73 3a 2f 2f 64 6f 63 73 2e 73 79 https://docs.sy
14de0 6e 63 74 68 69 6e 67 2e 6e 65 74 2f 75 73 65 72 ncthing.net/user
14df0 73 2f 73 74 64 69 73 63 6f 73 72 76 2e 68 74 6d s/stdiscosrv.htm
14e00 6c 3b 20 68 74 74 70 73 3a 2f 2f 72 61 77 2e 67 l; https://raw.g
14e10 69 74 68 75 62 75 73 65 72 63 6f 6e 74 65 6e 74 ithubusercontent
14e20 2e 63 6f 6d 2f 73 79 6e 63 74 68 69 6e 67 2f 64 .com/syncthing/d
14e30 6f 63 73 2f 6d 61 69 6e 2f 75 73 65 72 73 2f 73 ocs/main/users/s
14e40 74 72 65 6c 61 79 73 72 76 2e 72 73 74 22 0a 20 trelaysrv.rst".
14e50 20 7d 2c 0a 20 20 7b 0a 20 20 20 22 63 6c 61 69 },. {. "clai
14e60 6d 22 3a 20 22 4d 79 20 69 6e 66 65 72 65 6e 63 m": "My inferenc
14e70 65 20 66 6f 72 20 4f 43 58 2c 20 6e 6f 74 20 73 e for OCX, not s
14e80 74 61 74 65 64 20 69 6e 20 61 6e 79 20 73 6f 75 tated in any sou
14e90 72 63 65 3a 20 53 79 6e 63 74 68 69 6e 67 20 6e rce: Syncthing n
14ea0 65 76 65 72 20 67 65 74 73 20 72 69 64 20 6f 66 ever gets rid of
14eb0 20 61 20 72 65 61 63 68 61 62 6c 65 20 74 68 69 a reachable thi
14ec0 72 64 20 70 61 72 74 79 20 66 6f 72 20 4e 41 54 rd party for NAT
14ed0 2d 74 6f 2d 4e 41 54 20 70 65 65 72 73 2e 20 41 -to-NAT peers. A
14ee0 20 70 65 65 72 27 73 20 6f 75 74 73 69 64 65 20 peer's outside
14ef0 61 64 64 72 65 73 73 20 61 6e 64 20 70 6f 72 74 address and port
14f00 20 72 65 61 63 68 20 74 68 65 20 6f 74 68 65 72 reach the other
14f10 20 73 69 64 65 20 6f 6e 6c 79 20 74 68 72 6f 75 side only throu
14f20 67 68 20 64 69 73 63 6f 76 65 72 79 20 28 61 6e gh discovery (an
14f30 64 20 53 54 55 4e 29 2c 20 61 6e 64 20 72 65 6c d STUN), and rel
14f40 61 79 73 20 63 6f 76 65 72 20 74 68 65 20 73 79 ays cover the sy
14f50 6d 6d 65 74 72 69 63 2d 4e 41 54 20 63 61 73 65 mmetric-NAT case
14f60 73 2e 20 54 68 65 20 6f 6e 65 20 66 75 6c 6c 79 s. The one fully
14f70 20 6c 6f 63 61 6c 20 74 6f 6f 6c 20 69 74 20 68 local tool it h
14f80 61 73 20 69 73 20 55 50 6e 50 2f 4e 41 54 2d 50 as is UPnP/NAT-P
14f90 4d 50 20 70 6f 72 74 20 6d 61 70 70 69 6e 67 2c MP port mapping,
14fa0 20 77 68 69 63 68 20 77 6f 72 6b 73 20 6f 6e 6c which works onl
14fb0 79 20 77 68 65 6e 20 74 68 65 20 72 6f 75 74 65 y when the route
14fc0 72 20 73 75 70 70 6f 72 74 73 20 69 74 20 61 6e r supports it an
14fd0 64 20 68 61 73 20 69 74 20 65 6e 61 62 6c 65 64 d has it enabled
14fe0 2e 22 2c 0a 20 20 20 22 73 6f 75 72 63 65 22 3a .",. "source":
14ff0 20 22 49 6e 66 65 72 65 6e 63 65 20 66 72 6f 6d "Inference from
15000 20 74 68 65 20 73 6f 75 72 63 65 73 20 61 62 6f the sources abo
15010 76 65 20 28 73 74 75 6e 2e 67 6f 20 70 75 6e 63 ve (stun.go punc
15020 68 61 62 6c 65 20 6c 69 73 74 3b 20 61 70 69 73 hable list; apis
15030 72 76 2e 67 6f 20 66 69 78 75 70 41 64 64 72 65 rv.go fixupAddre
15040 73 73 65 73 3b 20 66 69 72 65 77 61 6c 6c 2e 68 sses; firewall.h
15050 74 6d 6c 29 22 0a 20 20 7d 0a 20 5d 2c 0a 20 22 tml)". }. ],. "
15060 75 6e 63 6f 6e 66 69 72 6d 65 64 22 3a 20 22 54 unconfirmed": "T
15070 68 69 6e 67 73 20 49 20 63 6f 75 6c 64 20 6e 6f hings I could no
15080 74 20 63 6f 6e 66 69 72 6d 3a 5c 6e 28 31 29 20 t confirm:\n(1)
15090 57 68 65 74 68 65 72 20 62 74 39 30 20 6f 72 20 Whether bt90 or
150a0 4e 75 6d 6d 65 72 33 37 38 20 61 72 65 20 53 79 Nummer378 are Sy
150b0 6e 63 74 68 69 6e 67 20 6d 61 69 6e 74 61 69 6e ncthing maintain
150c0 65 72 73 2e 20 62 74 39 30 20 68 61 73 20 6d 65 ers. bt90 has me
150d0 72 67 65 64 20 50 52 73 3b 20 49 20 66 6f 75 6e rged PRs; I foun
150e0 64 20 6e 6f 74 68 69 6e 67 20 6f 6e 20 4e 75 6d d nothing on Num
150f0 6d 65 72 33 37 38 27 73 20 72 6f 6c 65 2e 5c 6e mer378's role.\n
15100 28 32 29 20 57 68 65 74 68 65 72 20 53 79 6e 63 (2) Whether Sync
15110 74 68 69 6e 67 20 68 61 73 20 61 6e 79 20 65 78 thing has any ex
15120 70 6c 69 63 69 74 20 73 69 67 6e 61 6c 20 74 68 plicit signal th
15130 61 74 20 6d 61 6b 65 73 20 62 6f 74 68 20 70 65 at makes both pe
15140 65 72 73 20 64 69 61 6c 20 61 74 20 74 68 65 20 ers dial at the
15150 73 61 6d 65 20 6d 6f 6d 65 6e 74 2e 20 49 20 66 same moment. I f
15160 6f 75 6e 64 20 6e 6f 6e 65 20 69 6e 20 74 68 65 ound none in the
15170 20 64 6f 63 73 20 6f 72 20 74 68 65 20 63 6f 64 docs or the cod
15180 65 20 49 20 72 65 61 64 2e 20 49 74 20 61 70 70 e I read. It app
15190 65 61 72 73 20 74 6f 20 72 65 6c 79 20 6f 6e 20 ears to rely on
151a0 62 6f 74 68 20 73 69 64 65 73 20 72 65 64 69 61 both sides redia
151b0 6c 69 6e 67 20 6f 6e 20 74 68 65 69 72 20 6f 77 ling on their ow
151c0 6e 20 69 6e 74 65 72 76 61 6c 73 20 70 6c 75 73 n intervals plus
151d0 20 74 68 65 20 61 64 64 72 65 73 73 20 70 75 62 the address pub
151e0 6c 69 73 68 65 64 20 62 79 20 64 69 73 63 6f 76 lished by discov
151f0 65 72 79 2c 20 62 75 74 20 49 20 64 69 64 20 6e ery, but I did n
15200 6f 74 20 72 65 61 64 20 74 68 65 20 64 69 61 6c ot read the dial
15210 20 73 63 68 65 64 75 6c 65 72 2c 20 73 6f 20 74 scheduler, so t
15220 72 65 61 74 20 74 68 61 74 20 61 73 20 75 6e 76 reat that as unv
15230 65 72 69 66 69 65 64 2e 5c 6e 28 33 29 20 54 68 erified.\n(3) Th
15240 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 20 e default value
15250 6f 66 20 72 65 63 6f 6e 6e 65 63 74 69 6f 6e 49 of reconnectionI
15260 6e 74 65 72 76 61 6c 53 2e 20 54 68 65 20 64 6f ntervalS. The do
15270 63 20 74 65 78 74 20 49 20 66 65 74 63 68 65 64 c text I fetched
15280 20 67 61 76 65 20 69 74 73 20 6d 65 61 6e 69 6e gave its meanin
15290 67 20 62 75 74 20 6e 6f 20 6e 75 6d 62 65 72 2e g but no number.
152a0 5c 6e 28 34 29 20 54 68 65 20 65 78 61 63 74 20 \n(4) The exact
152b0 53 52 56 20 72 65 63 6f 72 64 20 6e 61 6d 65 20 SRV record name
152c0 66 6f 72 20 74 68 65 20 70 72 69 6d 61 72 79 20 for the primary
152d0 53 54 55 4e 20 73 65 72 76 65 72 73 2e 20 41 20 STUN servers. A
152e0 70 61 67 65 20 73 75 6d 6d 61 72 79 20 73 61 69 page summary sai
152f0 64 20 5f 73 74 75 6e 2e 5f 75 64 70 2e 73 79 6e d _stun._udp.syn
15300 63 74 68 69 6e 67 2e 6e 65 74 2c 20 62 75 74 20 cthing.net, but
15310 49 20 64 69 64 20 6e 6f 74 20 73 65 65 20 74 68 I did not see th
15320 65 20 63 6f 64 65 20 6c 69 6e 65 2e 5c 6e 28 35 e code line.\n(5
15330 29 20 54 68 65 20 79 65 61 72 20 6f 66 20 76 31 ) The year of v1
15340 2e 38 2e 30 2e 20 54 68 65 20 72 65 6c 65 61 73 .8.0. The releas
15350 65 20 70 61 67 65 20 73 68 6f 77 73 20 27 41 75 e page shows 'Au
15360 67 75 73 74 20 31 31 27 20 77 69 74 68 20 6e 6f gust 11' with no
15370 20 79 65 61 72 3b 20 74 68 65 20 6c 69 6e 6b 65 year; the linke
15380 64 20 69 73 73 75 65 20 63 6c 6f 73 65 64 20 32 d issue closed 2
15390 30 32 30 2d 30 36 2d 31 36 20 77 69 74 68 20 6d 020-06-16 with m
153a0 69 6c 65 73 74 6f 6e 65 20 76 31 2e 38 2e 30 2c ilestone v1.8.0,
153b0 20 73 6f 20 41 75 67 75 73 74 20 32 30 32 30 20 so August 2020
153c0 69 73 20 6c 69 6b 65 6c 79 2e 5c 6e 28 36 29 20 is likely.\n(6)
153d0 57 68 65 74 68 65 72 20 53 79 6e 63 74 68 69 6e Whether Syncthin
153e0 67 20 73 75 70 70 6f 72 74 73 20 50 43 50 2e 20 g supports PCP.
153f0 49 74 73 20 64 6f 63 73 20 6e 61 6d 65 20 6f 6e Its docs name on
15400 6c 79 20 55 50 6e 50 20 61 6e 64 20 4e 41 54 2d ly UPnP and NAT-
15410 50 4d 50 2e 5c 6e 28 37 29 20 41 6e 79 20 6d 65 PMP.\n(7) Any me
15420 61 73 75 72 65 64 20 73 75 63 63 65 73 73 20 72 asured success r
15430 61 74 65 20 66 6f 72 20 53 79 6e 63 74 68 69 6e ate for Syncthin
15440 67 27 73 20 68 6f 6c 65 20 70 75 6e 63 68 69 6e g's hole punchin
15450 67 2e 20 49 20 66 6f 75 6e 64 20 6e 6f 6e 65 2e g. I found none.
15460 5c 6e 28 38 29 20 50 6f 73 74 20 34 27 73 20 74 \n(8) Post 4's t
15470 69 6d 65 73 74 61 6d 70 20 64 69 66 66 65 72 73 imestamp differs
15480 3a 20 32 32 3a 31 31 3a 30 35 20 55 54 43 20 69 : 22:11:05 UTC i
15490 6e 20 74 68 65 20 4a 53 4f 4e 2c 20 32 32 3a 31 n the JSON, 22:1
154a0 35 3a 34 35 20 69 6e 20 74 68 65 20 72 61 77 20 5:45 in the raw
154b0 76 69 65 77 2c 20 70 72 6f 62 61 62 6c 79 20 61 view, probably a
154c0 6e 20 65 64 69 74 2e 5c 6e 5c 6e 4d 65 74 68 6f n edit.\n\nMetho
154d0 64 3a 20 49 20 72 65 61 64 20 65 76 65 72 79 20 d: I read every
154e0 70 61 67 65 20 74 68 72 6f 75 67 68 20 57 65 62 page through Web
154f0 46 65 74 63 68 2c 20 77 68 69 63 68 20 72 65 74 Fetch, which ret
15500 75 72 6e 73 20 61 20 73 6d 61 6c 6c 20 6d 6f 64 urns a small mod
15510 65 6c 27 73 20 65 78 74 72 61 63 74 69 6f 6e 2e el's extraction.
15520 20 51 75 6f 74 65 73 20 6d 61 72 6b 65 64 20 76 Quotes marked v
15530 65 72 62 61 74 69 6d 20 63 61 6d 65 20 66 72 6f erbatim came fro
15540 6d 20 72 61 77 20 6f 72 20 72 73 74 20 73 6f 75 m raw or rst sou
15550 72 63 65 73 2c 20 62 75 74 20 61 20 66 65 77 20 rces, but a few
15560 6d 61 79 20 62 65 20 6c 69 67 68 74 6c 79 20 70 may be lightly p
15570 61 72 61 70 68 72 61 73 65 64 2e 20 49 20 66 65 araphrased. I fe
15580 74 63 68 65 64 20 74 68 65 20 64 6f 63 73 20 66 tched the docs f
15590 72 6f 6d 20 74 68 65 20 6d 61 69 6e 20 62 72 61 rom the main bra
155a0 6e 63 68 2c 20 73 6f 20 74 68 65 79 20 6d 61 79 nch, so they may
155b0 20 72 75 6e 20 61 68 65 61 64 20 6f 66 20 61 20 run ahead of a
155c0 72 65 6c 65 61 73 65 64 20 76 65 72 73 69 6f 6e released version
155d0 2e 20 49 20 63 6f 6e 74 61 63 74 65 64 20 6e 6f . I contacted no
155e0 20 73 65 72 76 65 72 73 20 6f 74 68 65 72 20 74 servers other t
155f0 68 61 6e 20 70 75 62 6c 69 63 20 77 65 62 20 70 han public web p
15600 61 67 65 73 20 61 6e 64 20 63 68 61 6e 67 65 64 ages and changed
15610 20 6e 6f 74 68 69 6e 67 20 6c 6f 63 61 6c 6c 79 nothing locally
15620 2e 22 0a 7d 00 00 00 00 00 00 00 00 00 00 00 00 .".}............
15630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15640 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15650 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15670 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15680 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15690 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
156a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
156b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
156c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
156d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
156e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
156f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15710 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15730 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15750 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15770 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15790 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
157a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
157b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
157c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
157d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
157e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
157f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15850 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15870 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15890 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
158a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
158b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
158c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
158d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
158e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
158f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15930 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15950 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15970 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15990 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
159a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
159b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
159c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
159d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
159e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
159f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15a90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15aa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15ab0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15ac0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15ad0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15ae0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15af0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15b90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15ba0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15bb0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15bc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15bd0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15be0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
15bf0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................