Transmission Control Protocol (TCP)

Slides:



Advertisements
Similar presentations
TCP/IP Christopher Zacky. lolwut Decimal Numbers.
Advertisements

CISCO NETWORKING ACADEMY Chabot College ELEC Transport Layer (4)
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transmission Control Protocol (TCP)
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
CS 471/571 Transport Layer 5 Slides from Kurose and Ross.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
Networks I Transmission Control Protocol Instituto Tecnológico y de Estudios Superiores de Monterrey Campus Estado de México Prof. MSc. Ivan A. Escobar.
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
Transmission Control Protocol (TCP) Basics
5/6/2015© 2010 Raymond P. Jefferis IIILect Transport Layer.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Chapter 7 – Transport Layer Protocols
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.
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
Copyright 1999, S.D. Personick. All Rights Reserved. Telecommunications Networking II Lecture 32 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
EEC-484/584 Computer Networks Lecture 13 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.
Gursharan Singh Tatla Transport Layer 16-May
TCP Transport Control Protocol Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection.
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.
26-TCP Dr. John P. Abraham Professor UTPA. TCP  Transmission control protocol, another transport layer protocol.  Reliable delivery  Tcp must compensate.
Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transmission Control Protocol
Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
Chapter 24 Transport Control Protocol (TCP) Layer 4 protocol Responsible for reliable end-to-end transmission Provides illusion of reliable network to.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
Fall 2004FSU CIS 5930 Internet Protocols1 TCP – Data Exchange Reading: Section 24.4.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
CIS679: TCP and Multimedia r Review of last lecture r TCP and Multimedia.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
Computer Networks 1000-Transport layer, TCP Gergely Windisch v spring.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
09-Transport Layer: TCP Transport Layer.
Introduction to Networks
5. End-to-end protocols (part 1)
Transport Layer.
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
TCP.
© 2003, Cisco Systems, Inc. All rights reserved.
PART 5 Transport Layer Computer Networks.
CCNA Introduction to Networking 5.0 Rick Graziani Cabrillo College
TCP - Part I Karim El Defrawy
CSCI-1680 Transport Layer I
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Dr. John P. Abraham Professor UTPA
TRANSMISSION CONTROL PROTOCOL
Dr. John P. Abraham Professor UTPA
Chapter 5 Transport Layer Introduction
PART 5 Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Chapter 5 Transport Layer Introduction
Introduction to Computer Networks
Lecture 21 and 22 5/29/2019.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
Presentation transcript:

Transmission Control Protocol (TCP) Reading: Chapter 24 Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols TCP A reliable, byte-oriented, connection-oriented transport protocol Requirements Reliable transmission of byte streams In-order delivery (to application layer) No duplicate delivery (to AL) Transport data of arbitrary length Synchronization between sender and receiver Flow control Fall 2004 FSU CIS 5930 Internet Protocols

View of TCP from applications Connection-oriented Peer-to-peer communication Complete reliability Full-duplex communication Byte-stream interface Reliable connection startup Graceful connection shutdown Fall 2004 FSU CIS 5930 Internet Protocols

TCP header Fall 2004 FSU CIS 5930 Internet Protocols Data (optional) Options (optional) Destination Port Length Control Flags Source Port Sequence Number Acknowledgement Number reserved Window Size Checksum Urgent Pointer Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols struct tcphdr struct tcphdr { __u16 source; __u16 dest; __u32 seq; __u32 ack_seq; #if defined(__LITTLE_ENDIAN_BITFIELD) __u16 res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1; #elif defined(__BIG_ENDIAN_BITFIELD) __u16 doff:4, res1:4, cwr:1, fin:1; #else #error "Adjust your <asm/byteorder.h> defines" #endif __u16 window; __u16 check; __u16 urg_ptr; }; Fall 2004 FSU CIS 5930 Internet Protocols

Implementation of TCP Fall 2004 FSU CIS 5930 Internet Protocols TCP ip_input.c ip_local_deliver ip_output.c ip_queue_xmit tcp_v4_rcv tcp_v4_do_rcv __tcp_v4_lookup() tcp_rcv_ established TCP_ESTABLISHED tcp_rcv_ state_process tcp_sendmsg tcp_send_skb tcp_transmit_skb tcp_ack_ snd_check tcp_data_ snd_check tcp_write_ xmit tcp_write_ timer tcp_re - transmit_skb tcp_send_ (delayed)_ack tcp_ack tcp_data tcp_data _queue sk->data_ready Fast Path Slow Path send Pure ACK Retrans. Timer TCP Section 24.3 Fall 2004 FSU CIS 5930 Internet Protocols

Handling incoming TCP segments Ip dispatches packets based on protocol tcp_v4_rcv() Some sanity check, drop packet if necessary Looking for proper sock (tcp_v4_lookup()) If found, continue with tcp_v4_do_rcv() Else, send RESET segment (tcp_send_reset()) Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols tcp_v4_do_rcv() Processing segment depending on socket state (connection state) TCP_ESTABLISHED (tcp_rcv_established()) Other states (tcp_rcv_state_process()) tcp_rcv_established() To speed up segment processing Fast path vs. Slow path Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols Fast path vs. Slow path FP for “normal” TCP segments A pure ACK segment The expected packet (next packet in stream) SP for other segments Unexpected TCP flags Not a packet expected (out-of-order) Both parties exchange data Window size is zero Unexpected TCP options Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols Fast path Some sanity check If ACK segment Processing with tcp_ack() Releasing socket buffer Checking if local data can be sent (tcp_data_snd_check()) If data segment If can be copied to user process, copy payload Update expected packet Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols Fast path (cont’d) Otherwise (cannot copied to user process) Inserting into sock queue Updating expected packet Some management processing (tcp_event_data_rcv()) Checking if acknowledgement has to sent Delayed ACK vs. Quick ACK Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols Slow path Many many different processing conditions Checking code Some functions for handling incoming packets tcp_ack() tcp_event_data_recv() tcp_data_snd_check() tcp_rcv_state_process() Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols Sending TCP segments tcp_sendmsg() Copying data from user space to kernel Checking if connection established If not, wait_for_tcp_connect() Checking if data can be sent tcp_send_skb() Sending data __tcp_push_pending_frame() Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols tcp_send_skb() Adding data into transmit queue sk->write_queue Testing if data can be sent tcp_snd_test() If positive, send data tcp_transmit_skb() Starting retransmission timer tcp_reset_xmit_timer() Fall 2004 FSU CIS 5930 Internet Protocols

FSU CIS 5930 Internet Protocols tcp_transmit_skb() Some processing depending on if ACK set Passing packet toIP tp->af_specific->queue_xmit() tp_queue_xmit() Adjusting slow-start threshold Fall 2004 FSU CIS 5930 Internet Protocols

tcp_push_pending_frame() Checking if we can send data tcp_snd_test() Sending data tcp_write_xmit() Checking sending conditions (slow-start, congestion windows etc) Fragment data if necessary Sending data (tcp_transmit_skb()) Fall 2004 FSU CIS 5930 Internet Protocols