4.1: Session: Logon: 141=Y Process

Imported from previous forum

[ original email was from Witold Sames - witold@javtech.com ]
The spec (4.2) says about the procedure to reset sequence numbers (the session):

"When using the ResetSeqNumFlag to maintain 24 hour connectivity and establish a new set of sequence numbers, the process should be as follows. … the initiator should send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1. The acceptor should respond with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1. At this point new messages from either side should continue with MsgSeqNum of 2. It should be noted that once the initiator sends the Logon with the ResetSeqNumFlag set, the acceptor must obey this request and the message with the last sequence number transmitted "yesterday" may no
longer be available."

Imagine that A sends such a Logon with 141=Y, and B replies with a Logon that does not even have tag 141 in it. Would that mean that party B would now only reset the incoming sequence number counter for the connection with party A (they had sent that flag after all), and keep their outgoing
counter for the connection to A where it was? Or does a 141=Y actually mean “let’s just both start from 1 again”?

That case would “violate” the mutual agreement between counterparties to support this and result in session failure, most likely. You can’t reset just one side of the connection w/ this field and both parties should specify it as to explictly ack and agree to it. You also have to account for the fact the other side could be sending new messages at the same time you send the first Logon w/ ResetSeqNumFlag and thus you can’t consider the session actually reset until you receive their Logon ack w/ ResetSeqNumFlag set.

This is a powerful and useful feature and is by no means bulletproof and certainly requires counteparty agreement.

> The spec (4.2) says about the procedure to reset sequence numbers (the session):
>
>
> “When using the ResetSeqNumFlag to maintain 24 hour connectivity and establish a new set of sequence numbers, the process should be as follows. … the initiator should send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1. The acceptor should respond with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1. At this point new messages from either side should continue with MsgSeqNum of 2. It should be noted that once the initiator sends the Logon with the ResetSeqNumFlag set, the acceptor must obey this request and the message with the last sequence number transmitted “yesterday” may no
> longer be available.”
>
> Imagine that A sends such a Logon with 141=Y, and B replies with a Logon that does not even have tag 141 in it. Would that mean that party B would now only reset the incoming sequence number counter for the connection with party A (they had sent that flag after all), and keep their outgoing
> counter for the connection to A where it was? Or does a 141=Y actually mean “let’s just both start from 1 again”?
>
>
>