Skip to content

Mettiu88/ccn-simulator

Repository files navigation

CCN Simulator

A Content Centric Networking (CCN) simulator written in Java, developed at Politecnico di Torino. It simulates CCN network topologies with routers, publishers, clients, and attackers, supporting different Pending Interest Table (PIT) implementations.

Research

This simulator was used to produce the research results presented in:

M. Virgilio, G. Marchetto, R. Sisto, "PIT overload analysis in content centric networks," in Proceedings of the 3rd ACM SIGCOMM Workshop on Information-Centric Networking (ICN '13), pp. 67–72, 2013. DOI: 10.1145/2491224.2491225

Project Structure

src/
  main/
    java/it/polito/ccn/
      simulator/          # Core simulator classes (network, routers, caches, PIT, etc.)
        exception/        # Custom exceptions
        gui/              # Swing GUI
      testing/            # Entry point and utility classes
    resources/            # XSD schemas and classpath resources
    xsd/                  # XSD schemas + JAXB bindings (source for code generation)
  test/
    java/it/polito/ccn/
      testing/            # JUnit 5 tests
build/
  generated/sources/xjc/  # Auto-generated JAXB classes (not committed)
build.gradle              # Gradle build configuration
settings.gradle           # Gradle settings (includes toolchain auto-download)

Prerequisites

  • Java JDK 21 (automatically downloaded by Gradle via toolchain if not installed)
  • Gradle 8.12 (use the included wrapper ./gradlew)

All dependencies are managed by Gradle:

  • Jakarta XML Binding (JAXB) 4.0
  • Apache Commons Math 3.6.1
  • JUnit 5

Build and Run

Build

./gradlew build

Run a simulation

./gradlew run -DattackerUriDim=1000 -DrouterType=Core -DpitType=SimplePIT --args="examples/simpleTopology.xml"

Run tests

./gradlew test

System Properties

Property Required Description
-DattackerUriDim=<int> Yes URI dimension for attackers (e.g. 1000)
-DrouterType=<type> Yes Router type: Core or DiPIT
-DpitType=<type> Yes PIT implementation (see below)
-DenableGui=true No Enable the Swing GUI

JAXB Code Generation

JAXB classes are auto-generated from the XSD schemas during the build via the xjc Gradle plugin. The schemas and binding configuration are in src/main/xsd/:

  • NetworkSchema.xsd generates package it.polito.ccn.simulator.generated
  • UsersAllocationSchema.xsd generates package it.polito.ccn.simulator.usersgen
  • bindings.xjb maps each schema namespace to its target package

The generated classes end up in build/generated/sources/xjc/ and are not committed to the repository. To regenerate manually: ./gradlew xjc.

Topology Files

Topology configurations are XML files compliant with src/main/xsd/NetworkSchema.xsd. Example scenarios are in the examples/ directory:

  • simpleTopology.xml - Simple test topology
  • telecomTopology.xml / telecomTopologyMini.xml - Telecom-inspired topologies
  • testBanda*.xml - Bandwidth tests (100Mbit to 4Gbit)
  • testLifetime*.xml - Interest lifetime tests (4s to 60s)
  • testRetransmission.xml - Retransmission test

Additional scaled topologies (1000 nodes) are in examples/scaled_1000/.

IDE Setup

Import as a Gradle project in IntelliJ IDEA or Eclipse. The Gradle configuration handles all dependencies and the JDK toolchain automatically.

PIT Implementations

The simulator contains different implementations for the Pending Interest Table:

Class Description
SimplePIT.java Stores the whole content name
HashedPIT.java Stores a hash of the content name
DiPIT.java Distributed PIT (mathematical Bloom filter model)
DiPITBF.java Distributed PIT (actual Bloom filter implementation)

DiPIT is based on the approach introduced in this paper.

All PITs inherit from PIT.java, an abstract class that can be extended to create custom PIT implementations. See CCNComponentFactory.java for the mapping between -DpitType values and PIT classes.

License and Citation

This software is free to use. If you use this simulator in your research, please cite the following paper:

M. Virgilio, G. Marchetto, R. Sisto, "PIT overload analysis in content centric networks," in Proceedings of the 3rd ACM SIGCOMM Workshop on Information-Centric Networking (ICN '13), pp. 67–72, 2013. DOI: 10.1145/2491224.2491225

BibTeX:

@inproceedings{10.1145/2491224.2491225,
  author = {Virgilio, Matteo and Marchetto, Guido and Sisto, Riccardo},
  title = {PIT overload analysis in content centric networks},
  year = {2013},
  isbn = {9781450321792},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/2491224.2491225},
  doi = {10.1145/2491224.2491225},
  booktitle = {Proceedings of the 3rd ACM SIGCOMM Workshop on Information-Centric Networking},
  pages = {67--72},
  numpages = {6},
  keywords = {simulation, security, ddos attacks, content centric networking},
  location = {Hong Kong, China},
  series = {ICN '13}
}

Modernization

This project was originally developed in 2013 using Java 6. The codebase has been modernized to Java 21 with the assistance of AI (Claude by Anthropic), updating the build system to Gradle 8, migrating from javax.xml.bind to Jakarta XML Binding 4.0, and adopting JUnit 5 for testing. The original simulator logic and algorithms have been completely preserved — no functional changes were made to the simulation code.

Releases

No releases published

Packages

 
 
 

Contributors

Languages