[cifs-protocol] SR# 117072516091337 :SMB2 ECHO request

Jeff McCashland jeffm at microsoft.com
Wed Jul 26 21:26:14 UTC 2017


Hi Andreas,

You are correct, Windows and SMB2 allow SessionId to be 0 for ECHO, but do not require it. It is necessary to establish a Session, but the ID does not need to be passed with the ECHO request. Non-zero MessageId is also needed, but neither a Tree Connection nor TID are necessary for ECHO. 

Client behavior in regards to ECHO is implementation-specific (there is no mention in section 3.2). ECHO is merely a keep-alive ping to see if the server is responsive, so any response could be considered success. All the Server does (besides disconnecting the connection if Connection.SessionTable is empty) is validate the structure of the request. If the server returns STATUS_INVALID_PARAMETER, this indicates the Client formed the request incorrectly, but shows the Server is responsive (as does any response, error or success). 

SMB1 had a lot of ECHO processing, where all known servers were regularly pinged, then the connection was disconnected if a server didn't respond in a timely manner. SMB2 has significantly simplified and reduced ECHO processing. Windows client doesn't initiate an ECHO (as far as I've been able to find), and only checks the response for valid structure, otherwise, receiving any response is considered success. However, other clients may behave differently.

SMB2 Client also has a Request Expiration timer (3.2.2.1 - optional) and Idle Connection Timer (3.2.2.2) which appear to serve the purpose previously filled by ECHO. 

Please let me know if you have any further questions or concerns on this issue.

Best regards,
Jeff McCashland | Senior Escalation Engineer | Microsoft Protocol Open Specifications Team 
Phone: +1 (425) 703-8300 x38300 | Hours: 9am-5pm | Time zone: (UTC-08:00) Pacific Time (US and Canada)
Local country phone number found here: http://support.microsoft.com/globalenglish | Extension 1138300
We value your feedback.  My manager is Rama Ganesan (ramagane), +1 (425) 703-8712

-----Original Message-----
From: Jeff McCashland 
Sent: Tuesday, July 25, 2017 9:44 AM
To: Andreas Schneider <asn at samba.org>
Cc: cifs-protocol <cifs-protocol at lists.samba.org>; MSSolve Case Email <casemail at microsoft.com>
Subject: RE: SR# 117072516091337 :SMB2 ECHO request

Thanks Will! [Will to BCC, casemail on CC]

Hi Andreas,

I will research your SMB2 ECHO questions and let you know what I find. 

Best regards,
Jeff McCashland | Senior Escalation Engineer | Microsoft Protocol Open Specifications Team
Phone: +1 (425) 703-8300 x38300 | Hours: 9am-5pm | Time zone: (UTC-08:00) Pacific Time (US and Canada) Local country phone number found here: http://support.microsoft.com/globalenglish | Extension 1138300 We value your feedback.  My manager is Rama Ganesan (ramagane), +1 (425) 703-8712

-----Original Message-----
From: Will Gregg
Sent: Tuesday, July 25, 2017 8:56 AM
To: Andreas Schneider <asn at samba.org>
Cc: cifs-protocol <cifs-protocol at lists.samba.org>
Subject: RE: SR# 117072516091337 :SMB2 ECHO request

Hi Andreas,

Thank you for contacting the Open Specification Support Team regarding your SMB2 question. I have created a service request for your question and a member of the team will be reaching out to you regarding your issue.

Sincerely,
Will Gregg | escalation engineer | open specifications


-----Original Message-----
From: Andreas Schneider [mailto:asn at samba.org]
Sent: Tuesday, July 25, 2017 10:34 AM
To: Interoperability Documentation Help <dochelp at microsoft.com>
Cc: cifs-protocol <cifs-protocol at lists.samba.org>
Subject: SMB2 ECHO request

[You don't often get email from ASN at SAMBA.ORG. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]

Hello dochelp,

The documentation currently state:

~~~~~~~~~~~~~
2.2.28 SMB2 ECHO Request

The SMB2 ECHO Request packet is sent by a client to determine whether a server is processing requests. This request is composed of an SMB2 header, as specified in section 2.2.1, followed by this request structure:

StructureSize | Reserved | StructureSize (2 bytes): The client MUST set this to 4, indicating the size of the request structure, not including the header.
Reserved (2 bytes): This field MUST NOT be used and MUST be reserved. The client MUST set this to 0, and the server MUST ignore it on receipt.
~~~~~~~~~~~~~

and

~~~~~~~~~~~~~
2.2.1.1 SMB2 Packet Header - ASYNC

SessionId (8 bytes): Uniquely identifies the established session for the command. This field MUST be set to 0 for an SMB2 NEGOTIATE Request (section
2.2.3) and for an SMB2 NEGOTIATE Response (section 2.2.4).
~~~~~~~~~~~~~

Is it allowed to set the sessionID to 0 for an SMB2 ECHO request too? It looks like Windows allows this.


In addition to the above question, if the client receives an error in the SMB2 ECHO response (STATUS_INVALID_PARAMETER or STAUTS_USER_SESSION_DELETED) should the client terminate the connection to the SMB server?

Could you please clarify?


Thank you very much for your help.



Cheers,


        Andreas

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
https://na01.safelinks.protection.outlook.com/?url=www.samba.org&data=02%7C01%7Cdochelp%40windows.microsoft.com%7C59afbbdce2da4dab58ba08d4d3729d14%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636365936598264051&sdata=m4GXEN22gfEgw4Xf2r68kXiK1qjXNd0SSxnBZAI3k7k%3D&reserved=0




More information about the cifs-protocol mailing list