https post_auto_wnd not work

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

https post_auto_wnd not work

wilkxt
Hi
I have set:
#define LWIP_HTTPD_POST_MANUAL_WND  1
In normal http:
if *post_auto_wnd=1 its work ok, i can read large file.
if *post_auto_wnd=0, not work (I see TCP ZeroWindow flags).

When i run https it not work and It doesn't matter  if
*post_auto_wnd=0 or *post_auto_wnd=1. In wireshark  i see TCP
ZeroWindow flags in packet and conection is reset.
What is problem when I use https?
--
regards
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

goldsimon@gmx.de
Am 22.10.2019 um 14:48 schrieb tomek wilkxt:
> Hi
> I have set:
> #define LWIP_HTTPD_POST_MANUAL_WND  1
> In normal http:
> if *post_auto_wnd=1 its work ok, i can read large file.
> if *post_auto_wnd=0, not work (I see TCP ZeroWindow flags).

Well, these zero windows are expected, no? You'll have to update the
window from your application, of course.

>
> When i run https it not work and It doesn't matter  if
> *post_auto_wnd=0 or *post_auto_wnd=1. In wireshark  i see TCP
> ZeroWindow flags in packet and conection is reset.
> What is problem when I use https?
>

I don't know what's wrong, all I can say is it works for me. I have a
setup running where you can upload a file to (slow) flash and manual
window update throttles upload speed.

You might want to debug why the connection resets.

Regards,
Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

wilkxt
> > #define LWIP_HTTPD_POST_MANUAL_WND  1
> > In normal http:
> > if *post_auto_wnd=1 its work ok, i can read large file.
> > if *post_auto_wnd=0, not work (I see TCP ZeroWindow flags).
>
> Well, these zero windows are expected, no? You'll have to update the
> window from your application, of course.

you can show an example from manual widows update ?



--
regards
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

goldsimon@gmx.de
"tomek wilkxt" wrote:
> > > #define LWIP_HTTPD_POST_MANUAL_WND  1
> > > In normal http:
> > > if *post_auto_wnd=1 its work ok, i can read large file.
> > > if *post_auto_wnd=0, not work (I see TCP ZeroWindow flags).
> >
> > Well, these zero windows are expected, no? You'll have to update the
> > window from your application, of course.
>
> you can show an example from manual widows update ?

RTFM:
http://www.nongnu.org/lwip/2_1_x/group__httpd.html#ga6cb33693ee8f0c054be82a968ceff582

"post_auto_wnd Set this to 0 to let the callback code handle window updates by calling 'httpd_post_data_recved' (to throttle rx speed) default is 1 (httpd handles window updates automatically)"

Is that clear enough?

Regards,
Simon

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

wilkxt
śr., 23 paź 2019 o 12:06 Simon Goldschmidt <[hidden email]> napisał(a):

>
> "tomek wilkxt" wrote:
> > > > #define LWIP_HTTPD_POST_MANUAL_WND  1
> > > > In normal http:
> > > > if *post_auto_wnd=1 its work ok, i can read large file.
> > > > if *post_auto_wnd=0, not work (I see TCP ZeroWindow flags).
> > >
> > > Well, these zero windows are expected, no? You'll have to update the
> > > window from your application, of course.
> >
> > you can show an example from manual widows update ?
>
> RTFM:
> http://www.nongnu.org/lwip/2_1_x/group__httpd.html#ga6cb33693ee8f0c054be82a968ceff582
>
> "post_auto_wnd  Set this to 0 to let the callback code handle window updates by calling 'httpd_post_data_recved' (to throttle rx speed) default is 1 (httpd handles window updates automatically)"
>
> Is that clear enough?
So, I must call "httpd_post_data_recved" in  "httpd_post_receive_data" ?

I tried it and the result is the same as for the setting post_auto_wnd =1;

--
pozdrawiam
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

wilkxt
In reply to this post by goldsimon@gmx.de
śr., 23 paź 2019 o 12:06 Simon Goldschmidt <[hidden email]> napisał(a):

>
> "tomek wilkxt" wrote:
> > > > #define LWIP_HTTPD_POST_MANUAL_WND  1
> > > > In normal http:
> > > > if *post_auto_wnd=1 its work ok, i can read large file.
> > > > if *post_auto_wnd=0, not work (I see TCP ZeroWindow flags).
> > >
> > > Well, these zero windows are expected, no? You'll have to update the
> > > window from your application, of course.
> >
> > you can show an example from manual widows update ?
>
> RTFM:
> http://www.nongnu.org/lwip/2_1_x/group__httpd.html#ga6cb33693ee8f0c054be82a968ceff582
>
> "post_auto_wnd  Set this to 0 to let the callback code handle window updates by calling 'httpd_post_data_recved' (to throttle rx speed) default is 1 (httpd handles window updates automatically)"
>
> Is that clear enough?

