EmbeddedRelated.com
Forums

TNKernel

Started by Nils Springob June 1, 2012
Hi,

Does anybody use TNKernel (http://www.tnkernel.com/) in combination with the TCP/IP stack?
It is working on my LPC2378, but I have some questions regarding the datails....

Nils

An Engineer's Guide to the LPC2100 Series

> Does anybody use TNKernel (http://www.tnkernel.com/) in combination with
the TCP/IP stack?
> It is working on my LPC2378, but I have some questions regarding the
datails....

I may have tried it on a previous LPC2468 project, I tested many TCP stacks.
But I ended up using LWIP. Very small code that runs very fast.

All TCP stacks can be a pain to setup and tune. You have to get to know
them well, no free lunch here.
LWIP is very well supported and heavily used.

Chris.

Easier to use

http://www.saelig.com/MFR00088/BRD032.htm

all the protocols are off-loaded, including ARP, IP, TCP, ... and buffers for 8 sockets. SPI interface.
--- In l..., "Chris" wrote:
>
> > Does anybody use TNKernel (http://www.tnkernel.com/) in combination with
> the TCP/IP stack?
> > It is working on my LPC2378, but I have some questions regarding the
> datails....
>
> I may have tried it on a previous LPC2468 project, I tested many TCP stacks.
> But I ended up using LWIP. Very small code that runs very fast.
>
> All TCP stacks can be a pain to setup and tune. You have to get to know
> them well, no free lunch here.
> LWIP is very well supported and heavily used.
>
> Chris.
>

--- In l..., "stevec" wrote:
> Easier to use
>
> http://www.saelig.com/MFR00088/BRD032.htm
>
> all the protocols are off-loaded, including ARP, IP, TCP, ... and buffers for 8 sockets. SPI interface.

Kind of misses the point of having a MAC on-board, don't it !!

If your doing a one-off project, OK I'll agree.

But, a 1K unit product, why is spending $20K better ??

yes... external NIC makes sense for low volume. Look at mbed on the 1768.. after, what, 2 years, they still don't have a stable API to LWIP, nor a better alternative.
--- In l..., "Donald H" wrote:
>
> --- In l..., "stevec" wrote:
> >
> >
> > Easier to use
> >
> > http://www.saelig.com/MFR00088/BRD032.htm
> >
> > all the protocols are off-loaded, including ARP, IP, TCP, ... and buffers for 8 sockets. SPI interface.
>
> Kind of misses the point of having a MAC on-board, don't it !!
>
> If your doing a one-off project, OK I'll agree.
>
> But, a 1K unit product, why is spending $20K better ??
>

Hi Chris,

thanks for the answer! The LWIP looks very interesting and seems to be high quality....
The most interesting facts about the LWIP stack is the zero-copy approach and
the three layer api design!
But the TNKernel stack is not bad and is already running successfully on my hardware, I
am interested in tuning details ;-)

Nils.
Am 01.06.2012 23:56, schrieb Chris:
>> Does anybody use TNKernel (http://www.tnkernel.com/) in combination with
> the TCP/IP stack?
>> It is working on my LPC2378, but I have some questions regarding the
> datails....
>
> I may have tried it on a previous LPC2468 project, I tested many TCP stacks.
> But I ended up using LWIP. Very small code that runs very fast.
>
> All TCP stacks can be a pain to setup and tune. You have to get to know
> them well, no free lunch here.
> LWIP is very well supported and heavily used.
>
> Chris.
>
>
> thanks for the answer! The LWIP looks very interesting and seems to be
high quality....
> The most interesting facts about the LWIP stack is the zero-copy approach
and
> the three layer api design!
> But the TNKernel stack is not bad and is already running successfully on
my hardware, I
> am interested in tuning details ;-)

All TCP stacks are not created equal. It depends on what kind of
performance you need and resources.
You can make a crude TCP stack that runs on an 8b PIC MCU, but it may only
do 5KB/sec transfer rates.
If you need very high performance, MB/sec, then that is a much more
sophisticated complex stack and resources.

I tested many different TCP stacks several that were commercial high priced
code that costs $$$$.
Even some of those had problems, lower performance, or required so much RAM
I could hardly run them on LPC2468.

Eventually I went back to LWIP because it requires very little RAM/ROM, and
runs extremely fast and clean.
I could easily get 2.5MB/sec TCP transfer rates on E100 network. That's
very fast data throughput.
I use it with FreeRTOS and the stack uses about 70% of MCU time pumping data
through at that rate.

The truth is all TCP stacks require a lot of optimization time if you want
maximum performance.
There is no free lunch here, it is not the kind of code you can just plug in
and you're done.
This stuff takes a lot of tuning and optimization and you end up having to
learn far more about
IP and TCP packets than you ever wanted to know. You will spend a lot of
time with WireShark.

In my case I needed quite a few other features such as CGI and SSL support
etc. I built all that into LWIP.
Ethernet and IP is a very large spectrum of different applications and
protocols. It's very complex stuff.

Chris.

Hi Chris

> All TCP stacks are not created equal. It depends on what kind of
> performance you need and resources.

Well spoken, I'd like to forward this to some of our customers, who think,
an embedded TCP/IP stack works just like they are used to on a PC (and
ignore totally the differences in RAM/MHz).

--
42Bastian
+
| http://www.sciopta.com
| Fastest direct message passing kernel.
| IEC61508 certified.
+
> an embedded TCP/IP stack works just like they are used to on a PC (and
> ignore totally the differences in RAM/MHz).

Yes doing high performance TCP in an relatively small MCU is not trivial.
Some of the stacks I tested needed nearly 100K of RAM just to startup.
Try using those on an MCU with 64K RAM. Not going to happen.
They were designed for much bigger MCUs like ARM9 or external RAM.

I tested other stacks that used little RAM, but also had low performance.
Getting robust high performance in small RAM is very tricky.
This is where LWIP excels, especially using the Raw/Native interface.

Then you get into testing on a real LAN with traffic, going through multiple
routers, hops,
collisions, multicast, random delays, etc. and then things get really
interesting.
A 1MB file gets chopped into a zillion packets and those packets
do not necessarily come back in by the correct linear sequence.
The Stack has to put all those random packets back together again in the
right order.
Doing that in small RAM requires a lot of tricks.

You find out real quick whether all those other features your stack is
suppose to have
actually work, have bugs, or even exist at all.

I spent over 6 months on my Enet/Stack code
until I got everything working the way I wanted. It's very hard stuff to
debug too
because there are so many layers of protocols on top of each other,
and the MCU hardware is so heavily involved with the packet processing.
Performance tests under so many different conditions
and scenarios requires a lot of testing and tuning time as well.
It is a big learning curve.

Chris.

--- In l..., Nils Springob wrote:
>
> Hi,
>
> Does anybody use TNKernel (http://www.tnkernel.com/) in combination with the TCP/IP stack?
> It is working on my LPC2378, but I have some questions regarding the datails....
>
> Nils
>
Hi Nils,
I use TNKernel + TCP / IP stack are already a couple years. LPC2378 and LPC1769 now on first. Have not had any problems working very well. Consumes 16KB SRAM AHB + approx 4KB on-chip SRAM.

Johann