1- # Compact Cyphal/UDP in C
1+ <div align =" center " >
2+
3+ # Cyphal/UDP transport in C
24
35[ ![ Main Workflow] ( https://github.com/OpenCyphal-Garage/libudpard/actions/workflows/main.yml/badge.svg )] ( https://github.com/OpenCyphal-Garage/libudpard/actions/workflows/main.yml )
46[ ![ Reliability Rating] ( https://sonarcloud.io/api/project_badges/measure?project=libudpard&metric=reliability_rating )] ( https://sonarcloud.io/summary?id=libudpard )
57[ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=libudpard&metric=coverage )] ( https://sonarcloud.io/summary?id=libudpard )
68[ ![ Forum] ( https://img.shields.io/discourse/users.svg?server=https%3A%2F%2Fforum.opencyphal.org&color=1700b3 )] ( https://forum.opencyphal.org )
79
8- LibUDPard is a compact implementation of the Cyphal/UDP protocol in C99/C11 for high-integrity real-time
9- embedded systems.
10+ </div >
11+
12+ -----
13+
14+ LibUDPard is a robust implementation of the Cyphal/UDP transport layer in C99/C11 for high-integrity real-time systems.
1015
1116[ Cyphal] ( https://opencyphal.org ) is an open technology for real-time intravehicular distributed computing and
1217communication based on modern networking standards (Ethernet, CAN FD, etc.).
@@ -15,35 +20,22 @@ next-generation intelligent vehicles: manned and unmanned aircraft, spacecraft,
1520
1621## Features
1722
18- Some of the features listed here are intrinsic properties of Cyphal.
19-
23+ - Zero-copy RX pipeline -- payload is moved from the NIC driver all the way to the application without copying.
2024- Support for redundant network interfaces with seamless interface aggregation and zero fail-over delay.
21-
22- - Zero-copy data pipeline on reception --
23- payload is moved from the underlying NIC driver all the way to the application without copying.
24-
25- - Robust message reassembler with support for out-of-order and duplicate datagrams.
26-
27- - Support for repetition-coding forward error correction (FEC) for lossy links (e.g., wireless)
28- transparent to the application.
29-
30- - Compliance with automatically enforceable MISRA C rules (reach out to https://forum.opencyphal.org for details).
31-
25+ - Robust message reassembler tolerant to highly distorted datagram streams (out-of-order, duplication, distinct MTU).
26+ - Packet loss mitigation via:
27+ - repetition-coding FEC (transparent to the application);
28+ - redundant interfaces (packet lost on one interface may be received on another, transparent to the application);
29+ - positive acknowledgment with retransmission (retransmission not handled by the library).
30+ - No dependency on heap; the library can be used with fixed-size block pool allocators.
3231- Detailed time complexity and memory requirement models for the benefit of real-time high-integrity applications.
33-
34- - No dependency on heap memory; the library can be used with fixed-size block pool allocators.
35-
36- - Compatibility with all conventional 8/16/32/64-bit platforms and extremely resource-constrained baremetal
37- environments starting from 64K ROM and 64K RAM.
38-
39- - Implemented in only 2k lines of code.
32+ - Runs on any 8/16/32/64-bit platform and extremely resource-constrained baremetal environments with ~ 100K ROM/RAM.
33+ - MISRA C compliance (reach out to < https://forum.opencyphal.org > ).
34+ - Full implementation in a single C file with less than 2k lines of straightforward code!
4035
4136## Usage
4237
43- The library implements the Cyphal/UDP protocol, which is a transport-layer entity.
44- An application using this library will need to implement the presentation layer above the library,
45- perhaps with the help of the [ Nunavut transpiler] ( https://github.com/OpenCyphal/nunavut ) ,
46- and the network layer below the library using a third-party UDP/IP stack implementation with multicast/IGMP support
38+ An application using this library will need to provide a third-party UDP/IP stack with multicast/IGMP support
4739(TCP not needed).
4840In the most straightforward case, the network layer can be based on the standard Berkeley socket API
4941or a lightweight embedded stack such as LwIP.
@@ -52,24 +44,29 @@ or a lightweight embedded stack such as LwIP.
5244%%{init: {"fontFamily": "Ubuntu Mono, monospace", "flowchart": {"curve": "basis"}}}%%
5345flowchart TD
5446 classDef OpenCyphal color:#00DAC6,fill:#1700b3,stroke:#00DAC6,stroke-width:2px,font-weight:600
55- Application <-->|messages,\nrequests,\nresponses | LibUDPard[fa:fa-code LibUDPard]
47+ Application <-->|messages| LibUDPard[fa:fa-code LibUDPard]
5648 class LibUDPard OpenCyphal
57- LibUDPard <-->|multicast datagrams| UDP
49+ LibUDPard <-->|datagrams| UDP
5850 subgraph domain_udpip["3rd-party UDP/IP+IGMP stack"]
5951 UDP <--> IP["IPv4, IGMPv1+"] <--> MAC
6052 end
6153 MAC <--> PHY
6254```
6355
64- To integrate the library into your application, simply copy the files under ` libudpard/ ` into your project tree,
65- or add this entire repository as a submodule.
66- The library contains only one translation unit named ` udpard.c ` ;
67- no special compiler options are needed to build it.
68- The library should be compatible with all conventional computer architectures where a standards-compliant C99 compiler
69- is available.
56+ To integrate the library into your application, simply copy ` udpard.c ` and ` udpard.h ` from ` libudpard/ `
57+ into your project tree, or add this entire repository as a submodule;
58+ also ensure you have [ ` cavl2.h ` ] ( https://github.com/pavel-kirienko/cavl ) somewhere in your include paths.
59+
60+ The library contains only one translation unit named ` udpard.c ` ; no special compiler options are needed to build it.
61+ The library should be compatible out of the box with all conventional computer architectures where a
62+ standards-compliant C99 compiler is available.
7063
7164** Read the API docs in [ ` libudpard/udpard.h ` ] ( libudpard/udpard.h ) .**
7265
66+ ## See also
67+
68+ - [ Nunavut transpiler] ( https://github.com/OpenCyphal/nunavut ) for DSDL message (de)serialization.
69+
7370## Revisions
7471
7572### v3.0
0 commit comments