named-data / YaNFD

Yet another Named Data Networking Forwarding Daemon
https://pkg.go.dev/github.com/named-data/YaNFD
MIT License
13 stars 10 forks source link

Error that create the remote face with "nfdc face create remote tcp4://X.X.X.X:6363 #43

Closed haowaiwai closed 2 years ago

haowaiwai commented 2 years ago

The reason seems to be the remote YaNFD side. The TCP listener considers the remote URI of the new face as an UDP face (with RemoteURI=udp4://XX:6363, LocalUI=tcp4://XX:6363), and thus it is unable to maintain the connection. I will investigate this problem but I'm not sure when I can fix it. If you are willing to, please open an issue on GitHub.

from the intranet: nfdc face create remote tcp://120.53.13.74:6363 Error 406 when creating face: Transport error

the remote yanfd log: WARN[0481] [FaceMgmt] Unable to create unicast TCP face with URI tcp4://120.53.13.74:6363:Unable to connect to remote endpoint: dial tcp4 :6363->120.53.13.74:6363: bind: address already in use

zjkmxy commented 2 years ago

I have tested between Windows 11 and a Mac OS. Succeeded with python-ndn/example consumer.py and producer.py. Please let me know if the problem has not been solved.

haowaiwai commented 2 years ago

I think the problem has not been fixed, we meet the problem between Linux and Linux server,Failed with nfdc/C++,the command of "nfdc face create remote tcp://x.x.x.x:6363".

Pesa commented 2 years ago

is yanfd setting SO_REUSEADDR on the socket?

zjkmxy commented 2 years ago

is yanfd setting SO_REUSEADDR on the socket?

Yes: https://github.com/named-data/YaNFD/blob/b50074d86d9c224542e7076b162f81ec0b87cb07/face/tcp-listener.go#L47

But I think he is using two machines for test, so this shouldn't be the problem.

zjkmxy commented 2 years ago

The original code tried to specify the local TCP port number in connect(), which causes problem in Linux. Now I removed that argument and tested it on a Ubuntu 22.04 Docker. Should working now.