# Package net.i2p.router

The I2P router application handles I2P network communication.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  HandlerJobBuilder | Defines a class that builds jobs to handle a particular message - these builders are registered with the InNetMessagePool for various I2NP message types, allowing immediate queueing of a handler job rather than waiting for a polling job to come pick it up.
  Job | Interface for router-internal executable tasks.
  MessageSelector | Define a mechanism to select what messages are associated with a particular OutNetMessage.
  PeerManagerFacade | 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.
  ProfileManager | Manages peer profiles and performance metrics for router peers.
  ReplyJob | Defines an executable task that can be fired off in reply to a message
  RouterClock.ClockShiftListener | Listener interface for receiving notifications when the router clock shifts.
  RouterThrottle | Controls router load by throttling message processing and tunnel participation.
  Service | Defines the lifecycle interface for router subsystems.
  TunnelInfo | Defines the information associated with a tunnel
  TunnelManagerFacade | Manages tunnel creation, maintenance, and selection for encrypted routing.

- Class Summary
  Class | Description
  --- | ---
  Banlist | Manages router banlist entries with configurable expiration times and transport-specific bans.
  Banlist.Entry | Entry representing a banned peer with expiration and reason information
  Blocklist | Manage blocking by IP address, in a manner similar to the Banlist, which blocks by router hash.
  ClientManagerFacade | Manages client connections and LeaseSet operations for I2P applications.
  ClientMessage | Wrap a message either destined for a local client or received from one.
  ClientMessagePool | Manage all of the inbound and outbound client messages maintained by the router.
  ClientTunnelSettings | Wrap up the client settings specifying their tunnel criteria
  CommSystemFacade | Manages peer communication subsystem including transport protocols, connection handling, and network address management for router-to-router messaging.
  InNetMessagePool | Receives and dispatches inbound network messages with configurable processing modes.
  JobImpl | Base implementation of a Job For use by the router only.
  JobQueue | Prioritizes and executes router jobs with preference for earlier scheduled tasks.
  JobQueueRunner | Worker thread that executes jobs from the router job queue.
  JobStats | Collects and maintains statistical data for job execution performance.
  JobTiming | Define the timing requirements and statistics for a particular job For use by the router only.
  KeyManager | Manages all router cryptographic key pairs including persistent storage of router keys and in-memory management of LeaseSet keys for secure communications.
  LeaseSetKeys | Wrap up the keys given to the router when a destination connects to it.
  MessageHistory | Logs router message traffic for debugging and network analysis.
  MessageValidator | 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).
  MultiRouter | Fire up multiple routers in the same VM, all with their own RouterContext (and all that entails).
  NetworkDatabaseFacade | Abstract interface for I2P network database operations.
  OutNetMessage | Wrap up an outbound I2NP message, along with the information associated with its delivery and jobs to be fired off if particular events occur.
  OutNetMessagePool | Routes outbound messages to the communication system for delivery.
  PersistentKeyRing | ConcurrentHashMap with backing in the router.config file.
  Router | Core router implementation that manages I2P node lifecycle, configuration, and subsystem coordination.
  RouterClock | Alternate location for determining the time which takes into account an offset.
  RouterCommandLine | Simple command line access to various utilities.
  RouterContext | Extended application context that provides centralized resource coordination for router instances.
  RouterLaunch | This is the class called by the runplain.sh script on linux and the i2p.exe launcher on Windows.
  RouterThrottleImpl | Simple throttle that basically stops accepting messages or nontrivial requests if the jobQueue lag is too large.
  RouterVersion | Expose a version string
  StatisticsManager | Collects and publishes router performance statistics to the network database.
  TunnelPoolSettings | Wrap up the settings for a pool of tunnels.

- Enum Summary
  Enum | Description
  --- | ---
  CommSystemFacade.Status | Network connectivity status enumeration for IPv4 and IPv6 transport capabilities.

## Package net.i2p.router Description

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 I2P for those bundling router.

Message flow:

NTCP2 ────────────────────────────── SSU ────────────────────────────────────── kernel→NIO→Reader → NTCP2 PerConn PriQ→Frag → Writer→NIO→Kernel ↑ kernel→Reader→CodelQ → SSU Reasm→RED→Codel/PriQ→Frag→Win/ReTX→OMF→CodelQ → Writer→Kernel ↓ Tunnels / Bandwidth Limiter ↔──────────────┘ Middle Hop: InNet MsgPool → IBGW RED-Codel/Pri-FragQ → OBEP → OutNet MsgPool