summaryrefslogtreecommitdiff
path: root/src/lib/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* lib: Rename CACEP to CEP and set conngmr timeout0.21.2Dimitri Staessens2024-02-261-4/+4
| | | | | | | | | | | | | | | | The Common Application Connection Establishment Protocol (CACEP) is a RINA construct associated with the Common Distributed Application Protocol (CDAP). We dropped CDAP as O7s sees connection establishment as common to all applications (though it can be a nop). The wiki already refers to this as (O7s) Connection Establishment Protocol (CEP). The connection manager will now timeout waiting for CEP messages to avoid hanging forever, configurable at build time via CONNMGR_RCV_TIMEOUT. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* irmd: Always use reg_destroy_procDimitri Staessens2024-02-231-1/+1
| | | | | | | | | | | Destroying a process will now always be done with reg_destroy_proc, regardless of whether it was an IPCP or spawned. This makes it easier to keep the registry consistent and avoid races. Also improves some logs and updates some default settings. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Revise app flow allocationDimitri Staessens2024-02-231-3/+4
| | | | | | | | | | | | | This revises the application flow allocator to use the flow_info struct/message between the components. Revises the messaging to move the use protocol buffers to its own source (serdes-irm). Adds a timeout to the IRMd flow allocator to make sure flow allocations don't hang forever (this was previously taken care of by the sanitize thread). Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* irmd: Revise IRMd internalsDimitri Staessens2024-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a full revision of the IRMd internal implementation. The registry is now a proper subcomponent managing its own internal lock (a single mutex). Some tests are added for the registry and its data structures. Some macros for tests are added in <ouroboros/test.h>. Flow allocation is now more symmetric between the client side (alloc) and server size (accept). Each will create a flow in pending state (ALLOC_PENDING/ACCEPT_PENDING) that is potentially fulfilled by an IPCP using respond_alloc and respond_accept primitives. Deallocation is split in flow_dealloc (application side) and ipcp_flow_dealloc (IPCP side) to get the flow in DEALLOC_PENDING and DEALLOCATED state. Cleanup of failed flow allocation is now properly handled instead of relying on the sanitizer thread. The new sanitizer only needs to monitor crashed processes. On shutdown, the IRMd will now detect hanging processes and SIGKILL them and clean up their fuse mountpoints if needed. A lot of other things have been cleaned up and shuffled around a bit. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Make crypt.c independent source fileDimitri Staessens2023-10-251-0/+1
| | | | | | | | | | | The cryptography functions were in a C source that was directly imported into dev.c, enabling ECDHE+AES256 symmetric key encryption on flows. Now crypt.c is an independent source file with associated crypt.h header, to prepare for security management and configuration in the IRMd. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Move protobuf definitions to pb/ directoryDimitri Staessens2023-08-301-6/+6
| | | | | | | | | | This moves the protobuf definition in the library to a pb/ directory. Also renames the protobuf files and does a quick review of the #define guards in the include library to specify _LIB_ for internal/non-public library headers. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Link libcrypt and fix cmake compatibilityDimitri Staessens2023-08-231-3/+4
| | | | | | | | | | | | | | | Compatibility with versions of CMake older than 3.5 is deprecated from CMake 3.27 onwards, and will be removed from a future version. Calls to cmake_minimum_required() or cmake_policy() that set the policy version to an older value now issue a deprecation diagnostic. Fixed by indicating a max tested value for cmake_minimum_required(). Changed linking with OpenSSL to link with libcrypto only, we don't require libssl. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* irmd: Add configuration file supportDimitri Staessens2023-03-081-5/+13
| | | | | | | | | | | | | | | | | | | | | This adds initial support for configuration files using the C99 TOML parser (to be installed separately from https://github.com/cktan/tomlc99). The default location for the IRMd configuration file is /etc/ouroboros/irmd.conf. This is configurable at build time. An example file will be installed in the configuration directory with the name irmd.conf.example. Config file support can be disabled using the DISABLE_CONFIGFILE build option. There were some refactors and changes to the configuration messages and protobuf files. This works towards consolidation of protobuf C as an option for more generic handling of serialization/deserialization of various messages. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Add version and symlinks to shared objects0.19.3Marco Casaroli2022-08-061-0/+10
| | | | | | Building with Yocto was giving some package QA warnings. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
* lib: Fix RTO update on timeoutDimitri Staessens2022-04-031-0/+2
| | | | | | | | | | | | | This fixes the RTO doubling on timeout according to Karn/Partridge. Exponentially increasing RTO when it times out (e.g. doubling) fixes the problem that a sudden increase in real RTT starves the sRTT updates by never getting out of backoff as retransmitted packets can't update RTT. Added an parameter to make it less aggressive, default is doubling. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Add support for Linux RTT estimatorDimitri Staessens2022-04-031-0/+4
| | | | | | | | | | | | | This adds the option to use the Round-Trip-Time (RTT) estimation algorithm as it is implemented in the TCP implementation in Linux. It looks like it outperforms the TCP default algorithm, so I enabled this one by default. Also adds the option to change the RTO timeout calculation to include more (or less) than 4 times the mdev (specified as a power of 2. Left the default value to 2 (so, 4 mdevs), but 3 (8 mdevs) gives better results in my tests. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Non-configurable delayed acks in FRCPDimitri Staessens2022-03-301-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't really make sense to manually and one-sidedly configure the timeout of delayed acknowledgements, as setting it too high upsets the peer's sRTT estimates. Even worse, it also causes a lot of spurious retransmissions if it exceeds the sRTT mean deviation calculated by the receiver. Compensating on bare acknowledgment for the ack delay could improve the RTT estimate deviation, but not the spurious retransmissions if it was set too high. This sets the delayed ack to wait for a single RTT mean deviation. Probably needs more tweaking to further reduce differences between the RTT estimates at the sender and receiver, e.g. compensate the RTT estimate for delayed acks, or increase the RTO to add 8 mdevs to sRTT instead of 4. However, it looks like the mdev estimate is the trickiest one to get to sync, not the RTT average. Linux reduces the sample weight for mdev from 1/4 to 1/32 in some cases, will give that a shot some day too to see if that further align sRTT estimates. In any case, this patch already improves things a lot. Also fixes a bug where the sender was sending acknowlegments on the first packets in flight for the 0 sequence number. The receiver activity was measured in seconds but compared to a timeout value in nanoseconds. There's still a lot of spurious retransmissions that start after actual packet loss occurs, I'm still investigating what causes it. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Application RIB with FRCT statisticsDimitri Staessens2021-06-301-0/+10
| | | | | | | | | | Application flows can now be monitored from the RIB, exposing FRCT statistics (window edges, retransmission timeout, rtt estimate, etc). Application RIB requires user permissions to be able to access /dev/fuse. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Reduce timerwheel CPU consumptionDimitri Staessens2020-11-251-1/+1
| | | | | | | | | | | The timerwheel is checked during IPC calls (fevent, flow_read), causing huge load on CPU consumption in IPCPs, since they have a lot of fevent() threads for QoS. The timerwheel will need further optimization), but for now I reduced the default tick time to 5 ms and added a boolean to check that the wheel is actually used. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Don't default to lockless rbuffDimitri Staessens2020-11-221-1/+1
| | | | | | | | I mistakenly set the default to the (buggy) lockless rbuff implementation instead of the pthread one in commit 3aec660e. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Send and receive window updatesDimitri Staessens2020-10-111-0/+2
| | | | | | | | | This adds sending and receiving window updates for flow control. I used the 8 pad bits as part of the window update field, so it's 24 bits, allowing for ~16 million packets in flight. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Add compiler configuration for FRCPDimitri Staessens2020-10-111-2/+30
| | | | | | | | | | | | | This allows configuring some parameters for FRCP at compile time, such as default values for Delta-t and configuration of the timerwheel. The timerwheel will now reschedule when it fails to create a packet, instead of setting the flow down immediately. Some new things added are options to store packets for retransmission on the heap, and using non-blocking calls for retransmission. The defaults do not change the current behaviour. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Fix updating retransmission wheelDimitri Staessens2020-05-011-0/+2
| | | | | | | | | | Fixes infinite rescheduling with RTO getting lower than the timerwheel resolution. For very low RTO values we'd need a big packet buffer with the current memory allocator implementation (rdrbuff). Setting a (configurable) minimum RTO (250 us) reduces this need. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Move hashtable from lib to unicastDimitri Staessens2020-02-161-1/+0
| | | | | | | | | | The hashtable is only used for forwarding tables in the unicast IPCP. This moves the generic hashtable out of the library into the unicast IPCP to prepare a more tailored implementation specific to routing tables containing address lists. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Allow older OpenSSL versions for randomDimitri Staessens2019-10-051-2/+3
| | | | | | | | | Ubuntu 16 comes with older versions of OpenSSL, glibc and libgcrypt. Ouroboros will now fall back to OpenSSL even if the version is <= 1.1.0. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Check OpenSSL version >= 1.1.0Dimitri Staessens2019-09-291-10/+15
| | | | | | | | | The cryptographic functions require at least OpenSSL 1.1.0. The build will now check for this version and disable OpenSSL support when this requirement is not met. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Set independent size for rbuffDimitri Staessens2019-04-061-0/+2
| | | | | | | | | | This allows setting the size of the rbuffs in a system independently of the main packet buffer using SHM_RBUFF_SIZE. The benefit of setting a smaller rbuff size is that a single process can't fully occupy the main packet buffer. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Set specific compiler flags for SWIG target0.15.2Dimitri Staessens2019-03-211-1/+0
| | | | | | | | | | The compiler flags for the SWIG target were added to the global CMAKE_C_FLAGS used for the entire project. This sets the flags uniquely for the SWIG target. The eth has a similar case for the c99 flag. There was a lingering include in dev.c that was removed. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* lib: Revise du buff API towards a memory allocatorDimitri Staessens2018-10-261-2/+2
| | | | | | | | | This changes the API to the rdrbuff to treat it as a pool memory allocator. The head and tailspace to allocate in a buffer is now set system-wide instead of being passed as a parameter. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* Merge branch 'testing' into beSander Vrijders2018-10-111-1/+1
|\
| * lib: Disable CRC by defaultDimitri Staessens2018-10-111-1/+1
| | | | | | | | | | | | | | | | This sets the CRC check to be disabled by default, since it greatly hampers performance and is almost never needed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* | Merge branch 'testing' into beDimitri Staessens2018-10-091-1/+0
|\|
| * lib: Define QoS specs inside header file0.12.1Sander Vrijders2018-10-091-1/+0
| | | | | | | | | | | | | | | | | | The QoS specs were defined in the source file instead of in the header file, which resulted in uninitialized structs being used, which gave rise to weird behavior in the library. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* | Merge branch 'testing' into beDimitri Staessens2018-10-061-4/+8
|\|
| * lib: Split error checking from FRCTDimitri Staessens2018-10-051-0/+2
| | | | | | | | | | | | | | | | This splits off the CRC from FRCT so it can be set independently. Ouroboros now allows raw flows with error checking. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
| * ipcpd, lib, irmd, tools: Change SDU to packetSander Vrijders2018-10-051-3/+3
| | | | | | | | | | | | | | | | This will change SDU (Service Data Unit) to packet everywhere. SDU is OSI terminology, whereas packet is Ouroboros terminology. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
| * lib: Pass qosspec at flow allocationDimitri Staessens2018-10-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | The flow allocator now passes the full qos specification to the endpoint, instead of just a cube. This is a more flexible architecture, as it makes QoS cubes internal to the layers. Adds endianness transforms for the flow allocator protocol in the normal IPCP. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* | lib: Support for rudimentary retransmissionDimitri Staessens2018-07-271-1/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | This adds rudimentary support for sending and processing acknowledgments and doing retransmission. It replaces the generic timerwheel with a specific one for retransmission. This is currently a fixed wheel allowing retransmissions to be scheduled up to about 32 seconds into the future. It currently has an 8ms resolution. This could be made configurable in the future. Failures of the flow (i.e. rtx not working) are indicated by the rxmwheel_move() function returning a fd. This is currently not yet handled (maybe just setting the state of the flow to FLOWDOWN is a better solution). The shm_rdrbuff tracks the number of users of a du_buff. One user is the full stack, each retransmission will increment the refs counter (which effectively acts as a semaphore). The refs counter is decremented when a packet is acked. The du_buff is only allowed to be removed if there is only one user left (the "stack"). When a packet is retransmitted, it is copied in the rdrbuff. This is to ensure integrity of the packet when multiple layers do retransmission and it is passed down the stack again. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use macros for all time utility functions0.11.9Dimitri Staessens2018-06-131-1/+0
| | | | | | | | | This replaces the time utility functions with macros. This avoids using library functions in the tools and also slightly speeds up the implementation. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Revise FRCT reorderingDimitri Staessens2018-06-041-1/+0
| | | | | | | | The reordering queue is replaced by a fixed ring buffer for speed and simplicity. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Reduce default buffer size to 4096 blocksDimitri Staessens2018-02-261-2/+1
| | | | | | | | This reduces the default buffer size to 4096 blocks (about 16MB). This will avoid problems when users try a default build on smaller machines. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Revise Data Transfer component0.10.0Dimitri Staessens2018-02-131-2/+2
| | | | | | | | | | | This makes the TTL non-optional and allows the maximum (initial) value of the TTL to be specified at bootstrap (the default is set to 60). The fd in the DT PCI is now called EID (Endpoint ID). The names "dif" and "ae" have been replaced by "layer" and "component" respectively in all sources. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Use GNUInstallDirs instead of hardcoded values0.9.9Sander Vrijders2018-02-061-3/+3
| | | | | | | | This changes the build to use GNUInstallDirs instead of hardcoded values. Package maintainers can then override these defaults by passing the correct value to cmake on the command line. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib, tools: Rename application process and instanceDimitri Staessens2017-12-021-3/+3
| | | | | | | | | | | This refactors ouroboros to use "program" instead of "application process" and "process" instead of "application process instance" to align with current naming in current Operating Systems courses instead of the ISO nomenclature adopted by RINA. This change permeates through the entire implementation. Also contains some minor other refactors. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Fix setting configuration definitionsDimitri Staessens2017-11-181-0/+5
| | | | | | | | Variable in cache need to be explicitly unset else they will remain in the cache and still be defined by #cmakedefine. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Add options for debug builds with sanitizerDimitri Staessens2017-11-141-2/+2
| | | | | | | | | This adds three build types, DebugASan, DebugTSan and DebugLSan that enable the Address, Thread and Leak Sanitizer by setting the fsanitize flag to the compiler. This option is supported by both gcc and clang. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Set libraries for OpenSSL when not foundDimitri Staessens2017-11-141-0/+1
| | | | | | | | | The build didn't reset the CMake variable for OPENSSL_LIBRARIES, causing bad input to the linker. This error showed up when trying to build on XUbuntu 17.10 without OpenSSL or libgrcypt installed. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Avoid duplicate definitions in librariesDimitri Staessens2017-11-131-4/+2
| | | | | | | | There were sources defined in multiple libraries. This issue was reported by the address sanitizer on FreeBSD. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Use packed struct for FRCT header accessDimitri Staessens2017-11-081-1/+0
| | | | | | | | | | | | | | | This replaces the variable FRCT header with a packed struct, which significantly simplifies the implementation. The shm_du_buff calls to release the head/tail are updated to return a pointer to the original head or the new tail (in symmetry to the alloc calls, which return a pointer to the new head and old tail), so that it immediately points to the structure that is needed. The frct_pci sources are removed and frct is now fully in the frct.c source file. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* Merged in dstaesse/ouroboros/be-deprecate-ouroboros-init-fini (pull request ↵dimitri staessens2017-10-141-19/+45
|\ | | | | | | | | | | #626) Be deprecate ouroboros init fini
| * lib: Deprecate ouroboros_init and ourboros_finidimitri staessens2017-10-141-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit deprecates ouroboros_init and ouroboros_fini and adds them as a constructor or destructor, causing these function to be run automatically when a program that links to the library calls and exits main(). For this to fully work, the library had to be split so that we can avoid the irmd calling these functions (the IRMd has to create the shm structures on which these calls depend). The library is split in 3 parts: libouroboros-dev, libouroboros-irm and libouroboros-common. The latter is linked to the other two so that including libouroboros-dev or libouroboros-irm will also link libouroboros-common.
* | lib: Re-enable multi-block supportdimitri staessens2017-10-131-0/+2
|/ | | | | | Multi-block support was forgotten during the update of the build system. This enables it again and fixes some bugs when it is disabled and larger SDUs are sent.
* lib: Disable lockless rbuff by defaultSander Vrijders2017-09-221-2/+2
| | | | | This disables the lockless rbuff by default since it is less stable and tested.
* irmd: Init libgcrypt before using itdimitri staessens2017-09-201-1/+1
|
* build: Notify if FUSE is not installeddimitri staessens2017-09-191-0/+2
|