TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.

Slides:



Advertisements
Similar presentations
CISCO NETWORKING ACADEMY Chabot College ELEC Transport Layer (4)
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.
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.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
TCP & UDP - Protocol Details Yen-Cheng Chen
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.
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.
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.
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:
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.
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.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
Gursharan Singh Tatla Transport Layer 16-May
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 12 Transmission Control Protocol (TCP) Basics.
Process-to-Process Delivery:
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.
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 Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
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.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
1 UDP : User Datagram Protocol Computer Network System Sirak Kaewjamnong.
Networking Basics CCNA 1 Chapter 11.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
Transport Protocols.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
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
The Transport Layer Implementation Services Functions Protocols
09-Transport Layer: TCP Transport Layer.
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.
Introduction to TCP/IP networking
Introduction to Networks
5. End-to-end protocols (part 1)
Process-to-Process Delivery
TCP.
TCP.
Magda El Zarki Professor, ICS UC, Irvine
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.
Process-to-Process Delivery:
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.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Introduction to Computer Networks
Lecture 21 and 22 5/29/2019.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Transport Layer 9/22/2019.
Presentation transcript:

TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong

2 Agenda Service provide by TCP TCP format How TCP reliable TCP connection TCP state

3 TCP Encapsulation With Ethernet frame Ethernet headerIP headerTCP headerdata Segment

4 TCP and UDP Services TCP : Transmission Control Protocol RFC 793 connection-oriented service full duplex reliable service by adding more overhead to manage acknowledgement, flow control and timer

5 TCP TCP performs typical transport layer function passed data to relevant application- level services error recovery flow control data stream (avoid buffer overflow)

6 TCP Properties Byte stream with full duplex transferring adaptive to LAN/WAN congestion avoidance and control

7 TCP Data Stream TCP provides a full duplex that simultaneous manages two streams of data Stream of octets passed between sender and receiver Application Send Receive Application Receive Send

8 Ports Port : A 16 bits address allocated for the most common application level service UDP and TCP use port addressing to deliver information to applications Service are known by port number –FTP 20, TELNET 23, SMTP 25, HTTP 80

9 Ports Port numbers are generally allocated by 0 not used Reserves port to well known service Other reserve port user defined server ports UNIX store general used ports in /etc/service

10 Transmission Control Protocol TCP passed block of data to IP, consisting of the TCP header and application layer data, called SEGMENT Adding reliability in TCP achieved by Error detection and correction (due to segment corrupted) Flow control (prevent a transmitter overrunning a receiver owing a resource limitations) Resequencing (IP and deliver datagrams in any order) Removing duplicate segments (due to error recovery mechanism used by TCP)

11 How TCP handles Reliability Using sequence number to identify data positive acknowledgments of data received in the correct sequence retransmission of segments which have not been acknowledgment within a variable time limit Let ’ s see these mechanisms in TCP header

12 TCP Header Source Port : 16Destination Port : 16 Acknowledgment Number : 32 Window Size : 16 Urgent Pointer : 16Checksum : 16 Option and Padding Sequence Number : 32 Data offs :4Resv:6Flag:6

13 TCP Header Details (I) Source, destination port: 16, 16 - identify application at ends of the connection sequence : 32 - indicates 1st data octet in this segment acknowledgment : 32 - next expected sequence number, valid only when the ACK bit (reside in flag) is set data offset : bit words offset tells the receiver where user data begins

14 TCP Header Details (II) Reserve : 6 - not used Flag : 6 URG : validity of urgent pointer field ACK : validity of acknowledgment field PSH : push request (pass segment to application layer immediately) RST : reset the connection SYN : initial synchronization FIN : send at end of byte stream

15 TCP Header Details (III) Window: 16 - advertise amount of buffer space this node has allocated checksum : bits one ’ s complement of pseudo header, TCP header and data urgent pointer : 16 - byte position of data that should be processed first options : - variable length option e.g. max segment size tells destination node

16 TCP in Action Before data could be transferred, a connection must be opened Server do passive open (listen) Client do active open (connect) When it finished, the connection is closed TCP has general 3 phases Connection setup phase Data phase Connection close phase

17 TCP Connection Establishment TCP uses 3-ways handshake to establish a connection Exchange the sequence number Ensures that both ends are ready and sync sequence number Host A Host B 1. send SYN (seq = x) 2. Send SYN (seq = y, ack = x+1) 3. send ACK (ack = y+1) Connection is setup

18 TCP State Diagram : Open

19 TCP Transfer Phase Simple example with terminal connection such as telnet. Host echoes back each received character Host A Host B 1. SEQ = 92, ACK =109 Data = “ W ” 2. SEQ = 109, ACK = 93, Data = “ W ” 3. SEQ = 93, ACK =110 Data = “ A ” Host echoes back “ W ”

20 TCP Connection Close Use FIN flag to close connection Host A Host B 1. FIN_WAIT_1 Seq = x, 2. CLOASE_WAIT, Ack = x +1 3.FIN_WAIT_2 4. LAST_ACK, Seq = y 5.TIME_WAIT Ack = y+1 Connection is close

21 TCP State Diagram : Close

22 Open/Close Mechanisms Haft open: one end has closed, aborted without the knowledge of the other end Host may be crashed, power off No detection if no data transfer Reset segment (RST bit)is sent when detected Half close: one end of connection terminated its output, but still receiving data from the other end Simultaneous open: both end perform an active open to each other Simultaneous close: both end perform an active close to each other

23 Sliding Window Principle Send and wait for acknowledgment no ACK within a certain time, retransmit the packet use for flow control: prevent sender from overloading receiver with data, e.g. fast server to slow PC congestion inside network, e.g. router performance, slow link speed How to provide flow control set the appropriate size of sliding window size

24 Sliding Window Flow Control Receiver advertises it ’ s window size in acknowledgments Sender will adjusts its allowed to send pointer as receiver ’ s advertisement

25 Sliding Window : Small Window Size 1 byte window size utilizes efficiency of channel in haft (haft-duplex transmission) Why not send many packets and get back cumulative ACK? SenderReceiver Window size = 1 Send 1 Send 2 Receive 1 Ack 2 Receive 2 Ack 3

26 Sliding Window : Larger Window Size A larger window size allows more data to be transmitted pending acknowledgment Window size specifies how many bytes the receiver is willing to accept Window size = 3 Sender Receiver Send 1 Send 2 Send 3 Receive ACK 4 Send 4 Send 5 Send 6 Receive 1 Receive 2 Receive 3 Send ACK 4 Receive 4 Receive 5 Receive 6

27 Sliding Window Buffer Sender groups its packet to be transmitted with window indication … … … 1199 Sent and ACK Sent and not ACK Can Send ASAP Can ’ t Send now SndWnd Offer window SndUnaSndNxtSndUna + SndWnd

28 TCP in Action Movement of the right and left edges of the window … … … 1199 … … … 1199 … … … 1199 … … … 1199 Initial Send 100 bytes More 100 bytes ACK 100 bytes SndUna,SndNxtSndUna + SndWnd SndNxt, SndUna + SndWnd SndUnaSndNxt SndUna SndNxtSndUna + SndWnd

29 Error Recovery (I) Receiver had to send ACK with sequence number Sender reset timer when receives ACK Host A Host B Segment #i, Start timer ACK i+1 Reset timer

30 Error Recovery (II) On time out, sender will retransmit the segment This mechanism is used for error recovery Host A Host B Segment #i, Start timer ACK i+ 1 Reset timer Timer expires, resend #i