Network Address Translation Simulator for P2P Software Testing

Is there a network address translation simulator for testing P2P software?

I am currently working on P2P software for devices and run into problems to test my software on other types of NAT types, for example; - Clients behind the same NAT (same Private network), Different NAT (different private networks), in different global networks, different levels of Nat

- Do I need to physically configure the test environment, for example; Hosts behind NAT

OR

- Is there a network address translation simulator for testing P2P software?

+4
source share
1 answer

Virtualization software such as VirtualBox allows you to connect multiple guest virtual machines (virtual machines) through NAT, rather than using direct connections.

the built-in NAT provided by Virtualbox is unrealistically peer-to-friendly , although compared to conventional NAT routers and ISP routers. Virtualbox NAT is apparently a β€œfull cone NAT” that makes NAT traversal (UDP / TCP bumps) unrealistic easy (see this Wikipedia article for an explanation), while many NAT routers are either β€œsymmetric” NAT ", or some form of" bounded NAT cone "based on port and / or address restrictions.

Thus, one way to simulate multiple hosts interacting with realistic NAT is to use virtualization tools such as Virtualbox and combine them together using Linux routing virtual machines that perform routing and NAT using the built-in netfilter functions in the Linux kernel. The iptables command allows you to set netfilter rules to achieve various NAT actions (as detailed in the above Wikipedia article), for example. full cone NAT using iptables . .

See this guide for general information on configuring netfilter / IP masking (required for NAT): http://www.ibiblio.org/pub/linux/docs/howto/other-formats/html_single/IP-Masquerade-HOWTO. html

Of course, you could associate your P2P software with various local interfaces (within the range 127.0.0.0/24 or use an IPv6 subnet) and configure routing tables and netfilter rules on the same machine to do this without virtualization. I'm not sure which approach will be easier for you, although if you have the machine resources, the virtualization approach may be easier to track.

+2
source

Source: https://habr.com/ru/post/1342914/


All Articles