• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NAT-PMP not honoring requested external port
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NAT-PMP not honoring requested external port


  • Subject: Re: NAT-PMP not honoring requested external port
  • From: james woodyatt <email@hidden>
  • Date: Mon, 9 Jun 2008 12:22:20 -0700

On Jun 9, 2008, at 09:48, Jens Alfke wrote:

I know this is valid behavior according to the spec, but it's a problem for P2P discovery, because it prevents other clients from being able to cache this peer's IP address and reconnect to it later.

AirPort's natpmpd tries to assign the requested public port unless that port is unavailable, in which case it assigns another one that *is* available. Reasons a port might be unavailable include: a) the port is in use by another NAT-PMP client; b) the port is in use by the AirPort itself; and c) the port is mapped manually to a different private address as part of the AirPort configuration.


(Obviously such caching is not going to be 100% reliable anyway, but in practice most home cable/DSL connections seem to keep the same IP address for long periods of time; so if the port number could be kept static too, the caching would work pretty well.)

You're assuming that most residential ISP services will continue with this practice for the foreseeable future. I don't see why you think that's a reasonable assumption (there are good reasons to be skeptical), but we'll leave it on the table for now.


Is there any way around this?

I'm confused... you want a way around what? If you don't want to use the port that AirPort's natpmpd assigns, then don't use it. It would probably be a good idea to return the port if you're not going to use it, but nobody is forcing you to use a port number you didn't request.


What sort of behavior were you expecting in AirPort?

Perhaps I'm using a port number in a range the base station doesn't allow? (I use 60506 by default.)

AirPort's natpmpd permits requests to map the dynamic/private ports. If you're not getting the port you want, then the reason is that it's not available, i.e. it's probably been mapped by something else for another purpose. I would recommend not using the dynamic/private ports, as those are frequently used by AirPort itself for its own purposes.


Ideally, what you would do is request public port zero, and use whatever port natpmpd assigns to you by registering it in a dynamic directory service like, for example, Wide-Area Bonjour. Or you could roll your own. If you're writing a P2P application, the you should be able to just hash the public port and the public IP address into your application address and proceed from there.


-- james woodyatt <email@hidden> member of technical staff, communications engineering


_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NAT-PMP not honoring requested external port
      • From: Jens Alfke <email@hidden>
References: 
 >NAT-PMP not honoring requested external port (From: Jens Alfke <email@hidden>)

  • Prev by Date: NAT-PMP not honoring requested external port
  • Next by Date: NETLINK like APIs to monitor NIC activity
  • Previous by thread: NAT-PMP not honoring requested external port
  • Next by thread: Re: NAT-PMP not honoring requested external port
  • Index(es):
    • Date
    • Thread