CS2911 Week 9, Sometime Today Week 10, Tuesday TCP

Slides:



Advertisements
Similar presentations
CS144 Review Session 4 April 25, 2008 Ben Nham
Advertisements

Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Transmission Control Protocol (TCP)
Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
CS 471/571 Transport Layer 5 Slides from Kurose and Ross.
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
Transport Layer3-1 Summary of Reliable Data Transfer Checksums help us detect errors ACKs and NAKs help us deal with errors If ACK/NAK has errors sender.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer 3-1 outline r TCP m segment structure m reliable data transfer m flow control m congestion control.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Network LayerII-1 RSC Part III: Transport Layer 3. TCP Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are, mainly, part.
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
2: Transport Layer 21 Transport Layer 2. 2: Transport Layer 22 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_b Transport Protocols - TCP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
TCP Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
CS332, Ch. 26: TCP Victor Norman Calvin College 1.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
CSE679: Computer Network Review r Review of the uncounted quiz r Computer network review.
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Chapter 24 Transport Control Protocol (TCP) Layer 4 protocol Responsible for reliable end-to-end transmission Provides illusion of reliable network to.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
CS2910 Week 9, Class 1 Today –Quiz on SMTP –TCP: Flow control vs. Congestion Control –TCP startup, error recovery, and shut-down Before 8am Thursday: –Watch.
ECE 4110 – Internetwork Programming
TCP as a Reliable Transport. How things can go wrong… Lost packets Corrupted packets Reordered packets …Malicious packets…
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 3: Transport.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
CIS679: TCP and Multimedia r Review of last lecture r TCP and Multimedia.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
09-Transport Layer: TCP Transport Layer.
Chapter 3 Transport Layer
DMET 602: Networks and Media Lab
Fast Retransmit For sliding windows flow control we waited for a timer to expire before beginning retransmission of a packet TCP uses an additional mechanism.
CS450 – Introduction to Networking Lecture 19 – Congestion Control (2)
Chapter 5 TCP Sequence Numbers & TCP Transmission Control
CS 1652 Jack Lange University of Pittsburgh
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
The Transport Layer (TCP)
Introduction to Networks
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
PART 5 Transport Layer Computer Networks.
CS1652 TCP Jack Lange University of Pittsburgh
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Internet and Intranet Protocols and Applications
Chapter 5 TCP Transmission Control
Transmission Control Protocol (TCP)
CS2911 Week 7, Class 3 Today Week 8, Lab period Muddiest Point
Transport Protocols: TCP Segments, Flow control and Connection Setup
CS4470 Computer Networking Protocols
Transport Layer: Congestion Control
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
TCP flow and congestion control
Chapter 3 Transport Layer
Chapter 3 Transport Layer
Presentation transcript:

CS2911 Week 9, Sometime Today Week 10, Tuesday TCP 7 September 2018 CS2911 Week 9, Sometime Today TCP Week 10, Tuesday Class climate evaluations! TCP concluded Credit: Many slides in this deck by Dr. Rothe and the authors of our textbook 18q1 CS2911 Dr. Yoder Dr. Josiah Yoder

Outcomes Be familiar with the layout of the TCP header CS2910 9/7/2018 Outcomes Be familiar with the layout of the TCP header Describe the purpose of the following TCP header fields: Source Port, Dest Port, Sequence number, Acknowledgement number Receive window Checksum Calculate sequence and acknowledgement numbers Describe the behavior of the 3-way handshake Dr. Josiah Yoder

TCP as a Reliable Transport

CS2910 9/7/2018 TCP Header format http://ps-2.kev009.com/wisclibrary/aix51/usr/share/man/info/en_US/a_doc_lib/aixbman/commadmn/tcp_protocols.htm SE-2811 Dr.Yoder Dr. Josiah Yoder

Formatting of Field Values CS2910 9/7/2018 Formatting of Field Values Like UDP, all fields are stored in raw binary in a big-endian order (most significant byte first) SE-2811 Dr.Yoder Dr. Josiah Yoder

