[Nfd-dev] YaNFD cannot create TCP face

郝广宇 haoguangyu at chorustek.com
Mon Sep 26 00:05:38 PDT 2022


Hello,
We get the error when create the remote face between yanfd and yanfd, the following is the info about the error.


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


Thanks a lot.


Guangyu Hao 


------------------ Original ------------------
From:  "XINYU MA"<ma.xinyu.26a at kyoto-u.jp>;
Date:  Thu, Sep 22, 2022 04:22 PM
To:  "郝广宇"<haoguangyu at chorustek.com>; 
Cc:  "nfd-dev"<nfd-dev at lists.cs.ucla.edu>; 
Subject:  Re: [Nfd-dev] YaNFD cannot create TCP face

 

Hello,Thank you for reporting this bug.
It should be fixed by https://github.com/named-data/YaNFD/commit/f7767468f3d4540e468bc0bd5a195066eb2a20d4
Best wishes,
Xinyu Ma.




2022年9月21日(水) 3:00 郝广宇 <haoguangyu at chorustek.com>:

I have a YaNFD issue of that failed with "nfdc face create remote tcp4://X.X.X.X:6363", I read the source code that not tcp supported, the following is the code.
No case of tcpURI? 


// Canonize attempts to canonize the URI, if not already canonical.
func (u *URI) Canonize() error {
 switch u.uriType {
 case devURI, fdURI:
  // Nothing to do to canonize these
 case ethernetURI:
  mac, err := net.ParseMAC(strings.Trim(u.path, "[]"))
  if err != nil {
   return core.ErrNotCanonical
  }
  u.scheme = "ether"
  u.path = mac.String()
  u.port = 0
 case udpURI:
  path := u.path
  zone := ""
  if strings.Contains(u.path, "%") {
   // Has zone, so separate out
   path = u.PathHost()
   zone = "%" + u.PathZone()
  }
  ip := net.ParseIP(strings.Trim(path, "[]"))
  if ip == nil {
   // Resolve DNS
   resolvedIPs, err := net.LookupHost(path)
   if err != nil || len(resolvedIPs) == 0 {
    return core.ErrNotCanonical
   }
   ip = net.ParseIP(resolvedIPs[0])
   if ip == nil {
    return core.ErrNotCanonical
   }
  }


  if ip.To4() != nil {
   u.scheme = "udp4"
   u.path = ip.String() + zone
  } else if ip.To16() != nil {
   u.scheme = "udp6"
   u.path = ip.String() + zone
  } else {
   return core.ErrNotCanonical
  }
 case unixURI:
  u.scheme = "unix"
  testPath := "/" + u.path
  if runtime.GOOS == "windows" {
   testPath = u.path
  }
  fileInfo, err := os.Stat(testPath)
  if err != nil && !os.IsNotExist(err) {
   // File couldn't be opened, but not just because it doesn't exist
   return core.ErrNotCanonical
  } else if err == nil && fileInfo.IsDir() {
   // File is a directory
   return core.ErrNotCanonical
  }
  u.port = 0
 default:
  return core.ErrNotCanonical
 }


 return nil
}

 _______________________________________________
 Nfd-dev mailing list
 Nfd-dev at lists.cs.ucla.edu
 https://www.lists.cs.ucla.edu/mailman/listinfo/nfd-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20220926/542dd8a0/attachment.html>


More information about the Nfd-dev mailing list