{"id":13702003,"url":"https://github.com/NodleCode/dtn7-kotlin","last_synced_at":"2025-05-05T04:30:41.317Z","repository":{"id":37823893,"uuid":"338552749","full_name":"NodleCode/dtn7-kotlin","owner":"NodleCode","description":"Delay-tolerant networking software suite for Kotlin, Bundle Protocol Version 7","archived":false,"fork":false,"pushed_at":"2022-12-22T12:11:11.000Z","size":7722,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-18T07:15:22.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NodleCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-13T10:50:02.000Z","updated_at":"2025-03-15T22:51:18.000Z","dependencies_parsed_at":"2023-01-30T08:31:31.978Z","dependency_job_id":null,"html_url":"https://github.com/NodleCode/dtn7-kotlin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodleCode%2Fdtn7-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodleCode%2Fdtn7-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodleCode%2Fdtn7-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodleCode%2Fdtn7-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NodleCode","download_url":"https://codeload.github.com/NodleCode/dtn7-kotlin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252439372,"owners_count":21747993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T21:00:29.440Z","updated_at":"2025-05-05T04:30:40.881Z","avatar_url":"https://github.com/NodleCode.png","language":"Kotlin","readme":"# dtn7-kotlin\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\ndtn7-kotlin is a delay-tolerant networking software suite for kotlin, Bundle Protocol Version 7.\nIt is well unit-tested and compatible with the [dtn7-go](https://github.com/dtn7/dtn7-go/) bpv7 suite.\nIt currently supports the following protocols:\n\n* [bpv7](https://datatracker.ietf.org/doc/html/rfc9171) rfc9171\n* [bpsec](https://datatracker.ietf.org/doc/html/rfc9172) rfc9172\n\n\n## bputil Tool\n\n```\n$ bputil --help\nUsage: bputil [-hV] [COMMAND]\n\nbputil is a simple tool to encode and parse bundle\n\nOptions:\n  -h, --help      Show this help message and exit.\n  -V, --version   Print version information and exit.\nCommands:\n  status\n  create\n  show\n  key\n```\n\nExample:\n\n```\n$ echo \"hello world\" | ./bputil create -s \"dtn://source/\" -d \"dtn://destination/\" --crc-32 | ./bputil show\n\nBundle(primaryBlock=PrimaryBlock(version=7, procV7Flags=0, crcType=CRC32, destination=dtn://destination/, source=dtn://source/, reportTo=dtn://report/, creationTimestamp=1613738857441, sequenceNumber=0, lifetime=0, fragmentOffset=0, appDataLength=0), canonicalBlocks=[CanonicalBlock(blockType=1, blockNumber=1, procV7flags=0, crcType=CRC32, data=BlobBlockData(buffer=0x68656c6c6f20776f726c640a))])\n```\n\n### creating bundle key\n\nThis implementation support the [bpsec](https://tools.ietf.org/html/draft-ietf-dtn-bpsec-26) (current version 26). Since there are no specific standard defined yet for actual security context, we currently support only a simple signature block based on Ed25519. bputil allows one to create signing key like this:\n\n```\n$ bputil key create\ned25519 priv=0xc9f07a22dc1f565eb0f1e984e95d773cbf1b46ee8177ba1e51c025918d2225a7  pub=0xd9ae678a046a2fd20f9bd29344e603be4119775264f5d4f82c617e6b76c00dd0\n```\n\nthe private key can be used to sign a bundle with bputil like so:\n\n```\necho \"hello world\" | bputil create --sign 0 --key 0xdb87c297ea39ee8e32f00cf75eb49ad5d959916bb806ac96d86352cfe42ddd5e  | bputil show\n\nBundle(primaryBlock=PrimaryBlock(version=7, procV7Flags=0, crcType=CRC32, destination=dtn://destination/, source=dtn://source/, reportTo=dtn://report/, creationTimestamp=1613739504192, sequenceNumber=0, lifetime=0, fragmentOffset=0, appDataLength=0), canonicalBlocks=[CanonicalBlock(blockType=40, blockNumber=2, procV7flags=0, crcType=NoCRC, data=AbstractSecurityBlockData(securityTargets=[0], securityContext=1, securityBlockV7Flags=1, securitySource=dtn:none, securityContextParameters=[SecurityContextParameter(id=0, result=0x8662ffc4bda05bcf5537ea0db1d6898d1765b64eb5a9f2935b3073018d94dbeb)], securityResults=[[SecurityResult(id=0, result=0x5d5241073f6435d5acaac49d71998e4864862244c994418a118e2a4ac5314c929a92a5d58ec598ec20f4d897b4ee2b1bfc8e4a0e7739caf4a5551ddc360b5b0a)]])), CanonicalBlock(blockType=1, blockNumber=1, procV7flags=0, crcType=CRC32, data=BlobBlockData(buffer=0x68656c6c6f20776f726c640a))])\n```\n\n### creating status report\n\nbputil can also be used to create administration record, only the generation of status report is currently supported. A full bundle can then be created by simply chaining commands.\nFor instance, the following command generate a status report, wrap it in a signed bundle and print it in stdout:\n\n```\n$ bputil status -d 1613607271 -f 1613607275 -s \"dtn://source/\" | bputil create -f 2 --sign 0 --key 0xdb87c297ea39ee8e32f00cf75eb49ad5d959916bb806ac96d86352cfe42ddd5e --age 150 -l 200 | bputil show\n\nBundle(primaryBlock=PrimaryBlock(version=7, procV7Flags=2, crcType=CRC32, destination=dtn://destination/, source=dtn://source/, reportTo=dtn://report/, creationTimestamp=0, sequenceNumber=0, lifetime=200, fragmentOffset=0, appDataLength=0), canonicalBlocks=[CanonicalBlock(blockType=40, blockNumber=3, procV7flags=0, crcType=NoCRC, data=AbstractSecurityBlockData(securityTargets=[0], securityContext=1, securityBlockV7Flags=1, securitySource=dtn:none, securityContextParameters=[SecurityContextParameter(id=0, result=0x8662ffc4bda05bcf5537ea0db1d6898d1765b64eb5a9f2935b3073018d94dbeb)], securityResults=[[SecurityResult(id=0, result=0xc0b88afa05cbac8da18a01d64781b13b46f965120aecfe6c09ff27dea9f1f9b287de4de780c30e19a5a1700afafcdafe2583113b5c1908c1f0465ce1c8080708)]])), CanonicalBlock(blockType=7, blockNumber=2, procV7flags=0, crcType=NoCRC, data=BundleAgeBlockData(age=150)), CanonicalBlock(blockType=1, blockNumber=1, procV7flags=0, crcType=CRC32, data=BlobBlockData(buffer=0x8201868481f482f51a602db16b82f51a602db16781f4008201702f2f7374617475732d736f757263652f000000))])\n```\n\n### compatibility with dtn7-go\n\nWe can combine bputil from this project and dtn-tool from dtn7-go together. For instance we use bputil to produce a signed bundle (with bpsec) and submit it to dtn7-go.\n\n```\n$ echo \"hello world\" | ./bputil create --sign 0 --key 0xdb87c297ea39ee8e32f00cf75eb49ad5d959916bb806ac96d86352cfe42ddd5e --age 150 -l 200 | dtn-tool show -\n\n{\"primaryBlock\":{\"bundleControlFlags\":null,\"destination\":\"dtn://destination/\",\"source\":\"dtn://source/\",\"reportTo\":\"dtn://report/\",\"creationTimestamp\":{\"date\":\"2000-01-01 00:00:00.000\",\"sequenceNo\":0},\"lifetime\":200},\"canonicalBlocks\":[{\"blockNumber\":3,\"blockTypeCode\":40,\"blockType\":\"N/A\",\"blockControlFlags\":null,\"data\":\"WHOGgQABAYIBAIGCAFgghmL/xL2gW89VN+oNsdaJjRdltk61qfKTWzBzAY2U2+uBgYIAWEBl7PG9eWtcuV8reSLUJmzoiJm2udFsH7qBPnSWChyxVlb4SgfMS3QrGrQNCTK4r1UUxvhfnfD34L7gR1UD/I4O\"},{\"blockNumber\":2,\"blockTypeCode\":7,\"blockType\":\"Bundle Age Block\",\"blockControlFlags\":null,\"data\":\"150 ms\"},{\"blockNumber\":1,\"blockTypeCode\":1,\"blockType\":\"Payload Block\",\"blockControlFlags\":null,\"data\":\"aGVsbG8gd29ybGQK\"}]}\n```\n\n## Using the library\n\n### 1. Add the JitPack repository.\n```\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\n### 2. Add the dtn7-kotlin\n\nthe bpv7 library include the data, parsers and serializers. agent contains a simple yet easily extensible implementation of the bundle protocol.\ncla is an empty shell at the moment but aa contain a simple HTTP convergence layer to upload bundles using the request body and receive bundles from the response body.\n\n```\ndependencies {\n    implementation \"com.github.NodleCode.dtn7-kotlin:bpv7:master\"\n    implementation \"com.github.NodleCode.dtn7-kotlin:agent:master\"\n    implementation \"com.github.NodleCode.dtn7-kotlin:aa:master\"\n    implementation \"com.github.NodleCode.dtn7-kotlin:cla:master\"\n}\n\nif you only need the parser, just use the bpv7:master.\n```\n\n## Additional Notes\n\nThis is a work in progress and comes with no warranty.\ncontribution are welcome. If you have any question, ideas or if you found a bug, please open an issue!\n","funding_links":[],"categories":["Bundle Protocol Version 7 - RFC 9171"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodleCode%2Fdtn7-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNodleCode%2Fdtn7-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodleCode%2Fdtn7-kotlin/lists"}