Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)

Similar presentations


Presentation on theme: "1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)"— Presentation transcript:

1 1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)

2 2 Underlying Best-Effort Network Drops messages Re-orders messages Delivers duplicate copies of a given message Limits messages to some finite size Delivers messages after an arbitrarily long delay

3 3 Common End-to-End Services Guarantee message delivery Deliver messages in the same order they are sent Deliver at most one copy of each message Support arbitrarily large messages Support synchronization Allow the receiver to flow control the sender Support multiple application processes on each host

4 4 Transport Protocol All end-to-end services provided by transport protocol Separate layer of protocol stack Conceptually between -Applications layer -IP layer

5 5 Terminology IP -Provides computer-to-computer (or node to node) communication in two different networks -Source and destination addresses are computers -Called machine-to-machine Transport protocols -Provide application-to-application communication -Need extended addressing mechanism to identify applications (port numbers) -Called end-to-end

6 6 Transport Protocol Functionality Identify sending and receiving applications (by using port numbers) Optionally provide -Reliability -Flow control -Congestion control Note: not all transport protocols provide above facilities

7 7 Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Major differences -Interface to applications -Functionality

8 8 User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal -Overhead -Computation -Communication Best for LAN applications (because LAN is a very reliable environment) Used to support audio/video streaming applications or similar applications that does not require absolute reliability

9 9 UDP Details Connectionless service paradigm -Message-oriented interface Each message encapsulated in IP datagram UDP header identifies -Sending application -Receiving application

10 10 UDP Detail (contd..) Included in TCP/IP suite Supports many protocol ports Transports a message from one machine to another Does not use acknowledgements Does not order incoming messages Does not do flow control Application program is responsible to handle all problems such as loss, duplication, delay, out of order delivery, etc.

11 11 UDP Protocol Layering Operates in the same layer as TCP Application Transport Internet Network Interface Physical

12 12 UDP Encapsulation Entire UDP message is encapsulated in an IP datagram UDP-HdrData Area IP Data AreaIP-Hdr Frame Data AreaFrame-Hdr

13 13 Note: The IP layer is responsible only for transferring data between a pair of hosts on an internet, while UDP layer is responsible only for differentiating among multiple sources or destinations within one host.

14 14 UDP Message Queue Application process Application process Application process UDP Packets arrive Ports Queues Packets demultiplexed

15 15 Identifying An Application Cannot extend IP address: No unused bits Cannot use OS-dependent quantity: Process ID, task number or Job name Must work on all computer systems Invent new abstraction -Used only with TCP/IP -Identifies sender and receiver unambiguously Technique -Each application assigned unique integer -Called protocol port number

16 16 Protocol Ports Server -Follows standard (Ex: HTTP server runs on port 80) -Always uses same port number -Uses lower port numbers Client -Obtains unused port from protocol software -Uses higher port numbers

17 17 Protocol Port Example Domain name server application is assigned port 53 Application using DNS obtains port 28900 UDP datagram sent from application to DNS server has -Source port number 28900 -Destination port number 53 When DNS server replies, UDP datagram has -Source port number 53 -Destination port number 28900

18 18 Common Port Assignments

19 19 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer

20 20 TCP Features Connection-oriented service Point-to-point Full-duplex communication Stream interface Stream divided into segments for transmission Each segment encapsulated in IP datagram Uses protocol ports to identify applications

21 21 TCP Overview Connection-oriented Byte-stream -app writes bytes -TCP sends segments -app reads bytes Application process Write bytes TCP Send buffer Segment Transmit segments Application process Read bytes TCP Receive buffer … …… Full duplex Flow control: keep sender from overrunning receiver Congestion control: keep sender from overrunning network

22 22 TCP Feature Summary TCP provides a completely reliable (no data duplication or loss), connection-oriented, full- duplex stream transport service that allows two application programs to form a connection, send data in either direction, and then terminate the connection.

23 23 Achieving Reliability Reliable connection startup Reliable data transmission Graceful connection shutdown

