This wiki is now locked - both user registration and edits (except by admins) are disabled. We're currently migrating all the content to our new wiki. If you have time, please register and help us out!

You can still view the source code of every page. Once a page has been copied over to the new wiki, please add a link to it to MigratedPages (the only page which is still editable), to notify the admins to go and blank it.


Old Packet Format


The packet format currently used by Freenet 0.7. See the proposed new packet format, which is somewhat more secure.

Key setup

A four-stage Station-To-Station protocol variant, soon to be replaced with JFKi.

Authentication/link setup packets are super-encrypted with a temporary setup key derived from the identities of the nodes involved. The plaintext (the actual STS exchange) is padded with between 0 and 100 bytes of random data, is encrypted, and an IV and hash of the plaintext are prepended. Thus the packets are variable size and contain no recognisable bytes. The key exchange produces a single session key which is used in both directions. For more details, check the source! :)

Link Packets

Packet:
- Hash of plaintext (32 bytes)
- Plaintext encrypted using session key in PCFB mode (= CFB as we use 256/256 rijndael), with IV = the above hash

Plaintext:
- Sequence number (4 bytes)
- Random padding (12 bytes)
- Version = 0 (1 byte)
- Sequence number (4 bytes) - may be -1 if no messages included, otherwise incremented on each packet sent
- Real sequence number (4 bytes) - only included if sequence number = -1
- Reference sequence number (4 bytes) - last seen sequence number of *incoming* packets
- Number of acks (1 byte, unsigned)
- Ack's (1 byte, unsigned offsets from the reference sequence number)
- Number of retransmit requests
- Retransmit requests (as ack's)
- Number of ack requests
- Ack requests (relative to seqno/real seqno)
- Number of forgotten packets
- Forgotten packet numbers (relative to seqno/real seqno)
- Number of messages (1 byte unsigned)
- Messages

Note that much of the above is dictated by the current rather bizarre custom retransmission/acknowledgement algorithm. The NewPacketFormat includes a much better algorithm for retransmission, based on TCP.
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki