Which approach to a server with two stacks is better?

I wrote two server programs for a double stack before implementation in the application.

  • A two-stage server program that can accept both IPv6 and IPv4 clients with a single IPv6 interface. But IPv4 reuest as a mapped IPv6 address.

  • The two-stage server program, which has two interfaces, listens to handle IPv6 and IPv4 clients separately, as the IPv6 interface for IPv6 clients and the IPv4 interface for IPv4 clients, in which there is no IPv4-mapped address for the IPv4 client.

Both work fine. But since I need to use only one server model to build my server application. so which one is preferable or even offers me if there is any other better model.?

Displays the IPv4 IPv6 address in the future.

Can anybody help me. Thanks in advance for your help. (working under Linux 2.6.9 and network programming using C.)

+4
source share
1 answer

If you can do everything you need with IPv6, then I think option 1 is much simpler. Your code will be cleaner and maintenance easier. You might want to explicitly set the IPV6_V6ONLY flag to 0 in your code if you rely on this if the default behavior is changed using sysadmin.

+2
source

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


All Articles