All Projects โ†’ tass-belgium โ†’ Picotcp

tass-belgium / Picotcp

Licence: other
PicoTCP is a free TCP/IP stack implementation

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Picotcp

Modular
A modular front end development framework
Stars: โœญ 475 (-43.32%)
Mutual labels:  modular
Whs.js
๐Ÿš€ ๐ŸŒช Super-fast 3D framework for Web Applications ๐Ÿฅ‡ & Games ๐ŸŽฎ. Based on Three.js
Stars: โœญ 5,685 (+578.4%)
Mutual labels:  modular
Pragmatapro
PragmataPro font is designed to help pros to work better
Stars: โœญ 887 (+5.85%)
Mutual labels:  modular
Tabler
Tabler is free and open-source HTML Dashboard UI Kit built on Bootstrap
Stars: โœญ 24,611 (+2836.87%)
Mutual labels:  modular
Posts
A sample Android app using Kotlin, Dagger 2, RxJava, RxAndroid, Retrofit and Android Architecture Components with a modular setup & effective networking
Stars: โœญ 599 (-28.52%)
Mutual labels:  modular
Uppy
The next open source file uploader for web browsers ๐Ÿถ
Stars: โœญ 24,829 (+2862.89%)
Mutual labels:  modular
Mastering Modular Javascript
๐Ÿ“ฆ Module thinking, principles, design patterns and best practices.
Stars: โœญ 3,972 (+373.99%)
Mutual labels:  modular
Pytest Patterns
A couple of examples showing how pytest and its plugins can be combined to solve real-world needs.
Stars: โœญ 24 (-97.14%)
Mutual labels:  modular
Injectify
Perform advanced MiTM attacks on websites with ease ๐Ÿ’‰
Stars: โœญ 612 (-26.97%)
Mutual labels:  modular
Choo
๐Ÿš‚๐Ÿš‹ - sturdy 4kb frontend framework
Stars: โœญ 6,637 (+692%)
Mutual labels:  modular
Orchardcore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
Stars: โœญ 5,591 (+567.18%)
Mutual labels:  modular
Rasa
Extremely modular text editor built in Haskell
Stars: โœญ 597 (-28.76%)
Mutual labels:  modular
Casadi
CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.
Stars: โœญ 714 (-14.8%)
Mutual labels:  modular
Zikrouter
Interface-oriented router for discovering modules, and injecting dependencies with protocol in Objective-C and Swift.
Stars: โœญ 516 (-38.42%)
Mutual labels:  modular
Euircbot
A featureful nodejs irc bot
Stars: โœญ 16 (-98.09%)
Mutual labels:  modular
Beehive
๐Ÿ BeeHive is a solution for iOS Application module programs, it absorbed the Spring Framework API service concept to avoid coupling between modules.
Stars: โœญ 4,117 (+391.29%)
Mutual labels:  modular
Extcore
Free, open source and cross-platform framework for creating modular and extendable web applications based on ASP.NET Core
Stars: โœญ 666 (-20.53%)
Mutual labels:  modular
Cs.2click
๐Ÿ”Š A Better Audio Router for a Modular System.
Stars: โœญ 7 (-99.16%)
Mutual labels:  modular
Swizzin
A simple, modular seedbox solution
Stars: โœญ 888 (+5.97%)
Mutual labels:  modular
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: โœญ 763 (-8.95%)
Mutual labels:  modular

picoTCP


Welcome to the one and only picoTCP repository.

picoTCP is a small-footprint, modular TCP/IP stack designed for embedded systems and the Internet of Things. It's actively being developed by Altran Intelligent Systems.

This code is released under the terms of GNU GPL v2 and GNU GPL v3. Some rights reserved. Other licenses may apply at the sole discretion of the copyright holders.

Learn how to use picoTCP in your project by going through the Getting Started guide on our GitHub wiki.

For more information send us an email or contact us on Twitter, Facebook or Reddit.

Wondering about picoTCP's code quality? Check our TiCS score


