Almost every Smart Messaging formats have own port number. The terminal which is receiving Smart Messaging message indicates the message type according the port number.
Picture Message and Downloadable Profile are exceptions. These Multipart Messages have same port number and indication between them (and possible future extensions) is made in the beginning of the user data part.
The list of the reserved port numbers can be found in the Smart Messaging specification. In the Smart Messaging specification 3.0.0 the list locates in the Appendix A