How to Convert an Application from IPv4 to IPv4/IPv6 (Windows CE 5.0)

Send Feedback

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:

  1. Use Platform Builder to create two OS designs: one for a server and one for a client.
  2. Use the sample code to create client and server applications that supports only IPv4.
  3. Add the applications to the OS designs, build the run-time images, and then deploy the images to the CEPCs.
  4. Run the applications to see how they perform in an IPv4 environment.
  5. Convert the IPv4 code to be IP-independent, meaning that it supports both IPv4 and IPv6.
  6. Add the converted applications to the OS designs, rebuild the run-time images, and then deploy them again.
  7. 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:
  • Name the OS design CeClientOS.
  • For BSP, choose CEPC x86.
  • For design template, choose Enterprise Web Pad.
  • On the Networking & Communications page, make sure TCP/IPv6 support is selected.
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.
  1. From the Build OS menu, choose Set Active Configuration.
  2. Choose the Release build.
  3. Choose OK.
Not Applicable.
4. Build the OS design into a run-time image.
  1. From the Build OS menu, ensure that the following are selected:

    Clean Before Building

    Copy Files to Release Directory after Build

    Make Run-Time Image After Build

  2. From the Build OS menu, choose Build and Sysgen.
Not Applicable.
5. Add your device and name it as follows:
  1. From the Target menu, choose Connectivity options.
  2. Under Device Configuration, choose Add Device.
  3. For New target device name, type a name for your device. In this example, type CeClientDevice.
 
6. Configure a connection to the CEPC, and make the following choices:
  • From the Download list, choose Ethernet and then choose Settings.
  • From the Device Boot Name list, choose the CEPC.
  • From the Transport list, choose Ethernet.
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.

Note   If the status bar in this dialog box does not show download progress within a few minutes, restart the CEPC.
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:
  • Name the OS design CeServerOS.
  • Add your device and name it. In this example, type CeServerDevice.
  • In step 5, create a new project for the server application.
  • In step 6, create a server application.
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:
  1. In the Workspace Window, choose the SimpleClient or SimpleServer project.
  2. From the Build Project menu, select Make a Run-Time Image after Build.
  3. From the Build Project menu, choose Build Current Project.
 
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:

  • Run the server.
  • Run the IPv4-only client against the server using IPv4 address of the server device.

To demonstrate IPv6 communication between the IPv4/IPv6 client and server, do the following:

  • Run the server.
  • Run the IPv4/IPv6 client against the server using the IPv6 address of the server device.

    If you use the link local IPv6 address of the server device, make sure to use the correct Scope ID of the client device following the link local address of the server.

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:

  • Set a unique network name for the CE device running the server. To do this, on the device:
    1. Select Start > Settings > Control Panel.
    2. Double-click the System icon. The System Properties dialog box appears.
    3. Select the Device Name tab, type the name of the server in the Device name field, and then choose OK.
  • Run the server.
  • Run the IPv4/IPv6 client against the server using name of the server device.

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

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.