1 / 49

Transmission Control Protocol (TCP)

Transmission Control Protocol (TCP). BSAD 141 Dave Novak Sources : Network + Guide to Networks, Dean 2013. Outline. Discuss role of layer 4 transport protocols from perspective of OSI model services Process-level communication TCP How different from IP Connection-based service

kelda
Download Presentation

Transmission Control Protocol (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. Transmission Control Protocol (TCP) BSAD 141 Dave Novak Sources: Network+ Guide to Networks, Dean 2013

  2. Outline • Discuss role of layer 4 transport protocols from perspective of OSI model services • Process-level communication • TCP • How different from IP • Connection-based service • Reliability aspects • UDP

  3. Transport protocols • From OSI model perspective IP is a network layer protocol • Has its own layer (internetworking layer) in the TCP/IP model • IP provides a universal routable address format and offers: • Connectionless, best-effort service • Unreliable service

  4. Transport protocols • Layer 4 transport layer protocols work with layer 3 network layer protocols to provide additional services: • Process-to-process communication • End-to-end error control

  5. Transport protocols • IP focuses on host-to-host communication, not process-to-process communication • What is process-to-process communication? • Individual hosts run multiple processes at one time • Multiple applications, utilities, etc. • Must be some protocol to manage multiple processes between hosts

  6. Transport protocols • Layer 4 transport layer protocols are responsible for managing process-to-process communication • 2 transport layer protocols in TCP/IP protocol suite • 1) • 2)

  7. TCP Introduction • It can be desirable to have a transport protocol that not only manages processes, but provides reliable service

  8. Internet Protocol (IP) • IP is connectionless • Provides a generic, universal address format that is understood by all devices on the internet • Independent of specific data link technologies • Routes all IP datagrams independently • No guarantee that packets will travel on same route to destination

  9. Internet Protocol (IP) • Allows for fragmentation and reassembly of datagrams • Can subdivide datagrams to fit in any frame payload

  10. Transmission Control Protocol (TCP) • Connection-oriented service • Establishes virtual connection between 2 hosts • Provides reliableservice • Guaranteed delivery of data with acknowledgement from the receiver

  11. Transmission Control Protocol (TCP) • Point-to-point • Establishes connections between two specific endpoints – single process running on sending host to single process running on receiving host

  12. Transmission Control Protocol (TCP) • Manage process-to-process communication • Address out of order delivery • Address packet loss • Adjust routing based on network conditions (congestion control) • Adjust how many packets are sent in a given time period (flow control) • Establish an explicit “connection” between sender and receiver • Address corrupt data

  13. TCP Segments • TCP uses same format for all messages (the segment “looks” the same regardless of the type of message) • Data transmission • ACK (acknowledgement) • 3-way handshake (connection establishment and tear-down) • All TCP messages called segments • Segments encapsulated in IP datagram payload

  14. TCP Encapsulation Layer 4 (TCP segment) IP datagram payload – TCP segment header becomes part of IP payload IP datagram header Layer 3 (IP datagram) Frame payload – IP header placed in frame payload Frame header Layer 2 (Frame)

  15. TCP – Ports • Transport layer protocol (TCP or UDP) identify the protocol or process that generated data • Often map this to a specific port number • 1) On a computer, a place to be physically connected to another device (example, serial port, parallel port) • 2) Using TCP/IP, a logical connection (a client application specifies an application on a remote computer (SOFTWARE) • 3) In programming, to move an application for the development environment to be run in another environment

  16. TCP – Ports • Common internet applications are assigned specific, well-known port numbers • TCP and UDP maintain their own separate lists of well-known ports

  17. TCP – Examples of Common Ports You can visit http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers To view a list of well-known TCP and UDP port numbers

  18. Sockets • TCP/IP system addresses traffic to another system using combination of: • 1) IP address • 2) Port number • This combination of IP address and port number is called a socket • Sending socket – 137.99.101.55:4532 • Receiving socket – 185.100.32.56:80

  19. TCP – Sockets • Don’t specify port number when typing URL because applications assume you are connecting to well known port numbers • Your Web browser generally addresses all URLs to TCP port 80 – default HTTP port • You could configure a Web server to operate on an alternate port – any users connecting to your Web server would need to know the port number and specify it • http://www.privateserver.com:81

  20. TCP • Mapping the OSI and TCP/IP models FTP, HTTP, DHCP Application layer 7 Application layer Binary, ASCII Presentation layer 6 Session layer 5 TCP Transport layer Transport layer 4 IP Network layer Internet layer 3 2 Data Link layer LAN technology, cabling Network Interface layer 1 Physical layer

  21. TCP Services • Major features of TCP • Connection oriented • Point-to-point communication • Complete reliability • Full duplex communication • Connection startup and shutdown

  22. Reliable service – what does this mean? • Many types of problems can arise on a communications network • Duplicate messages • Out-of-order delivery • Delayed messages • Lost messages • TCP employs a number of techniques to address these issues and provide “reliable” service

  23. Achieving Reliability • 4 components to TCP reliable service • 1) • 2) • 3) • 4)

  24. 1) Connection Establishment • Before two systems exchange application layer data, a virtual connection between 2 processes on 2 hosts explicitly established • Ensures both sender and receiver are: • 1) Present (actually exist and are accessible) • 2) Operating properly • 3) Ready to receive data

  25. 1) Connection Establishment • Connection implemented through software and remains alive during data exchange • Then the connection terminated in an orderly, systematic fashion • Usually a single file exchange

  26. 1) Connection Establishment • Three-way handshake algorithm • Systematic connection establishment and tear down requires an exchange of three messages • SYN segment – synchronization segment for establishment • FIN segment – for termination

  27. 1) Connection Establishment • Three-way handshake algorithm • Each system (sender on one end, receiver on the other) establishes separate connections running in opposite directions • Full duplex protocol • Each terminates separately

  28. 3-Way Handshake (initialization) Client initiates Server 1) Client sends session Initialization request to server. Includes “plan” for transmission 1) SYN 2) Server sends back its starting sequence number and an acknowledgement 2) ACK + SYN 3) Client acknowledges receipt of server’s sequence number 3) ACK

  29. Terminating Both Connections (tear down) Client initiates Server 1) Client sends termination request to server 1) Client FIN 2) Server acknowledges that it has received client’s request 3) Server generates its own FIN message 2) ACK 3) Server FIN 4) Client acknowledges receipt of server’s FIN FIN and ACK cannot piggy back Server cannot include its FIN in the ACK sent to client 4) ACK

  30. End-to-End Service • Direct connection from process on one host to process on another host • Set up connection • Socket • Exchange data • Receiver knows exactly how much data to expect • Close connection

  31. 2) Retransmission • If data are lost, or there are problems, TCP can retransmit messages • TCP allows multiple applications to communicate with multiple destinations at same time • TCP must handle variety of delay scenarios and times that can change • A timer is set to decide when to retransmit • The retransmission timer can differ by application

  32. 2) Retransmission

  33. 2) Retransmission • Timer for retransmission depends on: • Network congestion • Distance to destination • Bandwidth of link • TCP can adapt to network conditions and to the needs of individual applications

  34. Adaptive Retransmission • TCP uses adaptive retransmission • Monitors delay on each retransmission and adapts to accommodate changing conditions • TCP estimates round trip time (RTT) for each active connection

  35. Adaptive Retransmission • Adapts by subtracting time message is sent from time ack is received • Ack received 8:03:45:07 • Message sent 8:03:45:02 • 8:03:45:07 - 8:03:45:02 = 0:0:0:05 • Uses weighted moving average of RTT • Weights most recent activity most heavily • Adjusts to conditions on network

  36. Adaptive Retransmission • Fixed timeouts specifying retransmission times do not work well on a large internetwork • Why would this be the case?

  37. Adaptive Retransmission

  38. 3) Flow Control • Managing the flowof data between two processes • Why would this be important? • What would happen if the sending computer is much faster and has a larger buffer than the receiving computer?

  39. 3) Flow Control • TCP utilizes the sliding windowscheme for flow control • Connection established • Each host allocates buffer to hold incoming data until it can be processed • Size of buffer sent to other computer • Remaining buffer size specified in ack when each transmission is received • Sending computer adjusts amount of data it sends based on size of remaining buffer size • If zero buffer remains, sending computer must stop transmitting until space is available

  40. 3) Flow Control

  41. 3) Flow Control • Offered window – # bytes receiving system has authorized transmitting system to send As receiver acknowledges bytes, left side of window moves to the right As receiver passes acknowledged bits up to application layer, right side of window moves to the right

  42. 4) Congestion Control • Managing amount of data being injected onto the network by specific host • Why would this be important? • What happens if switches and/or links become overloaded?

  43. 4) Congestion Control • Packet loss and delay most often caused by congestion, not hardware failure • TCP can exacerbate congestion problem through retransmission • How (what happens if you add cars to an already congested freeway)?

  44. 4) Congestion Control • Congestion collapse • TCP uses packet loss as a measure of congestion measurement • TCP determines how busy the network is by the number and frequency of lost packets

  45. 4) Congestion Control • Simplified algorithm for congestion control • When packet loss occurs, TCP immediately reduces number of packets sent to one (regardless of the maximum number it can send) • If ack for single packet received, send 2 packets • Receiver acknowledges successful receipt of data • If ack for both packets received, send 4 packets • Exponential increase, until half Send Window Size (max amount that can be sent) achieved • Than cut back to a less aggressive increase

  46. User Datagram Protocol (UDP) • While TCP captures most of our attention, UDP is also widely used transport protocol in TCP/IP stack • Process-to-process communication • Connectionless datagram service • Provides NO reliability • Very little overhead

  47. User Datagram Protocol (UDP) • Communication consists of 2 messages • Request and reply – there is no connection establishment

  48. UDP • If TCP provides reliability and UDP does not, why would UDP be used at all?

  49. Summary • Process-to-process communication • TCP • How different from IP • Four reliability components • UDP

More Related