TCP Tunnel

A demonstration of an IPv4 tunnel (over TCP) between the Node A and Node B subnets.

  • GitHub Link: https://github.com/packetcord/packetcord.io/tree/main/apps/l3_tcp_tunnel
  • Topology File: topology_examples/l3_tunnel_example.json

Topology diagram

TOP

Steps

Build the project (all examples)

cd packetcord.io
mkdir build
cd build
cmake .. --fresh
make

Start the topology

Use the l3_tunnel_example.json project file. As it is configured for the UDP Tunnel app by default, on the two endpoint nodes we need to change the network app field to point to the TCP tunnel client and server compiled binaries. It is also recommended to modify the MTU sizes from 1420 to 1400 - inside the shell commands field.

Note: Complete example will be added as part of the next release of Network Builder IDE.

Load the exampe topology project file. Then Validate, Generate and Launch the topology.

Inside the shell of TEP A

cd /root
./l3_tunnel_tep_c_app

Inside the shell of TEP B

cd /root
./l3_tunnel_tep_s_app

Result

Open the shells of Node A and Node B. Try to ping each other (11.11.11.100 and 192.168.111.100).

# ping -c4 192.168.111.100
PING 192.168.111.100 (192.168.111.100): 56 data bytes
64 bytes from 192.168.111.100: seq=0 ttl=64 time=0.142 ms
64 bytes from 192.168.111.100: seq=1 ttl=64 time=0.249 ms
64 bytes from 192.168.111.100: seq=2 ttl=64 time=0.182 ms
64 bytes from 192.168.111.100: seq=3 ttl=64 time=0.350 ms

Let's also run iperf3 between Node A (client) and Node B (server):

Inside the shell of Node B

iperf3 -s

Inside the shell of Node A

iperf3 -c 192.168.111.100
Connecting to host 192.168.111.100, port 5201
[  5] local 11.11.11.100 port 35718 connected to 192.168.111.100 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  1.00 MBytes  8.38 Mbits/sec  256   2.63 KBytes       
[  5]   1.00-2.00   sec   896 KBytes  7.34 Mbits/sec  159   2.63 KBytes       
[  5]   2.00-3.00   sec   128 KBytes  1.05 Mbits/sec   50   2.63 KBytes       
[  5]   3.00-4.00   sec   128 KBytes  1.05 Mbits/sec   48   2.63 KBytes       
[  5]   4.00-5.00   sec   128 KBytes  1.05 Mbits/sec   48   2.63 KBytes       
[  5]   5.00-6.00   sec   128 KBytes  1.05 Mbits/sec   50   2.63 KBytes       
[  5]   6.00-7.00   sec   128 KBytes  1.05 Mbits/sec   48   2.63 KBytes       
[  5]   7.00-8.00   sec   128 KBytes  1.05 Mbits/sec   50   2.63 KBytes       
[  5]   8.00-9.00   sec   128 KBytes  1.05 Mbits/sec   48   2.63 KBytes       
[  5]   9.00-10.00  sec   128 KBytes  1.05 Mbits/sec   48   2.63 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  2.88 MBytes  2.41 Mbits/sec  805            sender
[  5]   0.00-10.25  sec  2.88 MBytes  2.35 Mbits/sec                 receiver

Note:

Our TCP tunnel example does not handle:

1) Fragmentation

2) Packet buffering and looped TX/RX until all bytes are sent/received

Terminate

Use the Destroy button to terminate the emulation.