TCP/IP Transport Layer (Layer 4)

Layer 4 is the Transport layer. The transport layer creates virtual Transfer Control Protocol (TCP) or User Datagram Protocol (UDP) connections between network hosts.

This layer sends and receives data to and from the applications running on its host. The Transport layer assigns port numbers to the processes running in applications on the host and adds a TCP or UDP header to the messages received from the applications detailing the source and destination port numbers.

Note that some of the applications, specifically Telnet, SMTP, and HTTP require TCP as the transport protocol while the others use UDP.

Click image to enlarge.

Some applications require reliable ordered delivery of packets. The TCP protocol provides this capability. It uses error detection, retransmissions and acknowledgements. This protocol cares about your data.

Other applications don’t care if every packet is received. These applications can take advantage UDP’s lower overhead to enable faster transmissions.

Typical TCP applications include email and web browsing and typical UDP applications include VoIP and music streaming.

TCP is strictly used for point to point or unicast transmissions while UDP can also be used for multicast and broadcast transmissions.


TCP and UDP Headers

The header added to messages by the Transport layer includes more than just the source and destination port numbers. Here we are showing all the information included in TCP and UDP headers.

Note how the TCP protocol requires more information and overhead to guarantee data delivery.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.