I was reading answers to this this SO question explaining how the firewall will take certain actions dependent on the protocol data was sent over (such as FTP vs HTTP, etc.). In addition, the router will have the data rerouted differently dependent on whether it is UDP port X or TCP port X.
1) Is there a standard for encoding what protocol data was sent over in the data itself?
2) Are the protocols for all layers (1-7 in the OSI model) encoded in the message, or just certain layers such as transport layer and application layer?