lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Getting the server to use an MSS larger than 536


From: Simon Goldschmidt
Subject: Re: [lwip-users] Getting the server to use an MSS larger than 536
Date: Wed, 21 Mar 2012 17:00:05 +0100

Mason <address@hidden> wrote:
> Note that Google sends only 590-byte frames. How do I get lwip
> to advertize larger MSS?
> 
> NB: I have the following TCP-related definitions in my lwipopts.h
> 
> #define TCP_MSS 1460
> #define TCP_WND (40*TCP_MSS)
> #define TCP_SND_BUF (8*TCP_MSS)
> #define TCP_SND_QUEUELEN 16
> 
> There's relevant code in src/core/tcp.c
> 
>   pcb->snd_wnd = TCP_WND;
>   /* As initial send MSS, we use TCP_MSS but limit it to 536.
>      The send MSS is updated when an MSS option is received. */
>   pcb->mss = (TCP_MSS > 536) ? 536 : TCP_MSS;
> #if TCP_CALCULATE_EFF_SEND_MSS
>   pcb->mss = tcp_eff_send_mss(pcb->mss, ipaddr);
> #endif /* TCP_CALCULATE_EFF_SEND_MSS */
> 
> [..]
> 
> (My MTU is 1500, I'm using Ethernet.)

In that case (if you have set netif->mtu to 1500), tcp_eff_send_mss() should 
return 1460 (1500 - IP_HLEN - TCP_HLEN). If it doesn't, possible problems could 
be that ip_route() doesn't return your netif or that netif->mtu isn't set to 
1500.

> When I receive Google's SYN+ACK packet with MSS=1430 in
> tcp_parseopt, the pcb mss is correctly set to 1430. Perhaps
> this is only the /write/ MSS?

Yes, this is lwIP's send MSS, while the initial pcb->mss is used to construct 
an MSS option in the initial SYN packet sent on connect.

> How can I make Google send larger datagrams?

You should check the MSS option in the SYN packet sent to the Google server.

> Is this a Path MTU Discovery issue?

No.


Simon
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]