How to Convert an Application from IPv4 to IPv4/IPv6 (Windows Embedded CE 6.0)
1/6/2010
You can add IPv6 capability to your Microsoft Windows application while still retaining IPv4 functionality. This is important because IPv6 and IPv4 can coexist on the Internet. However, IPv6 is not backward compatible with IPv4.
In this procedure, you will convert two sample IPv4 applications to applications that support both IPv4 and IPv6, and you will use Platform Builder to verify their functionality.
Note
An actual platform may not have the same features and dependencies as this example.
You will perform the following major steps:
- Use Platform Builder to create two OS designs: one for a server and one for a client.
- Use the sample code to create client and server applications that supports only IPv4.
- Add the applications to the OS designs, build the run-time images, and then deploy the images to the Windows Embedded CE PC-based platforms (CEPCs).
- Run the applications to see how they perform in an IPv4 environment.
- Convert the IPv4 code to be IP-independent, meaning that it supports both IPv4 and IPv6.
- Add the converted applications to the OS designs, rebuild the run-time images, and then deploy them again.
- Run the applications and verify that they support IPv6.
By using the examples and following these steps, you will gain an understanding about how to convert your own application so that it supports both IPv4 and IPv6. Before you convert your own application, ensure that it works as expected in an IPv4 environment and passes your normal testing procedures.
Hardware and Software Assumptions
- Your Platform Builder installation includes the CEPC x86 board support package (BSP).
- You have two CEPCs that are already configured to run your applications. For more information, see How to Set Up a CEPC.
- The CEPCs are configured as follows:
- Each has a product Ethernet card, or uses the VMINI driver. VMINI enables you to use the same network card for downloading and debugging the image, and for connecting to a network. You must know the type of network card in each CEPC. You will use this information in these instructions.
- You have boot floppy disks for the CEPCs. For more information, see Creating a Boot Floppy Disk for an x86 SDB.
- Your CEPCs have 32 MB RAM for a typical run-time image built from a Release configuration.
- or -
Your CEPCs have 64 MB RAM for a typical run-time image built from a Debug configuration. Run-time images built from Debug configurations can be larger than those built from release configurations, and can require more memory to run. - For communication between the CEPCs by using local IPv6 address, ensure that the devices are connected to the network through the same hub.
Steps
Step | Topic |
---|---|
1. Create an OS design for the Client as follows:
|
Creating an OS Design with the Windows Embedded CE OS Design Wizard |
2. Add the device driver for the network card in your CEPC. To do this, in the Catalog, under Device Drivers\Networking\Local Area Networking (LAN) devices, add the Catalog item that supports the network card. |
|
3. Prepare to build the OS design.
|
|
4. Build the OS design into a run-time image. |
|
5. In the Output window, on the Output tab, verify that the build contains no errors. |
|
6. Choose a download service appropriate for the connection hardware. The download service will download a run-time image to the CEPC. |
|
7. Set up and configure the connection hardware required for the download service. That hardware connects the CEPC to the development workstation, on which Platform Builder is installed. Examples of connection hardware include cables, a hub, or Ethernet network adapters. |
|
8. If you selected Serial Download Service in step 6, configure the HyperTerminal terminal emulation application to display the serial debug output from the serial port on the CEPC. This configuration requires a null-modem cable connected to a serial port, such as COM1. |
|
9. Turn on the CEPC so that it becomes active on the Ethernet network or over the serial connection, and Platform Builder can discover it. |
Not applicable |
10. Configure the connection to the CEPC. Choose the appropriate topic based on whether the development workstation and the CEPC are connected by an Ethernet network or a serial port connection. |
|
11. Create a new project for the client application. |
|
12. Create the Client Application to convert to IPv4/IPv6. |
|
13. From the Target menu, choose Attach Device. When successfully attached, the CEPC displays the Enterprise Web Pad UI.
Note:
If the status bar in this dialog box does not show download progress within a few minutes, restart the CEPC.
|
Not applicable |
14. Open a new instance of Platform Builder. |
Not applicable |
15. Follow steps 1 through 13 to create an OS design for the Server, making the following choices:
|
Not applicable |
16. Run the applications. |
|
17. (Optional) If your application has a graphical UI, decide how to display IPv6 addresses. The Client and Server samples that you are creating do not have a graphical UI. |
|
18. Run the Checkv4 Utility on both the Client and Server applications. |
|
19. Using the Checkv4 output, change the client and server application source code to support IPv6. |
|
20. Build the Client and Server projects again as follows:
|
|
21. Run the applications and verify that they support IPv6: To demonstrate IPv4 communication between the IPv4-only client and the IPv4/IPv6 server, do the following:
To demonstrate IPv6 communication between the IPv4/IPv6 client and server, do the following:
If you have a DNS/WINS server available on your network, to demonstrate IPv4 communication between the IPv4/IPv6 client and server, do the following:
In this case, Windows Embedded CE does not register an IPv6 address with DNS; The client resolves the server name to an IPv4 address only. |
The document titled IPv6 Guide for Windows Sockets Applications at this Microsoft Web site contains complete, working examples of a simple Windows Sockets application that has been modified to support both IPv6 and IPv4.
If you are working with actual applications rather than these samples, you should test your application in an IPv6 environment. For more information, see Testing your Application or Device in an IPv6 Environment.
See Also
Concepts
How to Set Up and Use an IPv6 Test Lab