Re: [lwip-users] TCP keep-alive not working on half-closed connections

2018-06-06 Thread Joel Cunningham
On 06/06/2018 02:13 PM, goldsi...@gmx.de wrote: https://stackoverflow.com/questions/18110239/does-tcp-endpoint-that-has-sent-a-fin-still-send-keepalive

Re: [lwip-users] Incorrect ACK number for the TCP Server with PPPoS, NetConn and FreeRTOS

2018-06-06 Thread Joel Cunningham
On 06/06/2018 09:29 AM, sarp wrote: I am implementing a TCP Server with PPPoS where NO_SYS = 0(FreeRTOS). Everything is OK, one thread feeds ppp and the other opens a netconn socket for server and starts listening. However, when a client is connected, connection is reset because of incorrect

Re: [lwip-users] TCP keep-alive not working on half-closed connections

2018-06-06 Thread Joel Cunningham
On 06/06/2018 07:45 AM, goldsi...@gmx.de wrote: On 06.06.2018 11:42, R. Diez wrote: [..] The trouble is, this changes the connection state (pcb->state) from ESTABLISHED to FIN_WAIT_1, which then turns quickly into FIN_WAIT_2. Afterwards, TCP keep-alive does not work anymore, because of this

Re: [lwip-users] Getting Raw ARP Packets

2018-05-29 Thread Joel Cunningham
> On May 22, 2018, at 06:13, David M. Zar wrote: > > As a side note, we have a software version of our proposed system running on > a PC... it opens a BSD RAW_SOCKET and does everything at that level. > Essentially, that's what I'm trying to emulate, here, but being as efficient > as

Re: [lwip-users] Help debugging IPv6 SLAAC

2018-04-19 Thread Joel Cunningham
> On Apr 19, 2018, at 2:49 PM, goldsi...@gmx.de wrote: > > On 19.04.2018 14:45, thomasfogh wrote: >> I've changed my IPv4 only application to be IPv6 only. >> Right now it doesn't do anything but try to get an IPv6 address. > > What's your setting for LWIP_IPV6_MLD? I think I remember that you

Re: [lwip-users] LWIP Socket Interface + Raw Ethernet Data

2018-03-29 Thread Joel Cunningham
> On Mar 26, 2018, at 6:34 AM, Kashyap Gada > wrote: > > Dear all, > > We have a project of a custom radio working as a point to point device > working as a bridge between two LAN Networks. We have two requirements – > 1. Sending and receiving all

Re: [lwip-users] access to tcp_pcb data from socket+

2018-03-07 Thread Joel Cunningham
On 03/07/2018 04:05 AM, Mattia Settin wrote: Hi For example I need to check the send buffer size (e.i. SO_SNDBUF) which is not implemented options. Regards Setting the send buffer size at run-time is not supported. We have a compile time setting TCP_SND_BUF for that.  Are you wanting to

Re: [lwip-users] TCP Sessions Scale Limit

