1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) 802.11 WiFi, Ethernet Link (Physical)

Slides:



Advertisements
Similar presentations
Flow control Connection management TCP, UDP
Advertisements

TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
CSCI 4550/8556 Computer Networks
Transmission Control Protocol (TCP)
Fundamentals of Computer Networks ECE 478/578 Lecture #20: Transmission Control Protocol Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
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.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
1 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
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.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
1 Transport Protocols Relates to Lab 5. UDP and TCP.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
BZUPAGES.COM 1 User Datagram Protocol - UDP RFC 768, Protocol 17 Provides unreliable, connectionless on top of IP Minimal overhead, high performance –No.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
TELE202 Lecture 14 TCP/UDP (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (1) »Source: chapter 17 ¥This Lecture »TCP/UDP (2) »Source: chapter.
1 TCP CSE May TCP Services Flow control Connection establishment and termination Congestion control 2.
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 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
CSCE 515: Computer Network Programming TCP Details Wenyuan Xu Department of Computer Science and Engineering.
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.
Transport Layer TCP and UDP IS250 Spring 2010
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
1 Transport Layer Computer Networks. 2 Where are we?
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.
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.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
Transport Layer: UDP, TCP
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
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.
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:
ECE 4110 – Internetwork Programming
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
Transport Protocols.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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).
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Chapter 3 outline 3.1 Transport-layer services
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.
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Introduction to Networks
5. End-to-end protocols (part 1)
TCP.
TCP.
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
TCP - Part I Karim El Defrawy
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
The Transmission Control Protocol (TCP)
Lecture 21 and 22 5/29/2019.
Chapter 3 Transport Layer
Transport Layer 9/22/2019.
Presentation transcript:

1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)

TCP Transmission Control Protocol TCP is an alternative transport layer protocol over IP. TCP provides:  Connection-oriented  Reliable  Full-duplex  Byte-Stream 2

Connection-Oriented Connection oriented means that a virtual connection is established before any user data is transferred. If the connection cannot be established - the user program is notified. If the connection is ever interrupted - the user program(s) is notified. 3

Reliable Reliable means that every transmission of data is acknowledged by the receiver. If the sender does not receive acknowledgement within a specified amount of time, the sender retransmits the data. 4

Byte Stream Stream means that the connection is treated as a stream of bytes. The user application does not need to package data in individual datagrams (as with UDP). 5

Full Duplex TCP provides transfer in both directions. To the application program these appear as 2 unrelated data streams, although TCP can piggyback control and data communication by providing control information (such as an ACK) along with user data. 6

Motivation SourceDestination Packet 1 Ack 2 Packet 2 Ack 3 Packet 3 7 The sender: 1. Send a packet. 2. Wait for acknowledgement 3. Go back to 1. The receiver: 1. Wait for a packet 2. Acknowledge the sender 3. Go back to 1.

Connection Establishment TCP 3 steps handshake 8

Connection Termination 9

Window size The window size is the number of packets that are transmitted before ack received. In the previous example, the windows size was fixed to 1. The windows size in TCP is adaptive (details later) Both the source and the destination should have a buffer with equal (or bigger) size than the window size. Receiver puts each packet in its right place  No out of place packets. 10

Example: window size of 3 Source Destination Packet 1 Packet 2 Packet 3 Packet 4 Packet 5 Packet 6 ack2 ack3 ack4 ack5 ack6 ack7 11

Buffering Keep in mind that TCP is part of the Operating System. The O.S. takes care of all these details asynchronously. The TCP layer doesn’t know when the application will ask for any received data. TCP buffers incoming data so it’s ready when we ask for it. 12

TCP Buffers Both the client and server allocate buffers to hold incoming and outgoing data  The TCP layer does this. Both the client and server announce with every ACK how much buffer space remains (the Window field in a TCP segment). 13

Send Buffers The application gives the TCP layer some data to send. The data is put in a send buffer, where it stays until the data is ACK’d. The TCP layer won’t accept data from the application unless (or until) there is buffer space. 14

Lost packets SourceDestination Packet 1 Packet 2 Packet 3 Packet Lost SourceDestination Fin / Sync Packet Lost 15

Packets Retransmissions To overcome this, the sender should have a timeout for a retransmission. RTT:: Round Trip Time between a pair of hosts on the Internet (until ack received). The timeout value is set as a function of the expected RTT. 16

Packets Retransmissions Source Destination Packet 1 Packet 2 Packet 3 Packet Lost Source Destination Fin / Sync Packet Lost Fin / Sync Packet 1 Timeout Consequences of a bad choice of timeout? 17

Adaptive Retransmissions Keep a running average of RTT and compute TimeOut as a function of this RTT. Send packet and keep timestamp ts. When ACK arrives, record timestamp ta. SampleRTT = ta - ts 18

