lwip-users
[Top][All Lists]
Advanced

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

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


From: Mason
Subject: [lwip-users] Getting the server to use an MSS larger than 536
Date: Wed, 21 Mar 2012 16:26:09 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2

Hello,

Consider the attached Wireshark trace of a simple HTTP request:

  GET / HTTP/1.1
  Host: www.google.fr
  Accept: */*

223.200.200.68  = set-top box using lwip+libcurl
223.200.200.254 = LAN gateway
223.200.200.204 = LAN DNS server
173.194.78.94   = google.fr (apparently)

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 */

(TCP_CALCULATE_EFF_SEND_MSS is 1 by default)
/**
 * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really
 * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which
 * reflects the available reassembly buffer size at the remote host) and the
 * largest size permitted by the IP layer" (RFC 1122)
 * Setting this to 1 enables code that checks TCP_MSS against the MTU of the
 * netif used for a connection and limits the MSS if it would be too big 
otherwise.
 */

(My MTU is 1500, I'm using Ethernet.)

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?

How can I make Google send larger datagrams?

Is this a Path MTU Discovery issue?

-- 
Regards.

Attachment: curl_google_from_STB.pcap
Description: Binary data


reply via email to

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