Greg,

My question about MSS wasn't clear– what I mean is, to an application (like
tcpecho or tcpblaster), the size of MSS shouldn't matter. Shouldn't the
application be able to send as many bytes as it wants? The TCP stack
divides the stream up into chunks (of MSS length) and transmits them...
sending more than MSS bytes should not hang the application...?

That's not what I"m seeing with the NuttX that I'm using (SAMA5D36-Xplained
using the gigabit ethernet port, built from the latest master).

cheers
adam

-adam

On Sat, Feb 8, 2020 at 4:22 PM Adam Feuer <a...@starcat.io> wrote:

> Hey Greg,
>
> Thanks for the help. Yeah I forgot the ethernet frame size.
>
> But– shouldn't I be able to send TCP data regardless of MSS? Why should
> the MSS matter at the TCP network layer?
>
> I was using the nuttx master branch from several weeks ago. Just updated
> to the latest master, and things are much worse now. I can't do more than 3
> TCP sends of any size now with tcpecho. After thee sends it just freezes.
> :(
>
> Re: Giant Board, haven't got it yet, but CrowdSupply said they will ship
> next week. Will let you know how it goes. I'm going to try the
> SAMA5D27-XULT first, but haven't got to it yet... I want to resolve the
> networking issues on the D36 that I can debug easily first.
>
> I'll check out the net/KConfig file.
>
> -adam
>
> On Sat, Feb 8, 2020 at 3:45 PM Gregory Nutt <spudan...@gmail.com> wrote:
>
>>
>> > I'm still having problems with TCP sending and receiving on the
>> SAMA5D36. I
>> > switched from tcpblaster to tcpecho. That works as long as whatever
>> send I
>> > do from the host linux computer is shorter than the MTU or ETH_PKTSIZE
>> > (right now, configured to be 1500 bytes). I'm using the SAMA5D36 GMAC
>> > (gigabit ethernet port) which has a max packet size of 1536 bytes.
>> >
>> > So I can do any amount of discrete sends, each of less than 1448 bytes.
>> > This seems to be because the IP header size is 30 bytes and the TCP
>> header
>> > size is 20 bytes, 1448 + 32 + 20 = 1500 bytes.
>> >
>> > But when I try to do a send of 1448 bytes or more, the tcpecho server
>> > hangs. It seems like it can't handle TCP sends that have more than one
>> IP
>> > packet.
>> >
>> > What could cause that? Could it be a bug in the NuttX TCP code? Or is it
>> > some kind of misconfiguration on my part?
>>
>> The packet size is not the same as the MTU.  The MTU excludes Ethernet
>> header.  The packet size includes the size of Ethernet header (plus some
>> guard size).
>>
>> The Ethernet header size if 14 bytes.  So the max packet size of 1536
>> corresponds to an MTU of 1522.  The IP and TCP header lengths are
>> variable in size, depending upon the number of options in the header.
>> With no options, the IPv4 header length is 20 bytes; the IPv6 header
>> length is 40 bytes.  With no options, the TCP header length is, indeed,
>> 20 bytes.
>>
>> Assuming a packet size of 1536 bytes and IPv6, the maximum payload (MSS)
>> would be 1536 - 14 - 40 - 20 = 1452.  This about what you are seeing.
>> If you are using IPv4, you should be able to get an MSS that is 20 bytes
>> larger.
>>
>> This is all discussed in detail in, as I recall, the net/Kconfig file.
>>
>> Greg
>>
>> PS:  Did you get your Giant board?  How did the bring-up go?
>>
>>
>>
>
> --
> Adam Feuer <a...@starcat.io>
>


-- 
Adam Feuer <a...@starcat.io>

Reply via email to