Welcome to the world of Infosys Engineering! It is a half a billion plus organization that takes pride in shaping our engineering aspirations and dreams and bringing them to fruition. We provide engineering services and solutions across the lifecycle of our clients’ offerings, ranging from product ideation to realization and sustenance, that caters to a cross-section of industries - aerospace, automotive, medical devices, retail, telecommunications, hi tech, financial services, energy and utilities just to name a few major ones.

« Adopting Big Data - Challenges and Success Factors | Main | Automotive Telematics - What Lies Ahead »

Enable your application for IPv6

As per data collected by Internet society, IPv6 adoption is gaining momentum, across the globe. Though IPv4 is not going away anytime soon, it is clear that IPv6 adoption is on the rise. This makes a good case for software applications, which follow client-server architecture and use TCP/IP based communication, to enable themselves to communicate over IPv6 protocol. Abundant text is already available about why IPv6 is not just about overcoming IP address space crunch and how it is a more efficient protocol than IPv6. In this blog, I explore the challenges associated with changes needed at the application level, to enable support for IPv6.
Legacy applications may not have been written anticipating the need to change the communication protocol and hence the complexities of identifying the impact areas. Most modern operating systems are dual-stack i.e. they support both IPv4 and IPv6. The application layer should make use of this capability and add support for IPv6 to existing codebase instead of replacing IPv4 completely with IPv6. This approach will ensure everything does not switch over to IPv6 overnight. Below mentioned is a stepwise approach to add IPv6 support at application level:
Assessment: The first step is to identify impact on socket communication between client and server, data exchange between various components and UI.
A) TCP/IP communication:
To facilitate determination of impact on socket-level communication, Microsoft provides a command line based tool, named Checkv4.exe. This utility inspects the code and points out code constructs which need to be modified to support IPv6 and provides suggestions on exact code change too. Though this utility works on one file at a time, it can be easily invoked in a program that iterates over all the files in a project or folder hierarchy and invokes Checkv4.exe on each file. For our purpose, we had created such a program and also captured the output of Checkv4.exe for each source/header file into a text file. This is useful to size the amount of change needed and to arrive at necessary effort estimation for the changes. Checkv4.exe helped us find out relevant APIs and data structures in C, C++ and VB code. Checkv4 is suitable for windows-based codebase. For non-Windows source code, a run-time utility IPv6 CARE can be used to locate impacted areas.
As mentioned earlier, most modern operating systems allow IPv4 and IPv6 to co-exist, recommendations provided by Checkv4.exe are on the lines of replacing IPv4-only APIs and data structures with IP-agnostic counterparts. The IP-agnostic APIs and data structures abstract the differentiation between IPv4 and IPv6 address from invoking programs. A detailed guide to IPv4-only data structures and APIs and their IP-agnostic counterparts is available over here.
If there is a single component which handles all socket level communication, scope for these modifications is limited to this. If the communication code is scattered across different components then it is a good idea to create a new component whose sole purpose is to take care of communication (This is per the widely known principle of 'Separation of Concerns')

B) Data Exchange:
The application suite that I worked on involved multiple components written in different programming languages. Some of them were related to UI while others contained business rules. For intercommunication, these components exchanged user-defined structures and their collections. As the components had been implemented for IPv4 addressing scheme only, the data structure elements were of a size that specifically catered to IPv4 addresses, and hence were incapable of holding IPv6 addresses of longer length. The easiest way to locate such changes is to trace the data flow from UI till the data is sent to server and identify the containers that carry data. Enterprise Architect by Sparx Systems can help generate control flow and UML diagrams from application execution. The approach taken was to add new members to hold IPv6 address and retain the IPv4 data member too. Intent behind retaining data member for IPv4 was to allow socket communication in scenarios when either of the client or server modules was hosted on an old operating system which supported only IPv4 stack. User provided values on GUI and data received from server were validated (there are in-built routines in most programming languages to verify addressing scheme) to determine whether which addressing scheme was in use. This helped in avoiding usage of conditional compilation symbols which reduce readability of code.
C) User Interface for IPv6:
Though IPv6 address is hard to memorize and key-in, applications still need to support IPv6 addressing in GUI controls. To allow ease of search, reading and general usage, rules mentioned in RFCs need to be adhered to. RFC 5952 deals with UI representation of IPv6 address in a very detailed manner. Compliance to the RFC standards ensures application behavior is universally consistent and ensures ease of access for users. Winsock is a UI control built into Visual Basic UI designer which has been traditionally used for displaying and validating IPv4 address. In VC++ based GUI applications, masked edit control has been put to good use for the same purpose. Thus, these two could be used as starting point in GUI layer, to determine impacted areas.
After the assessment of modifications needed is complete, overall approach for change can be designed and effort estimates drawn.


I read your articles very excellent and the i agree our all points because all is very good information provided this through in the post.
It is very helpful for me.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter