The IPv6 dual stack mode assumes the following:
Both IPv4 and IPv6 stacks are enabled
Applications can talk to both IPv6 and IPv4
Your choice of the IP version is based on name lookup and application preference
The following diagram shows the dual stack approach.
Figure 2-1 Dual Stack
Dual stack hosts can handle both IPv4 and IPv6 clients by using IPv4‑mapped IPv6 addresses. For example, the following process shows how an IPv4 TCP client communicates with an IPv6 server:
The IPv6 server starts and creates an IPv6 listening socket.
The IPv4 client calls gethostbyname and finds a record for the server.
The client calls connect and the client’s host sends IPv4 SYN to the server.
The server host receives the IPv4 SYN directed to the IPv6 listening socket. The server sets a flag indicating that this connection is using IPv4-mapped IPv6 addresses and responds with an IPv4 SYN/ACK.
All communication between the client and server takes place using IPv4 datagrams.
Unless the server explicitly checks whether this IPv6 address is an IPv4-mapped IPv6 address, the server never knows that it is communicating with an IPv4 client.