CCNA Certification/Transport Layer

=Transport Layer=
The transport layer is the second highest layer in the TCP/IP reference model. It responds to service requests from the application layer and issues service requests to the network layer. It is also the name of layer four of the seven layer OSI model, where it responds to service requests from the session layer and issues service requests to the network layer. The definitions of the transport layer are slightly different in these two models. The following text primarily refers to the TCP/IP model.
The transport layer provides transparent transfer of data between hosts. It is usually responsible for end-to-end connection, error recovery, flow control, and ensuring complete data transfer. In the Internet protocol suite(TCP/IP) this function is most commonly achieved by the connection oriented Transmission Control Protocol (TCP). The datagram-type transport, User Datagram Protocol (UDP), provides neither error recovery nor flow control, leaving these to the application. The purpose of the Transport layer is to provide transparent transfer of data between end users, thus relieving the upper layers from any concern with providing reliable and cost-effective data transfer. 
The transport layer usually turns the unreliable and very basic service provided by the Network layer into a more powerful one. There is a long list of services that can be optionally provided at this level. None of them are compulsory, because not all applications want all the services available. Some can be wasted overhead, or even counterproductive in some cases.
On the Internet there are a variety of Transport services, but the two most common are TCP and UDP. TCP is the more complicated, providing a connection and byte oriented stream which is almost error free, with flow control, multiple ports, and same order delivery. UDP is a very simple 'datagram' service, which provides limited error reduction and multiple ports. TCP stands for Transmission Control Protocol, while UDP stands for User Datagram Protocol. Other options are the Datagram Congestion Control Protocol (DCCP) and Stream Control Transmission Protocol (SCTP).
Some things, such as connection orientation can be implemented at either Transport or Network layer. The idea is that the Network layer implements whatever set of options is easiest: for some underlying networks it is easiest to implement connectionless communication, while for others it is easiest to implement connection oriented communication. The Transport layer uses this simplest set of options to implement whatever combinations of options are actually desired.
TCP.
The Transmission Control Protocol (TCP) is one of the core protocols of the Internet protocol suite, often simply referred to as TCP/IP. Using TCP, applications on networked hosts can create "connections" to one another, over which they can exchange streams of data using Stream Sockets. The protocol guarantees reliable and in-order delivery of data from sender to receiver. TCP also distinguishes data for multiple connections by concurrent applications ("e.g.", Web server and e-mail server) running on the same host.
TCP supports many of the Internet's most popular application protocols and resulting applications, including the World Wide Web, e-mail, File Transfer Protocol and Secure Shell.
In the Internet protocol suite, TCP is the intermediate layer between the Internet Protocol (IP) below it, application above it. Applications often need reliable pipe-like connections to each other, whereas the Internet Protocol does not provide such streams, but rather only best effort delivery ("i.e.", unreliable packets). TCP does the task of the transport layer in the simplified OSI model of computer networks. The other main transport-level Internet protocol is UDP.
Applications send streams of octets (8-bit bytes) to TCP for delivery through the network, and TCP divides the byte stream into appropriately sized segments (usually delineated by the maximum transmission unit (MTU) size of the data link layer of the network to which the computer is attached). TCP then passes the resulting packets to the Internet Protocol, for delivery through a network to the TCP module of the entity at the other end. TCP checks to make sure that no packets are lost by giving each packet a "sequence number", which is also used to make sure that the data are delivered to the entity at the other end in the correct order. The TCP module at the far end sends back an "acknowledgment" for packets which have been successfully received; a timer at the sending TCP will cause a "timeout" if an acknowledgment is not received within a reasonable round-trip time ( RTT), and the (presumably lost) data will then be "re-transmitted". The TCP checks that no bytes are damaged by using a checksum; one is computed at the sender for each block of data before it is sent, and checked at the receiver.
UDP.
The User Datagram Protocol (UDP) is one of the core protocols of the Internet protocol suite. Using UDP, programs on networked computers can send short messages sometimes known as "datagrams" to one another. UDP is sometimes called the Universal Datagram Protocol or Unreliable Datagram Protocol.
UDP does not provide the reliability and ordering that TCP does. Datagrams may arrive out of order, appear duplicated, or go missing without notice. Without the overhead of checking whether every packet actually arrived, UDP is faster and more efficient for many lightweight or time-sensitive purposes. Also, its stateless nature is useful for servers that answer small queries from huge numbers of clients. Compared to TCP, UDP is required for Broadcasting (send to all on local network) and multicast (send to all subscribers).
Common network applications that use UDP include the Domain Name System (DNS), streaming media applications such as IPTV, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online games.
Ports.
UDP utilizes ports to allow application-to-application communication.
The port field is 16-bits so the valid range is 0 to 65,535.
Port 0 is reserved, but is a permissible source port value if the sending process does not expect messages in response.
Ports 1 through 1023 are named "well-known" ports and on Unix-derived operating systems binding to one of these ports requires root access.
Ports 1024 through 49,151 are registered ports.
Ports 49,152 through 65,535 are ephemeral ports and are used as temporary ports primarily by clients when communicating to servers.