24 24 Reliable Data Transmission Positive acknowledgement -Receiver returns short message when data arrives -Called acknowledgement Retransmission -Sender starts timer whenever message is transmitted -If timer expires before acknowledgement arrives, sender retransmits message

25 25 How Long Should TCP Wait Before Retransmitting? Time for acknowledgement to arrive depends on -Distance to destination -Current traffic conditions Multiple connections can be open simultaneously Traffic conditions change rapidly

26 26 Important Point The delay that is required for data to reach a destination and an acknowledgement to return depends on traffic in the internet as well as the distance to the destination. Because it allows multiple application programs to communicate with multiple destinations concurrently, TCP must handle a variety of delays that can change rapidly.

27 27 Solving Retransmission Problem Keep estimate of roundtrip time on each connection Use current estimate to set retransmission timer Known as adaptive retransmission Key to TCP’s success

28 28 TCP Flow Control Receiver -Advertises available buffer space -Called window Sender -Can send up to entire window before ack arrives

29 29 Startup And Shutdown Connection startup -Must be reliable Connection shutdown -Must be graceful Difficult to achieve

30 30 Why Startup/Shutdown is difficult? Segments can be -Lost -Duplicated -Delayed -Delivered out of order -Either side can crash -Either side can reboot Need to avoid duplicate “shutdown” message from affecting later connection

31 31 TCP Checksum Computation TCP prepends a pseudo header to the segment Appends enough zero bits to make the segment a multiple of 16 bits Computes 16-bit checksum over the entire result Uses 16-bit arithmetic Takes one's complement of the one's complement sum Notes: -TCP does not count the pseudo header or padding in the segment length -TCP does not transmit the pseudo header or padding -TCP assumes the checksum field itself is zero before computation

32 32 Purpose of Pseudo Header To verify the segment has reached its correct destination (Port number & destination IP address) IP passes the source and destination IP addresses to the receiving TCP from the datagram Receiving TCP performs the same computation

33 33 Congestion Condition of severe delay Caused by an overload of datagram's at one or more switching points (routers) Retransmissions aggravate congestion instead of alleviating it. Why?

34 34 Congestion Collapse and Avoidance A condition at which the entire network becomes useless due to congestion (a stalemate situation). TCP must reduce transmission rates when congestion occurs Routers watch queue lengths and use techniques like ICMP source quench to inform hosts that congestion has occurred

35 35 TCP Standard Techniques To Avoid Congestion Remember the size of the receiver's window Maintain a second limit, called the congestion window limit as: Allowed_window = min(receiver_advertisement, congestion_window) Use the slow-start algorithm during recovery stage and the multiplicative decrease algorithm for avoidance of congestion

36 36 Multiplicative Decrease Congestion Avoidance Algorithm Upon loss of a segment: -Reduce the congestion window by half (down to a minimum of at least one segment) -For those segments that remain in the allowed window, backoff the retransmission timer exponentially.

37 37 Congestion Avoidance Phase Once the congestion window reaches one half of its original size before congestion, TCP slows down the rate of increment. It increases the congestion window by 1 only if all segments in the window have been acknowledged.

38 38 Initial Sequence Numbers TCP software of both sides agree on initial sequence numbers TCP software in each machine chooses an initial sequence number at random Sequence numbers are sent and acknowledged during handshake

39 39 TCP State Machine TCP operation can be modeled as a finite state machine Terminology -Passive open command  To wait for a connection from another machine -Active open command  To initiate a connection -Maximum segment lifetime  Maximum time an old segment can remain alive in an internet (120 seconds by current standard)

40 40 TCP Performance TCP is a complex protocol Common misconception -Since it is complex, the code must be cumbersome and inefficient But experiments show: -The same TCP that operates over the global Internet can deliver 8 Mbps of sustained throughput of user data between two workstations on a 10Mbps Ethernet


Download ppt "1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)"

Similar presentations


Ads by Google