Layer 4 is between the application that the user interacts with and the network of computers that receive data generated by the client.
Data from the previous layers comes into this layer to be categorized into individual segments.
The layer includes the TCP and UDP protocols, which can be thought of as a software password on the machine involved in the data exchange.
- TCP – ensures the delivery of data in a correct form, which uses different methods of checks. TCP is more accurate but slower than UDP, so it is used for example in authorization.
- UDP – transfers data from one device to another without checking the integrity of the bits in the minimum time. It is used where a small loss of data is not critical. For example, for video or audio.