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
                                                                                                                                                   .                 )
                                                                                                                                                   .                 )