[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] lwip PPPoS + ESP8266 wifi module
From: |
Sylvain Rochet |
Subject: |
Re: [lwip-users] lwip PPPoS + ESP8266 wifi module |
Date: |
Fri, 27 Apr 2018 14:22:40 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hi Andrea,
On Fri, Apr 27, 2018 at 05:53:27AM +0000, Andrea Marangon wrote:
> Hi everyone,
> I'm using lwip on the ESP8266 wifi module.
> This module is connected to my card and communicates via PPPos (the PPP
> client is the Wifi module).
> Now I need to receive and transmit TCP and UDP packets via Wifi.
>
> Initially I created two TCP sockets (netconn), one client and the other
> server forwarding the data via buffers, but it is very expensive in time and
> memory.
> I have doubts about this implementation considering that I will have to do
> the same with the UDP transmission.
>
>
> Board(10.11.12.13) --> PPPoS --> netconn TCP client(10.11.12.13) --> netconn
> TCP server(172.16.0.1) --> mobile system (172.16.0.2)
>
>
> I thought of using the network interfaces (netif, one the PPPoS and the
> other the WiFi) to do a kind of forwarding...
> could this be the right way? Can the UDP part coexist?
> Do you have any suggestions?
The proper way is to use IP routing(=forwarding) but you will need
properly set routing table on all hosts, which is generally hard to
achieve. The other way is to use NAT but lwIP does not support NAT.
In my opinion, the UDP/TCP proxy you did is the easiest way to achieve
what you need and is, although not the best from the state of the art
perspective, but a very acceptable solution.
Note you don't need to use the heavy socket/netconn interface since you
are just forwarding packets inside the lwIP stack at the end, using the
raw API interface inside the TCP/IP thread would be best suited.
Sylvain
signature.asc
Description: Digital signature