Professional Documents
Culture Documents
Transport Layer
INTRODUCTION (9.0)
Data networks and the Internet support the
human network by supplying reliable
communication between people. On a single
device, people can use multiple applications and
services such as email, the web, and instant
messaging to send messages or retrieve
information. Data from each of these
applications is packaged, transported, and
delivered to the appropriate application on the
destination device.
Figure 9-1 Enabling Applications on Devices to Communicate
The processes described in the OSI transport layer
accept data from the application layer and prepare
it for addressing at the network layer. A source Transport Layer Responsibilities
computer communicates with a receiving computer (9.1.1.2)
to decide how to break up data into segments, how
to make sure none of the segments get lost, and Tracking Individual Conversations
how to verify all the segments arrived. When
thinking about the transport layer, think of a At the transport layer, each set of data flowing
shipping department preparing a single order of between a source application and a destination
multiple packages for delivery. application is known as a conversation (Figure 9-
2). A host may have multiple applications that
are communicating across the network
simultaneously. Each of these applications
TRANSPORT LAYER
communicates with one or more applications on
PROTOCOLS (9.1) one or more remote hosts. It is the responsibility
As previously discussed, for communication to of the transport layer to maintain and track these
occur between source and destination, a set of multiple conversations.
rules or protocols must be followed. This section
focuses on the protocols at the transport layer.
At the destination, the transport layer must be able Figure 9-5 Multiplexing Conversations
to reconstruct the pieces of data into a complete
data stream that is useful to the application layer. To identify each segment of data, the transport
The protocols at the transport layer describe how layer adds a header containing binary data
the transport layer header information is used to organized into several fields. It is the values in these
reassemble the data pieces into streams to be fields that enable various transport layer protocols
passed to the application layer. to perform different functions in managing data
communication.
Identifying the Applications
Transport Layer Reliability (9.1.1.4)
To pass data streams to the proper applications,
the transport layer must identify the target The transport layer is also responsible for
application (Figure 9-4). To accomplish this, the managing reliability requirements of a
transport layer assigns each application an conversation. Different applications have
identifier called a port number. Each software different transport reliability requirements.
process that needs to access the network is IP is concerned only with the structure, addressing,
assigned a port number unique to that host. and routing of packets. IP does not specify how the
delivery or transportation of the packets takes
place. Transport protocols specify how to transfer
messages between hosts. TCP/IP provides two
transport layer protocols, Transmission Control
Protocol (TCP) and User Datagram Protocol
(UDP), as shown in Figure 9-6. IP uses these
transport protocols to enable hosts to communicate
and transfer data.
TCP (9.1.1.5)
TCP transport is analogous to sending packages
that are tracked from source to destination. If a
shipping order is broken up into several
packages, a customer can check online to see the
order of the delivery.
With TCP, there are three basic operations of Figure 9-7 Choosing a Transport Layer Protocol
reliability:
For example, applications such as databases, web
Numbering and tracking data segments
browsers, and email clients, require that all data
transmitted to a specific host from a specific that is sent arrives at the destination in its original
application condition. Any missing data could cause a corrupt
Acknowledging received data communication that is either incomplete or
Retransmitting any unacknowledged data after a unreadable. These applications are designed to use
certain period of time TCP.
In other cases, an application can tolerate some
UDP (9.1.1.6) data loss during transmission over the network, but
delays in transmission are unacceptable. UDP is the
Whereas the TCP reliability functions provide better choice for these applications because less
more robust communication between network overhead is required. UDP is preferable for
applications, they also incur additional overhead applications such as streaming live audio, live
and possible delays in transmission. There is a video, and Voice over IP (VoIP).
trade-off between the value of reliability and the Acknowledgements and retransmission would slow
burden it places on network resources. Adding down delivery.
overhead to ensure reliability for some For example, if one or two segments of a live video
applications could reduce the usefulness of the stream fail to arrive, it creates a momentary
application and can even be detrimental. In such disruption in the stream. This may appear as
cases, UDP is a better transport protocol. distortion in the image or sound, but may not be
noticeable to the user. If the destination device had
UDP provides the basic functions for delivering to account for lost data, the stream could be
data segments between the appropriate delayed while waiting for retransmissions,
applications, with very little overhead and data therefore causing the image or sound to be greatly
checking. UDP is known as a best-effort delivery degraded. In this case, it is better to render the best
protocol. In the context of networking, best-effort media possible with the segments received, and
delivery is referred to as unreliable because there is forego reliability.
no acknowledgement that the data is received at the
destination. With UDP, there are no transport layer Note
processes that inform the sender of a successful Applications that stream stored audio and video use
delivery. TCP. For example, if your network suddenly cannot
UDP is similar to placing a regular, non-registered, support the bandwidth needed to watch an on-
letter in the mail. The sender of the letter is not demand movie, the application pauses the
aware of the availability of the receiver to receive playback. During the pause, you might see a
the letter. Nor is the post office responsible for “buffering...” message whereas TCP works to re-
tracking the letter or informing the sender if the establish the stream. Once all the segments are in
letter does not arrive at the final destination. order and a minimum level of bandwidth is
restored, your TCP session resumes and the movie
begins playing.
The Right Transport Layer Protocol for
the Right Application (9.1.1.7)
TCP and UDP Overview (9.1.2)
For some applications, segments must arrive in a
As previously mentioned, both TCP and UDP are
very specific sequence to be processed
transport layer protocols. It is up to the
successfully. With other applications, all data
developer to determine which of these protocols
must be fully received before any is considered
best match the requirements of the application
useful. In both of these instances, TCP is used as
being developed. Regardless of the choice, a good
the transport protocol. Application developers
understanding of both protocols is required by
must choose which transport protocol type is
any networker.
appropriate based on the requirements of the
applications, as shown in Figure 9-7.
TCP Features (9.1.2.1)
To understand the differences between TCP and
UDP, it is important to understand how each
protocol implements specific reliability features
and how they track conversations. In addition to TCP Header (9.1.2.2)
supporting the basic functions of data TCP is a stateful protocol. A stateful protocol is a
segmentation and reassembly, TCP, as shown protocol that keeps track of the state of the
in Figure 9-8, also provides other services. communication session. To track the state of a
session, TCP records which information it has
sent and which information has been
acknowledged. The stateful session begins with
the session establishment and ends when closed
with the session termination.
The TCP segment header is shown in Figure 9-9.
Establishing a Session
TCP is a connection-oriented protocol. A
connection-oriented protocol is one that
negotiates and establishes a virtual connection
(or session) between source and destination
devices prior to forwarding any traffic. Through Figure 9-9 TCP Segment Header
session establishment, the devices negotiate the
Each TCP segment has 20 bytes of overhead in the
amount of traffic that can be forwarded at a
header encapsulating the application layer data:
given time, and the communication data between
the two can be closely managed. Source Port (16 bits) and Destination Port
(16 bits) – Used to identify a sending devices port
number and the destination port number on the
Reliable Delivery target device.
In networking terms, reliability means ensuring Sequence number (32 bits) – Used for data
that each segment that the source sends arrives reassembly purposes.
at the destination. For many reasons, it is Acknowledgement number (32 bits)
possible for a segment to become corrupted or – Indicates the data that has been received.
lost completely, as it is transmitted over the Header length (4 bits) – Known as “data
network. offset.” Indicates the length of the TCP segment
header.
Same-Order Delivery Reserved (6 bits) – This field is reserved for
Because networks may provide multiple routes the future.
that can have different transmission rates, data Control bits (6 bits) – Known as flags, these
can arrive in the wrong order. By numbering and identify bit codes that indicate the purpose and
sequencing the segments, TCP can ensure that function of the TCP segment.
these segments are reassembled into the proper Window size (16 bits) – Indicates the number
order. of bytes that can be accepted at one time.
Checksum (16 bits) – Used for error checking
Flow Control of the segment header and data.
Network hosts have limited resources, such as Urgent (16 bits) – Indicates if data is urgent.
memory and processing power. When TCP is
aware that these resources are overtaxed, it can UDP Features (9.1.2.3)
request that the sending application reduce the User Datagram Protocol (UDP) is considered a
rate of data flow. This is done by TCP regulating best-effort transport protocol. UDP is a
the amount of data the source transmits. Flow lightweight transport protocol that offers the
control can prevent the need for retransmission same data segmentation and reassembly as TCP,
of the data when the receiving host’s resources but without TCP reliability and flow control. UDP
are overwhelmed. is such a simple protocol that it is usually
For more information on TCP, search the Internet described in terms of what it does not do
for RFC 793. compared to TCP.
The features of UDP are described in Figure 9-10. uniquely identify these applications. These unique
identifiers are the port numbers, as shown in Figure
9-12.
Sometimes the reliability associated with TCP is Therefore, UDP simply reassembles the data in the
not required or the overhead associated with order that it was received and forwards it to the
providing this reliability is not suitable for the application. If the data sequence is important to the
application. This is where UDP is used. application, the application must identify the
proper sequence and determine how the data
UDP Low Overhead versus Reliability should be processed.
(9.2.3.1)
UDP Server Processes and Requests
UDP is a simple protocol that provides the basic (9.2.3.3)
transport layer functions. As shown in Figure 9-
32, UDP has much lower overhead than TCP Like TCP-based applications, UDP-based server
because it is not connection-oriented and does applications are assigned well-known or
not offer the sophisticated retransmission, registered port numbers, as shown in Figure 9-
sequencing, and flow control mechanisms that 34. When these applications or processes are
provide reliability. running on a server, they accept the data
matched with the assigned port number. When
UDP receives a datagram destined for one of
these ports, it forwards the application data to
the appropriate application based on its port
number.
Note
Figure 9-35 TCP Applications
The Remote Authentication Dial-in User Service
(RADIUS) server shown in the figure provides
authentication, authorization, and accounting Applications that Use UDP (9.2.4.2)
services to manage user access. The operation of Common UDP applications are shown in Figure
RADIUS is beyond the scope of this course.
9-36.
UDP Client Processes (9.2.3.4)
As with TCP, client-server communication is
initiated by a client application that requests
data from a server process. The UDP client
process dynamically selects a port number from
the range of port numbers and uses this as the
source port for the conversation. The destination
port is usually the well-known or registered port
number assigned to the server process.
After a client has selected the source and
destination ports, the same pair of ports is used in
the header of all datagrams used in the transaction.
For the data returning to the client from the server,
the source and destination port numbers in the
datagram header are reversed. This is essentially
the same process as illustrated for TCP in Figure 9- Figure 9-36 UDP Applications
15 through 9-19.
There are three types of applications that are best
suited for UDP:
TCP or UDP (9.2.4)
Live video and multimedia applications
As previously stated, the decision to use TCP or – Can tolerate some data loss, but require little or
UDP as a transport layer protocol rests with the no delay. Examples include VoIP and live streaming
application developer. Each protocol has unique video.
characteristics that must be matched to the Simple request and reply applications
specific application. – Applications with simple transactions where a
host sends a request and may or may not receive a
Applications that Use TCP (9.2.4.1) reply. Examples include DNS and DHCP.
TCP is a great example of how the different Applications that handle reliability
layers of the TCP/IP protocol suite have specific themselves – Unidirectional communications
where flow control, error detection,
roles. TCP handles all tasks associated with
acknowledgements, and error recovery is not
dividing the data stream into segments, required or can be handled by the application.
providing reliability, controlling data flow, and Examples include SNMP and TFTP.
the reordering of segments. TCP frees the
Although DNS and SNMP use UDP by default, both
application from having to manage any of these can also use TCP. DNS will use TCP if the DNS
tasks. Applications, like those shown in Figure 9- request or DNS response is more than 512 bytes,
35, can simply send the data stream to the such as when a DNS response includes a large
transport layer and use the services of TCP. number of name resolutions. Similarly, under some
situations the network administrator may want to
configure SNMP to use TCP.
SUMMARY (9.3)
The transport layer provides transport-related 2. What is assigned by the transport layer to
services by identify an application or service?
Dividing data received from an application into A. Segment
segments B. Packet
Adding a header to identify and manage each C. Port
segment
D. MAC address
Using the header information to reassemble the
segments back into application data E. IP address
Passing the assembled data to the correct 3. Fill in the blank. _____ is the term used to
application describe the interleaving of data from multiple
users on the same network.
UDP and TCP are common transport layer
protocols. 4. What is a characteristic of UDP?
UDP datagrams and TCP segments have headers A. Reliable delivery
added in front of the data that include a source port B. Connectionless
number and destination port number. These port C. Windowing
numbers enable data to be directed to the correct
application running on the destination computer. D. Expectational acknowledgements
TCP does not pass any data to the network until it E. Flow control
knows that the destination is ready to receive it. 5. Which of the following types of applications
TCP then manages the flow of the data and resends would use UDP? (Choose three.)
any data segments that are not acknowledged as A. Telnet
being received at the destination. TCP uses
mechanisms of handshaking, timers, B. VoIP
acknowledgement messages, and dynamic C. FTP
windowing to achieve reliability. The reliability D. HTTP
process, however, imposes overhead on the
E. DHCP
network in terms of much larger segment headers
and more network traffic between the source and F. TFTP
destination. 6. Which TCP header field specifies the number of
If the application data needs to be delivered across bytes that can be accepted before an
the network quickly, or if network bandwidth acknowledgement is required?
cannot support the overhead of control messages A. Acknowledgement number
being exchanged between the source and the
B. Header length
destination systems, UDP would be the developer’s
preferred transport layer protocol. UDP provides C. Window size
none of the TCP reliability features. However, this D. Checksum
does not necessarily mean that the communication 7. Fill in the blank. Both TCP and UDP use ____ to
itself is unreliable; there may be mechanisms in the
separate multiple communications on the same
application layer protocols and services that channel.
process lost or delayed datagrams if the application
has these requirements. 8. What is an advantage that UDP has over TCP?
The application developer decides the transport A. Advanced flow control
layer protocol that best meets the requirements for B. Low overhead
the application. It is important to remember that C. Reordering of segments
the other layers all play a part in data network
communications and influences its performance. D. Reliable delivery
9. What range of ports can either be used by TCP or
CHECK YOUR UDP to identify the requested service on the
destination device or as a client source port?
UNDERSTANDING QUESTIONS
A. 0 to 1023
1. What are the primary purposes of the transport
layer? (Choose three.) B. 0 to 49151
A. Determining the best route between source and C. 1024 to 49151
destination D. 49152 to 65535
B. Adding the source and destination MAC address 10. Fill in the blank. A dynamic port in the range of
to frames 49152 to 65535 is also known as a(n) ____ port.
C. Tracking the individual communication between 11. What does UDP do when receiving messages
applications on the source and destination hosts that are more than one datagram in length?
D. Adding the source and destination IP address A. UDP places the datagrams into the correct order
E. Segmenting data for and reassembling before passing them to the application.
segmented data into streams of application data at B. UDP reassembles that data in the order it was
the destination received and passes it to the application.
F. Identifying the proper application for each
communication stream
C. UDP requests retransmission of the datagrams
in the correct order before passing to the
application.
D. UDP transmissions are limited to a single
datagram.
12. Which TCP header control bit is set on to
terminate a TCP conversation?
A. URG
B. ACK
D. PSH
D. RST
E. SYN
F. FIN
13. If a client sends an ISN of 2 to a server and a
server responds with an ISN of 1 to the client, what
is the final stage of the TCP three-way handshake?
A. Client sends an acknowledgement of 2.
B. Server sends an acknowledgement of 2.
C. Client sends an acknowledgement of 3.
D. Server sends an acknowledgement of 3.
E. Client sends a new ISN of 3.
F. Server sends a new ISN of 2.
14. A client is downloading a large file from a
server using FTP. Many of the segments are lost
during transit. What will most likely happen?
A. The FTP session is immediately terminated.
B. The FTP client responds to the server with a
smaller window size in the TCP header.
C. The FTP client responds to the client with an
increased window size in the TCP header.
D. The FTP server responds to the client with a
smaller window size in the TCP header.
E. The FTP server responds to the client with an
increased window size in the TCP header.
F. The FTP session continues, but the result is a
corrupt file that must be downloaded again.
G. The FTP session continues with no alteration in
window size, and the missing segment is requested
again after the rest of the file is downloaded.
15. Fill in the blank. TCP will normally retransmit
lost data from the last successful acknowledgement.
To allow the destination to acknowledge bytes in
discontinuous segments and request
retransmission of only the missing data, both hosts
must be able to support an optional feature called
__________.