Commit graph

26 commits

Author SHA1 Message Date
Felix Walter
229f884a57 python-ud3tn-utils: Introduce JSON configuration format
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>
2025-06-05 17:03:39 +02:00
Fiona Fuchs
e249cc3006 Add index.md file, change documentation structure, add new elements and images to folders, add CSS
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>
2024-11-15 07:59:32 +01:00
Felix Walter
0b4550f765 cmdline: Rename eid to node-id
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>
2024-09-13 15:18:03 +02:00
Felix Walter
459e1b60ff python: aap: Make behavior of AAP (v1) tools consistent with AAPv2
This adapts the v1 tools to the recent changes in the AAPv2 tools so
they use the same return codes and (error) messages.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-08-09 15:02:19 +02:00
Felix Walter
62afaffac7 python-ud3tn-utils: Inform that contact plan script can still be used
This extends the message printed by aap_contact_plan_reader.py to
explain that it can still be used if we launch µD3TN with the
--allow-remote-config commandline flag.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-07-15 23:42:09 +02:00
Felix Walter
487ae5bf72 python-ud3tn-utils: Remove aap_storage_agent.py
This script is outdated as it does not support the newest approach to
filter bundles and also does not support the authorization required by
the storage agent (the flag is set via AAP 2.0).

aap2_storage_agent.py should be used instead.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-07-15 23:39:59 +02:00
Maximilian Nitsch
9902fd072d python: Use cbor2 instead of the deprecated cbor library
Since the last update of the cbor[^1] library was in 2016 and the
repository no longer even exists, the cbor2[^2] python library is now
used instead.

[^1]: https://pypi.org/project/cbor/
[^2]: https://pypi.org/project/cbor2/

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2024-07-02 17:17:57 +02:00
Maximilian Nitsch
3ba8281796 treewide: Use python-ud3tn-utils scripts instead of those from tools/
Changes all occurrences of the old script paths from tools/ to the
scripts installed by python-ud3tn-utils.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2024-07-01 10:10:56 +02:00
Maximilian Nitsch
fa6d159d10 python-ud3tn-utils: Add AAP + AAP2 tools
- Moves `tools/aap` + `tools/aap2` to `python-ud3tn-utils/aap*/bin/` to
  add the scripts to the python package
- Adds a `main()` function to each script to reference it
- Define `logger` as global variable
- Adds a symbolic link to keep compatibility with existing tooling
- Moves `tools/aap/aap_test.py` to `test/functional/`
- Adds additional dependencies (pyd3tn, cbor) to python-ud3tn-utils and
  the corresponding nix package
- Add scripts to python-ud3tn-utils `pyproject.toml`

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2024-07-01 10:10:56 +02:00
Felix Walter
3d2d50a88f python-ud3tn-utils: Serialize bundle ID instead len() of it
The integer value `bundle_id` does not have a "length" - this seems like
a C&P error.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-06-08 12:56:44 +02:00
Felix Walter
769b1b0abe python-ud3tn-utils: Document functions handling the bundle ID
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-15 11:40:47 +02:00
Felix Walter
b07a653389 AAP: Return bundle creation timestamp and sequence number in bundle ID
See the added description in the AAP documentation - this adds an
internal format to the 64 bit integer value returned as "bundle ID" in
the `SENDCONFIRM` AAP message to uniquely identify the created bundle in
conformance to RFC 9171.

Closes: #60

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-11 17:03:29 +02:00
Felix Walter
22e0ede032 ud3tn_utils: Set log level in AAP client to DEBUG
The AAP client class prints some log messages, but we do not want them
to be printed by default if we turn on INFO logging. This uses
`logger.debug` instead.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-11-11 10:12:47 +01:00
Felix Walter
4002eed29f
Merge branch 'hotfix/93-ipn-eid-printing'
See !66
2022-10-11 18:05:16 +02:00
Felix Walter
d9f67e83fc python_ud3tn_utils: Drop leading zero from ipn service number
Do not simply concatenate the node EID and agent ID in case of `ipn`
EIDs.

Fixes: #93
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-09-19 08:07:42 +02:00
Felix Walter
092e7a7b2f python_ud3tn_utils: Limit auto-generated ipn service nbr to INT32_MAX
See #92 - ION only supports 32 bit service numbers.

