Dual-stack ping command
Student: Jan Sucan (sucanjan@gmail.com)
- Mentor: Alan Somers (asomers@)
Project description
Ping has been one of the basic most used utilities for network diagnostic. Because of this the major aspect concerning it is ensuring its long term quality. Currently, there are two implementations of ping in FreeBSD: ping is for IPv4 networks and ping6 is for IPv6. They have a lot of duplicate code. To ease maintenance of this tools (adding new features, fixing bugs) the primary goal of my work is to create a single implementation, containing support for both IPv4 and IPv6 networks, where the code duplication will be eliminated and the functionality and output will be equal to the old implementations. The secondary goal is to document my work so that it could be used as a guide for other programmers who would do some similar unifying work.
Approach to solving the problem
The main concern when unifying ping and pin6 is that their output and functionality must not change. In order to increase probability of detection of such changes the development will be similar to a test-driven development. Unification of the utilities will not start until the tests have been created.
Deliverables
- Dual-stack ping command maintaining functionality of the old ping and ping6.
- Tests for checking that the unification has not changed the functionality.
- Documentation of the unification process.
Milestones
- May 6th – May 19th
- Initial analysis of ping and ping6 source codes to understand their implementation.
- May 20th – June 16th
- Design of tests used to ensure that the output of the dual-stack command is equal to the old commands.
- June 17th - 30th
- June 24th - 28th: Mid-term Evaluations #1
- Eliminating use of global variables in ping and ping6 with no change in their functionality and output.
- Identification of duplicate functionality in ping and ping6. Design of unified user interface and selection of the network protocol type.
- July 1st - 28th
- July 22nd - 26th: Mid-term Evaluations #2
- Implementing dual-stack ping command.
- July 29th – August 4th
- Writing manual page for the new dual-stack ping command.
- August 5th (Soft End of coding) - 18th (Hard End of coding)
- Adding more comments to the source codes.
- Static code analysis of the source codes and fixing errors found.
Test Plan
The tests will be based on the Automated Testing Framework.
The Code
ping branch in https://github.com/jansucan/freebsd
Progress
Done
- Installed FreeBSD in a virtual machine.
- Forked the FreeBSD repository on Github.
- Cloned the forked repository and updated the system from source.
- Installed kyua for running the ATF tests.
- ping and ping6 unified by common frontend and merged into common source directory.
- Renamed ping6 options in the code and manual page so that there is no conflict when they are merged with ping options.
TODO
- Merge the option processing.
- Make consistent alphabetical ordering of options in the manual pages and code.
- Write the first ATF test in C.
- ping6 has undocumented options -Z and -A. Document them.
Notes
(A place to make notes that will be useful to others looking at your code. You probably don't need to put anything here on day one)
Useful links
Introduction to ATF tests in FreeBSD Journal
Building FreeBSD in meta mode