TCP[1] and UDP[2] are both transport layer protocols, but they serve different purposes:
The choice between TCP[1] and UDP[2] depends on whether reliability or speed is more important for the application.