heiher / natmap

TCP/UDP port mapping for full cone NAT
MIT License
1.28k stars 95 forks source link

My opinion on “IP4P address” #9

Open ysc3839 opened 1 year ago

ysc3839 commented 1 year ago
  1. It should not use public internet address space 2001::/32. It's better to use private address space, for example: fc00::/7.
  2. It should contain some “magic numbers”. For example SLAAC address has FF:FE in it: https://en.wikipedia.org/wiki/IPv6_address#Stateless_address_autoconfiguration

I suggest using DNS SRV record to store port info. It's a internet standard and is more likely to be accepted by client apps. But it requires more code on the client side, and some DNS providers may not support SRV record. https://en.wikipedia.org/wiki/SRV_record https://www.cloudflare.com/learning/dns/dns-records/dns-srv-record/

heiher commented 1 year ago

Thanks for your suggestions.

  1. It should not use public internet address space 2001::/32. It's better to use private address space, for example: fc00::/7.

Yeah. The IP4P address is changed from using private address, because the RFC1918(enabled by default on openwrt) will drop dns response that contains private addresses.

2. It should contain some “magic numbers”. For example SLAAC address has `FF:FE` in it: https://en.wikipedia.org/wiki/IPv6_address#Stateless_address_autoconfiguration

I think magic number is better for human-readable or as a characteristic distinguishing the different services.

I suggest using DNS SRV record to store port info. It's a internet standard and is more likely to be accepted by client apps. But it requires more code on the client side, and some DNS providers may not support SRV record. https://en.wikipedia.org/wiki/SRV_record https://www.cloudflare.com/learning/dns/dns-records/dns-srv-record/

Sure.

IP4P uses Teredo tunneling addresses primarily for availability, and the user does not using Teredo tunnel at same time. I think IP4P is a reference implementation for specical-case, It is almost impossible to standardize. By the way, We can choose the encoding method we like, not limited to IP4P of natmap.

If there is a way that actually works better, let's improve it together.