lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] netconn_write throughput stuck at 1024 bytes


From: DownyTif
Subject: Re: [lwip-users] netconn_write throughput stuck at 1024 bytes
Date: Wed, 21 Jan 2009 07:18:27 -0800 (PST)

>DownyTif wrote:
>> 
>> first, I want to say that I'm new to this lwip world. I'm trying to make
>> a
>> Ethernet speed test using the EVK1100 board from ATMEL (AVR32). The
>> communication will be between the board and a PC using 2 ports, one
>> dedicated to bidir requests/responses between the board and the host, the
>> other dedicated to maximum speed data sending from the board to the host.
>> I
>> would like to be able to send packets of 32768 bytes.

>Do you really mean "packets" there? Is this ethernet? Ethernet's normal 
>MTU is around 1500 bytes, unless you're going to be using jumbo frames. 
>You can send larger IP packets, but they get fragmented down to the MTU 
>size, which is inefficient.

Yeah, I meant Ethernet frames. I didn't know about that MTU... So what would
help me achieve the maximum throughput? On another system using the same
host but a different board, I was able to get about 65Mbps of throughput
sending Ethernet frames of ~450kb each (lot of data). Ok, that other board
is using a in-house IP stack (I don't have the code) and a dedicated
Ethernet MCU, so I don't expect to get those results with my AVR32 board.
But still, I'm looking for the fastest transfers. If I understand correctly,
when I "netconn_write()" a frame of let's say 4096 bytes and my configured
MSS is 1460, the lwip will divide my frame into 3 segments (1460, 1460 and
284) and send to the host those 3 frames in one send right? Or will the lwip
send 3 frames in 3 send actions resulting in many ACK hand-shaking? In other
words, is there a difference in this:

netconn_write(..., 4096, ...);

or

netconn_write(..., 1460, ...);
netconn_write(..., 1460, ...);
netconn_write(..., 284, ...);

?

>> Presently, for some reason, I can't send packets bigger than 1024 bytes.

>Do you mean the data doesn't get sent at all, or it gets sent, but not all 
>2048 bytes in one packet on the wire?

Ok, that part was a bug in my host application, sorry. I can receive the
2048 bytes now, but I haven't checked with a sniffer, so according to your
comment on the MTU, I presume I'm getting 2 frames to fill the 2048 bytes
and not only one (in the same send)? (well... related to the question above
:))

>> Even if I write this:
>> writeRet = netconn_write(pNewConnection, g_pSDRAM, 2048, NETCONN_COPY);
>> 
>> what I get on the PC is 1024-byte packets. Tracing in the code, I found
>> that
>> my connection is correctly configured ("pcb->mss" is 2048) but for some
>> reason, "pcb->mss" becomes 1460 somewhere (found by tracing in
>> tcp_out.c). 

>pcb->mss is set according to the MSS provided by the remote host when 
>establishing the TCP connection. The remote host is probably setting its 
>MSS option to 1460. Use a packet sniffer on the PC to see what's going on 
>(tcpdump, ethereal, wireshark, etc.). You would need to configure your 
>remote host's TCP stack to indicate a larger MSS.

I traced the code and you are right. I found that until I accept the
connection, my mss is 2048, but the incoming connection puts it to 1460.
Unfortunatly, I don't think I can change that on the host, because it's a
Windows PC and I'm not sure I want to mess with those settings on the
client's computers.

>Jifl

-- 
View this message in context: 
http://www.nabble.com/netconn_write-throughput-stuck-at-1024-bytes-tp21571019p21585222.html
Sent from the lwip-users mailing list archive at Nabble.com.





reply via email to

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