Client send MaxMessageSize smaller then defined min buffer size of 8192|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Client send MaxMessageSize smaller then defined min buffer size of 8192
Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
1
07/18/2019 - 03:40
sp_Permalink sp_Print

If a client sends for instance MaxMessageSize=5000 whereby specified is that the smallet BufferSize is 8192 what should the server return in the Acknowledge Message? Or should it send an ErrorMsg?

br
Martin

Avatar
Randy Armstrong
Admin
Forum Posts: 1563
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
07/18/2019 - 07:48
sp_Permalink sp_Print

It should return 8192 for the ReceiveBufferSize and SendBufferSize.

MaxMessageSize could be smaller than the ReceiveBufferSize/SendBufferSize because it only constrains the unencrypted message body.The signature and MessageChunk headers are not included.

This also means the 8192 byte limit does not apply to the MaxMessageSize  - the limit only applies to the ReceiveBufferSize/SendBufferSize.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
3
07/19/2019 - 03:47
sp_Permalink sp_Print

Thanks for clarification!

This means if a client request e.g. MaxMessageSize = 1 all responses will end in an ErrMsg?
And only if the client send a HEL msg with smaller buffers then 8192 the server return the error code Bad_InvalidArgument or Bad_InvalidArgument?

Avatar
Randy Armstrong
Admin
Forum Posts: 1563
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
07/21/2019 - 15:58
sp_Permalink sp_Print

MaxMessageSize=1 would be an error since no UA service message can fit in 1 bytes.

If a client requests buffers less than 8192 the server returns what it requires.

It is up to the client to decide if it can deal with the server requirements.

Once the server returns the ACK it can assume that if the client continues that it accepts the new terms.

The 8196 min will be reduced when we release the ECC profiles.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
5
07/23/2019 - 06:51
sp_Permalink sp_Print

"MaxMessageSize=1 would be an error since no UA service message can fit in 1 bytes."

How should be this signalled to the client? Which statuscode is the correct one? So the HelloMsg will be answered with an ErrorMsg. Anyway I'm wondering that there is no minimum specified.

"If a client requests buffers less than 8192 the server returns what it requires.
It is up to the client to decide if it can deal with the server requirements.
Once the server returns the ACK it can assume that if the client continues that it accepts the new terms."

Where is this written in the spec?

For me is the MaxMessageSize a unidiretional informartion which can not be revised by the server as in the UA Services.

The spec says for the HelloMessage (1.04, Table 51):

MaxMesageSize: The maximum size for any response Message. The Server shall abort the Message with a Bad_ResponseTooLarge Error Message if a response Message exceeds this value. 

AcknowledgeMessage (1.04, Table 52):

MaxMesageSize: The maximum size for any request Message. The Client shall abort the Message with a Bad_RequestTooLarge StatusCode if a request Message exceeds this value. 

Avatar
Randy Armstrong
Admin
Forum Posts: 1563
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
6
07/23/2019 - 18:23
sp_Permalink sp_Print sp_EditHistory

There is an important distinction between BufferSize and MessageSize.

BufferSize is maximum size for any single MessageChunck. This has a 8192 minimum but will be reduced for ECC security policies.

MessageSize is the maximum length of an unencrypted Message that can be split into multiple MessageChunks.

The maximum number of MessageChunks = MaxMesageSize/BufferSize.

The requirements for MaxMessageSize say an error is returned after a single message actually exceeds the MaxMessageSize . It is not an error that is returned based on hypothetical possibility that a single message could exceed that limit.

7.1.3 Establishing a connection describes the negotiation and does not require any error message to be returned by the Server if it can't deal with the Client buffer sizes it responds with what it can and the Client decides.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
7
07/30/2019 - 07:24
sp_Permalink sp_Print

Ok, thanks.

So this means:

1. Scenario: A Client requests a MaxMessageSize = 5000 (HEL Msg), the server responses with MaxMessageSize = 7000 (Acknodlegde Msg).

2. Scenraio: A Client requests a MaxMessageSize = 4000, the server responses with MaxMessageSize = 2000.

Both scenarios the Client decides whether it establishes the connection or not, correct?

Avatar
Randy Armstrong
Admin
Forum Posts: 1563
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
8
07/30/2019 - 07:40
sp_Permalink sp_Print

Yes that is correct.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 15
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1431
Posts: 4848