Continuous integration

Functional tests: Jenkins autotest - Unit tests : Jenkins unit tests - RFC compliance : Jenkins RFC Compliance - TICS quality : Jenkins TICS Coverity Scan Build status: Coverity Scan Build Status


It runs on (pretty much) everything

By keeping interfaces simple, the porting effort to new platforms and OSses are very low. To give you an indication: porting to a new platform can be done in 3 days or less, a new OS in a single day and if you really go crazy, you can do an initial port in a single evening. Different platforms, mean different compilers, thatโ€™s why we continuously compile our stack with a bunch of them. The following list shows some of the currently supported platforms, device drivers and compilers.

PicoTCP has been used with

Platforms picoTCP runs on: ARM Cortex-M series (ST Micro STM, NXP LPC, TI Stellaris, Freescale K64F), ARM ARM9-series (ST Micro STR9), Texas Instruments (MSP430), Microchip (PIC24, PIC32), Atmel (AVR 8bit), Linux (User space (TUN/TAP), Kernel space), Windows (User space (TAP))

Network devices picoTCP has worked with: BCM43362 (IEEE 802.11), MRF24WG (IEEE 802.11), LPC Ethernet ENET/EMAC (IEEE 802.3), Stellaris Ethernet (IEEE 802.3), STM32 Ethernet (IEEE 802.3), Wiznet W5100 (IEEE 802.3), USB CDC-ECM (CDC1.2), PPP, Virtual drivers ( TUN/TAP, VDE, Libpcap)

(RT)OSes picoTCP has been integrated into: No OS / Bare metal, FreeRTOS, mbed-RTOS, Frosted, linux / POSIX, MS DOS, MS Windows

Libraries picoTCP has been integrated with: wolfSSL, mbedTLS, Mongoose RESTful library, MicroPython

Compilers picoTCP compiles under: GCC, Clang, TCC, ARM-RCVT, IAR, XC-16, XC-32, MSP-GCC, AVR-GCC

Unfortunately we can't release all the code, a.o. because some parts depend on code or binaries that aren't GPL compatible, some parts were developed under a commercial contract, and some consist of very rough proof-of-concept code. If you want to know more about the availability under the commercial license, or the possibility of using our expert services for porting or driver development, feel free to contact us at [email protected].

Your favorite not in the list? Check out the wiki for information and examples on how to port picoTCP to a new platform!


Highly configurable and modular design

Features are developed as modules in picoTCP, allowing you to pick the features you want in your application. This results in the smallest possible stack that remains compliant with the internet standards. The schematic below provides an overview of all implemented protocols.

modular


Simple example

Preparations

This example uses Ubuntu 14.04. It works on other linux distibutions as well, though you may need to change some package names. See setting up the environment for some more info.

sudo apt-get install git check vde2 libvdeplug2-dev libpcap0.8-dev openvpn wireshark
git clone https://github.com/tass-belgium/picotcp
cd picotcp
make TAP=1
cd ..

The code

Then make a new directory, e.g. example, and create a file with the following content : //: # (The code below is pulled through our CI - please leave the code extractor comments intact!) //: # (code extractor start)

#include <time.h>
#include <pico_stack.h>
#include <pico_ipv4.h>
#include <pico_icmp4.h>
#include <pico_dev_tap.h>

#define NUM_PING 10

static int finished = 0;

/* gets called when the ping receives a reply, or encounters a problem */
void cb_ping(struct pico_icmp4_stats *s)
{
    char host[30];
    pico_ipv4_to_string(host, s->dst.addr);
    if (s->err == 0) {
        /* if all is well, print some pretty info */
        printf("%lu bytes from %s: icmp_req=%lu ttl=%lu time=%lu ms\n", s->size,
                host, s->seq, s->ttl, (long unsigned int)s->time);
        if (s->seq >= NUM_PING)
            finished = 1;
    } else {
        /* if something went wrong, print it and signal we want to stop */
        printf("PING %lu to %s: Error %d\n", s->seq, host, s->err);
        finished = 1;
    }
}


