Skip to content

Commit 0d71d6c

Browse files
committed
Clarified wording in gday post.
1 parent 0112224 commit 0d71d6c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/posts/gday/gday.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ hands out many fake/private IP addresses to all the computers within that buildi
1818

1919
The NAT translates packets flowing out of the private network by replacing their fake/private IP addresses with its own real/public IP address, and vice versa.
2020

21-
It also modifies the port numbers of outgoing packets, so that each public port number corresponds to a different computer or connection within its network. Then it looks at the port numbers of incoming packets to determine which internal computer to forward them to.
21+
It also dynamically modifies the origin port numbers of outgoing packets, so that each port number corresponds to a different internal computer or connection.
22+
Then it looks at the port numbers of incoming response packets to determine which internal computer to forward them to.
2223

23-
Unfortunately, this makes it difficult for two computers, each behind their own NAT, to connect to each other. If one computer tries to send a packet to another computer, the receiving NAT won't know which computer on its internal network to forward it to. So the packet will be dropped.
24+
Unfortunately, this makes it difficult for computers to connect if they're both behind different NATs.
25+
If one computer tries to send a packet to another computer, the receiving NAT won't know which computer on its internal network to forward it to.
26+
So it'll drop the packet.
2427

2528
Note: this is just a high-level summary. To learn more, read [Wikipedia article on NATs](https://en.wikipedia.org/wiki/Network_address_translation).
2629

@@ -49,7 +52,7 @@ Common examples of relay servers are email, Google Drive, [Magic Wormhole](https
4952

5053
Thankfully, there's a way to trick certain NATs into allowing computers behind them to connect directly to each other.
5154
It's a procedure called [TCP hole punching](https://bford.info/pub/net/p2pnat/) in which both computers temporarily connect to a contact exchange server, which shares their public IP addresses and port numbers with each other.
52-
Then, both computers try connecting to the address+port they've received.
55+
Then, both computers try connecting a few times to the address+port they've received.
5356

5457
However, this only works on full-cone NATs, address-restricted-cone NATs, and port-restricted cone NATs. It doesn't work on symmetric NATs. To understand why, [read about NATs on Wikipedia](https://en.wikipedia.org/wiki/Network_address_translation).
5558

0 commit comments

Comments
 (0)