Adaptive Retransmissions Compute a weighted average: EstimatedRTT = α x estimatedRTT + (1- α) x sampleRTT Original TCP spec: α in range (0.8,0.9)  TimeOut = 2 x EstimatedRTT 19

Adaptive retransmissions with exponential backoff strategy 20 Consider what happens when TCP sends a segment after a sharp increase in delay Solution – use exponential backoff. If the timer expires and causes a retransmission, TCP increases the timeout by a factor of 2

Fast Retransmit The problem – waiting for a timeout takes long time and the throughput drops. Fast Retransmit was added to the TCP protocol. Since the receiver responds every time a packet arrives, this implies the sender will see duplicate ACKs. Fast Retransmit - Upon receipt of three duplicate ACKs, the TCP Sender retransmits the lost packet. 21

Fast Retransmit Packet 1 Packet 2 Packet 3 Packet 4 Packet 5 Packet 6 Retransmit packet 3 ACK 2 ACK 3 ACK 7 ACK 3 SenderReceiver 22 Packet 7 ACK 8

Network Congestion Network congestion occurs when a link or node is carrying so much data that its quality of service deteriorates Typical effects include queuing delay and packet loss Simple solution - retry to send the packets  That creates a positive effect that only lead to more load. Instead, Congestion Control algorithms are used. 23

Slow Start TCP Congestion Control When congestion is detected (packets loss), decrease the window size to one  The current window size is called congestion threshold. On each ack, increase the window size by 1.  Note– it has an exponential growth phase. When the window size equal to the congestion threshold, start to increase the window size linearly (increase by 1 on each window-size # of packets). 24

TCP Slow start Source Destination Timeout It also explains the TCP adaptive windows size discussed previously 25 Packet Lost

Fast Recovery Handling congestion is expensive. This algorithm try to avoid congestion Algorithm description:  If 3 duplicated ACKs detected.  The congestion window size is reduced to the slow-start threshold 26

TCP Frame TCP segments have a 20 byte header with >= 0 bytes of data. 27

TCP header fields Port Number:  A port number identifies the endpoint of a connection.  A pair identifies one endpoint of a connection.  Two pairs and identify a TCP connection. 28

TCP header fields Sequence Number (SeqNo):  Sequence number is 32 bits long.  So the range of SeqNo is 0 <= SeqNo <=  4.3 Gbyte  Each sequence number identifies a byte in the byte stream  Initial Sequence Number (ISN) of a connection is set during connection establishment 29

TCP header fields Acknowledgement Number (AckNo):  Acknowledgements are piggybacked, I.e a segment from A -> B can contain an acknowledgement for a data sent in the B -> A direction  A hosts uses the AckNo field to send acknowledgements. (If a host sends an AckNo in a segment it sets the “ACK flag”)  The AckNo contains the next SeqNo that a hosts wants to receive Example: The acknowledgement for a segment with sequence numbers is AckNo=

TCP header fields Acknowledgement Number (cont’d)  TCP uses the sliding window flow protocol to regulate the flow of traffic from sender to receiver  TCP uses a variation of sliding window which uses only cumulative ACKs Example: Assume: Sender sends two segments with “ ” and “ ”, but receiver only gets the second segment. In this case, the receiver cannot acknowledge the second packet. It can only send AckNo=1 31

TCP header fields Header Length ( 4bits):  Length of header in 32-bit words  Note that TCP header has variable length (with minimum 20 bytes) 32

TCP header fields Flag bits:  URG: Urgent pointer is valid If the bit is set, the following bytes contain an urgent message in the range: SeqNo <= urgent message <= SeqNo+urgent pointer  ACK: Acknowledgement Number is valid  PSH: PUSH Flag Notification from sender to the receiver that the receiver should pass all data that it has to the application. Normally set by sender when the sender’s buffer is empty 33

TCP header fields Flag bits:  RST: Reset the connection The flag causes the receiver to reset the connection Receiver of a RST terminates the connection and indicates higher layer application about the reset  SYN: Synchronize sequence numbers Sent in the first packet when initiating a connection  FIN: Sender is finished with sending Used for closing a connection Both sides of a connection must send a FIN 34

TCP header fields Window Size:  Each side of the connection advertises the window size  Window size is the maximum number of bytes that a receiver can accept.  Maximum window size is = bytes TCP Checksum:  TCP checksum covers over both TCP header and TCP data (also covers some parts of the IP header) Urgent Pointer:  Only valid if URG flag is set 35

Transport Layer Summary 36 PropertyUDPTCP Corrupted packetsno Reliablenoyes Connection typeConnectionlessConnection oriented Congestion controlNoYes LatencyLowHigh ApplicationsVOIP, Most games, NFS, DNS HTTP, HTTPs, FTP, SMTP, Telnet, SSH