summaryrefslogtreecommitdiff
path: root/include/ouroboros/ipcp.h
Commit message (Collapse)AuthorAgeFilesLines
* ipcpd: Single UDP port for the ipcpd-udp0.18.0Dimitri Staessens2021-01-031-2/+1
| | | | | | | | | | | | | | | | | | The UDP layer will now use a single (configurable) UDP port, default 3435. This makes it easer to allocate flows as a client from behind a NAT firewall without having to configure port forwarding rules. So basically, from now on Ouroboros traffic is transported over a bidirectional <src><port>:<dst><port> UDP tunnel. The reason for not using/allowing different client/server ports is that it would require reading from different sockets using select() or something similar, but since we need the EID anyway (mgmt packets arrive on the same server UDP port), there's not a lot of benefit in doing it. Now the operation is similar to the ipcpd-eth, with the port somewhat functioning as a "layer name", where in UDP, the Ethertype functions as a "layer name". Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Update email addressesDimitri Staessens2021-01-031-2/+2
| | | | | | | | The ugent email addresses are shut down, updated to Ouroboros mail addresses. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Update copyright to 2021Dimitri Staessens2021-01-031-1/+1
| | | | | | | Happy New Year, Ouroboros! Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Add congestion avoidance policiesDimitri Staessens2020-12-021-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds congestion avoidance policies to the unicast IPCP. The default policy is a multi-bit explicit congestion avoidance algorithm based on data-center TCP congestion avoidance (DCTCP) to relay information about the maximum queue depth that packets experienced to the receiver. There's also a "nop" policy to disable congestion avoidance for testing and benchmarking purposes. The (initial) API for congestion avoidance policies is: void * (* ctx_create)(void); void (* ctx_destroy)(void * ctx); These calls create / and or destroy a context for congestion control for a specific flow. Thread-safety of the context is the responsability of the flow allocator (operations on the ctx should be performed under a lock). ca_wnd_t (* ctx_update_snd)(void * ctx, size_t len); This is the sender call to update the context, and should be called for every packet that is sent on the flow. The len parameter in this API is the packet length, which allows calculating the bandwidth. It returns an opaque union type that is used for the call to check/wait if the congestion window is open or closed (and allowing to release locks before waiting). bool (* ctx_update_rcv)(void * ctx, size_t len, uint8_t ecn, uint16_t * ece); This is the call to update the flow congestion context on the receiver side. It should be called for every received packet. It gets the ecn value from the packet and its length, and returns the ECE (explicit congestion experienced) value to be sent to the sender in case of congestion. The boolean returned signals whether or not a congestion update needs to be sent. void (* ctx_update_ece)(void * ctx, uint16_t ece); This is the call for the sending side top update the context when it receives an ECE update from the receiver. void (* wnd_wait)(ca_wnd_t wnd); This is a (blocking) call that waits for the congestion window to clear. It should be stateless (to avoid waiting under locks). This may change later on if passing the context is needed for different algorithms. uint8_t (* calc_ecn)(int fd, size_t len); This is the call that intermediate IPCPs(routers) should use to update the ECN field on passing packets. The multi-bit ECN policy bases the value for the ECN field on the depth of the rbuff queue packets will be sent on. I created another call to grab the queue depth as fccntl is write-locking the application. We can further optimize this to avoid most locking on the rbuff. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* Add equal-cost multipath routing policyDimitri Staessens2020-02-161-1/+2
| | | | | | | | | | This adds an equal-cost multipath routing policy to Ouroboros, based on Nick Aerts' code. When selected, flows will send packets over all paths with equal cost (hop count). Path selection is round-robin. It does not yet take into account flows that are down. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Configure PFF from routing policyDimitri Staessens2020-02-161-6/+0
| | | | | | | | | | | | The Packet Forwarding Function (PFF) was user-configurable using the irm tool. However, this isn't really wanted since the PFF is dictated by the routing algorithm. This moves the responsability for selecting the correct PFF from the network admin to the unicast IPCP implementation. Each routing policy now has to specify which PFF it will use. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Update copyright to 20200.16.0Dimitri Staessens2020-01-021-1/+1
| | | | | Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Refactor normal to unicastDimitri Staessens2019-07-291-3/+3
| | | | | | | | This completes the renaming of the normal IPCP to the unicast IPCP in the sources, to get everything consistent with the documentation. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* ipcpd: Revise UDP IPCPDimitri Staessens2019-03-181-0/+2
| | | | | | | | | | | The UDP IPCP now uses a fixed server UDP port (default 3435) for all communications. This allows passing firewalls more easily since only a single port needs to be opened. The client port can be fixed as well if needed (default random). It uses an internal eid, so the MTU of the UDP layer is reduced by 4 bytes, similar to the Ethernet IPCPs. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
* build: Update copyright to 2019Dimitri Staessens2019-02-051-1/+1
| | | | | | | Updates the copyright notice in all sources to 2019. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add broadcast IPCPDimitri Staessens2018-10-241-0/+1
| | | | | | | | | | This adds a broadcast IPCP that allows us to easily create multicast applications. The broadcast IPCP accepts flows for "<layer_name>.mc". A tool, obc (Ouroboros broadcast), is added that sends and reads a message to a broadcast layer. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* tools: Fix memleaks and buffer overflows in irm toolSander Vrijders2018-09-271-2/+2
| | | | | | | | This fixes some memleaks and potential buffer overflows in the irm tool. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* irmd: Fix memleak when failing to list ipcpsDimitri Staessens2018-03-221-1/+2
| | | | | | | | | The list_ipcps call had a memleak in the failure case. Also fixes a compiler warning for a possible uninitialized variable and renumbers the gpb ipcpd message fields. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Add IPCP over DIX EthernetDimitri Staessens2018-03-101-2/+6
| | | | | | | | | | | | | | | | | | This adds an IPC Process that uses DIX Ethernet with an Ethertype that is configurable at bootstrap. This allows parallel DIX layers over the same Ethernet network with different Ethertypes (and one LLC layer). It allows jumbo frames in the future, and should avoid the problems we have with some routers not handling LLC traffic very well. The destination endpoint ID is sent as a 16 bit integer, so the maximum payload is 1498 bytes in standard Ethernet, and 8998 bytes when Jumbo frames are used. The implementation is very similar to the Ethernet LLC IPCP, so it is implemented using preprocessor macros in the single source instead of duplicating code. 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-5/+5
| | | | | | | | | | | 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>
* include, src: Update copyright to 2018Dimitri Staessens2018-01-091-1/+1
| | | | | | | Happy New Year, Ouroboros. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Use the term "layer" and deprecate "shim"Dimitri Staessens2017-12-191-7/+7
| | | | | | | | | | | | | | This changes the terminology to use layer instead of DIF and deprecate the word "shim" for the IPCPs that attach to Ethernet LLC and UDP .The terminology has not yet been changed in the variable names etc. This reflects the design choices in Ouroboros to make IPCPs pure resource allocators instead of also providing an "IPC service". The Ouroboros IPCPs that attach to Ethernet and UDP implement the allocator and are thus not really shims. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Integrate raptor into ouroboros 0.8Dimitri Staessens2017-12-151-0/+1
| | | | | | | | | | | The raptor code is refactored to completely remove reduntant code relating to addresses. The dependency on the google protocol buffers is removed. The build system will only build raptor if the relevant kernel module is found on the system. The irm tool and the relevant documentation are updated. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: normal: Add Loop-Free Alternates routingSander Vrijders2017-09-291-1/+2
| | | | | | This adds the Loop-Free Alternates (LFA) policy. In case a link goes down a LFA may be selected to route the SDUs on without causing loops instead of the main hop that just went down.
* ipcpd: normal: Add alternate hop PFFSander Vrijders2017-09-211-3/+4
| | | | | This adds a PFF that returns an alternate hop as next hop in case the hop that would have been returned is down.
* ipcpd: normal: Make PFF policy-basedSander Vrijders2017-09-201-0/+5
| | | | | This turns the PDU Forwarding Function of the IPCP into a policy. For now only the simple PFF policy is available.
* ipcpd: Deprecate gam as autonomous componentdimitri staessens2017-08-281-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The graph adjacency manager has been deprecated in favor of providing an external interface into the connectivity manager so that adjacencies can be controlled from the command line, user scripts or user applications. The gam and its associated policies were removed from the normal IPCP and the IRM configuration tools. The "/members" part of the RIB was deprecated. Removal of the gam means that initial connectivity based on changes in the RIB can't be provided, so some changes were required throughout the normal IPCP. The enrollment procedure was revised to establish its own connectivity. First, it gets boot information from a peer by establishing a connection to the remote enrollment component and downloading the IPCP configuratoin. This is now done using its own protocol buffers message in anticipation of deprecation of the RIB and CDAP for communication within a DIF. After the boot information is downloaded, it establishes a data transfer flow for enrolling the directory (DHT). After the DHT has enrolled, it signals the peer to that enrollment is done, and the data transfer connection is torn down. Signaling connections is done via the nbs struct, which is now passed to the connmgr, which enables control of the connectivity graph from external sources.
* build: Replace fsf snail mail with contact URLdimitri staessens2017-08-131-2/+1
|
* lib, ipcpd, tools: Fix enum assignmentsSander Vrijders2017-08-101-2/+2
| | | | This fixes several assignments to the wrong enum type.
* build, lib, ipcpd, irmd: Add support for libgcryptdimitri staessens2017-08-091-10/+7
| | | | | | | | | | | | | | | | This adds support for libgcrypt. If at least version 1.7.0 of libgcrypt is present, it may be used for secure random number generation and is used for hashing in the irmd/ipcp. The hash definitions are moved to the internal hash.h header, and defined independently of the hashes that are defined as part of the directory policy for the normal IPCP. The translation is moved from the IRMd to ipcpd/ipcp.h. The bootstrap call from the IRMd expects the IPCP to return the correct hash algorithm with a dif_info struct, which is in line with the behavior of the enroll call. This also improves how some platform checks in the build system are handled.
* ipcpd, lib, irmd: Hardcode shim hash algorithmsSander Vrijders2017-07-121-2/+5
| | | | | | | This will hardcode the shim hash algorithms as they don't have an enrollment phase. Fixes #44
* ipcpd: normal: Make routing a policySander Vrijders2017-05-151-0/+5
| | | | | | This makes the routing component into a policy since different approaches may exist to do this, depending on how high the rank of the DIF is.
* ipcpd: Allow specifying fixed syntaxdimitri staessens2017-05-151-19/+11
| | | | | | This commits adds the functions and messages to specify a fixed protocol syntax during CACEP. It also revises the messages for specifying the DT protocol syntax from the irm tool.
* ipcpd: Add capability reportingdimitri staessens2017-04-271-0/+8
| | | | | | | | The IPCP will now report the DIF name and the hash value to the IRMd as a dif_info struct. This can later be extended to add further capability reporting. Some bugfixes in normal. Fixes #24
* lib: Remove dependency on installed headersSander Vrijders2017-04-241-2/+9
| | | | | | | The header ipcp.h was not installed systemwide, giving compile time errors when trying to compile external programs that use irm.h. ipcp.h also included hash.h, which exposes project interal functions. The enum was moved to ipcp.h to prevent this.
* ipcpd: Allow specifying the hash algorithm to usedimitri staessens2017-04-161-1/+3
| | | | Currently CRC32, MD5, and SHA3 (224, 256, 384 and 512 bit) are supported.
* lib, ipcpd, irmd: Register hash instead of namedimitri staessens2017-04-131-0/+80
| | | | | | | | | All information passed over the IRMd/IPCP boundary for using IPC services (flow allocation, registration) is now hashed. This effectively fixes the shared namespace between DIFs and the IRMDs. This PR also fixes some API issues (adding const identifiers), shuffles the include headers a bit and some small bugs.
* lib, ipcp: Revise fast path and flow interfacesdimitri staessens2016-10-041-81/+0
| | | | | | | | | | | | IPCPs can now use ap_init() to initialize the memory. All flows are accessed using flow descriptors, this greatly simplifies IPCP development. Reverts the fast path to a single ap_rbuff per process. Splits lib/ipcp into irmd/ipcp and lib/ipcp-dev. Adds a lib/shim-dev holding tailored functions for shims. Moves the buffer_t to utils.h. Fixes the shim-eth-llc length field. Removes the flow from shared.h. Fixes #4 Fixes #5
* lib: ipcp: Decouple flow_deallocdimitri staessens2016-09-021-4/+1
| | | | Sending a dealloc to the irmd moved to its own call.
* ipcp, irmd, lib: Notify IRMd upon IPCP initializationSander Vrijders2016-08-101-0/+3
| | | | | | This will notify the IRMd when the IPCP is initialized and ready to receive messages. Previously a bootstrap could fail since the IPCP was not listening to the socket yet.
* lib: Remove N-1 DIF param from enroll operationSander Vrijders2016-07-121-2/+1
| | | | | | This removes the parameter N-1 DIF from the enroll operation. IPCPs should just allocate a flow to a DIF name and let the N-1 DIF resolve it.
* ipcpd: Deprecate ipcp_reg/ipcp_unregdimitri staessens2016-07-081-7/+0
|
* lib: Provide first implementation of revised CDAPSander Vrijders2016-07-051-1/+1
| | | | | | | | This commit introduces a first version of the revised CDAP specification. CACEP (for authentication purposes) has been separated from CDAP. Application developers may use CDAP if they find it useful. Within Ouroboros CDAP will be used to perform operations on the RIB of an IPCP.
* lib, irmd, ipcpd: Change pid to apiSander Vrijders2016-06-281-15/+15
| | | | Changes the variable name as well to API instead of PID.
* lib, irmd, ipcpd: Change of IRM APISander Vrijders2016-06-281-4/+2
| | | | | | | | | | | | | | This changes the IRM API after discussions with Dimitri. The register operation is now split into a bind and register operation. The same for unregister; unbind and unregister. PIDs are now used as the application instance name. A name for a PID is only provided for scriptability in bash. It is therefore also no longer passed down to the IPCP. Every operation on an IPCP through the IRM API has to use the PID. Quering of the PIDs by name is possible. The IRM tool has been updated to use this new API as well. A subcommand 'ipcp' has been added for operations that take effect on IPCPs only. Fixes #12
* lib: Change DA header to NSMSander Vrijders2016-06-221-1/+1
| | | | | | Functionality that was previously thought to be part of the DIF Allocator is actually namespace management. Hence the file has been renamed and the API updated.
* lib, irmd, tools, ipcpd: updates to dev API.dimitri staessens2016-06-131-2/+0
| | | | | | | | | | | | | | | The registration function has been moved to the irm tool, applications now need to be registered by an administrator. Currently only supports one instance per registered name, and an AP can be registered under only one name. The irmd can now start a registered server application on demand. For the full functionality of the tool, execute "irm register". AP name removed from flow allocation. Flow allocation does not send the source ap name as it is quite useless. The accept() call now only returns the AE name.
* lib, ipcpd, irmd: Add QoS cube definitionSander Vrijders2016-05-141-11/+11
| | | | | | | | | | This adds the QoS cube definition, which is an enum to select which QoS is needed in the IPCP. An application has to use the qos_spec in qos.h to define what it needs. The IRMd will map this unto a qos cube definition. Some headers are now also no longer installed on the system, since they are only to be used within the irmd and ipcps.
* lib: changed port_id to intdimitri staessens2016-05-081-14/+14
| | | | | returning -1 as uint32_t leads to bugs. also changed types in GPB to sint to use zigzag encoding.
* irmd: flow allocation and fast pathdimitri staessens2016-05-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit has a first implementation of flow allocation (the "slow path") and read/write (the "fast path") for ouroboros. It provides basic but unstable communications over the shared memory. It required a lot of changes all over the stack, and fixes a number of previously undetected issues. This PR still need heavy revision regarding data model, locking and cleanup. lib/dev: modifications to the API. It now uses an ap_init() call to set the AP name and sets the Instance ID to the pid of the process. It also binds the AP to the shared memory and creates tables for mappings in the fast path. A call to ap_fini() releases the resources. lib/shm_ap_rbuff: added ring buffer for data exchange between processes in the fast path. It passes an index in the shm_du_map. lib/shm_du_map: rewrote API to work with calls from dev.c. Garbage collector added. Tests updated to new API. ipcpd/ipcp-data: removed everything related to flows, as these are universal for all ap's and kept in ap_data (dev.c), or similar structs for shim ipcps. shim-udp: added flow allocator and read/write functions and shm elements. irmd: revised data model and structures necessary for flow allocation. tools: echo updated to new dev.h API. messaging system was updated to comply with new flow allocation messages. All exchanges use pid and port_id to bootstrap the fast path.
* lib: instance ID's are now set to the process PIDdimitri staessens2016-04-261-2/+2
| | | | | | | | All instance-id's in ouroboros will be set by the system to the pid of the process associated with this application process instance. This means that the user has no way to choose the instance id's. Function calls that assumed manually defined instance id's have been replaced throughout the system.
* irmd: reg/unreg whatevercast namesdimitri staessens2016-04-221-11/+10
| | | | | | | | | | | | Unregistering ap's now works. An AP now registers/unregisters its AP-I by sending its AP name and its pid to the IRMd. The IPCPs register whatevercast names. An AP name is currently mapped on a whatevercast name represented by the same string literal. The IRMd allows registration of only one AP-I per AP. A Name Space Management system is needed in the processing system so we can resolve this completely. Changing the stack to register whatevercast names required some changes all over the ipcpd implemented and in the library.
* lib, irmd, irm: Add dif_configSander Vrijders2016-04-081-3/+7
| | | | | | | | | This adds dif_config to the prototype, in which one is able to specify the parameters a DIF should have. The bootstrap operation of an IPCP takes this as parameter and is oblivious to whether it is a shim or a normal IPCP. The dif_config struct is also correctly serialized and deserialized and passed opaquely to the correct IPCP. This IPCP is in charge of deserializing it correctly.
* lib: Implementation of flow related opsSander Vrijders2016-03-311-10/+8
| | | | | | This adds the messages that are sent to the IPCPs related to flows. Some messages are also sent to the IRMd (e.g. when a new flow arrives).
* lib: Add flow related ops to ipcp.hSander Vrijders2016-03-311-11/+48
| | | | | This adds the operations related to flows to ipcp.h. Previously it only contained operations on the IPCP level.