This section presents all relevant activities involved in the software development of JNFD, which include the following topics: reuse of existing software artefacts, configuration and build management utilised during the development process as well as the host targets where JNFD was tested. All these parts are presented in the following paragraphs.
5.2.1
Software reuse
JNFD is implemented re-using appropriate existing components, systems and code. For example, it reuses the JNDN client libraries provided by the NDN project10, the proto3 language for specifying message formats provided by Google11, as well as the existing Java libraries provided by Android or Linux based platforms. JNFD reuses code and concepts at the abstraction and object level rather than at component and system level, as presented in the following paragraphs.
Abstraction level At this level, JNFD utilises creational design patterns such as the builder and singleton patterns [Gamma et al., 1994]. The strategy pattern is used in the forwarding strategies, which are selectable at runtime and can potentially be changed depending on circumstances other than user selection.
Class/object level As initially mentioned, JNFD reuses classes and objects from exiting libraries, such as objects from JNDN, proto3 from Google, Spock for testing, and Android libraries. Table 5.6 lists the relevant objects that the JNFD code reuses from existing libraries.
Component level At the component level, JNFD adapts and extends a set of objects mainly for interfaces that have direct contact with the user, such as the case of Android libraries used to collect and display information to the screen of the mobile device.
System level JNFD does not reuse entire applications or software for its implementation. One exception to this is theipcommand line tool that allows to change Wi-Fi network interfaces to ad hoc mode. In the JNFD development process, existing NDN applications as well as IP-based applications such ascurlwere used for system testing.
10https://github.com/named-data/jndn
Library Name Brief description
Java concurrent hash maps
All internal tables in JNFD are implemented using con- current hashmaps. For example, in the case of the PIT, the key of the hashmap is the interest packet and its value is a set of connections to nodes that have requested a content of a particular name.
Google protocol buffer messages
JNFD utilises the features of proto3 from Google12 to create its own data structure of messages to be exchanged between nodes. It lets proto3 manage the details of reading and writing units of messages. JNFD utilises the encoding and parsing functionalities of Proto3 by using the generated getters and setters.
Apache commons dae- mons
JNFD utilises JSVC13 from the Apache common dae- mon14 libraries to run JNFD as service on Unix-based platforms. By using JSVC to run JNFD as a daemon, JNFD reuses the methods provided by JSVC to start, stop, destroy, and initialise JNFD.
JNDN client libraries As JNFD needs to be compatible with NDN applications, JNFD reuses objects provided by JNDN, such as the Name, Interest, Data, Blob, KeyChain, and MetaInfo classes.
Java Runtime JNFD utilises the Java Runtime’s functionality to execute Unix shell command lines at a running time, for example, to enable Ad-hoc mode on Linux-based laptops.
Java NIO networking JNFD implements sockets using the non-blocking IO and multiplexing functionalities of the Java NIO libraries. It mainly utilises socket channels and selectors for TCP and UDP connections.
Android libraries The JNFD module for Android devices utilises the li- braries provided by Google for developers15.
Java logging JNFD uses the standard Java logging libraries to generate logs under the JNFD format that is discussed in Appendix 5.6.
Args4j command line parsing
JNFD uses the Java classes of the Args4j16library to parse command line arguments provided on Linux systems.
5.2.2
Configuration management
Changes in JNFD implementation during its development were managed by the following activities:
Version management: JNFD source code was initially created in Bitbucket repositories using the Git17version control system for tracking code changes. JNFD also includes unit, component and system testing code in its Git repository.
System integration: The JNFD Git repository includes the scripts and procedures for installation. As JNFD is open source, it provides the necessary instructions for system integration with other platforms.
5.2.3
Host target development
JNFD software was developed using Android Studio18 for both the Android and the Linux version. A Gradle19build process allows the system to be built from the command line. Tests are also executed from the command line as are the experiments and the analysis of the collected experimental data.
JNFD was tested on Android smart-phones such as the Motorola Moto E and Moto G as well as the Samsung Note 4 and Galaxy. JNFD can be deployed in Android smart-phones by installing the .apk file through Android Studio, or through theadb20 command line. Additionally, it was tested on Linux-based systems. For Linux systems, JNFD can be deployed by shell scripts, which compile and create the links to the binaries of JNFD.