LwIP – Lightweight IP Stack
nongnu.org
nongnu.org
It is more like the busybox of embedded networking, but with a much more convenient license.
The project involved multiple microcontrollers communicating over an internal LAN. They used a small embedded kernel named MicroCOS, with LwIP as the IP stack.
We had cross-platform build tools set up, so we could build our stand-alone microprocessor applications either for native execution or with gcc, compiling to x64 code and executable on developer boxes. In the latter case, we implemented the lowest level link-layer part of LwIP using a mock, that used standard TCP/IP! We wrote a small TCP server and would spool up the micro-controller applications, which would then talk to each other on the developer machines as though they were running inside the actual system.
This setup worked really well, and we used it for years during the development effort for the project.
It has been one of the top commercial RTOS network stacks for, I think, 20 years. It moved hands a couple of times and now is supported by the Eclipse Foundation and is MIT-licensed. I'd use it over LwIP.
I remember running into some obscure bugs with the NetX BSD socket layer that we ended up fixing in-house. It’s been way too long to dig up the specifics, but it’s great that fixes can now be upstreamed more easily.
Unfortunately, it doesn't seem they have a process for that yet. But I'm sure that will improve. Or the community could take over. It would be nice to get a silicon vendor to pick this up to build a larger community around it.
> I remember running into some obscure bugs with the NetX BSD socket layer that we ended up fixing in-house. It’s been way too long to dig up the specifics, but it’s great that fixes can now be upstreamed more easily.
Yeah, I always had the impression their translation layers were afterthoughts. Never used the BSD one though.
EDIT: I found an answer[0].
StevePerkins on May 22, 2016 | unvote | next [–]
http://savannah.gnu.org is a hosting site for "official" GNU software (i.e. sponsored by the Free Software Foundation).
http://savannah.nongnu.org is a hosting site for "community" projects that are not sponsored by the FSF.
[0] https://news.ycombinator.com/item?id=11747093- NetXDuo from ThreadX. It's Opensource for a while now.
- Zephyr also brings its own stack
NetX, Zephyr, LwIP, and SmolTCP all sort of fit in this realm these days it seems like. Probably others too... but yeah hard to discern the differences at a high level without digging in.
If you look at ST and their STM32 the lwip integration is extremely bug ridden. Just read all the articles in their forum from "Piranha". I also struggled with extremely hard to debug bugs coming from their adaption layers.
Lwip itself has a solid quality.
"This making lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM."
6 months later and they still haven't got a working implementation.
I've seen their implementation. It was horrible. We eventually took the project away from them and had the local team work on it.
Also a fun story: they didn't use version control at all. When we eventually forced them to use git, they put the whole codebase in a .zip file and committed that.
At least it it a clear mischaracterisation of waterfall:
* https://changelog.com/posts/waterfall-doesnt-mean-what-you-t...
* HN discussion: https://news.ycombinator.com/item?id=37405049
* http://bawiki.com/wiki/Waterfall.html
* HN discussion: https://news.ycombinator.com/item?id=26760606
Daily what?
Luckily going to another employer soon, this place is a mess.
I did the latter a decade ago for a home-grown SoC and it is non-trivial. And then testing it with conformance/performance in mind takes more time.
At that time there was a reference port for the Hercules development board available on-line. It was mostly working straight out of the box. I just had to fix a few issues with the Halcogen generated files (since then, TI has fixed the bugs), configure the lwIP options (to have DHCP and only use UDP). Since then (7 years ago), I have not touched the code once.
Feed received frames from your MAC into the appropriate receive function in a netif, and link the output function pointer to something that sends frames to your MAC.
Examples for STM32 parts are so prevalent on the web that ChatGPT or Copilot can probably get you working source in 30 seconds.
I've been using it in a toy OS project and it works brilliantly.
I used to work with TinyTCP back when. What's interesting is if a search for tinytcp turns up a bunch of them. Awesome!
Apparently there's no tiny ipv6 stack?
Basically, it's an area for software that is aligned with the GNU philosophy, might one day become part of the GNU project, but isn't officially currently part of the GNU project.
It's allowed to repost "classic" stuff on HN as long as it isn't too frequent.
Plugging in a new TCP congestion control scheme was also straightforward.
the biggest problem with lwip is the documentation. you have doxygen API docs that tell you exactly what the interfaces are (and not much more than the reading the header filed does), you have a few pages of "how to ..." and higher level background. but often it's slightly bit rotted, subtly hasn't kept up with design changes. so it's difficult to learn - you effectively have to thoroughly read the code to get the big picture. and if you make a mistake in handling your application callbacks, you can easily leak buffers or create other problems. it's not "awful to use", it's actually very simple - once you understand it, which is seriously hampered by truly lacking documentation.
the second issue is that the SoC vendors inevitably pay some overseas contractor to do the port and MAC/PHY drivers and example code, just like another [1] comment describes. that's where a lot of the instability and bugs come in. it's not lwip, it's the port that sucks.