How to Convert an Application from IPv4 to IPv4/IPv6 (Windows CE 5.0)
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 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.
To track your progress in the following table, select the check box next to each step.
Step | Topic | |
---|---|---|
1. Create an OS design for the Client as follows:
|
Creating an OS Design | |
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. |
Adding an Item from the Catalog | |
3. Prepare to build the OS design.
|
Not Applicable. | |
4. Build the OS design into a run-time image.
|
Not Applicable. | |
5. Add your device and name it as follows:
|
||
6. Configure a connection to the CEPC, and make the following choices:
|
Configuring a Connection for Downloading and Debugging | |
7. Create a new project for the client application. | Creating a New Project for Converting to IPv4/IPv6 | |
8. Create the Client Application to convert to IPv4/IPv6. | Creating an Application to Convert to IPv4/IPv6 | |
9. From the Target menu, choose Attach Device.
When successfully attached, the CEPC displays the Enterprise Web Pad UI.
|
Not Applicable. | |
10. Open a new instance of Platform Builder. | Not Applicable. | |
11. Follow steps 1 through 9 to create an OS design for the Server, making the following choices:
|
Creating an OS Design | |
12. Run the applications. | Running the SimpleClient and SimpleServer Applications | |
13. (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. |
Deciding How to Display IP Addresses | |
14. Run the Checkv4 Utility on both the Client and Server applications. | Running the Checkv4 Utility | |
15. Using the Checkv4 output, change the client and server application source code to support IPv6. | Changing the Application Source Code to Support IPv6 | |
16. Build the Client and Server projects again as follows:
|
||
17. 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 CE does not register an IPv6 address with DNS; The client resolves the server name to an IPv4 address only. |
Running the SimpleClient and SimpleServer Applications |
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
How to Set Up and Use an IPv6 Test Lab
Send Feedback on this topic to the authors