How things can go wrong… CS2911 7 September 2018 How things can go wrong… Corrupted packets Lost packets Reordered packets …Malicious packets… In these slides, we do not consider security issues – only the basics to overcome unintentional network errors Dr. Josiah Yoder

Requirements for Reliability Error Detection Receiver Feedback Retransmission

Requirements for Reliability Error Detection Checksum Receiver Feedback ACK – acknowledgment NAK – negative acknowledgment Missing ACK Retransmission Sender resends the segment requested in the NAK or which had the ACK missing

Stop and Wait RTT – Round Trip Time

Packet Loss CS2911 7 September 2018 No way to send a NAK in this case Dr. Josiah Yoder

Sliding Window - Pipelined

TCP Data Transfer Specifics Data transferred as a stream of octets (bytes) Data is transferred in segments, but acknowledged at the octet level Full duplex – data can be transferred in either direction, or both Both endpoints of connection must maintain buffers/windows for both sending and receiving

Acknowledgement Acknowledgements are cumulative CS2911 7 September 2018 Acknowledgement Acknowledgements are cumulative Acknowledgement of any octet implies receipt of all previous octets Simple Lost acknowledgements will not necessarily result in retransmission Skipped slide 12 (transfer specifics) and ended with this slide 18q1-wk9-2-011 Dr. Josiah Yoder

Acknowledgement Acknowledgements are cumulative Acknowledgement of any octet implies receipt of all previous octets

Acknowledgement Acknowledgements are cumulative Acknowledgement of any octet implies receipt of all previous octets Think (30 s) Pair (30 s) Shair What if timeout was here?

Exercise: TCP sequence & acknowlegement numbers TCP sequence numbers actually start at a random number To establish the number, the sender sends the random first sequence number. The receiver replies with the sequence number + 1 After this, the current sequence number is always first number + 1 + total number of bytes sent/received

Starting a TCP sequence Client Server SYN, SEQ = 368 ACK, ACK = 369 SEQ = 369, 10 bytes data ACK, ACK = 379 SEQ = 379, 10 bytes data ACK = 389

Server also can send data Client Server SYN, SEQ = 824 ACK, ACK = 825 SEQ = 825, 30 bytes data ACK, ACK = 855 SEQ = 855, 20 bytes data

All together now… Client Server SYN, SEQ = 368 ACK, ACK = 369 SEQ = 825, 30 bytes data ACK, ACK = 855 SYN, SEQ = 368 ACK, ACK = 369 Three-way Handshake SEQ = 369, 10 bytes data ACK, ACK = 379 SEQ = 379, 10 bytes data SEQ = 855, 20 bytes data ACK = 389

Multiple pending messages Client SYN, SEQ = 368 ACK, ACK = 369 SEQ = 369, 10 bytes data SEQ = 379, 20 bytes data

Closing a TCP connection Client Server FIN SEQ = 835 ACK = 836 FIN SEQ = 529 ACK = 530 17q1: example sequence and acknowledgement numbers added after morning class Note that the ACK to the FIN also counts as 1 "virtual byte"

Closing a TCP connection Client Server FIN, SEQ = 835 ACK, ACK = 529 SEQ = 529 ACK, ACK = 836 FIN, SEQ = 529 SEQ = 836 ACK, ACK = 530 17q1: example sequence and acknowledgement numbers added after morning class Note that the ACK to the FIN also counts as 1 "virtual byte"

Exercise Fill in the blanks of the sample TCP message below

Sliding Window - Pipelined CS2911 7 September 2018 Sliding Window - Pipelined Just like stop and wait, the sliding window requires a buffer on either end. But now the sender can send as many messages as will fill the buffer. This is the window. Dr. Josiah Yoder

Sender’s Window 1, 2 have been sent and acknowledged 3 – 6 sent but not acknowledged 7 – 9 have not been sent but can be without delay 10 and higher will not be sent until window moves

