package net.i2p.router

The I2P router application handles I2P network communication.

It encompasses sending and receiving messages, building up tunnels, encrypting and decrypting (on multiple levels) where applicable, and so on.

Classes in this package, sub-packages, and others in router.jar are not for use by apps, clients or plugins (except for routerconsole). Subject to change. Not necessarily maintained as a stable API.

For applications bundling I2P router, instantiate Router and call runRouter(), or use Router.main() or RouterLaunch. Most public methods in Router are maintained as a stable API for those bundling router.

Message flow: received bytes go from the kernel through NIO readers into the transport - NTCP2 (TCP) per-connection queues, or SSU (UDP) reassembly with RED and CoDel queue management and a retransmission window - then up to the tunnel layer and bandwidth limiter; sent messages take the reverse path through fragmentation and writers back to the kernel. As a middle hop, a message moves from the inbound network message pool through the inbound gateway queues to the outbound endpoint and the outbound network message pool.


  • Class
    Description
    Records live bandwidth samples every second for the minigraph.
    Manages router banlist entries with configurable expiration times and transport-specific bans.
    Entry representing a banned peer with expiration and reason information.
    Dedicated logger for all ban events.
    Manage blocking by IP address, in a manner similar to the Banlist, which blocks by router hash.
    A blocklist file and its parsed contents.
    The result of parsing one line.
    Manages client connections and LeaseSet operations for I2P applications.
    Wrap a message either destined for a local client or received from one.
    Manage all of the inbound and outbound client messages maintained by the router.
    Wrap up the client settings specifying their tunnel criteria.
    Manages peer communication subsystem including transport protocols, connection handling, and network address management for router-to-router messaging.
    Network connectivity status enumeration for IPv4 and IPv6 transport capabilities.
    Builds jobs to handle a particular message type.
    Receives and dispatches inbound network messages with configurable processing modes.
    Wrapper class to pair tunnel data messages with their sender hash.
    Interface for router-internal executable tasks.
    Base implementation of a Job
    Prioritizes and executes router jobs with preference for earlier scheduled tasks.
    Orders the jobs by their next run time.
    Queue entry that stops the pumper.
    Worker thread that executes jobs from the router job queue.
    Dynamic job runner scaling controller for the JobQueue.
    Snapshot of metrics taken before scaling up.
    Collects and maintains statistical data for job execution performance.
    One recorded recent execution.
    Totals over the most recent runs of one job type.
    Define the timing requirements and statistics for a particular job
    Manages all router cryptographic key pairs including persistent storage of router keys and in-memory management of LeaseSet keys for secure communications.
    Wrap up the keys given to the router when a destination connects to it.
    Logs router message traffic for debugging and network analysis.
    Define a mechanism to select what messages are associated with a particular OutNetMessage.
    Singleton to manage the logic (and historical data) to determine whether a message is valid or not (meaning it isn't expired and hasn't already been received).
    Fire up multiple routers in the same VM, all with their own RouterContext (and all that entails).
    Abstract interface for I2P network database operations.
    Wrap up an outbound I2NP message, along with the information associated with its delivery and jobs to be fired off if particular events occur.
    Routes outbound messages to the communication system for delivery.
    Manage peer references and keep them up to date so that when asked for peers, it can provide appropriate peers according to the criteria provided.
    ConcurrentHashMap with backing in the router.config file.
    Manages peer profiles and performance metrics for router peers.
    Defines an executable task that can be fired off in reply to a message.
    Core router implementation that manages I2P node lifecycle, configuration, and subsystem coordination.
    State management - startup / shutdown states.
    Alternate location for determining the time which takes into account an offset.
    Listener interface for receiving notifications when the router clock shifts.
    Simple command line access to various utilities.
    Extended application context that provides centralized resource coordination for router instances.
    Cleanup task to remove this context from the static contexts list.
    This is the class called by the runplain.sh script on linux and the i2p.exe launcher on Windows.
    Controls router load by throttling message processing and tunnel participation.
    Simple throttle that basically stops accepting messages or nontrivial requests if the jobQueue lag is too large.
    Expose a version string.
    Defines the lifecycle interface for router subsystems.
    Collects and publishes router performance statistics to the network database.
    General-purpose adaptive tuner.
    Manages the autotune.config file — separate from router.config.
    Base class for tunable params with history tracking and auto-revert.
    Reflection helper for accessing TunnelControllerGroup across module boundaries.
    Snapshot of a subsystem's tunable parameter values at a point in time.
    CPU saturation state of one transport worker stage.
    Reflection helper for the streaming module's tuned statics.
    Per-subsystem health scores.
    Tracks overall router health score for adaptive tuning decisions.
    Thread-id keyed sample state for Tuner.sampleStageCpu(): per live thread, which Tuner.CPU_STAGES entry its name matched and the CPU nanoseconds recorded at the previous sample.
    One generation of the table: parallel arrays probed by the same index, keyed by thread id so no id is ever boxed.
    A tunable parameter with name, description, bounds, and default value.
    Defines the information associated with a tunnel.
    Manages tunnel creation, maintenance, and selection for encrypted routing.
    Wrap up the settings for a pool of tunnels.
    Test status for tunnel testing display.