> On 7 Dec 2015, at 11:00 PM, Software Engineer 979 <softeng...@gmail.com> 
> wrote:
> 
> 
>> Hello,
>> 
>> I'm currently developing an data transfer application using OpenSSL. The 
>> application is required to securely transfer large amounts of data over a 
>> low latency/high bandwidth network. The data being transferred lives in a 
>> 3rd part application that uses 1 MB buffer to transfer data to my 
>> application. When I hook OpenSSL into my application I notice an appreciable 
>> decline in network throughput. I've traced the issue the default TLS record 
>> size of 16K. The smaller record size causes the 3rd party application's 
>> buffer to be segmented into 4 16K buffers per write and the resulting 
>> overhead considerably slows things down. I've since modified the version of 
>> OpenSSL that I'm using to support an arbitrary TLS record size allowing 
>> OpenSSL to scale up to 1MB or larger TLS record size. Since this change, my 
>> network throughput has dramatically increased (187% degradation down to 
>> 33%). 
>> 
>> I subsequently checked the TLS RFC to determine why a 16K record size was 
>> being used, and all could find was the following:
>> 
>> length
>>       The length (in bytes) of the following TLSCompressed.fragment. 
>>       The length MUST NOT exceed 2^14 + 1024.
>> 
>> The language here is pretty explicit stating that the length must not exceed 
>> 16K (+ some change).Does anyone know the reason for this? Is there a 
>> cryptographic reason why we shouldn't exceed this message size? Based on my 
>> limited experiment, it would appear that a larger record size would benefit 
>> low latency/high bandwidth networks.

This is only a guess, but you usually want to fetch the entire record off the 
network before you begin decrypting and checking MAC (unfortunately, it that 
order), so the intention was to limit that amount of buffering the receiver is 
required to do. Perhaps also allow for more parallel network fetching and 
decryption.  In either case, these are decisions made almost 20 years ago in 
SSLv3, and they may or may not make sense today. Although with all the IoT 
devices, it might make even more sense today to reduce buffering requirements.

Yoav


_______________________________________________
TLS mailing list
TLS@ietf.org
https://www.ietf.org/mailman/listinfo/tls

Reply via email to