Window Advertisement Window size can vary over time CS2911 7 September 2018 Window Advertisement Window size can vary over time Receiver sends a windows size with acknowledgement that indicates how many octets it is willing to accept Allows flow control An advertisement of 0 will halt transfer Receive is willing to accept as many bytes as will fit in its buffer Dr. Josiah Yoder

Sliding Window - Pipelined Requires buffering on each end Remaining space on receiver in last acknowledgement

Sliding Window supports Flow Control Won't over-fill receiver's buffer Waits for receiving application to be ready This is one reason to call recv even before we have gotten the whole message So the purpose of the flow control window is to make sure we don’t send more packets than the receiver can handle. In your experience, do different servers operate at different speeds, or is the bottleneck somewhere else? (If somewhere else, where?)

Flow vs. Congestion Control Flow control is a function of the receiver and its ability to accept data Congestion control is a function of the network and its ability to carry messages Congestion control avoids sending more data than the network can handle, resulting in collapse of the network Last slide for 18q1-011

New Variable - cwnd Two windows cwnd – congestion window Un-acknowledged bytes cwnd – congestion window rwnd – receive (flow control) window Note that this is NOT a new field in the headers – convenient!

cwnd We can send up to cwnd bytes per RTT period Average transmission rate is roughly cwnd/RTT bytes/sec By manipulating cwnd, transmission rate can be controlled Stopped roughly here 18q1-031 Suppose the window is open and I send a message. Then I can send enough messages to fill the whole window. But after that, I will wait for the first message to be ack’d before I can send any more messages – just like with flow control. In flow control, we are making sure we don’t fill a buffer on the receiver. Here, we are making sure we don’t spit too many packets onto the network so that it doesn’t collapse. So I will send on average cwnd/RTT bytes/sec

Congestion Detection If segments lost, maybe we are sending too many Adjust cwnd Decrease when a segment is lost Increase when ACKs are received Continue to increase until a segment is lost, then backoff [consistent] ACks

TCP Slow Start Start with a small cwnd (one MSS)

cwnd Over Time Tahoe – slow start, but not fast recovery (and not what is described in the Congestion Avoidance section on p. 273 of the 7th Ed – see p. 276, first para for explicit statement of this) Reno – slow start, but including fast recovery and Congestion Avoidance. Note that if a timeout occurs, Fast Recovery would also drop back to 1 MSS per round trip See (7th Ed) pp. 275-276 within Sec 3.7

Challenge: How to avoid accidental message? What if a TCP message from a previous connection gets stuck in a router for a while, but then eventually gets delivered later? How to avoid it being mistaken for the newer message?

A very brief history of the internet 1957 – Sputnik launched, ARPA formed 1962 – ARPA forms IPTO to create ARPAnet 1969 – First packet switched network at UCLA 1971 – First emails with @ signs 1983 – TCP/IP first deployed 1986 – NSFNET created (& many others) 1989 – HTTP starts with just GET 1991 – NSFNET allows commercial activities. e-Bay, Google, Amazon … 2000's – Facebook, Twitter, Youtube, … Source: Kurose & Ross, 6th, Ed, Section 1.7 and http://www.calvin.edu/academic/rit/webBook/chapter3/Introduction/arpanet.htm http://www.livinginternet.com/e/ei.htm Wiki: HTTP

CS2911 7 September 2018 Acknowledgement The content of this video is based in part on lecture slides from a very good textbook, and used with the author’s permission: Computer Networking: A Top-Down Approach, 7th edition, by Jim Kurose and Keith Ross Publisher: Pearson, 2017 Dr. Josiah Yoder

Timeout and Retransmission What do we use for a timeout? LAN – round-trip time for ACK might be ms Internet – 100x Varies over time

Adaptive Retransmission Round-trip time (RTT) is monitored for each transmission/ACK 0 ≤ α < 1 Recommended value of α = 0.128 [RFC 6298] Recommended β is 0.25 Last slide for 18q1-021