1. A method for optimized message processing, the method comprising: receiving a message including header information; determining, using the header information, that a fast-path identification rule does not exist for identifying a protocol of the message; and in response to determining that the fast-path identification rule does not exist: identifying the protocol of the message using slow-path processing, determining the fast-path identification rule using the slow-path processing, wherein the fast-path identification rule includes a mask that indicates locations of protocol-identifying data in messages associated with the protocol, and storing the fast-path identification rule in a memory.