[Top][All Lists]

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

[lwip-users] TCP bandwidth limited by rate of ACKs

From: Mason
Subject: [lwip-users] TCP bandwidth limited by rate of ACKs
Date: Mon, 10 Oct 2011 16:03:15 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110928 Firefox/7.0.1 SeaMonkey/2.4.1


I've ported lwip 1.4.0 to an ST7105 dev set-top box
(450 MHz SH-4 core, Fast Ethernet port).


The STB is connected directly to my PC (no switch or router).

I've written code on the STB to receive a TCP stream on port 44044,
and code on the PC to send a TCP stream to that port.

I send 58,400,000 bytes from the PC to the STB.
This takes 14.25 seconds, i.e. an average of 33 Mbit/s

I was expecting to reach 80+ Mbit/s, so I captured the conversation
with Wireshark, and I noticed that the sender is being throttled
because the receiver (the STB running lwip) is not sending ACKs
fast enough.

cf. STB_TCP_RX_2.pcap (6 MB -- I truncated payloads to 100 bytes)

(I've also attached a copy of my current lwipopts.h)

Can someone nudge me in the right direction to optimize my
build of lwip?

Here's the code I run on the STB (it runs in a dedicated thread
with priority MIN_PRIO+4, same as tcpip_thread)

  int sock = socket(PF_INET, SOCK_STREAM, 0);
  if (sock < 0) { perror("socket"); return -1; }

  struct sockaddr_in addr = { 0, AF_INET, htons(44044), };
  err = bind(sock, (struct sockaddr *)&addr, sizeof addr);
  if (err) { perror("bind"); return -2; }

  err = listen(sock, 10);
  if (err) { perror("listen"); return -3; }

  struct sockaddr_in from = { 0 };
  socklen_t len = sizeof from;
  int sock2 = accept(sock, (struct sockaddr *)&from, &len);
  if (sock2 < 0) { perror("accept"); return -4; }

#define BUF_LEN (4*1460)
  u8_t *buf = malloc(BUF_LEN);
  while ( 1 )
    int res = read(sock2, buf, BUF_LEN);
    if (res <= 0) break;


Attachment: lwipopts.h
Description: Text document

reply via email to

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