* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Chapter 12: The Transport layer
Survey
Document related concepts
Transcript
University of the Western Cape Chapter 12: The Transport Layer Purpose of the transport layer University of the Western Cape The phrase "quality of service" is often used to describe the purpose of Layer 4 - the transport layer. The transport layer regulates information flow to ensure end-toend connectivity between host applications reliably and accurately The end-to-end control, provided by sliding windows, and reliability in sequencing numbers and acknowledgments are primary duties of Layer 4. Transport layer segments and reassembles data into a data stream. TCP is one of the transport layer protocols used with IP. Transport Layer PDU is segment. Transport Layer Protocols University of the Western Cape The TCP/IP protocol of the OSI model Layer 4 (transport layer) has two protocols - TCP and UDP: TCP (Transmission Control Protocol) supplies a virtual circuit between enduser applications. These are its characteristics: connection-oriented reliable divides outgoing messages into segments reassembles messages at the destination station re-sends anything not received reassembles messages from incoming segments. UDP (User Datagram Protocol) transports data unreliably between hosts. Following are the characteristics of UDP: connectionless unreliable transmit messages (called user datagrams) provides no software checking for message delivery (unreliable) does not reassemble incoming messages uses no acknowledgments provides no flow control Comparing TCP and IP University of the Western Cape TCP/IP is a combination of two individual protocols: TCP and IP IP is a Layer 3 protocol - a connectionless service that provides best-effort delivery across a network. TCP is a Layer 4 protocol - a connection-oriented service that provides flow control as well as reliability. Pairing the protocols enables them to provide a wider range of services. Together, they represent the entire suite. TCP/IP is the Layer 3 and Layer 4 protocol on which the Internet is based. TCP and UDP Segments Format University of the Western Cape UDP TCP Following are the definitions of the fields in the TCP segment: source port -- number of the calling port destination port -- number of the called port sequence number -- number used to ensure correct sequencing of the arriving data acknowledgment number - next expected TCP octet HLEN -- number of 32-bit words in the header reserved -- set to zero code bits -- control functions (such as setup and termination of a session) window-- number of octets that the sender is willing to accept checksum -- calculated checksum of the header and data fields urgent pointer -- indicates the end of the urgent data option-one option -- maximum TCP segment size data -- upper-layer protocol data University of the Western Cape TCP/IP Protocols Port Numbers University of the Western Cape Port numbers have the following assigned ranges: Numbers below 255 - for public applications Numbers from 255-1023 assigned to companies for marketable applications Numbers above 1023 are unregulated Both TCP and UDP use port (or socket) numbers to pass information to the upper layers. Port numbers are used to keep track of different conversations that cross the network at the same time. Application software developers have agreed to use the well-known port numbers that are defined in RFC1700. University of the Western Cape Connection-oriented Session 1. 2. 3. Connection oriented services involve three phases: In the connection establishment phase, a single path between the source and destination is determined. Resources are typically reserved at this time to ensure a consistent grade of service. During the data transfer phase, data is transmitted sequentially over the established path, arriving at the destination in the order in which it was sent. The connection termination phase consists of terminating the connection between the source and destination when it is no longer needed. TCP establishes a connection University of the Western Cape In order for data transfer to begin, one user of the transport layer must establish a connection-oriented session with its peer system. 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. Three way-handshake 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 University of the Western Cape 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 University of the Western Cape Reliable connectionoriented data transfer means that data packets arrive in the same order in which they are sent The number of data packets a sender is allowed to transmit without having received an acknowledgment is known as a window. TCP acknowledgment technique University of the Western Cape 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. University of the Western Cape The End