© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.

Slides:



Advertisements
Similar presentations
Flow control Connection management TCP, UDP
Advertisements

Transportation Layer (2). TCP full duplex data: – bi-directional data flow in same connection – MSS: maximum segment size connection-oriented: – handshaking.
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.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
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
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
CS 471/571 Transport Layer 5 Slides from Kurose and Ross.
Configuring a Router with RIP Basic Configuration and Show Commands.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
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.
Transmission Control Protocol (TCP) Basics
1 Transport Protocols Relates to Lab 5. UDP and TCP.
5/6/2015© 2010 Raymond P. Jefferis IIILect Transport Layer.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.
1 Week 10 Transport Protocols, UDP, TCP. 2 Orientation r We move one layer up and look at the transport layer across the Internet.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
TCP segment structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement number rcvr window size ptr.
TCP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
Lecture 23: Network Primer 7/15/2003 CSCE 590 Summer 2003.
CSCE 515: Computer Network Programming TCP Details Wenyuan Xu Department of Computer Science and Engineering.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
1 ELEN 602 Lecture 15 More on IP TCP. 2 byte stream Send buffer segments Receive buffer byte stream Application ACKs Transmitter Receiver TCP Streams.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
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.
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.
Transport Layer: UDP, TCP
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transmission Control Protocol
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Connection Establishment and Termination. Tcpdump tcpdump is a common packet analyzer that runs under the command line. It allows the user to intercept.
Slide #1 CIT 380: Securing Computer Systems TCP/IP.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
1 Transmission Control Protocol (TCP) RFC: Introduction The TCP is intended to provide a reliable process-to-process communication service in a.
Two Transport Protocols Available Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Provides unreliable transfer Requires minimal – Overhead.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
09-Transport Layer: TCP Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
5. End-to-end protocols (part 1)
Chapter 17 and 18: TCP is connection oriented
Transport Layer.
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
Chapter 5: Transport Protocols
TCP.
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.
PART V Transport Layer.
PART 5 Transport Layer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Introduction to Computer Networks
Lecture 21 and 22 5/29/2019.
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Presentation transcript:

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 2 Overview TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 3 Connection-Oriented Before any data transfer, TCP establishes a connection: One TCP entity is waiting for a connection (“server”) The other TCP entity (“client”) contacts the server The actual procedure for setting up connections is more complex. Each connection is full duplex

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 4 Reliable Byte stream is broken up into chunks which are called seg- ments Receiver sends acknowledgements (ACKs) for segments TCP maintains a timer. If an ACK is not received in time, the segment is retransmitted Detecting errors: TCP has checksums for header and data. Segments with invalid checksums are discarded Each segment that is transmitted has a sequence number

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 5 Byte Stream Service To the lower layers, TCP handles data in blocks, the segments. To the higher layers TCP handles data as a sequence of bytes and does not identify boundaries between bytes So: Higher layers do not know about the beginning and end of segments !

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 6 TCP Format TCP segments have a 20 byte header with >= 0 bytes of data. reserved

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 7 TCP header fields - Port Numbers 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.

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 8 TCP header fields - Sequence Number Sequence Number (SeqNo): –Sequence number is 32 bits long. –So the range of SeqNo is 0 <= SeqNo <=  4.3 Gbyte –Each sequence number identifies the byte in the stream of data from the sending TCP to the receiving TCP that the first byte of data in this segment represents. –Initial Sequence Number (ISN) of a connection is set during connection establishment

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 9 TCP header fields - Ack. No. 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 Q: Why is piggybacking good ? –The AckNo contains the next SeqNo that a host wants to receive Example: The acknowledgement for a 1500-byte segment with the sequence number 0 is AckNo=1500 –A host uses the AckNo field to send acknowledgements. (If a host sends an AckNo in a segment it sets the “ACK flag”)

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 10 TCP header fields - Ack. No. Contd. Acknowledge Number (cont’d) –TCP uses the sliding window flow protocol (see EL536) to regulate the flow of traffic from sender to receiver –TCP uses the following variation of sliding window: –no NACKs (Negative ACKnowledgement) –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

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 11 TCP header fields - Header Length Header Length ( 4bits): –Length of header in 32-bit words –Note that TCP header has variable length (with minimum 20 bytes)

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 12 TCP header fields - Flags 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 as soon as possible. –Normally set by sender when the sender’s buffer is empty (so TCP does not wait expecting more data)

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 13 TCP header fields - Flags Contd. 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

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 14 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 both TCP header and TCP data Urgent Pointer: –Only valid if URG flag is set

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 15 TCP header fields - Options Options:

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 16 TCP header fields Options: –NOP is used to pad TCP header to multiples of 4 bytes –Maximum Segment Size –Window Scale Options »Increases the TCP window size »1-byte shift count (R) is between 0 and 14 »The 16-bit advertised window is left-shifted R bits »Maximum window size = 65535×2 14 bytes »This option can only be used in the SYN segment (first segment) during connection establishment time –Timestamp Option »Can be used for roundtrip measurements

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 17 Connection Management in TCP Opening a TCP Connection Closing a TCP Connection Special Scenarios State Diagram

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 18 TCP Connection Establishment TCP uses a three-way handshake to open a connection: (1) ACTIVE OPEN: Client sends a segment with –SYN bit set –port number of client, port number of server –initial sequence number (ISN) of client (2) PASSIVE OPEN: Server responds with a segment with –SYN bit set –initial sequence number of server –ACK for ISN of client (3) Client acknowledges by sending a segment with: – ACK ISN of server

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 19 Three-Way Handshake

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 20 A Closer Look with tcpdump 1 aida.poly.edu.1121 > mng.poly.edu.telnet: S : (0) win mng.poly.edu.telnet > aida.poly.edu.1121: S : (0) ack win aida.poly.edu.1121 > mng.poly.edu.telnet:. ack win aida.poly.edu.1121 > mng.poly.edu.telnet: P : (24) ack win mng.poly.edu.telnet > aida.poly.edu.1121: P : (3) ack win aida.poly.edu.1121 > mng.poly.edu.telnet: P : (3) ack win 17520

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 21 Three-Way Handshake

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 22 SYN sequence number Note that the data segment following the three-way handshake will start with the sequence number following that of the SYN segment

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 23 TCP Connection Termination Each end of the data flow must be shut down independently (“half-close”) If one end is done it sends a FIN segment. This means that no more data will be sent Four steps involved: (1) X sends a FIN to Y (active close) (2) Y ACKs the FIN, (at this time: Y can still send data to X) (3) and Y sends a FIN to X (passive close) (4) X ACKs the FIN.

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 24 Connection termination with tcpdump 1 mng.poly.edu.telnet > aida.poly.edu.1121: F : (0) ack win aida.poly.edu.1121 > mng.poly.edu.telnet:. ack win aida.poly.edu.1121 > mng.poly.edu.telnet: F : (0) ack win mng.poly.edu.telnet > aida.poly.edu.1121:. ack win 8733

© Jörg Liebeherr (modified by Malathi Veeraraghavan) 25 TCP Connection Termination