public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Jürgen Lambrecht" <J.Lambrecht@televic.com>
To: "lawshere@gmail.com" <lawshere@gmail.com>,
	"osdeve.mirror.rtos.ecos-discuss"
	<osdeve_mirror_rtos_ecos-discuss@googlegroups.com>
Cc: "ecos-discuss@ecos.sourceware.org" <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] max IP packet size = 9216 B. Why?
Date: Fri, 23 Jun 2017 10:32:00 -0000	[thread overview]
Message-ID: <5c8ce1a2-1e15-3408-6929-4fd882226de2@televic.com> (raw)
In-Reply-To: <8a8cdaa7-7907-f1a1-b8c1-e1ae798377db@televic.com>

On 06/20/2017 12:29 PM, Jürgen Lambrecht wrote:
> Hi,
>
> It is a implicit limitation of eCos: to limit the amount of RAM 
> needed, the maximum IP packet size is 9kB.
> This is hardcoded in the eCos code, so I changed it there.
> I don't remember where, but when I find it, I will mail you again.
I found it back, and it is not hard-coded.
There is a default set in 
ecos/packages/net/bsd_tcpip/current/src/sys/netinet/udp_usrreq.c.

But you can overwrite it on the socket:

   udpEchoSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
   sendBuf = 65507; //The maximum IP packet has 64KB or 65535 B. The 
maximum UDP
                    //payload is (- 20B IP  header and 8B UDP header) 65507.
   if (setsockopt(udpEchoSocket, SOL_SOCKET, SO_SNDBUF, &sendBuf, 
sizeof(sendBuf))) {
     debug_printf("<ERR> setsockopt SO_SNDBUF\n");
   }
   sendBuf = 65539; //The maximum IP packet has 64KB or 65535 B. The 
maximum UDP
   if (setsockopt(udpEchoSocket, SOL_SOCKET, SO_RCVBUF, &sendBuf, 
sizeof(sendBuf))) {
     debug_printf("<ERR> setsockopt SO_RCVBUF\n");
   }


I tried both ways (first change eCos sources, then use the ioctl calls), 
and both worked for me: I could send/receive up to 64kB IP (UDP and TCP) 
packets.

Kind regards,
Jürgen
>
> Kind regards,
> Jürgen
>
> On 05/04/2017 02:55 AM, lawshere@gmail.com wrote:
>> is there any patch for it,
>> no matter how i set SNDBUF, the problem is still,
>> it seems the maximum accessable size for one udp packet is the same 
>> as MTU.
>>
>> 在 2007年6月12日星期二 UTC+8下午11:49:30,Jürgen Lambrecht写道:
>>
>>     Hello,
>>
>>     I found out that the maximum IP packet size = 9216 B (0x2400).
>>     I implemented an echo program, both udp and tcp.
>>     My ecos applic can receive more that 9216B, but not send back more
>>     than
>>     that.
>>
>>     Has anybody a clue how to solve this?
>>     I need to support the maximum IP packet size of 65535 B
>>     (IP_MAXPACKET).
>>     I don't know if this is a bug in ecos, or a (hidden?) limitation
>>     of an
>>     embedded OS.
>>
>>     Thanks,
>>     Juergen Lambrecht
>>
>>     P.S.:
>>     I'm busy tracing this back in the source
>>     This comes from the socket that is allocated statically in
>>     /io/fileio/.../fd.cxx and socket is part of a cyg_file (cyg_file is
>>     defined by file in file.h). In cyg_file there is a member f_data,
>>     which
>>     is the socket.
>>     I'm continuing my search in the code at this point....
>>
>>     --     Jürgen Lambrecht
>>     R&D Engineer
>>     Televic Transport Systems
>> http://www.televic.com
>>     Televic NV / SA (main office)
>>     Leo Bekaertlaan 1
>>     B-8870 Izegem
>>     Tel: +32 (0)51 303045
>>     Fax: +32 (0)51 310670
>>
>>
>>     --     Before posting, please read the FAQ:
>> http://ecos.sourceware.org/fom/ecos
>> <http://ecos.sourceware.org/fom/ecos>
>>     and search the list archive:
>> http://ecos.sourceware.org/ml/ecos-discuss
>> <http://ecos.sourceware.org/ml/ecos-discuss>
>>
>
>


-- 
Jürgen Lambrecht
R&D Associate
Mobile: +32 499 644 531
Twitter: JGRLambrecht
Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
http://www.televic-rail.com
https://www.facebook.com/TelevicRail
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk

This electronic transmission is intended exclusively for the person or entity
to whom it is addressed and may contain confidential and/or privileged
material. Any disclosure, copying, distribution or other action based upon the
information by persons or entities other than the intended recipient is
prohibited. All e-mail correspondence from Televic Rail NV is only intended for
information purposes and can not result in contractual obligations. Commitments
under Televic Rail NV can only occur through regular exchange of letters,
signed by authorized persons in accordance with publication in the Belgian
Official Gazette.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

      reply	other threads:[~2017-06-23 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12 21:58 Jürgen Lambrecht
2007-06-12 22:12 ` Andrew Lunn
2007-06-12 22:46   ` Jürgen Lambrecht
2007-06-12 23:03     ` Andrew Lunn
2007-06-13 14:24       ` Jürgen Lambrecht
2007-06-13 15:44         ` Andrew Lunn
     [not found] ` <058cebc1-1c19-438d-b5de-2c8015835c36@googlegroups.com>
2017-06-20 10:29   ` Jürgen Lambrecht
2017-06-23 10:32     ` Jürgen Lambrecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c8ce1a2-1e15-3408-6929-4fd882226de2@televic.com \
    --to=j.lambrecht@televic.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=lawshere@gmail.com \
    --cc=osdeve_mirror_rtos_ecos-discuss@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).