CPSC 3600 - DAY 20 APRIL 26, 2017 ================================================================================ TCP PROTOCOL ------------ Internet Protocol (IP) and User Datagram Protocol (UDP) that runs over IP to provide the connectionless packet delivery service described in previous presentations. Uses unreliable datagram service offered by IP when sending across the internet but provides reliable data delivery service to application programs. Compensates for loss, delay, duplication, and out-of-order delivery without overloading the underlying networks and routers. Connection orientation: TCP provides connection-oriented services in which an application must first request a connection to a destination, and then use the connection to transfer data. Point-to-Point Communication: Each TCP connection has exactly two endpoints. Complete Reliability: TCP guarantees that the data sent across a connection will be delivered exactly as sent, complete and in order. Full Duplex Communication: A TCP connection allows data to flow in either direction, and allows either application program to send data at any time. Stream Interface: TCP provides a stream interface in which an application sends a continuous sequence of octets across a connection. TCP does not group data into records or messages, and does not guarantee to deliver data in the same size pieces that were transferred by the sending application. Graceful Connection Shutdown: Before closing a connection, TCP insures that all data has been delivered and that both sides have agreed to shut down the connection. Reliable Connection Startup: TCP allows two applications to reliably start communication. TCP software is needed at the ends of a virtual connection, not in the intermediate routers IP does not read the messages, only passing the contents of the message to TCP End-to-end transport protocols have some major issues: Unreliable- messages sent across the internet can be lost, duplicated, corrupted, delayed, delivered out of order, or other similar issues. End System Reboot - At any time, either endo of the connection might crash and reboot, meaning different sessions would need to be able to function with each other. Heterogeneous End Systems - A disparity in the capacity of a sender and a receiver can result in a powerful sender generating data faster than a slow reciever can recieve them. Internet Congestion - Intermediate routers can be overrun when multiple senders transmit large amounts of data simultaeously. Duplicates and out-of-order delivery - resolved with sequencing, attach a seq. number to each packet, duplicate sequence numbers are dropped and the packets can be reordered. Lost Packets - the receivers sends an acknowledgement with each successful frame recieved, but if the sender does not get an acknowledgement, it sends another copy, known as retransmission. This is called positive acknowledgement with retransmission. Does not work if hardware failure has disconnected network or caused receiving computer to crash. If packets are delayed, retransmission can result in duplicate packets, and protocols that use retransmission must also be able to handle duplicate packets. Replay - Long delays can lead to replay errors, in which a delayed packet affects later communications. Packets that establish or terminate the connection. Resolved through a unique session ID, discarding packets with an incorrect ID. These IDs are not to be reused for a reasonable time frame. Data overrun - Flow control refers to techniques to handle disparity in data transmission/reception speeds. Stop and go systems have the sender wait until the receiver sends a message indicating it is ready for the next packet. Data overrun is managed with a technique known as a sliding window. The sender and receiver have a fixed window size, the maximum data sent before an acknowledgement arrives. Computer reboots can cause data integrity issues. TCP normally uses retransmission to adress the issue of packet loss. TCP uses adaptive retransmission. TCP monitors current delay on each connection and estimates a round-trip delay for each active connection. When it sends a message to which it expects a response, TCP records the time at which the message was sent. When a response arrives, TCP subtracts the time the message was sent from the current time to produce a new estimate of the round-trip delay for that connection. TCP uses a window mechanism to control the flow of data. TCP window is the amount of buffer space available at any time measured in bytes. If the receiving application can read data as quickly as it arrives, a reciver will send a positive window advertisement along with each acknowledgement. If the sending side operates faster than the receiving side, incoming data will eventually fill the receivers buffer, causing the receiver to advertise a zero window. TCP uses a 3-way handshake in which three messages are exchanged. Synchronization segment (SYN) describes the control messages used to create a connection. Finish segment (FIN) describes the control messagges used to close a connection TCP uses changes in delay as a measure of congestion. it responds by reducing the rate at which it retransmits data to control congestion. TCP bases transmission on buffer size, instead of computing a data rate. A transport protocol should reduce the rate of transmission when congestion occurs. TCP can achieve a reduction in data rate by temporarily reducing the window size. TCP can temporarily reduce the window to one-half of its current value. TCP uses a special congestion control mechanism known as a slow start when starting a new connection or when a message is lost. TCP begins by sending a single message containing data. If an acknowledgement arrives without additional loss, TCP doubles the amount of data being sent and sends two additional messages, If both acknowledgements arrive, TCP sends four messages, and so on. The exponential increase continues until TCP is sending half of the receiver's advertised window. When one-half of the original window is reached TCP slows the rate ofi= increase and increases the window size linearly as long as congestion does not occur.