GNB is an open source, decentralized VPN that performs three-layer network switching through P2P with ultimate intranet penetration capabilities.
Data is transmitted between GNB nodes through the UDP protocol. In some network environments, routers/firewalls will implement QOS policies for UDP packets. Therefore, forwarding GNB data through tcp links does not require changes to the GNB communication protocol and can improve the adaptability of the GNB network. way.
gnb_udp_over_tcp is a service developed for GNB that forwards UDP packets through tcp links.
The remote GNB node ip address is 192.168.1.25 GNB UDP port 9025 GNB TUN ip 10.1.0.25 The remote GNB configuration file does not need to be adjusted
The relay server IP address is 192.168.1.11
[gnb_1010]
|
udp
|
[udp_over_tcp udp:127.0.0.1:5001] (./gnb_udp_over_tcp -u -l 5001 192.168.1.11 6000)
|
tcp
|
[udp_over_tcp tcp:192.168.1.11:6000] (./gnb_udp_over_tcp -t -l 6000 192.168.1.25 9025)
|
udp
|
[gnb_1025 udp:192.168.1.25:9025]
Executed on 192.168.1.11
./gnb_udp_over_tcp -t -l 6000 192.168.1.25 9025
The local ip address is 192.168.1.10 GNB TUN ip 10.1.0.10
The content of local GNB conf/1010/address.conf is
n|1025|127.0.0.1|5001
Do not configure i type GNB nodes in address.conf
Executed on 192.168.1.10
./gnb_udp_over_tcp -u -l 5001 192.168.1.11 6000
Start the local GNB node and ping 10.1.0.25 to check whether the ping can succeed.
[netcat] (nc -u 127.0.0.1 5001)
|
udp
|
[udp_over_tcp udp:127.0.0.1:5001] (./gnb_udp_over_tcp -u -l 5001 127.0.0.1 6000)
|
tcp
|
[udp_over_tcp tcp:127.0.0.1:6000] (./gnb_udp_over_tcp -t -l 6000 127.0.0.1 7000)
|
udp
|
[netcat udp:127.0.0.1:7000] (nc -u -l 7000)
Use nc to monitor port 7000 udp
nc -u -l 7000
Start the tcp side of gnb_udp_over_tcp: listen to the tcp 6000 port. Each tcp link connected to the port will establish a udp socket to form a channel. The packets received by the tcp link are sent to the UDP 7000 port of 127.0.0.1, from The data received at the udp end will be sent to the other end of the tcp link. The tcp end of gnb_udp_over_tcp can simultaneously access multiple tcp connections and forward them to the udp port of the same destination address.
./gnb_udp_over_tcp -t -l 6000 127.0.0.1 7000
Start the udp end of gnb_udp_over_tcp: listen to udp port 5001, establish a tcp link with 127.0.0.1 tcp port 6000, the data received by the udp end is sent to the other end of the tcp link, and the data received from the tcp link is sent to the udp end .
./gnb_udp_over_tcp -u -l 5001 127.0.0.1 6000
Use nc to access the 5001 udp port of 127.0.0.1 to check whether the data is successfully forwarded.
nc -u 127.0.0.1 5001
Disclaimer