Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,48 @@ binaries:
First you need to build the libraries, the modules and the applications:

```
$ ./gradlew build && ./gradlew distTar
./gradlew build && ./gradlew distTar
```

To run terra, which is the full-DTN daemon, go to the newly created build folder and run Terra by calling the terra script generated by gradle:

```
$ cd linux/terra/build/distribution/
$ tar xvf terra.tar
$ ./terra/bin/terra -h
cd linux/terra/build/distribution/
tar xvf terra.tar
./terra/bin/terra -h
```

By default terra runs no module and is pretty useless without convergence layer nor application agent. The directory to find the modules can be provided
from the command line so we will first create ad-hoc directories to the module that we just compiled:

```
$ ln -s ../../../../modules/core/libdtn-module-http/build/libs/ core-modules
$ ln -s ../../../../modules/cla/libdtn-module-stcp/build/libs/ cla-modules
$ ln -s ../../../../modules/aa/ldcp/libdtn-module-ldcp/build/libs/ aa-modules
ln -s ../../../../modules/core/libdtn-module-http/build/libs/ core-modules
ln -s ../../../../modules/cla/libdtn-module-stcp/build/libs/ cla-modules
ln -s ../../../../modules/aa/ldcp/libdtn-module-ldcp/build/libs/ aa-modules
```

we can then run an instance of Terra like so:

```
$ ./terra/bin/terra -d -n cla-modules -a aa-modules -c core-modules -s VOLATILE
./terra/bin/terra -v --module-cla=cla-modules --module-aa=aa-modules --module-core=core-modules \
--enable-modules=http --enable-modules=ldcp --enable-modules=stcp -d
```

## Using dtncat to register to a sink and listen for bundles:

Now we can use dtncat to register to a sink, send or receive bundle. just like Terra, gradle has generated a build folder and scripts for dtncat:

```
$ cd linux/dtncat/build/distribution
$ tar xvf dtncat.tar
$ ./dtncat/bin/dtncat -h
cd linux/dtncat/build/distribution
tar xvf dtncat.tar
./dtncat/bin/dtncat -h
```

dtncat is a light client and does not run DTN itself, it must connect to a DTN node like Terra to use dtn services. The following command will connect
dtncat to a running instance of Terra, register for a sink and wait for incomming bundles:

```
$ ./dtncat/bin/dtncat 127.0.0.1 4557 -l /test/recv/bundle
./dtncat/bin/dtncat 127.0.0.1 4557 -l /test/recv/bundle
sink registered. cookie: 31cb71b7-783a-4009-9e63-32d25edce9c1

```
Expand All @@ -80,7 +81,7 @@ An application agent (AA) cannot register to a sink that was already registered
For instance, if this process were killed, you could reattach to the registration like so:

```
$ ./dtncat/bin/dtncat 127.0.0.1 4557 -l /test/recv/bundle -c 31cb71b7-783a-4009-9e63-32d25edce9c1
./dtncat/bin/dtncat 127.0.0.1 4557 -l /test/recv/bundle -c 31cb71b7-783a-4009-9e63-32d25edce9c1
re-attach to registered sink

```
Expand All @@ -90,11 +91,11 @@ For instance, if this process were killed, you could reattach to the registratio
In another terminal, we will send a bundle to our listening instance of dtncat

```
$ echo "hello" | ./dtncat/bin/dtncat 127.0.0.1 4557 -D api:me/test/recv/bundle
echo "hello" | ./dtncat/bin/dtncat 127.0.0.1 4557 -D api:me/test/recv/bundle
bundle successfully sent to 127.0.0.1:4557
```

the -D options will set the destination EID for the bundle that wraps around standard input (in this case "hello). api:me is a special EID
the -D options will set the destination EID for the bundle that wraps around standard input (in this case "hello). *api:me* is a special EID
that identifies the node on which the application-agent is registering to.

If another instance of dtncat was running and actively listening for /test/recv/bundle, the bundle will be automatically delivered to it
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ public void initComponent(ConfigurationApi conf, ConfigurationApi.CoreEntry entr
storagePaths.stream()
.filter(p -> !updated_paths.contains(p))
.map(pathsToRemove::add)
.count();
pathsToRemove.stream().map(this::removePath).count();
.count();
pathsToRemove.forEach(x -> this.removePath(x));

/* add new path */
LinkedList<String> pathsToAdd = new LinkedList<>();
updated_paths.stream()
.filter(p -> !storagePaths.contains(p))
.map(pathsToAdd::add)
.count();
pathsToAdd.stream().map(this::addPath).count();
pathsToAdd.stream().forEach( x -> this.addPath(x));
});
}

Expand Down Expand Up @@ -370,13 +370,13 @@ Single<Bundle> store(Bundle bundle) {
File fbundle;
try {
fbundle = createBundleFile(bundle.bid, size.get());
} catch (StorageFullException sfe) {
} catch (StorageFullException sfe) {
if (hasBlob) {
bundle.getPayloadBlock().data = blob;
}
s.onError(new Throwable("storage is full"));
return;
}
}

/* actual serialization of the bundle */
OutputStream out = new BufferedOutputStream(new FileOutputStream(fbundle));
Expand Down
10 changes: 9 additions & 1 deletion modules/core/libdtn-module-http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@ dependencies {

// lib rx netty for http ApiEid
// note: we need to use compile keyword to add in the fatjar, implementation/api doesn't work
compile "io.reactivex:rxnetty-http:${rxnetty_version}"
compile group: 'io.reactivex', name: 'rxnetty-common', version: '0.5.2-rc.2'
compile group: 'io.reactivex', name: 'rxnetty-http', version: '0.5.2-rc.2'

compile "tv.cntt:jauter:${jauter_version}"
// // https://mvnrepository.com/artifact/io.reactivex/rxjava
compile group: 'io.reactivex', name: 'rxjava', version: '1.3.8'

// https://mvnrepository.com/artifact/io.netty/netty-all
compile group: 'io.netty', name: 'netty-all', version: '4.1.48.Final'


}

Expand Down
1 change: 1 addition & 0 deletions modules/core/libdtn-module-http/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rxnetty_version=0.5.2-rc.2
jauter_version=1.7
ionetty_version=4.1.48.Final