The main purpose of the layer 4 port assignment is to identify the processes that communicate with the end services and provide the host-to-host communication services for those processes. The layer 4 port assignment is also known as a transport layer; these layers are essential to communications but also help with things such as reliability and flow control.
This layer and port assignment ensures that data is delivered to the right application process in the computer. In order to complete its function, the transport layer has to be able to do multiple tasks at once, such as error detecting and using virtual circuits. The port numbers that are assigned to various layers are what allows someone to read email and watch videos at the same time on a computer. These functions each use different ports to avoid conflicts.