Package net.i2p.router


package net.i2p.router

The I2P router application handles the 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 the 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 the router.

Message flow:



                                                                                                                              NTCP2
                                                                                                                              Per-Conn

                                                                                                                                /--- Pri Queue )
NTCP2                                                                                                                          /        .      )                                                                      NTCP2
                                                                                                                              /         .      )
kernel -> NIO -> Reader -------------------------\                                                                           /          .      ) ---------------------------------------                       -- Writer -> NIO -> Kernel
                                                  \                                 Tunnels                                 /           .      )                                        \                     /
                                                   \                                                                       /            .      )                                         \                   /
                                                    \                      /-- RED - Codel/Pri - Frag - \                 /             .      )                                          \                 /
                                                     \              IBGW  /          Queue               \               /                                                                 \               /
                                                      \                  /                                \             /                                                                   \             /
                                                       \                /                                  \           /                                                                     \           /
                                                        \              /  Middle hop                        \         /                                                                        Bandwidth
                                                         -> In Net --------------------- RED ------------------Out Net                                                                         Limiter
                                                        /   Msg Pool   \                                   /   Msg Pool                                                                      /           \
                                                       /                \                                 /            \                                                                    /             \
                                                      /                  \                               /              \                                                                  /               \
SSU                                                  /              OBEP  \                             /                \                                                                /                 \
                                                    /                      \                           /                  \                                                              /                   \
kernel -> Reader -> Codel -----------------> Codel -                        --------------------- RED -                    \                                                            /                     \
                    Queue \              /   Queue                            \              /                              \       SSU                                                /                       \
                           \            /                                      \            /                                \      Per-Conn                                          /                         \
                             Reasssembly                                         Reasssembly                                  \                                                      /                           \
                                                                                                                               \--> Pri Queue -> Frag -> Window/ )                  /                             \
                                                                                                                                                         ReTX    )                 /                               \     SSU
                                                                                                                                               .                 )                /                                 \
                                                                                                                                               .                 ) - OMF - Codel -                                   - Writer -> Kernel
                                                                                                                                               .                 )         Queue
                                                                                                                                               .                 )
                                                                                                                                               .                 )
  • Class
    Description
    Routers are banlisted only if none of our transports can talk to them or their signed router info is completely screwy.
     
    Manage blocking by IP address, in a manner similar to the Banlist, which blocks by router hash.
    Manage all interactions with clients
    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
    Simple command line access to various utilities.
    Manages the communication subsystem between peers, including connections, listeners, transports, connection keys, etc.
    Since the codes may change.
    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.
    Manage a pool of inbound InNetMessages.
    Defines an executable task For use by the router only.
    Base implementation of a Job For use by the router only.
    Manage the pending jobs according to whatever algorithm is appropriate, giving preference to earlier scheduled jobs.
    a do run run run a do run run
    Glorified struct to contain basic job stats.
    Define the timing requirements and statistics for a particular job For use by the router only.
    Maintain all of the key pairs for the router.
    Wrap up the keys given to the router when a destination connects to it.
    Simply act as a pen register of messages sent in and out of the router.
    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).
    Defines the mechanism for interacting with I2P's network database
    Wrap up an outbound I2NP message, along with the information associated with its delivery and jobs to be fired off if particular events occur.
    Maintain a pool of OutNetMessages destined for other routers, organized by priority, expiring messages as necessary.
    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.
     
    Defines an executable task that can be fired off in reply to a message
    Main driver for the router.
    Alternate location for determining the time which takes into account an offset.
     
    Build off the core I2P context to provide a root for a router instance to coordinate its resources.
    Deprecated.
    unused
    This is the class called by the runplain.sh script on linux and the i2p.exe launcher on Windows.
    Gatekeeper for deciding whether to throttle the further processing of messages through the router.
    Simple throttle that basically stops accepting messages or nontrivial requests if the jobQueue lag is too large.
    Expose a version string
    Define the manageable service interface for the subsystems in the I2P router
    Publishes some statistics about the router in the netDB.
    Defines the information associated with a tunnel
    Build and maintain tunnels throughout the network.
    Wrap up the settings for a pool of tunnels.