Skip to content

Commit

Permalink
[docs] add knet packet layout
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Aug 21, 2019
1 parent 2e433d3 commit b7d0f70
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions libknet/threads_pmtud.c
Expand Up @@ -91,6 +91,28 @@ static int _handle_check_link_pmtud(knet_handle_t knet_h, struct knet_host *dst_
failsafe++;
}

/*
* unencrypted packet looks like:
*
* | ip | protocol | knet_header | unencrypted data |
* | onwire_len |
* | overhead_len |
* | data_len |
* | app MTU |
*
* encrypted packet looks like (not to scale):
*
* | ip | protocol | salt | crypto(knet_header | data) | crypto_data_pad | hash |
* | onwire_len |
* | overhead_len |
* | data_len |
* | app MTU |
*
* knet_h->sec_block_size is >= 0 if encryption will pad the data
* knet_h->sec_salt_size is >= 0 if encryption is enabled
* knet_h->sec_hash_size is >= 0 if signing is enabled
*/

data_len = onwire_len - overhead_len;

if (knet_h->crypto_instance) {
Expand Down

0 comments on commit b7d0f70

Please sign in to comment.