int main(void){
    int id;
    struct pico_ip4 ipaddr, netmask;
    struct pico_device* dev;

    /* initialise the stack. Super important if you don't want ugly stuff like
     * segfaults and such! */
    pico_stack_init();

    /* create the tap device */
    dev = pico_tap_create("tap0");
    if (!dev)
        return -1;

    /* assign the IP address to the tap interface */
    pico_string_to_ipv4("192.168.5.4", &ipaddr.addr);
    pico_string_to_ipv4("255.255.255.0", &netmask.addr);
    pico_ipv4_link_add(dev, ipaddr, netmask);

    printf("starting ping\n");
    id = pico_icmp4_ping("192.168.5.5", NUM_PING, 1000, 10000, 64, cb_ping);

    if (id == -1)
        return -1;

    /* keep running stack ticks to have picoTCP do its network magic. Note that
     * you can do other stuff here as well, or sleep a little. This will impact
     * your network performance, but everything should keep working (provided
     * you don't go overboard with the delays). */
    while (finished != 1)
    {
        usleep(1000);
        pico_stack_tick();
    }

    printf("finished !\n");
    return 0;
}

Building and running

Now we can compile this and link it, by running

gcc -c -o main.o -I../picotcp/build/include main.c
gcc -o main.elf main.o ../picotcp/build/lib/libpicotcp.a

Next we'll create a persistent tap device - a virtual network port. You don't need to repeat this each time, the device will exist until you reboot, or until you go sudo tunctl -d tap0

sudo tunctl -u <username>
sudo ifconfig tap0 192.168.5.5

Now, you should be able to run ./main.elf, and see output like

Protocol ethernet registered (layer: 2).
Protocol ipv4 registered (layer: 3).
Protocol ipv6 registered (layer: 3).
Protocol icmp4 registered (layer: 4).
Protocol icmp6 registered (layer: 4).
Protocol igmp registered (layer: 4).
Protocol udp registered (layer: 4).
Protocol tcp registered (layer: 4).
Device tap0 created.
Assigned ipv4 192.168.5.4 to device tap0
starting ping
64 bytes from 192.168.5.5: icmp_req=1 ttl=64 time=5 ms
64 bytes from 192.168.5.5: icmp_req=2 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=3 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=4 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=5 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=6 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=7 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=8 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=9 ttl=64 time=0 ms
64 bytes from 192.168.5.5: icmp_req=10 ttl=64 time=0 ms
finished !

While the application is running, you can also run

ping 192.168.5.4

to send pings in the other direction.

Investigating what happened

Run wireshark, and sniff the tap0 interface. Then run the ./main.elf again, and see what happens. You should see an ARP request from picoTCP to Linux, and a reply. After that you should see the ping requests and replies going back and forth.

Note, sometimes you may see lots of other stuff, IPv6 router sollicitations, various broadcasts, mDNS, DNS-SD, etc - this is your when your Linux notices the new network interface is up, and starts all sorts of discoveries. With the persistent TAP device, this usually only happens the first time you start the application. Start a new wireshark capture, and start the application again, it should be much cleaner now.

Now you could make some changes to the main.c file, and experiment a bit! Keep some statistics of your pings (max, min, avg time). Open a UDP socket, send some stuff to a netcat instance on your linux. Or build a rudimentary port scanner, see what ports are open on your machine.

This is just a very quick overview, more info can be found in our wiki.


Contributors

Contributors are very welcome. Report a bug, suggest a way to improve our documentation, or write some new code.

Note however that, before accepting your code, we would ask you to sign our Contributors License Agreement. Your code remains under your copyright, and will always be available under GPLv2 and GPLv3. However, this CLA enables us to use picoTCP (including code from external contributors like you) under other licenses, including our commercial license. By doing commercial projects, we can keep investing in the quality and features of picoTCP.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].