2018-02-27 Thread Joel Cunningham
If you have 128GB of RAM (wow!!!), it might be best to turn off LwIP's heap and pool and just use stdc malloc.  Then you won't be limited by any pool or heap defines in LwIP.  See the below options: /**  * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library  * instead of the

Re: [lwip-users] [OT] Minimize .html, .js and .css files

2018-02-20 Thread Joel Cunningham
On 02/20/2018 09:35 AM, Giuseppe Modugno wrote: Another OT. In order to reduce Flash space for the filesystem used by httpd, I'm thinking to reduce the size of .html, .css and .js files. This means removing comments, spaces (when not needed) and maybe changing variable names (from

Re: [lwip-users] missing definition for mem_perf_init()

2018-02-12 Thread Joel Cunningham
On 02/07/2018 01:41 PM, goldsi...@gmx.de wrote: On 07.02.2018 17:48, vinay s wrote: My clone is a week old, I tried enabling MEM_PERF (unix port) and realized there is no def for mem_perf_init(). Not sure if I saw something to the effect in wiki either. Any ideas? My idea would be that

Re: [lwip-users] lwIP in mainline linux kernel

2018-02-06 Thread Joel Cunningham
I haven't heard of LwIP running in the Linux kernel, but LwIP has been integrated into a number of other operating systems: ReactOS GNU Hurd Minix 3 I haven't studied the ReactOS integration, but GNU Hurd/Minix 3 happened more recently and their respective developers communicated on the

Re: [lwip-users] Best way for determining if a TCP connection is dead?

2018-01-24 Thread Joel Cunningham
On 01/24/2018 10:35 AM, Chris Seto wrote: I have some code which works great, based on the echo client example. I'm working on hardening it, and I'm wondering with how best to deal with a dead TCP connection as a result of the network link being down (ie, Ethernet cable disconnected).

Re: [lwip-users] issue adding static arp entries.

2017-12-19 Thread Joel Cunningham
On 12/19/2017 1:59 PM, Kent Pluntze wrote: Hello, I am trying to create a network with limited traffic so I am attempting to initialize all ARP tables to static. Currently I am calling a function in the application which does the following. makeArpTableStatic(void){ /*inits*/ int i; u8_t

Re: [lwip-users] 2 Devices

