1 / 28

Two Transport Protocols Available

Two Transport Protocols Available. Transmission Control Protocol (TCP). User Datagram Protocol (UDP). Provides unreliable transfer. Each message encapsulated in IP datagram. Requires minimal – Overhead – Computation – Communication. UDP. U ser D atagram P rotocol. internet.

zita
Download Presentation

Two Transport Protocols Available

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. Two Transport Protocols Available • Transmission Control Protocol (TCP) • User Datagram Protocol (UDP) • Provides unreliable transfer • Each message encapsulated in IP datagram • Requires minimal • – Overhead • – Computation • – Communication

  2. UDP • User Datagram Protocol

  3. internet Connectionless Sender socket sendto Dst/X Receiver socket bind on X recvfrom Dst Sender socket sendto Dst/X

  4. Protocol Ports • Server • – Follows standard • – Always uses same port number • – Uses lower port numbers • Client • – Obtains unused port from protocol software • – Uses higher port numbers

  5. Data Encapsulation

  6. 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

  7. UDP checksum 0 15 16 31 source IP address UDP pseudo header destination IP address zero protocol UDP length source port destination port UDP header checksum UDP length data(if any) pad (0)

  8. Example DHCP server DHCP client B: winipcfg DHCP client A: reboot

  9. TCP • Transmission Control Protocol

  10. TCP • Transmission Control Protocol • RFC-793 • Connection-oriented • Reliable • Byte stream • Dispatch data to socket

  11. internet Connection-Oriented • Receiver • socket • bind on X • listen • accept • recv • Sender • socket • bind • connect Dst/X • send Dst

  12. Reliable • Packet Checksum • Sequence number • Ack number • Timeout • Re-transmission

  13. Relationship Between TCP And Other Protocols • TCP on one computer uses IP to communicate with TCP on • another computer • IP offers best-effort (unreliable) delivery • TCP uses IP • TCP provides completely reliable transfer

  14. PacketFormat 0 15 16 31 source port destination port sequence number acknowledgement number header len reser U R G A C K P S H R S T S Y N F I N window size checksum urgent pointer

  15. Packet format • SYN : synchronize sequence numbers to initiate a connection • URG : urgent pointer is valid • ACK : ack number is valid • PSH : receiver should pass this data to application ASAP • RST : reset the connection • FIN : finish sending data

  16. Reliable Data Transmission • Positive acknowledgment • – Receiver returns short message when data arrives • – Called acknowledgment • Retransmission • – Sender starts timer whenever message is transmitted • – If timer expires before acknowledgment arrives, sender • retransmits message

  17. Illustration Of Retransmission

  18. How Long Should TCP Wait Before Retransmitting? • Time for acknowledgment to arrive depends on • – Distance to destination • – Current traffic conditions • Multiple connections can be open simultaneously • Traffic conditions change rapidly Solving The Retransmission Problem • Keep estimate of round trip time on each connection • Use current estimate to set retransmission timer • Known as adaptive retransmission • Key to TCP’s success

  19. Illustration Of Adaptive Retransmission • Timeout depends on current round-trip estimate

  20. Illustration Of Window Advertisement

  21. Checksum • For protecting the misdelivery by IP, except to the entire segment, the checksum calculation need to plus the pseudoheader • it calculates the 16-bit one’s complement addition of all 16-bit words in the pseudoheaer, TCP header, and TCP segment body • Two options for the TCP • Window scale factor: windows field is multiplied by a 2F, F <=14 • Timestamp: for deriving the round-trip time

  22. Connection Establish • Uses 3-way handshake to establish connection • SYN used for startup CLOSED SYN 141223, win 4096 <mss 1024> SYN_SENT SYN_RCVD SYN 254242, win 4096 ack 141224 <mss 1024> ESTABLISH ESTABLISH ack 254243, win 4096 MSS: max segment size

  23. Connection Termination • Uses modified 3-way handshake to establish connection • FIN used for shutdown ESTABLISH FIN 341248 ack 668451 FIN_WAIT_1 CLOSE_WAIT ack 341249 LAST_ACK FIN_WAIT_2 FIN 668451 ack 341249 TIME_WAIT ack 668452 CLOSED CLOSED

  24. TCP State Machine CLOSED passive OPEN active OPEN snd SYN recv SYN snd ACK, SYN LISTEN AP Close or timeout SYN_RCVD SYN_SENT recv SYN, ACK snd ACK recv ACK AP Close snd FIN ESTABLISHED CLOSE_WAIT AP Close snd FIN recv FIN snd ACK AP Close snd FIN LAST_ACK recv FIN snd ACK FIN_WAIT_1 CLOSING recv ACK recv FIN,ACK snd ACK recv ACK recv ACK recv FIN snd ACK Timeout=2MSL FIN_WAIT_2 TIME_WAIT

More Related