S
S
Siegurd_12018-10-11 11:52:31
Windows
Siegurd_1, 2018-10-11 11:52:31

How to build a TCP to UDP bridge and back on Windows?

There is a GSM modem (SIM800) (client) and a Windows PC (server).
On the router to which the PC is connected, port forwarding is configured (60100 TCP - 60100 TCP) on which the GSM modem is knocking.
There is software that works on two UDP ports on a Windows PC (60102 UDP for transmission and 60103 UDP for reception).
The question is how to bind TCP port 60100 to two UDP ports 60102 and UDP 60103?
Partially solved the issue using socat for Windows .
Command (TCP -> UDP1)

socat tcp4-listen:60100,reuseaddr,fork UDP:127.0.0.1:60103

on Windows PC it works fine - data from the GSM modem is received. But I can not get the transmission in the opposite direction to the GSM modem to work.
Tried like this: (TCP -> UDP1 and UDP2 -> TCP)
socat tcp4-listen:60100,reuseaddr,fork UDP:127.0.0.1:60103 | socat udp4-listen:60102,reuseaddr,fork tcp:localhost:60100

it turns out that the data from the modem is received, but I myself transmit the data that needs to be sent to the modem.
socat tcp4-listen:60100,reuseaddr,fork UDP:127.0.0.1:60103 | socat udp4-listen:60102,reuseaddr,fork tcp:192.168.115:60100

does not open a connection (192.168.115 - IP address of the PC)
I also tried to use netcat but the result was not achieved.
The software does not know how to receive and send data on the same UDP port.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
res2001, 2018-10-11
@res2001

Do you have the modem itself as a client or is it the device behind the modem?
If you raise a VPN server on a Windows PC on the TCP / 60100 port, and the device behind the modem is the VPN client, then you can push any traffic into the VPN pipe by simply accessing the Windows PC at the internal VPN address.

B
bbbuuu, 2019-05-12
@bbbuuu

socat tcp4-listen:60100,reuseaddr,fork UDP:127.0.0.1:60103!!UDP:127.0.0.1:60102

K
Karpion, 2020-01-24
@Karpion

Set up UDP forwarding on your router.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question