brook server protocol

Terminology

Client --TCP--> Server

Client Nonce + [AES_GCM(Fragment Length) + AES_GCM(Fragment)]...

The maximum length of AES_GCM(Fragment Length) + AES_GCM(Fragment) is 2048 bytes

Server --TCP--> Client

Server Nonce + [AES_GCM(Fragment Length) + AES_GCM(Fragment)]...

The maximum length of AES_GCM(Fragment Length) + AES_GCM(Fragment) is 2048 bytes

Client --UDP--> Server

Client Nonce + AES_GCM(Fragment)

The maximum length of Client Nonce + AES_GCM(Fragment) is 65507 bytes

Server --UDP--> Client

Server Nonce + AES_GCM(Fragment)

The maximum length of Server Nonce + AES_GCM(Fragment) is 65507 bytes

Client --UDP(UDP over TCP)--> Server

Client Nonce + [AES_GCM(Fragment Length) + AES_GCM(Fragment)]...

The maximum length of AES_GCM(Fragment Length) + AES_GCM(Fragment) is 65507 bytes, but the maximum length if the first one is 2048 bytes

Server --UDP(UDP over TCP)--> Client

Server Nonce + [AES_GCM(Fragment Length) + AES_GCM(Fragment)]...

The maximum length of AES_GCM(Fragment Length) + AES_GCM(Fragment) is 65507 bytes