|  | 1.4 |
Host Layers (the Upper 4 Layers of the OSI Model)
| 1.4.3 | Transport layer functions
Each of the upper-level layers performs its own functions. However, their functions depend on lower-layer services. All four upper layers - application (Layer 7), presentation (Layer 6), session (Layer 5), and transport (Layer 4) - can encapsulate data in end-to-end segments. The transport layer assumes that it can use the network as a cloud to send data packets from source to destination. If you examine the operations that take place inside the cloud, you can see that one of the functions involves selecting the best paths for a given route. You begin to see the role that routers perform in this process. Segmentation of upper-layer applications One reason for using a multi-layer model such as the OSI reference model is that multiple applications can share the same transport connection. Transport functionality is accomplished segment by segment. This means that different data segments from different applications, being sent to the same destination or to many destinations, are sent on a first-come, first-served basis. To understand how this works, imagine that you are sending an e-mail and transferring a file (FTP) to another device on a network. When you send your e-mail message, before the actual transmission begins, software in your device sets the SMTP (e-mail) port number and the originating program port number. As each application sends a data stream segment, it uses the previously defined port number. When the destination device receives the data stream, it separates and sorts the segments so that the transport layer can pass the data up to the correct corresponding destination application. TCP establishes a connection In order for data transfer to begin, one user of the transport layer must establish a connection-oriented session with its peer system. Then, both the sending and receiving application programs must inform their respective operating systems that a connection will be initiated. In concept, one device places a call to another device that the other device must accept. Protocol software modules in the two operating systems communicate by sending messages across the network to verify that the transfer is authorized and that both sides are ready. After all synchronization has occurred, a connection is established, and data transfer begins. During transfer, the two devices continue to communicate with their protocol software to verify that they are receiving the data correctly. The graphic depicts a typical connection between sending and receiving systems. The first handshake requests synchronization. The second and third handshakes acknowledge the initial synchronization request, and synchronize the connection parameters in the opposite direction. The final handshake segment sends an acknowledgement to the destination that both sides agree that a connection has been established. As soon as the connection has been established, data transfer begins. TCP sends data with flow control While data transfer is in progress, congestion can occur for two different reasons. First, a high-speed computer might generate traffic faster than a network can transfer it. Second, if many computers send datagrams simultaneously to a single destination, that destination can experience congestion. When datagrams arrive too quickly for a host or gateway to process, they are temporarily stored in memory. If the traffic continues, the host or gateway eventually exhausts its memory and discards any additional datagrams that arrive. Instead of allowing data to be lost, the transport function can issue a "not ready" indicator to the sender. This indicator acts like a stop sign and signals the sender to stop sending data. When the receiver is able to accept additional data, it sends a "ready" transport indicator, which is like a go signal. When the sending device receives this indicator, it resumes segment transmission. TCP achieves reliability with windowing Reliable connection-oriented data transfer means that data packets arrive in the same order in which they are sent. Protocols fail if any data packets are lost, damaged, duplicated, or received in the wrong order. In order to ensure transfer reliability, receiving devices must acknowledge receipt of each and every data segment. If a sending device must wait for acknowledgement after sending each segment, it is easy to see that throughput could be quite low. However, because there is a period of unused time available after each data packet transmission and before processing any received acknowledgment, the interval can be used for transmitting more data. The number of data packets a sender is allowed to transmit without having received an acknowledgment is known as a window. Windowing is an agreement between sender and receiver. It is a method of controlling the amount of information that can be transferred end-to-end. Some protocols measure information in terms of the number of packets; TCP/IP measures information in terms of the number of bytes. The examples in the Figure show the workstations of a sender and a receiver. One has a window size of 1, and the other a window size of 3. With a window size of 1, a sender must wait for an acknowledgment for every data packet transmitted. With a window size of 3, a sender can transmit three data packets before expecting an acknowledgment. TCP acknowledgment technique Reliable delivery guarantees that a stream of data that is sent from one device will be delivered through a data link to another device without duplication or data loss. Positive acknowledgment with retransmission is one process that guarantees reliable delivery of data streams. It requires a recipient to send an acknowledgment message to the sender whenever it receives data. The sender keeps a record of each data packet that it sends and then waits for the acknowledgment before sending the next data packet. The sender also starts a timer whenever it sends a segment, and retransmits the segment if the timer expires before the acknowledgment arrives. Figure shows a sender transmitting Data Packets 1, 2, and 3. The receiver acknowledges receipt of the packets by requesting Packet 4. The sender, upon receiving the acknowledgment, sends Packets 4, 5, and 6. If Packet 5 does not arrive at the destination, the receiver acknowledges with a request to re-send Packet 5. The sender re-sends Packet 5 and waits for acknowledgment before transmitting Packet 7. -