Ressource efficient protocol to exchange messages in a point-to-point network. This repository contains a library for bare-metal usage and a POSIX based bridging application.
Complex heterogenuous systems are equipped with an increasing number of small decentralized computing devices. These are used to read sensors or control motors distributed across the system. Connecting these nodes in a packet based point-to-point network allows for flexible data transmission between all participants. NDLCom (Node Level Data Link Communication) defines a simple packet format for data exchange, which needs fewer resources compared to more complex network technologies like IP. This allows microcontrollers or FPGAs with limited capabilities to communicate in a network with a PC. Point-to-point bytestreams based on UART are viewed as the smallest common denominator.
The protocol provides a communication infrastructure similar to the OSI-Layer 3, while it uses HDLC for Layer 2 message segmentation:
HDLC segments a continuous bytestream into individual messages by replacing every 0x7e and 0x7d with special escape-sequences (red) and sorounding each message with the previously replaced 0x7e (blue), thereby marking the boundaries in a unique way. Of course, the decoder has to undo this.
The header of each packet consists of 4 byte: One byte for sender and receiver respectively allow for up to 254 different addresses plus the additional "broadcast" address. The third byte is a packet-counter to enable detection of lost packages. The payload with a maximum capacity of 255 bytes is following the specification of the packet length. At the end, each packet is guarded by a 16Bit AUG-CCITT checksum to detect transmission errors:
Developed at DKFI RIC Bremen during the iStruct and SeeGrip projects, starting in 2010. To obtain something more profound like presentations and papers see the documents folder.
The C "core" code is written with the embedded/bare-metal case in mind: There is no dynamic memory involved, no C++, no locking and no multi threading. C++ code is provided for POSIX systems to create actually usefull software. For a high-level overview of the contained classes see here
Comes with a cmake-based buildsystem and pkg-config files. Provides a simple Makefile acting as a cmake-wrapper, just call make and it will probably do the right thing. To generate doxygen-documentation call make doc, to install all files into the default-directory ~/DFKI.install do make install.
- src Contains all source files of the library
- test Limited programs used for testing and benchmarking
- include/ndlcom Contains all external headers used in the library.
- doc Some documentation, with doc/tex containing the tikz-sources for graphics
- scripts Some tooling and testing scripts which fit nowhere else
- tools Contains useful ready-made tools for actual usage
./build/...The default build directory$HOME/DFKI.install/...The default install directory
There are two ways to use this library, both based on pkg-config:
- Compile and install here at first, using the provided wrapper makefile. Then use pkg-config inside your other project to obtain the neccessary flags needed to use the files from the install-tree.
- Use the cmake-directive
add_subdirectorypointing to this CMakeLists in your main-cmake project. Then set the environment variablePKG_CONFIG_PATHto point to the build-directory and use pkg-config to obtain the flags to use the files from the build-tree. This relies on the uninstalled variant of pkg-config files.
See minimalExample.c and minimalExample.cpp to get the idea on how an implementation might look like. See ndlcomBridge.service for an systemd service skeleton and rc-script.sh for a SystemV based system.
Have a look into this folder.




