Home

Awesome

DatagramTunneler

Author License: GPL v3 GitHub last commit Stars

<!-- ![GitHub (pre-)release](https://img.shields.io/github/release/MarkoPaul0/WireBait/all.svg?style=flat-square) ![GitHub (pre-)release](https://img.shields.io/github/commits-since/MarkoPaul0/WireBait/latest.svg?style=flat-square)-->

Simple cross-platform client/server program forwarding UDP datagrams through a TCP connection (aka tunnel). The client joins a multicast group and forwards the received datagrams to the server, which in turns multicasts them on its own subnet.

Content

Requirements<br/> Installation<br/> Synopsis<br/> Examples<br/> How does it work?<br/> The DTEP Protocol<br/> Licensing<br/>

<a name="requirements"/>

Requirements

<a name="installation"/>

Installation in 10 seconds

cd <path_to_the_repo>/DatagramTunneler
make
./bin/DatagramTunneler -h

For more info about how to run it, checkout the Synopsis below

<a name="synopsis"/>

Synopsis

In order to use the DatagramTunneler you need to start the server side first, then the client side. If you don't, the client will just fail to connect to the server and exit right away.

Server

  dgramtunneler --server -i <udp_iface_ip> -t <tcp_listen_port> [-u <udp_dst_ip>:<port>]

Client

  dgramtunneler --client -i <udp_iface_ip> -t <tcp_srv_ip>:<tcp_srv_port> -u <udp_dst_ip>:<port>
<a name="examples"/>

Examples

(Don't forget to give a little star if this tool is useful to you :]) server side:

./bin/datagramtunneler --server -i 192.168.0.104 -u 228.14.28.52:1234 -t 28052

client side:

./bin/datagramtunneler --client -i 192.168.0.105 -u 228.1.2.3:7437 -t 192.168.0.104:28052
<a name="how_it_works"/>

How does it work?

The purpose of the DatagramTunneler is to transfer multicast data from one subnet A to another subnet B where that multicast channel is not available. To achieve this, the DatagramTunneler is split into 2 sides: a client side and a server side, as shown on the diagram below: Datagram Tunneler

The Client Side

The client side should run in the subnet where the multicast channel is joinable. Once started it will do the following:

The Server Side

The server side should run in the subnet where the multicast is not available. Once started it will do the following:

<a name="dtep"/>

The Datagram Tunneler Encapsulation Protocol (DTEP)

The Datagram Tunneler Protocol or DTEP is a simple binary protocol, which is described by the following diagram:

A DTEP packet has a 1 byte header specifying the type of payload it contains.

Packet Type 0x00 = HEARTBEAT

This type of packet has no payload. It is sent by the client to the server and helps ensure both ends of the connection know if the other end is alive.

Packet Type 0x01 = DATAGRAM

This packet encapsulates the datagram observed by the client. Here is its complete description:

Although this diagram should be self explanatory, here is a break down of all the fields:

<a name="licensing"/>

Licensing

C.f. LICENSE