Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #28856

Re: High packet rate ethernet with LwIP

From upsidedown@downunder.com
Newsgroups comp.arch.embedded
Subject Re: High packet rate ethernet with LwIP
Message-ID <a55ioedac35imcob1lv1962hu7o4hhmnh1@4ax.com> (permalink)
References <nnd$46f32a8f$5fab99bf@bacadb246ebd9154> <f75aoe97bvj84fdfhp80376p9k1o1vm55v@4ax.com> <nnd$385a4f2f$5a6cc64f@f248034e4c3a4bf9>
Date 2019-09-23 22:26 +0300
Organization Elisa Customer

Show all headers | View raw


On Mon, 23 Sep 2019 10:37:17 +0200, Stef
<stef33d@yahooI-N-V-A-L-I-D.com.invalid> wrote:

>On 2019-09-20 upsidedown@downunder.com wrote in comp.arch.embedded:
>> On Fri, 20 Sep 2019 18:27:52 +0200, Stef
>><stef33d@yahooI-N-V-A-L-I-D.com.invalid> wrote:
>>
>>>For transportation of several high speed serial ports, we want to use a
>>>serial over ethernet approach. At a minimum I need to transfer four ports
>>>with 512 byte packets that come in every 40 ms at 2 Mbps.
>>>
>>>Search for a ready to use (for test at least) device has turned up nothing.
>>>Standard devices usually go up to 230 kbps, some to 1 Mbps. Most faster
>>>ones are single port only. And it should be a small device, embeddable,
>>>logic level is all that is needed. If anyone knows of a usable device...
>>>
>>>Since the board that this is on incorparates an ethernet capable controller
>>>(LPC4088) that has not that much work to do richt now, I thought it should
>>>be possible to add ethernet to it.
>>>
>>>For testing I got an LPC4088 demo board with ethernet interface and got
>>>LwIP running on it (stand alone, no OS).
>>>
>>>Got it working OK to simulate 4 ports sending slow data to 4 TCP ports
>>>that can be opened with a PC terminal program.
>>>
>>>But when I turn up the data volume and packet rate, it stops working.
>>>In some cases stuck in the hard fault handler, in other cases in a
>>>timed waiting loop in the LwIP stack.
>>>
>>>At this moment it is running fine with 2 ports open and a 512 byte packet
>>>every 100 ms on each. When I increase the speed to 50 ms, it stops after
>>>a while.
>>>
>>>I have no previous experience with LwIP so where to start looking?
>>>- First of all does it sound feasable over a 100 Mbit ethernet
>>>  connection using TCP?
>>>- What can be tuned in LwIP to improve this?
>>>  I have already increased PBUF_POOL_SIZE from default 7 to 64 and
>>>  MEM_SIZE from 12k to 32k
>>
>> Have you looked at the Ethernet traffic with e.g. Wireshark ? Look for
>> TCP retransmissions. If each serial line pumps data at 2 Mbit/s
>> without any flow control, a TCP retransmission will upset the Ethernet
>> traffic for a while, possibly overflowing buffers. Anyway, if retrials
>> are expected, the gross (ethernet) speed must be several times larger
>> than the net data rate.
>
>No, not done that yet, but indeed something I need to do.

Looking more closely on your original question, the actual duty cycle
is less than 10 %, so you could do the same thing with four 230 kbit/s
streams, thus the speed requirement is no big deal. There are lots of
eth/serial converters supporting 4-8 serial lines at 230 kbit/s.


>> Is it possible to use UDP and accept that some packets may be lost ?
>> Include a serial number in each frame and the receiver can detect
>> missing packets (that have failed CRC test) and mark the missing data
>> accordingly. This way the net speed can be much closer to the raw data
>> rate.
>
>That is something that came to my mind just after posting the question.
>Would UDP be a better match for this application? 

Using MAC or UDP framing is just using Ethernet as some very high
speed serial connections. The advantage of UDP compared to MAC
addressing is that ARP and more user friendly IP addressed compared to
Ethernet MAC addresses can be used. In addition, there is a better UDP
support in Windows, compared to raw Ethernet MAC framing.


>The whole TCP
>retransmission and timers may be the mechanisms causing the problem.
>I think the standard TCP timeouts ar far too slow for this kind of
>thing? Think I saw a 250 ms timer tick in the LwIP docs?

You really have to do the transmission and possible retransmission in
your 40 ms time window.

>Missing packets may not be a problem. It is measurement data and if
>any re-transmit takes over 40 ms there is no point anyway, there is
>already new data. 

Just make sure you know if some frames are missing (e.g. serial
numbering).

>On a much slower rate, some control connection does
>have to be reliable. So that could use TCP (if is does not disturb
>the parallel UDP flow in LwIP) or use UDP as well and implement the
>retries in the application.

Why not, you can use both TCP and UDP as two separate links, even with
the same IP-address and port number.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-20 18:27 +0200
  Re: High packet rate ethernet with LwIP upsidedown@downunder.com - 2019-09-20 21:20 +0300
    Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-23 10:37 +0200
      Re: High packet rate ethernet with LwIP Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2019-09-23 14:08 +0300
      Re: High packet rate ethernet with LwIP Richard Damon <Richard@Damon-Family.org> - 2019-09-23 07:13 -0400
        Re: High packet rate ethernet with LwIP Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2019-09-23 18:55 +0300
      Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-23 14:04 +0200
        Re: High packet rate ethernet with LwIP Dimiter_Popoff <dp@tgi-sci.com> - 2019-09-23 17:03 +0300
          Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-23 18:37 +0200
            Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-24 14:22 +0200
              Re: High packet rate ethernet with LwIP upsidedown@downunder.com - 2019-09-25 07:55 +0300
                Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-25 09:51 +0200
                Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-25 16:03 +0200
                Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-25 11:59 +0200
                Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-25 13:16 +0200
              Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-25 09:42 +0200
                Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-25 13:41 +0200
                Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-25 14:10 +0200
                Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-25 15:22 +0200
      Re: High packet rate ethernet with LwIP upsidedown@downunder.com - 2019-09-23 22:26 +0300
        Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-23 22:16 +0200
          Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-23 23:08 +0200
  Re: High packet rate ethernet with LwIP Joe Chisolm <jchisolm6@earthlink.net> - 2019-09-20 13:44 -0500
    Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-23 10:46 +0200
  Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-21 19:00 +0200
    Re: High packet rate ethernet with LwIP upsidedown@downunder.com - 2019-09-22 00:01 +0300
      Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-22 09:06 +0200
        Re: High packet rate ethernet with LwIP upsidedown@downunder.com - 2019-09-22 11:29 +0300
          Re: High packet rate ethernet with LwIP David Brown <david.brown@hesbynett.no> - 2019-09-22 23:24 +0200
        Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-23 11:10 +0200
    Re: High packet rate ethernet with LwIP Stef <stef33d@yahooI-N-V-A-L-I-D.com.invalid> - 2019-09-23 11:03 +0200

csiph-web