At which level of OSI model is a decision made whether to use TCP or UDP

The decision on whether to use TCP or UDP is typically made at the Transport layer (Layer 4) of the OSI model. This layer is responsible for establishing, maintaining, and terminating connections between devices, as well as for handling the segmentation and reassembly of data. TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two of the most common protocols used at this layer, and they each have different characteristics that make them suitable for different types of communication.