Skip to content

kota-yata/tcp-simultaneous-open

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

TCP Simultaneous Open

Implementation of TCP Simultaneous Open in C

Procedure

  1. Prepare two machines that are not behind Symmetric NAT.
  2. Check the external IP address and port of each with the following command:
$ gcc ./src/tcp-stun/client.c
$ ./a.out 44444 18.191.223.12 3478

This example uses stun.stunprotocol.org:3478 as STUN server. You can use whatever servers as long as it's available on TCP (though STUN Server supporting TCP is not really common). You can also specify other local ports than 44444.

  1. Run src/main.c with the local port, peer's external address and port
$ gcc ./src/main.c
$ ./a.out 0.0.0.0 [Local Port] [Peer's External Address] [Peer's External Port]

When the connection is successfully established the following prompt will be shown:

Waiting for xxxxx microseconds
Connecting...
Connection Established
Received: Hello :)

Environment

Ubuntu, FreeBSD, MacOS have been tested so far

About

Implementation of TCP Hole Punching

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages