cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

Could relays resolve names when adding faces? #219

Open Wojtek242 opened 6 years ago

Wojtek242 commented 6 years ago

I am trying to get ccn-lite working in docker containers and I am using docker-compose to network them at the moment. One convenient thing about docker-compose is that it allows the containers to access each other via their container names instead of an IP address. The way it works is that DNS requests for names that match container names will get correctly resolved by the network setup by docker-compose.

I noticed that this name resolution did not happen when adding a face to a relay. Would it make sense to add this capability?

This way I could set up a docker-compose file with nodeA, nodeB, nodeC, ... and add faces using their names rather than IP addresses.

mfrey commented 6 years ago

I noticed that this name resolution did not happen when adding a face to a relay. Would it make sense to add this capability?

Short answer: It might make sense, depending on the use case (e.g. it eases your docker setup) and the implications for the face generation process.

Slightly longer answer: A face is not necessarily a network interface. It could be a IPC channel to an application (pipes, shared memory, etc.) , it could be an interface directly to hardware (IEEE 802.15.4 radio, bluetooth adapter, etc.) or an inter-node channel (such as tunnels, etc.) or even something completely else. But maybe, I'm missing the point?

blacksheeep commented 6 years ago

But I think for udp sockets that should be possible?

mfrey commented 6 years ago

But I think for udp sockets that should be possible?

Absolutely, but do you really need it (except for something like docker)?

blacksheeep commented 6 years ago

I think for IP sockets, it should be possible to add a DNS lookup without affecting the others or changing a lot of code. So if somebody wants to write a patch for that... :-) It should even be possible to do the name lookup on the client side (in the control utility).

Wojtek242 commented 6 years ago

I guess this and the previous issue I raised could both be solved by using UDP sockets, but admittedly it does confine you to the IP/UDP stack. Perhaps this could be an option, but I understand the reasons now