[MS-SMB2] MaxTransactSize and MaxReadSize values clarification

Oleksandr 0 Reputation points
2024-02-02T14:12:18.7933333+00:00

I'm investigating documentation about the SMB protocol. And a misunderstanding arose between these two values.

2.2.4 SMB2 NEGOTIATE Response MaxTransactSize (4 bytes): The maximum size, in bytes, of the buffer that can be used for QUERY_INFO, QUERY_DIRECTORY, SET_INFO and CHANGE_NOTIFY operations. This field is applicable only for buffers sent by the client in SET_INFO requests, or returned from the server in QUERY_INFO, QUERY_DIRECTORY, and CHANGE_NOTIFY responses.

And

MaxReadSize (4 bytes): The maximum size, in bytes, of the Length in an SMB2 READ Request (section 2.2.19) that the server will accept.

The documentation describes that

3.2.5.1 Receiving Any Message
If the message size received exceeds Connection.MaxTransactSize, the client MUST disconnect the connection.

This statement means that MaxReadSize must be less than or equal to MaxTransactSize.
Or, only QUERY_INFO, QUERY_DIRECTORY, SET_INFO and CHANGE_NOTIFY operations depend on the MaxTransactSize value, and MaxReadSize can be greater than MaxTransactSize.

Could you please clarify this misunderstanding?

Windows Open Specifications
Windows Open Specifications
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
39 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Obaid Farooqi MSFT 511 Reputation points Microsoft Employee
    2024-02-03T02:19:07.64+00:00

    Hi Oleksandr

    MaxTransactSize and MaxReadSize are set to the same value which is 8388608 for Windows versions after 8 and Windows server versions 2012 and later.

    This information is repeated several places in section "6 Appendix A: Product Behavior".

    Please let me know if this does not answer your question.

    Regards,

    Obaid Farooqi - MSFT


  2. Obaid Farooqi MSFT 511 Reputation points Microsoft Employee
    2024-02-12T22:38:23.78+00:00

    Hi Oleksandr: There is no requirement that MaxTransactSize and MaxReadSize be the same. The number chosen is based on the internal details of the platform and file system on which SMB server is implemented. Your server can choose its own numbers. Please consult MS-SMB2 for any limitation of maximum or minimum values to interoperate with Windows. Regards, Obaid Farooqi - MSFT

    0 comments No comments

  3. Tal Aloni 0 Reputation points
    2024-02-13T09:36:02.0833333+00:00

    Hello Obaid and thank you for answering, While true that there is no requirement that MaxTransactSize and MaxReadSize be the same, I understand from section 3.2.5.1 Receiving Any Message ("If the message size received exceeds Connection.MaxTransactSize, the client MUST disconnect the connection"), that MaxReadSize must be less than or equal to MaxTransactSize, do you concur?

    0 comments No comments

  4. Obaid Farooqi MSFT 511 Reputation points Microsoft Employee
    2024-02-16T18:08:33.62+00:00

    Hi @Tal Aloni My colleague Sreekanth has provided explanation about the MaxTransactSzie and MaxReadSize in the following thread: https://learn.microsoft.com/en-us/answers/questions/1522049/(ms-smb2)-clarification-regarding-the-relationship Please let me know if that clears up this issue for you. Regards, Obaid Farooqi - MSFT

    0 comments No comments