2017-11-13 Thread Joel Cunningham
On 11/10/2017 03:51 AM, Fabian Cenedese wrote: struct sockaddr_in addr; s=socket(AF_INET, SOCK_DGRAM, 0); if (s >= 0) { // set up port from any address to bind to memset(, 0, sizeof(addr)); addr.sin_len=sizeof(addr); addr.sin_family=AF_INET;

Re: [lwip-users] win32 porting contrib: double IP address

2017-11-09 Thread Joel Cunningham
On 11/09/2017 03:41 AM, Giuseppe Modugno wrote: Il 08/11/2017 16:34, Joel Cunningham ha scritto: The ping works well if I launch "ping 192.168.1.156" command from *another* computer on the same network. You're most likely running into a checksum offload problem since you can

Re: [lwip-users] win32 porting contrib: double IP address

2017-11-08 Thread Joel Cunningham
On 11/08/2017 04:58 AM, Giuseppe Modugno wrote: Hello lwip users, this is my first post. I hope this is the right mailing list for my question. I started with lwip, so I downloaded both lwip and lwip-contrib. I was able to compile lwip test application for win32 (mingw compiler). When I

Re: [lwip-users] lwip 1.4.1 send a sporadic RST ACK

2017-10-25 Thread Joel Cunningham
I've updated the remaining comments to mention the same priority on git master Another thing you could do is have your application track number of active connections, make sure enough TCP pcbs are configured and then close the listener pcb once the maximum is reach. Joel On 10/24/2017

Re: [lwip-users] LWIP_MPU_COMPATIBLE set to 1, but still get memory management fault in lwip_select.

2017-09-08 Thread Joel Cunningham
David, Would you mind opening a bug report at https://savannah.nongnu.org/bugs/?func=additem=lwip and attaching the patches so we can do the review there? Also, it would be preferable to have the changes in a git patchset that can be

Re: [lwip-users] LWIP_MPU_COMPATIBLE set to 1, but still get memory management fault in lwip_select.

2017-09-07 Thread Joel Cunningham
> On Sep 7, 2017, at 9:14 AM, David Lockyer wrote: > > Hi Simon, > > Okay, thank you for the suggestion. Just to be clear are you suggesting > modifying lwip_select() to allocate select_cb from a pool & free prior to > return? > > I will have to investigate the

Re: [lwip-users] IPv6 MTU vs IPv4 MTU

2017-09-05 Thread Joel Cunningham
Sent from my iPad > On Sep 4, 2017, at 13:48, "goldsi...@gmx.de" wrote: > > Raphael Zulliger wrote: >> What do you think? Have I found a bug and shall I open a bug report or >> am I wrong? > > I'm not really sure. After all, the MTU is what a network can send. Having a >

Re: [lwip-users] TCP 2.0.2 pcb->snd_nxt is not updated somewhere?

2017-08-07 Thread Joel Cunningham
> > On Aug 7, 2017, at 4:43 AM, Simonas Kazlauskas > wrote: > > So it seems like for some reason the pcb->snd_nxt is one-off. This seems really strange. For an active open, sending of the SYN packet advances pcb->snd_nxt by 1. See the following code in

Re: [lwip-users] Bind fails after previous server-initiated connection close

2017-06-09 Thread Joel Cunningham
Hi, This is normal BSD semantics of a TCP listener, use SO_REUSEADDR before calling bind to avoid the issue Joel > On Jun 8, 2017, at 4:18 PM, Ignacio García Pérez wrote: > > Hi All, > > I'm writing a simple FTP server that needs to be started up and shut down > with

Re: [lwip-users] Raw api + multiple TCP Connections

2017-05-27 Thread Joel Cunningham
You're seeing the send stop from the server because the client's receive window is smaller than the next segment to send. At packet 28091, the receiver's window drops to 4 bytes and the sender's next segment is 8 bytes LwIP (on the server) is treating this as a zero window rather than splitting

Re: [lwip-users] Listen/Accept lwip 2.0.0

2017-05-04 Thread Joel Cunningham
Do you have TCP_LISTEN_BACKLOG enabled in your port? Also keep in mind, the backlog only limits connections that have not been accepted. Once accepted by your application, the connections are not part of the backlog. If your goal is to support 4 simultaneous connections at once (with no

Re: [lwip-users] zero window probe causes duplicated byte to be received

2017-04-02 Thread Joel Cunningham
Bug report: https://savannah.nongnu.org/bugs/?func=detailitem_id=49128 Fix: http://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=9ba9dee2aa809624eda0e96c96abd8abff29539e Joel > On Apr 1, 2017, at 22:41, Yao Lin wrote: > > Thanks Joel. In case you find that bug, could you

Re: [lwip-users] zero window probe causes duplicated byte to be received

2017-04-01 Thread Joel Cunningham
There was a bug where send_nxt was not advanced during the zero window probe and thus the zero window probe ACK caused LwIP to send back another ACK, creating an ACK storm. This has been fixed on master. I can dig up the bug report if you need it (away from git history at the moment) Even with

Re: [lwip-users] lwip FreeRTOS tcp window

2017-04-01 Thread Joel Cunningham
> On Apr 1, 2017, at 7:25 AM, Mohamed Hnezli wrote: > > Thank you for support, > Are there any way to change this, such as 1 ack for 5 TCP segments sent from > client (lwip) What you referring to is a stretch ACK (where the ACK covers more than 1 full sized

Re: [lwip-users] Question regarding mdns responder

2017-03-21 Thread Joel Cunningham
> On Mar 21, 2017, at 9:28 AM, Dirk Ziegelmeier wrote: > > from mdns.c: > > * Things left to implement: > * - > * > * - Probing/conflict resolution > […] Given the list of limitations, should the current mDNS support only be used for

Re: [lwip-users] Question regarding mdns responder

2017-03-21 Thread Joel Cunningham
> On Mar 21, 2017, at 6:30 AM, Dirk Ziegelmeier wrote: > > The problem is that you have two hosts with the same name "BGW" (= > "BGW.local" MDNS name) in the same network. They should have different names. > > Is this a known limitation of LwIP’s mDNS implementation?

Re: [lwip-users] lwip_sendto hanging with lwip 2.0

2017-01-25 Thread Joel Cunningham
If you want to send and receive on the same socket from two different threads, you’ll need to enable LWIP_NETCONN_FULLDUPLEX in opt.h (by default it’s not supported and feature is in alpha state): /** LWIP_NETCONN_FULLDUPLEX==1: Enable code that allows reading from one thread, * writing from a

Re: [lwip-users] TCP send() fails when other sockets perform retransmissions

2017-01-05 Thread Joel Cunningham
> On Jan 3, 2017, at 9:34 AM, Daniel Pauli wrote: > > If you have LwIP stats enabled, you can check the memory pools for errors to > figure out which one is failing. You should be able to resolve this by > sizing your memory pools to handle the number of supported

Re: [lwip-users] TCP send() fails when other sockets perform retransmissions

2016-12-30 Thread Joel Cunningham
TWAIT should be equivalent to setting the O_NONBLOCK, though you’ll need to include the flag for each call rather than set the mode once. > > On Fri, Dec 30, 2016 at 6:30 PM, Joel Cunningham <joel.cunning...@me.com > <mailto:joel.cunning...@me.com>> wrote: > >>

Re: [lwip-users] TCP send() fails when other sockets perform retransmissions

2016-12-30 Thread Joel Cunningham
. Typically this is a bad idea. There’s a decent discussion here on stackoverflow: http://stackoverflow.com/questions/3757289/tcp-option-so-linger-zero-when-its-required <http://stackoverflow.com/questions/3757289/tcp-option-so-linger-zero-when-its-required> > > Lastly, what version of

Re: [lwip-users] TCP send() fails when other sockets perform retransmissions

2016-12-28 Thread Joel Cunningham
On Dec 28, 2016, at 06:45 AM, Daniel Pauli wrote: Am I understanding the description correctly that sending on the stale connection eventually blocks once the remote side has crashed and this prevents sending on the new socket (only because the thread is blocked)?

Re: [lwip-users] TCP send() fails when other sockets perform retransmissions

2016-12-27 Thread Joel Cunningham
Am I understanding the description correctly that sending on the stale connection eventually blocks once the remote side has crashed and this prevents sending on the new socket (only because the thread is blocked)? If so, then the socket buffer on the stale socket has filled up (most likely)

Re: [lwip-users] Zero window and refused data problem

2016-12-09 Thread Joel Cunningham
Oleg, Would you mind testing the patch I've posted to https://savannah.nongnu.org/bugs/?49631 Thanks, Joel On Nov 09, 2016, at 01:26 AM, Oleg Gladyshev wrote: And since we don't want to create even more traffic in an overload situation, we don't even send and ACK

Re: [lwip-users] UDP bind error due to address and port reuse

2016-12-05 Thread Joel Cunningham
On Dec 03, 2016, at 01:05 PM, Michael Steinberg wrote: Am 03.12.2016 um 17:37 schrieb Surya Chaitanya: Hi, The scenario is something like this. I have created an array of say, 5 UDP PCB's. I'd like to bind all these 5 UDP PCB's to the same local IP address and

Re: [lwip-users] Zero window and refused data problem

2016-11-08 Thread Joel Cunningham
Follow up on my response, see below On Nov 08, 2016, at 05:58 PM, Joel Cunningham <joel.cunning...@me.com> wrote: Simon, On Nov 08, 2016, at 02:54 AM, Simon Goldschmidt <goldsi...@gmx.de> wrote: Hi Oleg,   first of all, I think you are "misusing" TCP as a queue

Re: [lwip-users] Zero window and refused data problem

2016-11-08 Thread Joel Cunningham
Simon, On Nov 08, 2016, at 02:54 AM, Simon Goldschmidt wrote: Hi Oleg,   first of all, I think you are "misusing" TCP as a queue here (and at least our implementation is not really meant for this). It might work (or not, as you see), but in my opinion, the various

Re: [lwip-users] Zero window and refused data problem

2016-11-07 Thread Joel Cunningham
Oleg, I agree that setting the window update threshold below 1 MSS would be bad.  I didn't realize your window was being updated in such small amounts.  Is there a reason why your application isn't continuing to drain the buffer? In terms of receiving a zero-window probe.  Is LwIP ACKing

Re: [lwip-users] Zero window and refused data problem

2016-11-07 Thread Joel Cunningham
Oleg, In your original post, you mentioned that your application reads some data out of the buffer, but this doesn't result in a window update.  This is because LwIP waits until 1/4 of the window has been opened up.  There is a setting that controls the update threshold in opt.h.  You can

Re: [lwip-users] Is there a way to cancel a call to lwip_select()?

2016-09-27 Thread Joel Cunningham
You can achieve the same thing with LwIP by using a UDP socket bound to a port on the loopback adapter.  Sending to the loopback address and port (from another thread) will be received on your UDP socket and will return the select call Joel On Sep 24, 2016, at 03:56 PM, doragasu

Re: [lwip-users] ethernet driver overloaded?

2016-08-29 Thread Joel Cunningham
I've ran into this problem on my products as well, but the situation is a little different.  We use LwIP on top of a WiFi subsystem and it's easy to fill up the driver's transmit queue when the device (operating as a station) moves out of range of the AP. We've handled it in two manners,

Re: [lwip-users] [lwip-devel] lwIP documentation update

2016-08-15 Thread Joel Cunningham
On the Overview page, there is a minor typo under the documentation section: There is now a constantly growin wiki about lwIP at http://lwip.wikia.com/wiki/LwIP_Wiki It should say "growing wiki" Joel On Aug 08, 2016, at 02:14 AM, Dirk Ziegelmeier wrote: Hello all,

Re: [lwip-users] lwIP delays outgoing TCP packets by up to 500ms

2016-07-13 Thread Joel Cunningham
It's worth comparing the behavior of the netconn API.  Even though the netconn API is only available with NO_SYS = 0, it is still a user of the raw API like the applications mentioned in this email thread. lwip_netconn_do_writemore() calls tcp_write() until all segments have been put into

Re: [lwip-users] LwIP multithread select mode problems

2016-06-28 Thread Joel Cunningham
See responses in-line Joel On Jun 24, 2016, at 09:31 PM, lampo wrote: thanks a lot. now I use *recv*, *send*, *close* apis in the same thread per one socket, that means each client socket occupy a new thread, and each of them calles *select*, *recv*, *send*, *close* .

Re: [lwip-users] LwIP multithread select mode problems

2016-06-24 Thread Joel Cunningham
Yes you need SYS_ARCH_PROTECT in a multi-threaded environment.  Whether or not you use SYS_LIGHTWEIGHT_PROT just controls whether the function prototypes are produced and used in SYS_ARCH_PROTECT: #define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev #define SYS_ARCH_PROTECT(lev) lev =

Re: [lwip-users] LwIP multithread select mode problems

2016-06-23 Thread Joel Cunningham
Hi, select() can be used by multiple threads at the same time and you can even have the same sockets in multiple calls and it will be safe.  The limitation comes from trying to use the same sockets from multiple simultaneous threads in other socket APIs (select is the exception,

Re: [lwip-users] [lwip-devel] 2.0.0 Beta2?

2016-06-20 Thread Joel Cunningham
On the timers.c issue, I haven't ran into that one yet, but I have ran into source file name collisions with mem.c My preferred solution is to fix it at the build system level.  Hopefully the project can use something smarter than a flattened global list of source files to compile. But if

Re: [lwip-users] TCP keep alive info to the application

2016-06-02 Thread Joel Cunningham
Agreed, trying to leverage TCP keepalive information in the application level is incorrect.  The keepalives are used internally by TCP and will abort the connection when communication is lost.  This event is then typically communicated through socket APIs returning an error on next use. You

Re: [lwip-users] Detect DHCP enabled for netif

2016-02-25 Thread Joel Cunningham
___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] LWIP raw TCP socket disconnection

2016-02-08 Thread Joel Cunningham
Here's a great article on everything you'd ever want to know about handling half-open TCP connections:http://www.codeproject.com/Articles/37490/Detection-of-Half-Open-Dropped-TCP-IP-Socket-ConneI make sure to keep this book marked :D JoelOn Feb 08, 2016, at 04:06 PM, Sylvain Rochet

Re: [lwip-users] TCP_SNDBUF limit

2016-02-04 Thread Joel Cunningham
___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] The issue about gethostbyname() function

2016-01-12 Thread Joel Cunningham
___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] lwip_close() doesn't work when lwip_write() hangs

2015-10-12 Thread Joel Cunningham
LwIP doesn't support this kind of threading model. Multiple threads can not perform simultaneous operations (read+write, write+close, etc.) on the same socket. The main limitation is that the netconn only has a single semaphore for blocking the calling thread when entering the core context.

Re: [lwip-users] lwip_close() doesn't work when lwip_write() hangs

2015-10-12 Thread Joel Cunningham
On Mon, Oct 12, 2015 at 7:44 AM, Joel Cunningham <joel.cunning...@me.com> wrote: LwIP doesn't support this kind of threading model. Multiple threads can not perform simultaneous operations (read+write, write+close, etc.) on the same socket. The main limitation is that the netconn only

Re: [lwip-users] lwip_close() doesn't work when lwip_write() hangs

2015-10-12 Thread Joel Cunningham
, at 02:19 PM, Sylvain Rochet <grada...@gradator.net> wrote:Hi Joel,On Mon, Oct 12, 2015 at 07:10:39PM +, Joel Cunningham wrote:You can use SO_SNDTIMEOUT, which should work on LwIP 1.4.1. I have used it in my port with LwIP 1.4.1, so possibly there's a problem with your port?I've also w

Re: [lwip-users] lwip full duplex?

2015-08-11 Thread Joel Cunningham
LwIP has not had supported for full duplex sockets in any release versions. On the master branch, there is some initial support under the flag LWIP_NETCONN_FULLDUPLEX, but I think the feature is pretty early in development. Here is the comment from the opt.h, noting the alpha state of this:

Re: [lwip-users] lwip full duplex?

2015-08-11 Thread Joel Cunningham
had not anticipated that it's common to have three threads on a socket running, each doing their own task on it. The problems stem from the third deleting thread, right? Reading + Writing seem to be unproblematic as it stands? Kind Regards, Michael Am 11.08.2015 um 16:38 schrieb Joel Cunningham

Re: [lwip-users] lwip full duplex?

2015-08-11 Thread Joel Cunningham
... Would it prove helpful to bring all the touched shared resources into a diagram? I could create such a diagram while digging... Perhaps it makes reasoning easier... Kind Regards, Michael Am 11.08.2015 um 17:09 schrieb Joel Cunningham: Michael, Historically there hasn't been support

Re: [lwip-users] SO_REUSEPORT is supported in LWIP 1.4.1

2015-07-01 Thread Joel Cunningham
I'm using it on a project with LwIP 1.4.1. You'll need to enable it with #define SO_REUSE 1 in your options header. The implementation is in sockets.c and calls ip_set_option()/ip_get_option() Joel On Jul 01, 2015, at 01:39 AM, jkp jithin...@in.abb.com wrote: Hi, I'm using LWIP Version

Re: [lwip-users] Sending to a non-local network without default netif set

2014-11-18 Thread Joel Cunningham
we do have a setup with two netifs and we cannot determine what the customer will do with the device so we need to also check for „same subnet“ scenarios. I would like to make a clear distinction between two possible same subnet scenarios 1) A multi-homed product is connected to the same

[lwip-users] event_callback() context switch when calling sys_sem_signal()

2014-09-19 Thread Joel Cunningham
I'm running LwIP 1.4.1 and have some questions about the event_callback() in sockets.c In my project, I am experiencing a crash related to synchronization in event_callback() and an application thread calling select().  My project is a uniprocessor system running an RTOS that implements a

Re: [lwip-users] Multi-threaded socket access once again

2014-07-21 Thread Joel Cunningham
@nongnu.org] On Behalf Of Joel Cunningham Sent: Freitag, 18. Juli 2014 19:21 To: Mailing list for lwIP users Subject: Re: [lwip-users] Multi-threaded socket access once again   Another problem beside the lwIP API not being designed for multiple thread access on the same socket, is an inability