This has helped me understand how hole punching in libp2p is being achieved, however they solved the clock synchronization problem by calculating RRT between the 2 clients with the help of a relay node. I learn something everyday, Thank you.
Why the SYN+ACK after each has already received a SYN? According to the RFC, when doing a Simultaneous Open, after each side receives their SYN, they send back only an ACK, not a SYN+ACK. Was this changed in a later RFC?
I tried to implememt it in python using sockets module but it didnt work. I think we also need to simultaneously listen() for connections on the same port through threading to catch connection request according to a nat traversal paper I read.
Hi there, thanks for making the video. It seems interesting however there is something I don't quite understand. What it seems to me that the code is basically firstly create a "server" (using bind) then create a "client" using connect. It seems not really matters to make the connection working to be right on the exact time? I basically cloned your code and changed line 32 to `std::thread::sleep(Duration::seconds(20).to_std().unwrap());` So I can run one manually at machine1 and then after a few seconds (within 20 seconds of course) I run another code via machine2. And I tested this both on a single mac, or using 2 mac macs I have here, they all can connect and print hellos. I also used tcpdump to monitoring on one of the machines and saw normal connection output. Wondering why I cannot see the [R.] error case as you shown in the video. Could it because on Mac there is something different, like some default timeout setting? Socket2's connect function also have a "connect_timeout" function where you can specific a very long time out and perhaps that will make your case work or? Or maybe you know why it works for my case? BTW, I can only seeing the [R.] error while just running one machine and never run the other and wait until sleep time out so it calls connection onto a socket address that is no bind, then I can see [R.] error from tcpdump view.
The timing matters when the computers are on different networks, A and B. Normally, routers block incoming connections. But if you send out an outgoing connection first, then the router *expects* a returning incoming connection and lets it through. If A sends a connection but B doesn't, the B will block the connection. But if both send a connection at the same time, B is *expecting* a return connection, and will let the connection from A through.
very nice,so does socket2 can transmit data from browser to a proxy server and transmit datat from a proxy server to browser,canyou make a video or some codes,than you in advance,i'm very puzzled
This has helped me understand how hole punching in libp2p is being achieved, however they solved the clock synchronization problem by calculating RRT between the 2 clients with the help of a relay node. I learn something everyday, Thank you.
Why the SYN+ACK after each has already received a SYN? According to the RFC, when doing a Simultaneous Open, after each side receives their SYN, they send back only an ACK, not a SYN+ACK. Was this changed in a later RFC?
Great video!
I tried to implememt it in python using sockets module but it didnt work. I think we also need to simultaneously listen() for connections on the same port through threading to catch connection request according to a nat traversal paper I read.
I managed to do it in python. Do you need the code?
Hi there, thanks for making the video. It seems interesting however there is something I don't quite understand. What it seems to me that the code is basically firstly create a "server" (using bind) then create a "client" using connect. It seems not really matters to make the connection working to be right on the exact time?
I basically cloned your code and changed line 32 to `std::thread::sleep(Duration::seconds(20).to_std().unwrap());`
So I can run one manually at machine1 and then after a few seconds (within 20 seconds of course) I run another code via machine2. And I tested this both on a single mac, or using 2 mac macs I have here, they all can connect and print hellos.
I also used tcpdump to monitoring on one of the machines and saw normal connection output. Wondering why I cannot see the [R.] error case as you shown in the video.
Could it because on Mac there is something different, like some default timeout setting?
Socket2's connect function also have a "connect_timeout" function where you can specific a very long time out and perhaps that will make your case work or?
Or maybe you know why it works for my case?
BTW, I can only seeing the [R.] error while just running one machine and never run the other and wait until sleep time out so it calls connection onto a socket address that is no bind, then I can see [R.] error from tcpdump view.
The timing matters when the computers are on different networks, A and B.
Normally, routers block incoming connections. But if you send out an outgoing connection first, then the router *expects* a returning incoming connection and lets it through. If A sends a connection but B doesn't, the B will block the connection. But if both send a connection at the same time, B is *expecting* a return connection, and will let the connection from A through.
very nice,so does socket2 can transmit data from browser to a proxy server and transmit datat from a proxy server to browser,canyou make a video or some codes,than you in advance,i'm very puzzled
bug? feature. 🤥
3:30 - its a technique used to perform hole punching