According to Wikipedia, Otway-Ress protocol is as follow:
The protocol can be specified as follows in security protocol notation, where Alice is authenticating herself to Bob using a server $S$ ($M$ is a session-identifier, $N_A$ and $N_B$ are nonces):
\begin{align} A & \rightarrow B : M,A,B, \{N_A,M,A,B\}_{K_{AS}}\\ B & \rightarrow S : M,A,B, \{N_A,M,A,B\}_{K_{AS}},\{N_B,M,A,B\}_{K_{BS}}\\ S & \rightarrow B : M, \{N_A,K_{AB}\}_{K_{AS}},\{N_B,K_{AB}\}_{K_{BS}}\\ B & \rightarrow A : M, \{N_A,K_{AB}\}_{K_{AS}} \end{align}
What is the role of $M$, the session identifier, in the security of protocol?
What will happen if we remove all $M$ in the protocol? (I think there will be no flow, I don't understand the role of $M$)