Purpose of the Transport Layer

The Transport layer provides for the sgementation of data and the control necessary to reassemble these pieces into the various communication streams. Its primary responsibilites to accomplish this are:

  • Tracking the individual communication between applications on the source and destination hosts
  • Segmenting data and managing each piece
  • Reassembling the segments into streams of application data
  • Identifying the different applications

Port Addressing - Identifying the Conversations

To differentiate the segments and datagrams for each application, both TCP and UDP have header fields that can uniquely identify these applications. These unique identifiers are the port numbers.

There are different types of port numbers:

The TCP Protocol - Communicating with Reliability

The reliability of TCP communication is performed using connection-oriented sessions. Before a host using TCP sends data to another host, the Transport layer initiates a process to create a connection with the destination.

TCP Server Processes

An inidividual server cannot have two services assigned to the same port number within the same Transport layer services.

TCP Connection Establishment and Termination

When two hosts communicate using TCP, a connection is established before data can be exchanged. After communication is completed, the sessions are closed and the connection is terminiated. The connection and session mechanisms enable TCP’s reliability function.

TCP Segment Reassembly

TCP will resequence segments to order transmitted.

TCP Acknowledgement with Windowing

TCP uses the acknowledgement number in segments sent back to the source to indicate the next byte in this session that the receiver expects to receive. This is called expectational acknowledgement.

TCP Retransmission

For a typical TCP implementation, a host may transmit a segment, put a copy of the segment in a retransmission queue, and start a timer. When a data acknowledgement is received, the segment is deleted from the quee. If the acknowledgement is not received before the timer expires, the sgement is retransmitted.

TCP Congestion Control - Minimizing Segment Loss

1, Flow Control

The Window Size field in the TCP header specifies the amount of data that can be transmittd before an acknowledgement must be received. The initial window size is determined during the session startup via the three-way handshake.

TCP attemps to manage the rate of transmission so that all data will be received and retransmissions will be minimized. During the delay in receiving the acknowledgement, the sender will not be sending any additional segments for this session. In periods when the network is congested or the resources of the receiving host are strained, the delay may increase. As this delay grows longer, the effective transmission rate of the data for this session decreases. The slowdown in data rate helps reduce the source contention.

2, Reducing Window Size

Another way to control the data flow is to use dynamic window sizes. When network resources are constrained, TCP can reduce the window size to require that received segments be acknowledge more frequently.

The UDP Protocol - Communicating With Low Overhead

UDP is much lower overhead than TCP, since it is not connection-oriented and does not provide the sophisticated retransmission, sequencing, and flow control mechanisms. Key application layer protocols that uss UDP include:

  • Domain Name System (DNS)
  • Simple Network Management Protocol (SNMP)
  • Dynamic Host Configuration Protocol (DHCP)
  • Routing Information Protocol (RIP)
  • Trivial File Transfer Protocol (TFTP)
  • Online games

UDP Datagram Reassembly

UDP simplyreassembles the data in the order that it was received and forwards it to the application. If the sequence of the data is important to the application, the applicationwill have to identify the proper sequence of the data and detemine how the data should be processed.

UDP Server Processes and Requests

UDP-based server applications are assigned Well Known or Registered port numbers.

UDP Client Processes

As with TCP, client/server communication is initiated by a client application that is requesting data from a server process. The UDP client process randomly selects a port number from the dynamic range of port numbers and uses this as the source port for the conversation.

评论需要翻墙 for disqus