Both of these are models are for our reference. They are for explaining protocol to protocol and protocol to api/application interactions to humans. They are also both imperfect when we try to make everything neatly fit. TCP, whether we are describing it with the TCP/IP Model or the OSI model, provides reliable transport. UDP, again regardless of the model we are applying it to, does not provide reliable transport. I totally understand the challenge this creates when learning this stuff. I always use the OSI model personally. The TCP/IP model is even sometimes shown as a 4 layer model and other times as a 5 layer model.
Yes I understand that TCP provides reliability and udp does not , but I don't understand why people are contrasting those 2 sentences : In OSI model the transport layer guarantees the delivery of packets. In TCP/IP model the transport layer does not guarantees delivery of packets
Perhaps they are saying that reliable delivery is mandatory in OSI and not mandatory in TCP/IP. Clearly it's not a hard requirement as UDP is lumped in with TCP and UDP does not guarantee reliable delivery. I'm looking at the OSI definition of the Transport Layer (straight out of the document) and while there's no specific mention of "guaranteed delivery" or that it's mandatory, it says (among other things):
188.8.131.52 The transport-service provides transparent transfer of data between session-entities and relieves them from any concern with the detailed way in which reliable and cost effective transfer of data is achieved.
184.108.40.206 Data Transfer
This facility provides data transfer in accordance with the agreed upon quality of service. When the quality of service cannot be maintaine and all possible recovery attempts have failed, the transport-connection is terminated and the session-entities are notified.
This implies that the inability to maintain reliable data transfer will result in the tearing down of the Transport layer service. It doesn't seem to suggest that there's an unreliable delivery option for the Transport layer in the OSI model.