summaryrefslogtreecommitdiff
path: root/src/ipcpd
Commit message (Collapse)AuthorAgeFilesLines
* ipcpd: Print endpoint in flow statisticsDimitri Staessens2018-02-234-14/+30
| | | | | | | | | | The flow statistics will now print the endpoint of the flow. If it's a local endpoint for the IPCP, it will print the component (e.g. "flow-allocator"). For remote flows, it will print the address of the IPCP. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Reset flow statistics on reuseDimitri Staessens2018-02-231-0/+2
| | | | | | | | The flow statistics were not reset when a new connection was created, resulting in wrong statistics. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix locking issues in flow statisticsDimitri Staessens2018-02-231-12/+59
| | | | | | | | | The locks were not initialised correctly due to a misspelled define and the fail_write was trying to lock a bad mutex (sometimes -1 out of array). This also fixes the statistics gathered. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix double definition of ipcp configDimitri Staessens2018-02-233-43/+2
| | | | | | | | | | The import of the IPCP config protobuf message in the enrollment message caused a double definition. The enroll.proto file is deprecated and the definition of the enrollment message is moved to the library to avoid this. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix missing lock in link-state policyDimitri Staessens2018-02-231-0/+27
| | | | | | | | The replication of the database was missing a lock. Now the database is first copied under lock and then sent. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Export flow statistics to RIBDimitri Staessens2018-02-203-20/+399
| | | | | | | | | | This adds flow statistics for the data transfer (DT) component to the RIB. The DT component will keep track of the traffic on each flow. This feature can be enabled or disabled by setting the IPCP_FLOW_STATS variable in the build system. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Get RIB attributes from componentDimitri Staessens2018-02-201-29/+80
| | | | | | | | | | | | This revises the RIB so it gets the complete file attribute list from the component instead of setting some attributes in the library. This will allow setting read/write access later on in the component itself. The time of last change of lsdb entries in the file system is now set to the time of the last received Link State Update for that entry. 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-1319-263/+255
| | | | | | | | | | | 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>
* ipcpd: Revise lookup tracking in DHTDimitri Staessens2018-02-102-54/+88
| | | | | | | | | | The lookups now track the responses by cookie instead of just counting the remaining number of responses. This is needed because simultaneous lookups for the same hash interfere with eachother and lead to missed responses. 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-065-5/+5
| | | | | | | | 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>
* ipcpd: Replicate database on new MGMT flowDimitri Staessens2018-02-061-0/+17
| | | | | | | | This will trigger the existing member to send all entries in its database as LSAs to the new member. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Handle LU_DONE state in DHTDimitri Staessens2018-02-061-0/+1
| | | | | | | | The DHT would enter an infinite loop in lookup_wait() because the LU_DONE state was not handled correctly. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Wait for DHT_RUNNING state at register/query0.9.4Dimitri Staessens2018-01-251-4/+10
| | | | | | | | | This will make the register and query calls at the DHT wait for a JOIN to complete. This avoids fails when calling register immediately after creating a data transfer connection. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix lookup handling in DHT0.9.3Dimitri Staessens2018-01-231-5/+2
| | | | | | | | Some responses for a query were missed because the lookup went into LU_COMPLETE state while still having pending requests. 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-0951-51/+51
| | | | | | | 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-1910-48/+47
| | | | | | | | | | | | | | 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: Define eth_llc_data_fini as staticDimitri Staessens2017-12-172-3/+2
| | | | | | | | The eth_llc_data_fini function should be statically defined. Also fixes some indentation in the CMakeLists.txt file. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Find raptor kernel module in default pathDimitri Staessens2017-12-171-3/+1
| | | | | | | | The raptor module is now installed in /lib/modules/$(uname -r)/extra and ouroboros will look for the module there. 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-153-435/+377
| | | | | | | | | | | 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: Add support for raptor FPGA deviceAlexander D'hoore2017-12-154-0/+1206
| | | | | | | | | This adds the initial raptor support from the master thesis entitled (dutch) "Implementatie van de Recursive Internet Architecture op een FPGA platform". Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Wait for DHT running state before accessDimitri Staessens2017-12-061-12/+13
| | | | | | | | | | The DHT will now wait for the DHT_RUNNING state before handling request messages, ensuring that the parameters are set correctly before they are read and sent at JOIN. Also fixes a re-introduced assertion failure when a JOIN fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Fix missing bracket in DHTDimitri Staessens2017-12-051-1/+1
| | | | | | | | ca2f47d had a missing bracket after a last-minute update to simplify the logic. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Update DHT buckets in JOINING stateDimitri Staessens2017-12-051-7/+31
| | | | | | | | | | The DHT buckets were not updated in JOINING state, which sometimes caused the DHT to miss its first peer update when joining and become isolated. This also checks if a name is already registered to avoid adding it multiple times. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Make hash algorithm configurableSander Vrijders2017-12-041-25/+23
| | | | | | | | | | This makes the hashing algorithm configurable once more for the local and the shim-eth-llc, since their scope is so small that it is up to the network administrator to select a correct algorithm for the whole network. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove protocol buffers from flow allocator0.8Sander Vrijders2017-12-043-117/+54
| | | | | | | | This will remove google protocol buffers from the flow allocator component in the normal IPCP. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Remove protocol buffers from link stateSander Vrijders2017-12-043-66/+24
| | | | | | | | | This will remove google protocol buffers from the link state routing algorithm in the normal IPCP. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove protocol buffers from shim-udpSander Vrijders2017-12-043-104/+69
| | | | | | | | This will remove google protocol buffers from the shim-udp. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* ipcpd: Remove protocol buffers from shim-eth-llcSander Vrijders2017-12-043-122/+99
| | | | | | | | This will remove google protocol buffers from the shim-eth-llc. It now uses packed structs, as supported by the compilers of choice. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
* lib, tools: Rename application process and instanceDimitri Staessens2017-12-0210-36/+35
| | | | | | | | | | | 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>
* ipcpd: Don't read commands under lockDimitri Staessens2017-11-301-3/+3
| | | | | | | | | The commands were read under a mutex. Since the cmd struct was just malloc'd, this is not needed. Also fixes closing the socket if the malloc fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Remove unnecessary linker directivesDimitri Staessens2017-11-292-3/+3
| | | | | | | The ouroboros-dev library links against ouroboros-common. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Don't bind from the IPCPDimitri Staessens2017-11-292-11/+1
| | | | | | | | | | The binding of the normal IPCP to its name is moved from the source code to the irm tool introducing the "autobind" option for the bootstrap and enroll commands. With this option, the IPCP will be bound to the IPCP name and the DIF name automatically. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Only update DHT buckets in running stateDimitri Staessens2017-11-281-1/+2
| | | | | | | This fixes accessing buckets when a DHT join fails. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Unset SHIM_ETH_LLC_TARGETDimitri Staessens2017-11-191-0/+1
| | | | | | | | This fixes the IRMd thinking a shim-eth-llc is available after it is disabled by configuring Ouroboros using ccmake. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* build: Define HAVE_LIBGCRYPT for IPCPsDimitri Staessens2017-11-181-0/+2
| | | | | | | | The HAVE_LIBGCRYPT variable was not defined for IPCPs, causing them to call the gcrypt functions with the wrong values for the enum. 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-182-2/+9
| | | | | | | | 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>
* ipcpd: Add return statement in eth-llc loopDimitri Staessens2017-11-151-0/+2
| | | | | | | | Some compiler versions complained about a missing return in non-void function. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Reset *dist on graph_routing_table failDimitri Staessens2017-11-151-0/+1
| | | | | | | | | | The *dist pointer was not reset on failure, causing the caller to try to free an unmalloced or already freed pointer. Reported-by: Nick Aerts <nick.aerts@ugent.be> Tested-by: Nick Aerts <nick.aerts@ugent.be> 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-144-8/+8
| | | | | | | | | 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>
* ipcpd: Fix unused label with netmap for LLC shimDimitri Staessens2017-11-101-1/+3
| | | | | | | | When the netmap driver is used for the LLC shim, the label fail_device: was never used, resulting in a compiler error. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: List adjacencies in link-state databaseDimitri Staessens2017-11-071-4/+27
| | | | | | | The lsdb will now list management and data transfer adjacencies. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* ipcpd: Create new SDUs for DHT join retriesDimitri Staessens2017-11-071-15/+15
| | | | | | | | | | The DHT join operation left an SDU in the rdrbuff for a couple of seconds during retries, which may cause the system to block if there is heavy traffic. This patch releases the sdb when the write fails and creates a new packet for every retry. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
* lib: Deprecate ouroboros_init and ourboros_finidimitri staessens2017-10-1413-33/+16
| | | | | | | | | | | | | | 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.
* ipcpd: Fix unreachable code in shim-eth-llcdimitri staessens2017-10-111-1/+9
| | | | | Closing the file descriptor after a while(true) loop led to clang compiler errors. This is fixed by adding a cleanup handler.
* ipcpd: Handle cancellation while writing LSAsdimitri staessens2017-10-071-1/+4
| | | | | | | | | | This adds a cleanup handler to ensure the lock is released in the event that the thread is cancelled during a write. An alternative solution could be to make the flow write in a non-blocking way (only the blocking write contains an execution path that has a cancellation point). Fixes #55
* lib: Cancel tpm threads instead of marking exitdimitri staessens2017-09-302-78/+94
| | | | | | | | | This makes the threadpool use pthread_cancel instead of setting an exit flag that threadpool managed threads check periodically. This drastically reduces CPU consumption in the irmd when running a lot of applications. It requires cancellation handlers in the ipcp and irmd to be implemented to ensure safe cancellation during operation and shutdown.
* ipcpd: normal: React to flow events in link state policySander Vrijders2017-09-293-4/+56
| | | | | | This will let the link state policy react to flow up and down events by notifying the PFFs of the routing instances of this event so they can take an appropriate action.
* ipcpd: normal: Add Loop-Free Alternates routingSander Vrijders2017-09-296-32/+199
| | | | | | 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.
* Merged in sandervrijders/ouroboros/be-routing (pull request #617)Sander Vrijders2017-09-264-189/+288
|\ | | | | | | Be routing
| * ipcpd: normal: Add refcount to graph edgesSander Vrijders2017-09-263-22/+53
| | | | | | | | | | This adds a refcount to the graph edges so that it is only included in the calculation if both sides announced it.