dtn7 / dtn7-gold

Delay-tolerant networking software suite, Bundle Protocol Version 7 (deprecated)
https://dtn7.github.io/
Other
78 stars 14 forks source link

Nothing is returned on REST fetch call #21

Closed Koshroy closed 4 years ago

Koshroy commented 4 years ago
kroy@2465-kroy ~/s/dtn7-go> curl -vd '{"Destination":"dtn:host","Payload":"aGVsbG8gd29ybGQK"}' http://localhost:8080/send/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /send/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 55
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 55 out of 55 bytes
< HTTP/1.1 200 OK
< Date: Thu, 17 Oct 2019 04:43:31 GMT
< Content-Length: 12
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host localhost left intact
{"Error":""}⏎
kroy@2465-kroy ~/s/dtn7-go> curl -v http://localhost:8080/fetch/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /fetch/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 17 Oct 2019 04:32:58 GMT
< Content-Length: 2
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host localhost left intact
[]⏎

configuration.toml:

[core]
store = "store"
inspect-all-bundles = true
node-id = "dtn://alpha/"

[logging]
level = "info"
report-caller = false
format = "text"

[discovery]
ipv4 = true
ipv6 = true
interval = 30

[simple-rest]
node = "dtn://alpha/"
listen = "127.0.0.1:8080"

[[listen]]
protocol = "tcpcl"
endpoint = ":4556"

[routing]
algorithm = "epidemic"

[routing.sprayconf]
multiplicity = 10

[routing.dtlsrconf]
recomputetime = "30s"
broadcasttime = "30s"
purgetime = "10m"

[routing.prophetconf]
pinit = 0.75
beta = 0.25
gamma = 0.98
ageinterval = "1m"
oxzi commented 4 years ago

Many thanks for trying dtn7.

I'm not completely sure what you wanted to try. You have configured one node with the provided configuration.toml and dispatched a new bundle addressed to dtn:hostto your node. When retrieving nodes from this specific node, nothing was returned. Am I right?

If this is the case, this is expected behavior. You configured your node's Node ID as dtn://alpha/ but addressed the new bundle to dtn:host. Try changing the recipient to dtn://alpha/.

Does that answer help you any?

Koshroy commented 4 years ago

Thanks so much, that was a bit silly on my end. I'm wondering if the BPv7 spec mandates the trailing slash at the end of the Node ID. Also, given that this issue is resolved, feel free to close it with/out a response.

oxzi commented 4 years ago

No problem, I'm glad it's working.

The BP7 Endpoint ID chapter says that "each endpoint ID (EID) is a Uniform Resource Identifier". So if I take a look at the specification, I would say that this is not the case. Likewise, these exemplary URIs show that it does not have to be. However, as previously discussed in #2, the stripping of the trailing slashes for each Endpoint ID in a Primary Block could save up to 3 bytes.