Commit eb57d79a authored by Juraj Sloboda's avatar Juraj Sloboda Committed by Matej Feder

Update README.md and related files

parent 41334de3
# Install docker
sudo apt install docker.io docker-compose
# Add user to docker group
usermod -a -G docker $USER
# Logout and login for group change above to take effect
groups | grep docker
pydtn adm cdrom sudo dip plugdev lpadmin sambashare docker
# Start topology
docker-compose up --build
# See pyDTN-1 logs
docker logs -f docker_pyDTN-1_1
# See pyDTN-2 logs
docker logs -f docker_pyDTN-2_1
# See uPCN-1 logs
docker logs -f docker_uPCN-1_1
# Send bundle
# Alternatively, you can use Postman and import docker/REST/pyDTN.postman_collection.json
cd tools/send_bundle/
./send.sh
# List running containers including commands running inside
docker-compose top
# Restart a container
docker-compose restart pyDTN-1
# Cleanup
docker-compose down
docker container prune -f
docker image prune -a -f
# docker-compose up console
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: Connection on TCPCL level established 'dtn://pyDTN-2.dtn' [components/cla/src/posix/TCPCL/cla.c:187]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: Couldn't find matching contact in existing gs list! (-1) [components/cla/src/posix/TCPCL/cla.c:74]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: Will create opportunistic contact rx task! (-1) [components/cla/src/posix/TCPCL/cla.c:75]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: contact_rx_task: Started up opportunistic (-1) [components/cla/src/posix/TCPCL/cla_contact_rx_task.c:417]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: The peer has disconnected gracefully! (-1) [components/cla/src/posix/TCPCL/cla_io.c:308]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: Payload size is 69 [components/upcn/src/bundleProcessor.c:362]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: Received local bundle! (-1) [components/upcn/src/bundleProcessor.c:377]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: configAgentTask: got routing command! (-1) [components/agents/src/config_agent.c:70]
uPCN-1_1 | [Wed Mar 21 14:41:43 2018]: RouterTask: Command processed successfully (49) [components/upcn/src/routerTask.c:135]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: ContactManager: Scheduled contact added (1184879392) [components/upcn/src/contactManager.c:226]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: contact_rx_task: Started up successfully (-1) [components/cla/src/posix/TCPCL/cla_contact_rx_task.c:419]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: contact_tx_task: Started successfully (1184879936) [components/cla/src/posix/TCPCL/cla_contact_tx_task.c:51]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Connection on TCPCL level established 'dtn://pyDTN-1.dtn' [components/cla/src/posix/TCPCL/cla.c:187]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Couldn't find matching contact in existing gs list! (-1) [components/cla/src/posix/TCPCL/cla.c:74]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Will create opportunistic contact rx task! (-1) [components/cla/src/posix/TCPCL/cla.c:75]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: contact_rx_task: Started up opportunistic (-1) [components/cla/src/posix/TCPCL/cla_contact_rx_task.c:417]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: RouterTask: Processed bundle successfully (2) [components/upcn/src/routerTask.c:183]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: The peer has disconnected gracefully! (-1) [components/cla/src/posix/TCPCL/cla_io.c:308]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Got dtn! magic! (-1) [components/cla/src/posix/TCPCL/cla_management.c:196]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Received EID is dtn://node2.dtn [components/cla/src/posix/TCPCL/cla_management.c:220]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Scheduled contact established on TCPCL level! (-1) [components/cla/src/posix/TCPCL/cla_management.c:222]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: Sending bundle with SN (0) [components/cla/src/posix/TCPCL/cla_contact_tx_task.c:88]
uPCN-1_1 | [Wed Mar 21 14:41:48 2018]: RouterTask: Sent bundle successfully (2) [components/upcn/src/routerTask.c:220]
uPCN-1_1 | [Wed Mar 21 14:42:03 2018]: ContactManager: Contact removed (1184879392) [components/upcn/src/contactManager.c:238]
uPCN-1_1 | [Wed Mar 21 14:42:03 2018]: Set contact pair to opportunistic! (-1) [components/cla/src/posix/TCPCL/cla_management.c:63]
uPCN-1_1 | [Wed Mar 21 14:42:03 2018]: RouterTask: Contact removed from table (1184879392) [components/upcn/src/routerTask.c:201]
# pyDTN-1 console
172.25.1.1 - - [21/Mar/2018 13:41:46] "POST /bundle?destination=dtn://pyDTN-2.dtn HTTP/1.1" 200 -
0000 64 74 6E 21 03 00 00 00 11 64 74 6E 3A 2F 2F 70 dtn!.....dtn://p
0016 79 44 54 4E 2D 31 2E 64 74 6E yDTN-1.dtn
Going to send contact header of length 26
bytearray(b'dtn!\x03\x00\x00\x00\x11dtn://pyDTN-1.dtn')
Message arrived, length 28
0000 64 74 6E 21 03 00 00 00 13 64 74 6E 3A 2F 2F 6F dtn!.....dtn://o
0016 70 73 2D 73 61 74 2E 64 74 6E 00 00 ps-sat.dtn..
# pyDTN-2 console
Received payload block: @
@
@
@
`@` @: `@ @ '@@@@@, @@ @@# @ @@ :@@#
+@ @@ @; @' #@ @@, '@# @@@+, @ @@ ,@,.@@
@@ #@ ;@ @@ @`#@ @: @@: @ @@ @;
@;`@` @` #@@, ;@ @` .@@# ;@ @@ @ `@# @#
,@@+ #@ @.#@ @::@ :@ #@ @ @@ @:@' `@+
@@ #@@@@@ @ ;@ @ `@ +@'+ ::` @ @.@@ @@; `@@,
;@@@ @# @; @@ @# '@@ @':. .;@`@@ @,@' ;@+
@, @, `@.@ @ @ `@#.#,` +,@ @@ @ `@# `@
@@ ;@ @@# @@@ @'@@@@@@`@@ @@ @ @@ @
#@ @@ ;@ .@ `@: ,'@.@ @@ @ @@ @` #@
.@ @+ @ @ .@`:.`:. @@ @ @@ #@@@@
@@+:` `
@@+,
@@
# Overview
This is the PoC (Proof of Concept) implementation of:
* [Bundle Protocol Version 7](https://tools.ietf.org/html/draft-ietf-dtn-bpbis-12)
* [Bundle Protocol Version 7](https://tools.ietf.org/html/draft-ietf-dtn-bpbis-13)
* Send/receive a bundle
* Register EIDs
* Schedule contacts
* Bundle routing
* Send bundle functionality is available via `REST` API, useful for testing
* Schedule contact functionality is available via `REST` API, useful for integration with [µPCN](https://upcn.eu/)
* Scheduling contacts for uPCN nodes is available via `REST` API, useful for integration with [uPCN](https://upcn.eu/)
* [Delay-Tolerant Networking TCP Convergence-Layer Protocol](https://tools.ietf.org/html/rfc7242)
* Send/receive contact headers
* [DTN IP Neighbor Discovery (IPND)](https://tools.ietf.org/html/draft-irtf-dtnrg-ipnd-03)
* Send/receive a beacon, code exists, integration in progress, see %2 milestone
* Send/receive a beacon, code exists, integration halted, since uPCN team decided not to support it
# Repository structure
```
/pydtn - Python library implementing DTN protocols
/pydtn_rest - Python library implementing REST API wrapping pydtn library API
/doc - Project documentation
/demo_app - Python demo application (imports pydtn_rest library)
/tools - Currently contains scripts and data files used for the demo
/docker - Containers for the demo
```
# Installation
#### pydtn library
```
pip3 install pydtn/
```
#### pydtn_rest library
```
pip3 install pydtn_rest/
```
# Documentation
# Use Case
![current_state](doc/readme/current_state.png)
#### Install requirements
```
pip3 install sphinx sphinx_rtd_theme
```
#### pydtn library
```
make -C pydtn/docs html
```
output:
pydtn/docs/_build/html/index.html
1. `pyDTN-2` receives `REST` request to schedule contact: `//pyDTN-2.dtn` is available on `172.25.2.11:2002`
1. `pyDTN-2` schedules contact with `uPCN`, note following issues:
* Proprietary (not part of any draft) `uPCN` config bundle is used
* `pyDTN-2` receives `uPCN`'s IP address/port on a [command line](docker/docker-compose.yml#L39)
1. `pyDTN-1` receives `REST` request to send a bundle to `pyDTN-2`
1. `pyDTN-1` sends bundle to `uPCN`, note following issues:
* `pyDTN-1` receives `uPCN`'s IP address/port on a [command line](docker/docker-compose.yml#L20)
* IP address/port is then set (kind of hard-coded) in [ipnd/httpd.py](src/httpd/httpd.py#L42)
1. `uPCN` receives a bundle from `pyDTN-1` and immediately forwards it to `pyDTN-2`, note following issues:
* `uPCN` currently does not store any bundles, if destination is not available, bundle is simply dropped
#### pydtn_rest library
```
make -C pydtn_rest/docs html
```
output:
pydtn_rest/docs/_build/html/index.html
Issues listed above will be solved as a part of %2 milestone.
# Try it yourself
See [DEMO_HOWTO.txt](DEMO_HOWTO.txt) (eventually will be integrated into this file)
# Demonstration
* [Communication with uPCN](UPCN_DEMO.md)
This diff is collapsed.
doc/readme/current_state.png

454 KB | W: | H:

doc/readme/current_state.png

338 KB | W: | H:

doc/readme/current_state.png
doc/readme/current_state.png
doc/readme/current_state.png
doc/readme/current_state.png
  • 2-up
  • Swipe
  • Onion skin
<mxfile modified="2019-03-24T15:41:00.922Z" host="www.draw.io" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/73.0.3683.75 Chrome/73.0.3683.75 Safari/537.36" etag="974iRFzm_IsnAKCbOAYh" version="10.5.4" type="device"><diagram name="Page-1" id="43d2112b-42d4-6ef0-ef21-dd1f29dee117">7Zpbc+I2FMc/DTPtA4wuli+PAZK03XQnM9mZ7j7tGCyMGmO5tkggn76SLWEbYy4pSbxdMpNEOrrY6Pz8PwdZPTxarG5TP5n/yQMa9RAIVj087iFkA9eV/5RlXVggggAUpjBlgTaWhgf2QrXRdFuygGa1joLzSLCkbpzyOKZTUbP5acqf691mPKpfNfFD2jA8TP2oaf2LBWJeWC1gPoZq+I2ycK4vbRHTMvGnj2HKl7G+YA/hWf5TNC98M5nun839gD9XTPi6h0cp56IoLVYjGqnlNetWjLtpad3ceEpjccwAR/vqyY+W1NyyHcmxw4A9yWKoisY0SbctcuZav/wzibVZSEFXyj4Xi0gaoCymNGMv/iTvAGTdXwqeFQCoZj9iYSzLEZ2pgU80FUz65UqbBU+kNUv8KYvDL6oy7lvSknAWi9zpZNgjY2mZ8VhosDDZ3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tq7gQ2Zcx3gdUzm2regO8GcdWHuJJmDLt6KrI5nd0vmbNh01EcdDjv6xWiX9ljI0UfDzPZ/V96L2ugjXQ9/JtebUy5dcT3Z9SZqiwW2yM9DV32Xy+xwc5i5skmjjzPjoR41ZotQ3lrEJvLvVAr/dz8VqsgXyVJKcybLd34iePIdInclfwdJHPYa+0Tq5+bmqBhwDsEmHtjOEjxw6B2PhXBTsvErJFtWyzPexU5keZYeX/8L</diagram></mxfile>
\ No newline at end of file
<mxfile modified="2019-09-08T15:22:06.814Z" host="www.draw.io" agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0" etag="64BKceM-uzHjfMBL6WNH" version="11.2.8" type="device" pages="1"><diagram name="Page-1" id="43d2112b-42d4-6ef0-ef21-dd1f29dee117">7Zpbc+I2FMc/DTPtA4wuli+PAZK03XQnM9mZ7j7tGCyMGmO5tkggn76SLWEbYy4pSbxdMpNEOrrY6Pz8PwdZPTxarG5TP5n/yQMa9RAIVj087iEECbblP2VZFxbPcbQlTFmge5WGB/ZCtRFo65IFNKt1FJxHgiV145THMZ2Kms1PU/5c7zbjUf2qiR/ShuFh6kdN618sEPPCagEAyobfKAvn+tIWMS0Tf/oYpnwZ6wv2EJ7lP0XzwjeT6f7Z3A/4c8WEr3t4lHIuitJiNaKRWl2zbsW4m5bWzY2nNBbHDHDcYsSTHy2puWU7kmOHAXuSxVAVjWmSblvkzLV++WcSa7OQgq6UfS4WkTRAWUxpxl78Sd4ByLq/FDwrAFDNfsTCWJYjOlMDn2gqmPTLlTYLnkhrlvhTFodfVGXct6Ql4SwWudPJsEfG0jLjsdBgYbK5terC6LVSl6Crikkv1C3lCyrStexiWoGnMdZc913iegPHdTzguY5FLK9ofi6ZMX6eV2nRNl9TGm6uVDpKFrSvdvvt9o/Q/t1+9Kaz0fVL8vRpfR9+6kOLNDxAA0m2rvJUzHnIYz+6Lq3DnFYaaH+Ufe54vr7KK39TIdZ6NZXD6i6lK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WU5kyW7/xE8OQ7RO5K/g6SOOw19onUz83NUTHgHIJNPLCdJXjg0DseC+GmZONXSLaslme8i53I8ig9vv4X</diagram></mxfile>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment