1 / 18

26-TCP

26-TCP. Dr. John P. Abraham Professor UTPA. TCP. Transmission control protocol, another transport layer protocol. Reliable delivery Tcp must compensate for loss, delay, duplication and out of order delivery that are introduced by IP. Packet in TCP is called a segment.

ruth-knight
Download Presentation

26-TCP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 26-TCP Dr. John P. Abraham Professor UTPA

  2. TCP • Transmission control protocol, another transport layer protocol. • Reliable delivery • Tcp must compensate for loss, delay, duplication and out of order delivery that are introduced by IP. • Packet in TCP is called a segment

  3. Service provided to applications • Connection orientation • Point-to-point (end to end) • Reliability • Full duplex • Stream interface • Reliable connection startup and gracefull connection shutdown

  4. Virtual connections • End-to-end provides service to application from end to the other. • Virtual connection is established. Virtual connection is achieved by the software (underlying hardware does not have a real connection between the two points). The tcp software on the two machines exchange messages to achieve the connection. • Uses IP to carry the data.

  5. Table 12.1 Well-known ports used by TCP

  6. Figure 12.2Stream delivery

  7. Figure 12.3Sending and receiving buffers

  8. Sequencing to handle duplicates and out of order delivery • The sending side attaches a sequence number to each packets. The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number. • The receiving side stores both the sequence number of the last packet arrived in order as well as a list of additional packets that arrived out of order. • If packet arrived in order it hands it to the higher layer and checks the pending out of order list, if any can be handed to the higher layer. • If packet arrived out of order, it adds it to the out of order list. • If a duplicate arrived (below the current sequence number, or already in the out of order list) it is discarded.

  9. Example 2 Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10001. What are the sequence numbers for each segment if data is sent in five segments, each carrying 1000 bytes? SolutionThe following shows the sequence number for each segment: Segment 1➡ Sequence Number: 10,001 (range: 10,001 to 11,000) Segment 2➡ Sequence Number: 11,001 (range: 11,001 to 12,000) Segment 3➡ Sequence Number: 12,001 (range: 12,001 to 13,000) Segment 4➡ Sequence Number: 13,001 (range: 13,001 to 14,000) Segment 5➡ Sequence Number: 14,001 (range: 14,001 to 15,000)

  10. Retransmission to handle lost packets • To handle packet lost tcp uses positive acknowledgement with retransmission. • Whenever a frame arrives intact, the receiving protocol sends a small ACK that repots successful reception. • When a packet is sent the sending side starts a timer. If the ACK is not received before the timer ends the packet is re-transmitted. • If an ACK is received for a later packet, all packets upto that point is considered ACKed.

  11. Connection establishment using three-way handshaking

  12. Acknowledgement field The value in the sequence number field of a segment defines the number of the first data byte containedin that segment. • The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. • The acknowledgment number is cumulative.

  13. Selective ACK • Relying purely on the cumulative acknowledgment scheme employed by the original TCP protocol can lead to inefficiencies when packets are lost. For example, suppose 10,000 bytes are sent in 10 different TCP packets, and the first packet is lost during transmission. In a pure cumulative acknowledgment protocol, the receiver cannot say that it received bytes 1,000 to 9,999 successfully, but failed to receive the first packet, containing bytes 0 to 999. Thus the sender may then have to resend all 10,000 bytes. • In order to solve this problem TCP employs the selective acknowledgment (SACK) option, defined in RFC 2018, which allows the receiver to acknowledge discontinuous blocks of packets that were received correctly

  14. Flow control to prevent data overrun • Covered sliding window already. • A sliding window is used to make transmission more efficient as well as to control the flow of data so that the destination does not become overwhelmed with data. • TCP’s sliding windows are byte oriented.

  15. Techniques to avoid congestion • When transmission exceeds the capacity of a receiving device (usually router), we have congestion. • Retransmission can only worsen the situation, may lead to congestion collapse. • To avoid this routers inform senders about congestion. Congestion is estimated based on packet delays and packet losses. • A reduced window size is sent to the sender. A size of 0 means, do not send any more. • If a receiver can’t handle received data, it will begin to reduce its window size. If this is repeated to the point that the header is more that the payload, a situation called “silly window syndrome” occurs.

  16. Three-way and shake • To guarantee that connections are established or terminated reliably. • 3 messages are exchanged, each side sends a control message that specifies an initial buffer size and a sequence number. • Send synreceive synsend back syn + ackreceve syn+ack and send ackreceive ack. • To close a connection send fin+ackreceive it and send fin+ackreceive it and send ackreceive ack.

  17. 3-way-handshake Handshake segments cannot carry data, but consumes sequence numbers.

  18. termination

More Related