Fixes: #92
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-09-19 07:52:21 +02:00
Felix Walter
d41bab7f77 tools: Use getaddrinfo() for establishing TCP connections
This allows us to support IPv6 properly. A slight re-structuring was
necessary as we have to attempt multiple connections with different
sockets one after another. Thus, the socket instance is created in
connect() instead of __init__ and we use abc.ABC to prevent
instantiating the AAPClient without overriding the connect() method.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-05-02 10:19:31 +02:00
Georg Alexander Murzik
298431c68f Insert SPDX license expression comments into our .c, .h, .py, and .sh code
ud3tn is available under multiple licenses and we want to reflect this in
our source code. But which license information should appear first and how
can we manage this efficiently in the future? The Linux Kernel uses SPDX
expressions instead of boilerplate sections. This seems to be a great
approach, so we do the same here.

Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
2022-02-20 16:24:38 +01:00
Felix Walter
37e39104aa Fix EID validation for dtn and ipn according to BPv7 draft 31
-> https://datatracker.ietf.org/doc/html/draft-ietf-dtn-bpbis-31#section-4.2.5

The previous validation methods were not sufficient to check validity of
dtn as well as ipn EIDs. This adds further functions to easily detect
the EID scheme and validate dtn plus ipn EIDs. Tests for the most common
cases where validity checks should be successful and where they might
fail are added as well.

Due to this change the default EID of uD3TN gets a slash appended, as
dtn EIDs always have to contain the name delimiter '/'.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-01-26 21:05:41 +01:00
Felix Walter
449d0bc17c Add proper support for the ipn EID scheme
Previously uD3TN implicitly assumed string EID in many places such as
the agent manager. This adds proper handling for ipn-scheme EIDs,
using numerical service numbers as agent IDs in case uD3TN is started
with an ipn-scheme EID. If the ipn scheme is used, uD3TN always has to
be configured with the service number 0. The config and management agent
IDs can be configured in config.h and are 9000 and 9001, respectively,
to keep the lower range of service numbers free. It is intentional that
agents can register with a service number of zero - uD3TN does not
provide specific functionality under this service number.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2022-01-26 21:05:41 +01:00
Tobias Nöthlich
10028924d6 Refactor Python components
This commit fixes typos and indentation issues and simplifies parts
of the bundle7.py, aap_message.py and aap_receive.py files.

Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
2022-01-26 21:04:02 +01:00
Tobias Nöthlich
60813aa49e Fix python-stylecheck warnings and errors
This commit remedies code smells introduced to pyd3tn and the python
tools while implementing the BIBE CLA.

Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
2021-11-29 13:29:31 +01:00
Tobias Nöthlich
fe5d08f2b0 Add sending/receiving BIBE AAP messages using Python
This commit modifies aap_send.py, aap_receive.py and aap_client.py to
allow for sending SENDBIBE messages using the Python uD3TN utils.

The clear distinction between regular SENDBUNDLE messages and SENDBIBE
messages allows for a rework of the crude check of the message type
performed in aap_receive.py, which is also implemented by this commit.

Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
2021-11-02 10:02:35 +01:00
Tobias Nöthlich
fc8e3bdaff Add SEND/RECVBIBE to aap_client and aap_message.py
To facilitate testing of AAP BIBE reception in uD3TN, this commit adds
the functionality for sending SENDBIBE messages using aap_client.py.

Signed-off-by: Tobias Nöthlich <tobias.noethlich@d3tn.com>
2021-11-02 08:31:53 +01:00
Maximilian Nitsch
24db3a530f tools+utils: Adapt default UNIX socket path
By changing the default UNIX socket path to PWD in !11, the default
parameters for the AAP tools are adapted accordingly.

Closes: #51

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2021-06-02 13:47:25 +02:00
Maximilian Nitsch
45bbccebb6 Prepare PyPi packages
To distribute the pyD3TN DTN protocol implementations as well as the
uD3TN python utilities on PyPi, the Python code is organized in separate
directories and the PyPi packaging guideline is applied. The
restructuring also requires an adjustment of the imports in the scripts
in tools/ and test/.

Signed-off-by: Maximilian Nitsch <maximilian.nitsch@d3tn.com>
2020-11-19 12:38:39 +01:00