[Ndn-lib] PyNDN UdpTransport: specify local port

Thompson, Jeff jefft0 at remap.ucla.edu
Tue Apr 24 11:08:13 PDT 2018

Hi Junxiao,

This sounds reasonable. I opened a Redmine issue.

I’ll implement it in a Git branch and use the Redmine issue to ask you to test it.

- Jeff T

From: Ndn-lib <ndn-lib-bounces at lists.cs.ucla.edu<mailto:ndn-lib-bounces at lists.cs.ucla.edu>> on behalf of Junxiao Shi <shijunxiao at email.arizona.edu<mailto:shijunxiao at email.arizona.edu>>
Date: Saturday, April 21, 2018 at 15:38:00
To: NDN Lib <ndn-lib at lists.cs.ucla.edu<mailto:ndn-lib at lists.cs.ucla.edu>>
Subject: [Ndn-lib] PyNDN UdpTransport: specify local port

Dear folks

I have a suggestion for PyNDN's UdpTransport: the application should be allowed to specify a local port number.

Use case: UdpTransport is typically used when the host running PyNDN application does not have a forwarder. In order for the application to serve content, it must register a prefix to receive Interests. Although the application could send a prefix registration command to the remote forwarder, it's not trivial to configure the keychain, and the application would also need to periodically refresh the prefix registration. On the other hand, when the operator has control over the remote forwarder as well, it is much more convenient to setup a route on the forwarder toward the application. However, this is possible only if the application's IP address and port number are known.

Suggested API:

1. In UdpTransport.ConnectionInfo class constructor, add a named parameter 'localPort'. Its default value is None.
2. In UdpTransport.connect method, if localPort is not None, call self._socket.bind(("", localPort)).
3. In case bind fails, raise an exception and let the caller handle it.

Yours, Junxiao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-lib/attachments/20180424/05bc9549/attachment.html>

More information about the Ndn-lib mailing list