High Level Explanation:
Transport layer is very self explanatory by itself, it will be responsible for the for the delivery of the package. Imagine that you as a person can send the letter to a address (layer three) but who actually make sure that the latter will reach the right person ? that is right the mail person (layer four). It controls and responds if the node in which the “address” is destined to is reachable and if not how to handle it (error control). And what if you send a huge component let’s say a industrial machine, you can’t really send it using only one package or transport that is when the “mail person” will choose which boxes to use or if it will be transported via plane, ship, truck etc (Segmentation)
Low Level Explanation: link to which I took this paragraph from
The transport layer controls the reliability of a given link through flow control, segmentation/desegmentation, and error control. Some protocols are state- and connection-oriented (TCP). This means that the transport layer can keep track of the segments and retransmit those that fail delivery. The transport layer also provides the acknowledgement of the successful data transmission and sends the next data if no errors occurred. The transport layer creates segments out of the message received from the application layer. Segmentation is the process of dividing a long message into smaller messages.
In other words the layer four is also the spokesperson between layer 3 and 5,6, and 7 . It will tell layer three if a package failed to be delivered and ask another one to substitute the one that hasn’t reached its destination, and layers 5,6, and 7 which protocol they will be using , number of packages that they are supposed to receive and so on.
This layer doesn’t really have any hardware, bacause its only purpose is mainly focused about two protocols which will be discuss next.
The protocols used by this layer are the TCP and UDP.
TCP: is a connection-oriented protocol which will make sure that every bit send by the server is delivery to the destined node for example when you send a message or send a email to a person.
UDP: is a connection-less protocol which doesn’t care all data send will be delivery or not as long as it gets send to the destined node like all steaming platform uses when a person is live streaming something.