CS4700/CS5700 Fundamentals of Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks

CS4700/CS5700 Fundamentals of Computer Networks Lecture 14: TCP Slides used with permissions from Edward W. Knightly, T. S. Eugene Ng, Ion Stoica, Hui Zhang Alan Mislove amislove at ccs.neu.edu Northeastern1 University What Layers are Needed in a Basic Telephone Network? • Supports a single application: Telephone • An end host is a telephone • Each telephone makes Application Layer Telephone only one voice stream Network Telephone – Even with call-waiting and numbering, Layer 3-way calling signaling, routing (Data) Link TDMA Layer Alan Mislove amislove at ccs.neu.edu Northeastern2 University Is this Enough for a Datagram Computer Network? • Supports many applications • Each end host is usually a general purpose computer Application telnet, ftp, email • Each end host can be generating Layer many data streams simultaneously Transport TCP, UDP • In theory, each data stream can be Layer identified as a different “Protocol” in the IP header for demultiplexing Network IP – At most 256 streams Layer (Data) Link 802.3, 802.11 • Insert Transport Layer to create an Layer interface for different applications – Provide (de)multiplexing – Provide value-added functions Alan Mislove amislove at ccs.neu.edu Northeastern3 University E.g. Using Transport Layer Port Number to (De) multiplex traffic telnet HTTP ssh ports Application p1 p2 p1 p2 p3 p1 p2 TCP Transport IP A B C In TCP, a data stream is identified by a set of numbers: (Source Address, Destination Address, Source Port, Destination Port) Alan Mislove amislove at ccs.neu.edu Northeastern4 University Transport Layer in Internet • Purpose 1: (De)multiplexing of data streams to different application processes • Purpose 2: Provide value-added services that many applications want – Recall network layer in Internet provides a “Best-effort” service only, transport layer can add value to that • Application may want reliability, etc – No need to reinvent the wheel each time you write a new application Alan Mislove amislove at ccs.neu.edu Northeastern5 University Transport Protocols Concern only End Hosts, not Routers •Lowest level end-to-end protocol. – Header generated by sender is interpreted only by the destination – Routers view transport header as part of the 5 5 payload Transport Transport •Adds functionality to the best-effort packet delivery IP IP IP IP service. Datalink 2 2 Datalink – Make up for the shortcomings of the Physical 1 1 Physical core network router Alan Mislove amislove at ccs.neu.edu Northeastern6 University (Possible) Transport Protocol Functions Alan Mislove amislove at ccs.neu.edu Northeastern7 University (Possible) Transport Protocol Functions • Multiplexing/demultiplexing for multiple applications. – Port abstraction Alan Mislove amislove at ccs.neu.edu Northeastern7 University (Possible) Transport Protocol Functions • Multiplexing/demultiplexing for multiple applications. – Port abstraction • Connection establishment. – Logical end-to-end connection – Connection state to optimize performance Alan Mislove amislove at ccs.neu.edu Northeastern7 University (Possible) Transport Protocol Functions • Multiplexing/demultiplexing for multiple applications. – Port abstraction • Connection establishment. – Logical end-to-end connection – Connection state to optimize performance • Error control. – Hide unreliability of the network layer from applications – Many types of errors: corruption, loss, duplication, reordering. Alan Mislove amislove at ccs.neu.edu Northeastern7 University (Possible) Transport Protocol Functions • Multiplexing/demultiplexing for multiple applications. – Port abstraction • Connection establishment. – Logical end-to-end connection – Connection state to optimize performance • Error control. – Hide unreliability of the network layer from applications – Many types of errors: corruption, loss, duplication, reordering. • End-to-end flow control. – Avoid flooding the receiver Alan Mislove amislove at ccs.neu.edu Northeastern7 University (Possible) Transport Protocol Functions • Multiplexing/demultiplexing for multiple applications. – Port abstraction • Connection establishment. – Logical end-to-end connection – Connection state to optimize performance • Error control. – Hide unreliability of the network layer from applications – Many types of errors: corruption, loss, duplication, reordering. • End-to-end flow control. – Avoid flooding the receiver • Congestion control. – Avoid flooding the network Alan Mislove amislove at ccs.neu.edu Northeastern7 University (Possible) Transport Protocol Functions • Multiplexing/demultiplexing for multiple applications. – Port abstraction • Connection establishment. – Logical end-to-end connection – Connection state to optimize performance • Error control. – Hide unreliability of the network layer from applications – Many types of errors: corruption, loss, duplication, reordering. • End-to-end flow control. – Avoid flooding the receiver • Congestion control. – Avoid flooding the network • More…. Alan Mislove amislove at ccs.neu.edu Northeastern7 University User Datagram Protocol (UDP) • Connectionless datagram – Socket: SOCK_DGRAM • Port number used for (de)multiplexing – port numbers = connection/application endpoint • Adds end-to-end reliability through optional checksum – protects against data corruption errors between source and destination (links, switches/routers, bus) – does not protect against packet loss, duplication or reordering 0 16 32 Source Port Dest. Port Length Checksum Alan Mislove amislove at ccs.neu.edu Northeastern8 University Using UDP • Custom protocols/applications can be implemented on top of UDP – use the port addressing provided by UDP – implement own reliability, flow control, ordering, congestion control as it sees fit • Examples: – remote procedure call – Multimedia streaming (real time protocol) – distributed computing communication libraries Alan Mislove amislove at ccs.neu.edu Northeastern9 University Transmission Control Protocol (TCP) 0 16 32 Source Port Dest. Port Sequence Number Acknowledgment Number HL/Flags Advertised Win. Checksum Urgent Pointer Options.. Alan Mislove amislove at ccs.neu.edu Northeastern10 University Transmission Control Protocol (TCP) • Reliable bidirectional in-order byte stream – Socket: SOCK_STREAM 0 16 32 Source Port Dest. Port Sequence Number Acknowledgment Number HL/Flags Advertised Win. Checksum Urgent Pointer Options.. Alan Mislove amislove at ccs.neu.edu Northeastern10 University Transmission Control Protocol (TCP) • Reliable bidirectional in-order byte stream – Socket: SOCK_STREAM • Connections established & torn down 0 16 32 Source Port Dest. Port Sequence Number Acknowledgment Number HL/Flags Advertised Win. Checksum Urgent Pointer Options.. Alan Mislove amislove at ccs.neu.edu Northeastern10 University Transmission Control Protocol (TCP) • Reliable bidirectional in-order byte stream – Socket: SOCK_STREAM • Connections established & torn down 0 16 32 • Multiplexing/ demultiplexing Source Port Dest. Port – Ports at both ends Sequence Number Acknowledgment Number HL/Flags Advertised Win. Checksum Urgent Pointer Options.. Alan Mislove amislove at ccs.neu.edu Northeastern10 University Transmission Control Protocol (TCP) • Reliable bidirectional in-order byte stream – Socket: SOCK_STREAM • Connections established & torn down 0 16 32 • Multiplexing/ demultiplexing Source Port Dest. Port – Ports at both ends Sequence Number • Error control Acknowledgment Number – Users see correct, ordered byte HL/Flags Advertised Win. sequences Checksum Urgent Pointer Options.. Alan Mislove amislove at ccs.neu.edu Northeastern10 University Transmission Control Protocol (TCP) • Reliable bidirectional in-order byte stream – Socket: SOCK_STREAM • Connections established & torn down 0 16 32 • Multiplexing/ demultiplexing Source Port Dest. Port – Ports at both ends Sequence Number • Error control Acknowledgment Number – Users see correct, ordered byte HL/Flags Advertised Win. sequences Checksum Urgent Pointer • End-end flow control Options.. – Avoid overwhelming machines at each end Alan Mislove amislove at ccs.neu.edu Northeastern10 University Transmission Control Protocol (TCP) • Reliable bidirectional in-order byte stream – Socket: SOCK_STREAM • Connections established & torn down 0 16 32 • Multiplexing/ demultiplexing Source Port Dest. Port – Ports at both ends Sequence Number • Error control Acknowledgment Number – Users see correct, ordered byte HL/Flags Advertised Win. sequences Checksum Urgent Pointer • End-end flow control Options.. – Avoid overwhelming machines at each end • Congestion avoidance – Avoid creating traffic jams within network Alan Mislove amislove at ccs.neu.edu Northeastern10 University High Level TCP Features • Sliding window protocol – Use sequence numbers • Bi-directional – Each host can be a receiver and a sender simultaneously – For clarity, we will usually discuss only one direction Alan Mislove amislove at ccs.neu.edu Northeastern11 University Connection Setup • Why need connection setup? • Mainly to agree on starting sequence numbers – Starting sequence number is randomly chosen – Reason, to reduce the chance that sequence numbers of old and new connections from overlapping Alan Mislove amislove at ccs.neu.edu Northeastern12 University Important TCP Flags • SYN: Synchronize – Used when setting up connection • FIN: Finish – Used when tearing down connection • ACK – Acknowledging received data Alan Mislove amislove at ccs.neu.edu Northeastern13 University Establishing Connection SYN: SeqC Client Server ACK: SeqC+1 SYN: SeqS ACK: SeqS+1 • Three-Way

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    72 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us