label Cursuri autorenew 2025-09-29, 16:55
12.3 TCP Connection Methods 12.3.1 Port numbers Instructor Note The purpose of this target indicator is NOT that students memorize all of the TCP port numbers. The purpose is to illustrate that the way TCP provides software services to upper layers is through these numbers -- they are a menu of services. Students should know the port numbers for http, smtp, and ftp. 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. Any conversation bound for the FTP application uses the standard port number 21. Conversations, that do not involve applications with well-known port numbers, are assigned port numbers that have been randomly selected from within a specific range. These port numbers are used as source and destination addresses in the TCP segment. Some ports are reserved in both TCP and UDP , although applications might not be written to support them. 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 End systems use port numbers to select proper applications. Originating source port numbers are dynamically assigned by the source host; usually, it is a number larger than 1023. 12.3 TCP Connection Methods 12.3.2 Three-way handshake/open connection Instructor Note Understanding the important TCP process of a three-way handshake is the purpose of this target indicator. Emphasize that that the vertical axis is time, and that horizontal lines are not permitted since they imply zero time for a message to travel. A kinesthetic activity -- with 2 students playing the roles of two hosts and acting out a three-way handshake with large numbers on pieces of paper -- will help students visualize this process. Understanding the important TCP process of acknowledgement is another purpose of this target indicator. Again emphasize that that the vertical axis is time, and that horizontal lines are not permitted since they imply zero time for a message to travel. A kinesthetic activity -- with 2 students playing the roles of two hosts and acting out a simple acknowledgement with large numbers on pieces of paper -- will help them visualize this process.Since the segments are encapsulated in packets, and since packets travel connectionless paths through internetworks, sequence and acknowledgement numbers become necessary for TCP to track (two successive IP packets may in many instance NOT travel the same path and arrive at the destination host out of order). 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 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 hosts establish a connection-oriented session with one another using a three-way handshake. A three-way handshake/open connection sequence synchronizes a connection at both ends before data is transferred. This exchange of introductory sequence numbers, during the connection sequence is important. It ensures that any data that is lost, due to transmission problems that may occur later can be recovered. First, one host initiates a connection by sending a packet indicating its initial sequence number of x with a certain bit in the header set to indicate a connection request. Second, the other host receives the packet, records the sequence number of x, replies with an acknowledgement of x + 1, and includes its own initial sequence number of y. The acknowledgement number of x + 1 means the host has received all octets up to and including x, and is expecting x + 1 next. Positive acknowledgement and retransmission, or PAR, is a common technique many protocols use to provide reliability. With PAR, the source sends a packet, starts a timer, and waits for an acknowledgement before sending the next packet. If the timer expires before the source receives an acknowledgement, the source retransmits the packet and starts the timer over again. Window size determines the amount of data that you can transmit at one time before receiving an acknowledgment from the destination. The larger the window size number (bytes), the greater the amount of data that the host can transmit. After a host transmits the window-sized number of bytes, the host must receive an acknowledgment that the data has been received before it can send any more messages. For example, with a window size of 1, each individual (1) segment must be acknowledged before you can send the next segment. TCP uses expectational acknowledgments, meaning that the acknowledgment number refers to the octet that is next expected. The "sliding" part, of sliding window, refers to the fact that the window size is negotiated dynamically during the TCP session. This results in inefficient use of bandwidth by the hosts.Windowing is a flow control mechanism requiring that the source device receive an acknowledgement from the destination after transmitting a certain amount of data. For example, with a window size of three, the source device can send three octets to the destination. It must then wait for an acknowledgement. If the destination receives the three octets, it sends an acknowledgement to the source device, which can now transmit three more octets. If, for some reason, the destination does not receive the three octets, for example, due to overflowing buffers, it does not send an acknowledgement. Because the source does not receive an acknowledgement, it knows that the octets should be retransmitted, and that the transmission rate should be slowed. TCP provides sequencing of segments with a forward reference acknowledgment. Each datagram is numbered before transmission. At the receiving station, TCP reassembles the segments into a complete message. If a sequence number is missing in the series, that segment is re-transmitted. Segments that are not acknowledged within a given time period result in re-transmission.