See: Description
| Class | Description |
|---|---|
| EstablishState |
Handle the 4-phase establishment, which is as follows:
Alice contacts Bob
=========================================================
Message 1 (Session Request):
X+(H(X) xor Bob.identHash)----------------------------->
Message 2 (Session Created):
<----------------------------------------Y+E(H(X+Y)+tsB, sk, Y[239:255])
Message 3 (Session Confirm A):
E(sz+Alice.identity+tsA+padding+S(X+Y+Bob.identHash+tsA+tsB), sk, hX_xor_Bob.identHash[16:31])--->
Message 4 (Session Confirm B):
<----------------------E(S(X+Y+Alice.identHash+tsA+tsB)+padding, sk, prev)
Key:
X, Y: 256 byte DH keys
H(): 32 byte SHA256 Hash
E(data, session key, IV): AES256 Encrypt
S(): 40 byte DSA Signature
tsA, tsB: timestamps (4 bytes, seconds since epoch)
sk: 32 byte Session key
sz: 2 byte size of Alice identity to follow
Alternately, when Bob receives a connection, it could be a
check connection (perhaps prompted by Bob asking for someone
to verify his listener).
|
| EventPumper |
The main NTCP NIO thread.
|
| NTCPAddress |
Wrap up an address
|
| NTCPConnection |
Coordinate the connection to a single peer.
|
| NTCPSendFinisher |
Previously, NTCP was using SimpleTimer with a delay of 0, which
was a real abuse.
|
| NTCPTransport |
The NIO TCP transport
|
| Reader |
Pool of running threads which will process any read bytes on any of the
NTCPConnections, including the decryption of the data read, connection
handshaking, parsing bytes into I2NP messages, etc.
|
| Writer |
Pool of running threads which will transform the next I2NP message into
something ready to be transferred over an NTCP connection, including the
encryption of the data read.
|
The NTCP transport allows passing I2P messages on top of TCP. The N in NTCP stands for 'New', as the NTCP transport replaces an older TCP transport which had issues concerning congestion collapse.