> SetuptoolsDeprecationWarning: `project.license` as a TOML table is
> deprecated
> Please use a simple string containing a SPDX expression for
> `project.license`. You can also use `project.license-files`.
> (Both options available on setuptools>=77.0.0).
> See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
> for details.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
This can be used for debugging the FIB and as example for developing
tools dealing with FIB changes.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
With BDM auth, the AAP2 client can specify the source EID as well. This
implements corresponding logic for the aap2-send and aap2-receive utilities.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We want to be permissive concerning client code and alernative client
implementations. Thus, we re-license these parts under Apache 2.0 and
BSD licenses.
Note: D3TN has all rights to publish the relevant code under an
arbitrary license, thus, this change does not conflict with the previous
licensing scheme.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
The Python package README files were outdated. They now list the correct
installation commands and aside from that refer to the upstream docs.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
The format is more modern and supports characters in the configuration
commands (e.g., as part of EIDs), which were previously forbidden.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
`assert` is only for debugging purposes and will not be executed if `-O`
is turned on.
This was partially implemented using AI, but heavily refactored.
Prompts:
- > One can disable the assert statement by passing -O to the Python interpreter. However, this leads to the statements inside the assert not being executed. Some scripts in the µD3TN codebase perform important actions in that context. We should check and, if necessary, refactor relevant uses of assert such that they only check for bugs. In places where an assert currently checks for issues with e.g. input data (things that can occur at runtime but are no bug in our Python code), regular exceptions should be used instead.
- (on one occasion) > This does not depend on input data. It would be a bug if the assertion is not true. Thus, it can be kept here.
Afterwards, the formatting was adjusted manually and the introduced
exceptions in the AAP2 tools were replaced by a log message plus
`sys.exit(1)` manually.
See: #221
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
- Use format strings
- Use enum field instead of magic number
- Cast to enum type
- Add type annotations to parse functions
- Improve docstrings mentioning Set types where function accepts Iterable
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This enables AAP 2.0 clients to receive status reports with a new ADU
flag (as we already deliver BIBE bundles). Moreover, it allows clients
to set a report-to EID and sets all of the status report flags on newly
created bundles in case a report-to EID is provided.
Closes: #241
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This introduces a JSON contact configuration format for the
deterministic first-contact forwarding (DFCF) implementation as a modern
alternative to our homebrewn configuration messages. For now, it is only
supported in the external DFCF BDM, but integration into the "router
agent" is planned.
Example JSON configuration string (from our tests):
```
{
"command": "ADD",
"node_id": "dtn://ud3tn2.dtn/",
"cla_addr": "mtcp:127.0.0.1:4223",
"reachable_eids": [
"ipn:1.0"
],
"contact_list": [
{
"start": 1401519306972,
"end": 1401519316972,
"data_rate": 2400,
"reachable_eids": [
"dtn://66553/",
"dtn://89326/"
]
},
{
"start": 1401519506972,
"end": 1401519516972,
"data_rate": 1200,
"reachable_eids": [
"dtn://12349/",
"dtn://89326/"
]
}
]
}
```
Closes: #15
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We implicitly expected all incoming config message data structures to
contain a list of contacts as well as a list of reachable EIDs in both the
config message and each contact in the contact list itself. This may not
always be the case if the config command does not contain such fields.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Previously, we were relying on a race condition for re-scheduling: if a
suitable contact is ongoing, even if it is in the process of being
dropped, it will be considered for re-scheduling a bundle.
This explicitly ignores the contact being dropped.
Due to the increased complexity, `_calc_bundle_schedule` is refactored
slightly.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
When we update an existing contact, e.g, to change the set of reachable
EIDs, we delete the previous entry, cancel the task, and add a new
entry. For this to work, we must wait for the task to terminate after
cancellation.
Additionally, we relax the check for which contacts to update to include
contacts that compare equal, which might be the case if only the
"reachable EIDs" list is different.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This would result in conflicts. We previously used an assertion to
ensure it, however, this could be triggered by external config commands
and crashed the BDM.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
If the link cannot be established, we need a timeout to remove the
contact from the active contacts set.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This re-impplements the QUERY command through our configuration
interface so we can get the contact plan back out of the BDM.
aap2_config.py is extended such that it allows for querying and deleting
contacts.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
As this can also be used for the built-in routing agent, we provide the
functionality in the shared Python module.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Regenerates the Python protobuf bindings with the updated `protoc`.
```sh
make aap2-proto-headers
make storage-agent-proto-headers
```
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
As Python 3.8 is end-of-life and the latest python-protobuf package
requires at least Python 3.9, the minimum Python version is set to 3.9.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
As discussed in !214 we add a validation based on `argparse` so the user
receives a nice error message when trying to pass an empty string to an
argument for which this is not valid.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Since the updated nixpkgs contains a new python.protobuf package version
(4.25.3 -> 5.28.3), the language bindings are regenerated.
See: https://gitlab.com/d3tn/ud3tn/-/issues/200
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
setuptools >= v62.5 supports dynamic dependencies, which allow to read
dependencies from a file. This prevents dependencies from being repeated
twice.
Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
The defaults for the AAP and AAP 2.0 TCP ports were the same. Thus, if
we specify a TCP host for both, µD3TN will terminate on startup as the
port is already in use by one agent but it tries to bind to it with
both.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This performs the following actions:
- change overall documentation tree to adjust to existing material
- add CSS for improved visuals
- add folders to improve structure
- move the README of the Contact Plan Reader to the doc folder and integrate it into the documentation
- add file for 'Home' to provide a starting point for the documentation
Signed-off-by: Fiona Fuchs <fiona.fuchs@d3tn.com>
When connecting to µD3TN with the client behind a NAT gateway, the connection
may be dropped silently after a while if no data is flowing from µD3TN to the
AAP 2.0 subscriber (i.e., if no bundles are received for a while). µD3TN
allows us to set a keepalive interval to prevent this, which was however
only exposed by aap2-receive and aap2-ping previously. As the BDMs may
also hold long-living receiving connections, this capability is added to
them as well.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This was confusing users. We are adding a detailed explanation in the
man page and informing in the help text that the parameter refers to the
administrative endpoint of uD3TN.
Fixes: #213
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
If the bundle must not be fragmented and, thus, `min_frag_size_first`
equals `serialized_size` and `min_frag_size_last` equals zero, we must
not treat `min_frag_size_first` as header size and add it to the
remaining payload size in the calculation of the total serialized size
in the BDM.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>