I noticed that this is not a POST MANUAL WND problem but a general
problem with receiving more data (both GET and POST).
As I increased TCP WND from
#define TCP_WND (2 * TCP_MSS)
to
#define TCP_WND (8 * TCP_MSS)
I can receive more data before the problem occurs. But the problem
still occurs when I want to send a larger file, it looks like the
automatic TCP_WND control does not work for https. I attach the
screenshot from wireshark as it looks.
https://drive.google.com/open?id=0B6fxdAbp613KeTV2Z05rU2xNSUZoOEF2MF9xTWMxdHVJZUE4



--
regards
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

wilkxt
Did anyone have a problem or could check how the https(mbedtls) server
works when receiving data volumes larger than TCP_WND?

>I noticed that this is not a POST MANUAL WND problem but a general
>problem with receiving more data (both GET and POST).
>As I increased TCP WND from
>#define TCP_WND (2 * TCP_MSS)
>to
>#define TCP_WND (8 * TCP_MSS)
>I can receive more data before the problem occurs. But the problem
>still occurs when I want to send a larger file, it looks like the
>automatic TCP_WND control does not work for https. I attach

> I noticed that this is not a POST MANUAL WND problem but a general
> problem with receiving more data (both GET and POST).
> As I increased TCP WND from
> #define TCP_WND (2 * TCP_MSS)
> to
> #define TCP_WND (8 * TCP_MSS)
> I can receive more data before the problem occurs. But the problem
> still occurs when I want to send a larger file, it looks like the
> automatic TCP_WND control does not work for https. I attach the
> screenshot from wireshark as it looks.
> https://drive.google.com/open?id=0B6fxdAbp613KeTV2Z05rU2xNSUZoOEF2MF9xTWMxdHVJZUE4



--
regards
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

Mario Luzeiro
I'm running a https server via altcp_tls_mbedtls
I'm new to this too so not sure how can I debug it for you...
but.. I guess it is working for me, also,
I found on alttcp_tls_mbedtls.c function altcp_tls_create_config

if (TCP_WND < MBEDTLS_SSL_MAX_CONTENT_LEN) {
    LWIP_DEBUGF(ALTCP_MBEDTLS_DEBUG|LWIP_DBG_LEVEL_SERIOUS,
      ("altcp_tls: TCP_WND is smaller than the RX decrypion buffer, connection RX might stall!\n"));
  }

so I made the TCP_WND greater than the max content len of TLS.
I guess in that case it sure is receiving data volumes that are larger than TCP_WND.


@Simon: would be possible to turn that run time if in to a pre-compiler check?

Mario Luzeiro

________________________________________
From: lwip-users <lwip-users-bounces+mrluzeiro=[hidden email]> on behalf of tomek wilkxt <[hidden email]>
Sent: 25 October 2019 07:22
To: Mailing list for lwIP users
Subject: Re: [lwip-users] https post_auto_wnd not work

Did anyone have a problem or could check how the https(mbedtls) server
works when receiving data volumes larger than TCP_WND?

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

wilkxt
> I'm running a https server via altcp_tls_mbedtls
> I'm new to this too so not sure how can I debug it for you...

Send GET or POST from for example; curl -q -X POST  --data-binary
"@test.txt"  -k https://192.168.1.100

when test.txt file has more data than your TCP_WND

> but.. I guess it is working for me, also,
> I found on alttcp_tls_mbedtls.c function altcp_tls_create_config
>
> if (TCP_WND < MBEDTLS_SSL_MAX_CONTENT_LEN) {
>     LWIP_DEBUGF(ALTCP_MBEDTLS_DEBUG|LWIP_DBG_LEVEL_SERIOUS,
>       ("altcp_tls: TCP_WND is smaller than the RX decrypion buffer, connection RX might stall!\n"));
>   }
>
> so I made the TCP_WND greater than the max content len of TLS.

how are you set to TCP_WND and MBEDTLS_SSL_MAX_CONTENT_LEN ?



--
pozdrawiam
tomek

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: https post_auto_wnd not work

Mario Luzeiro
> how are you set to TCP_WND and MBEDTLS_SSL_MAX_CONTENT_LEN ?

Hi Tomek,

here are my values:
#define MBEDTLS_SSL_MAX_CONTENT_LEN             2048
#define TCP_MSS                         800
#define TCP_WND                         (2048 + 2048 / 4) // not sure how much "headroom" should I give here.. but TCP_WND must be > 2*TCP_MSS

I will try latter your test suggestion...

Mario Luzeiro
_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users