Hack the Stack: Using Snort and Ethereal to Master the 8 Layers of an Insecure Network

The Transport layer (layer 4) is responsible for the reliable and efficient communication between programs called endpoints.The exchange can be peer-to-peer (e.g., an instant messaging application) or it can be a client/server interaction (e.g., a Web browser sending a request to a Web server).
Two kinds of protocols are encountered at the Transport layer: connection-oriented and connectionless. Both of these alternatives are available in most modern protocol suites (e.g., IPX and SPX solutions from Novell,Transmission Control Protocol [TCP] and User Datagram Program [UDP] in the TCP/IP [Transmission Control Protocol/Internet Protocol] design, and Network Basic Input/Output System [NetBIOS] Datagram and Session services). All networking systems demand both types of service.
Each protocol has pros and cons that motivate programmers to select one depending on what he or she is trying to accomplish via the network. End users do not choose what protocol is used; that is a programming decision. Generally, trivial and ad-hoc exchanges across the network are done in a connectionless manner. More persistent network relationships are largely handled with connection-oriented solutions, especially when a substantial amount of data is being transferred.
At the Transport layer you will find additional error checking and retransmission logic to ensure that all of the messages sent arrive intact at the receiving end. A checksum or similar mechanism is generally used to ensure message integrity. Retransmission strategies vary; however, in the case of TCP, data that is not positively acknowledged by the recipient in a timely way is retransmitted.