Skip to main content

A Developer’s Guide to the ONE Simulator

  • Chapter
  • First Online:
Opportunistic Mobile Networks

Part of the book series: Computer Communications and Networks ((CCN))

  • 875 Accesses

Abstract

In this chapter, we look at how to work with the Opportunistic Network Environment (ONE) simulator using the NetBeans integrated development environment (IDE). Use of such an IDE often makes workflow easier. Next, we discuss in detail a key topic—creating a new routing protocol using the ONE simulator. We illustrate this process with a simple example by considering a variation of the SnW protocol. A walkthrough of the code, together with insights, is provided. In real life, developing software is usually a complex process. In such scenarios, tracking back the code and debugging becomes easier using the graphical user interface (GUI) based IDEs. In this regard, we take a look at version control of source code using Git. Git operations can be performed from a terminal or from within NetBeans—we illustrate both approaches here. Later in this chapter, we cover the issue of testing a protocol developed with the ONE simulator. We discuss how to write a test case from scratch by using JUnit and the framework provided by the ONE simulator. Finally, we conclude this chapter with a set of best practices based on our experiences with the ONE simulator.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    http://junit.org/.

  2. 2.

    https://netbeans.org/.

  3. 3.

    The ONE simulator has been developed using Java 6. In the remainder of this chapter, all examples provided were executed using NetBeans running with OpenJDK 6. Minor changes might be required if Java 7 is used instead. The reader is suggested to consult appropriate documents/forums regarding this.

  4. 4.

    https://search.maven.org/#searchgav|1|g:%22junit%22%20AND%20a:%22junit%22.

  5. 5.

    By default, assertions are disabled in Java.

  6. 6.

    Such descriptions are made available by many users in the simulator’s community.

  7. 7.

    https://netbeans.org/kb/docs/ide/git.html.

  8. 8.

    For an interesting discussion, refer to http://programmers.stackexchange.com/questions/110518/binaries-in-source-control.

  9. 9.

    Windows users can use a command prompt for this purpose. Another alternative is to install Cygwin. Of course, whether you are using Linux or Windows, a Git client must be installed in your system.

  10. 10.

    An alternative to this approach is to use the @org.junit.Test annotation for each test method.

  11. 11.

    https://github.com/junit-team/junit/wiki/Test-fixtures.

  12. 12.

    An abstract class is one which cannot be instantiated, i.e., no objects of the type of the abstract class can be created.

  13. 13.

    Technically, it is an ArrayList with FIFO operations.

  14. 14.

    This is required for version 1.5.1 RC2. The behavior with other versions was not tested.

  15. 15.

    http://junit.org/faq.html#atests_18.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sudip Misra .

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Misra, S., Saha, B.K., Pal, S. (2016). A Developer’s Guide to the ONE Simulator. In: Opportunistic Mobile Networks. Computer Communications and Networks. Springer, Cham. https://doi.org/10.1007/978-3-319-29031-7_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-29031-7_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-29029-4

  • Online ISBN: 978-3-319-29031-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics