CS4470 Computer Networking Protocols

Slides:



Advertisements
Similar presentations
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Advertisements

Transmission Control Protocol (TCP)
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.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
TCP/IP Protocol Suite 1 Chapter 13 Upon completion you will be able to: Stream Control Transmission Protocol Be able to name and understand the services.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
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 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Ch 23 Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
Chapter 16 Stream Control Transmission Protocol (SCTP)
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
26-TCP Dr. John P. Abraham Professor UTPA. TCP  Transmission control protocol, another transport layer protocol.  Reliable delivery  Tcp must compensate.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 12 Transmission Control Protocol (TCP)
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Transmission Control Protocol (TCP)
MODULE I NETWORKING CONCEPTS.
Networking Basics CCNA 1 Chapter 11.
Connection Establishment and Termination. Tcpdump tcpdump is a common packet analyzer that runs under the command line. It allows the user to intercept.
Stream Control Transmission Protocol
Computer Network Architecture Lecture 6: OSI Model Layers Examples 1 20/12/2012.
Telnet  TErminaL NETwork  TELNET is a general-purpose client-server application program  TELNET enables the establishment of a connection to a remote.
1 Kyung Hee University PART 5 Transport Layer. 2 Kyung Hee University Role of position of Transport Layer  Overseeing the delivery of data from a process,
4343 X2 – The Transport Layer Tanenbaum Ch.6.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 16 Stream Control Transmission.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
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).
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Ch23 Ameera Almasoud 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007.
Chapter 5 Network and Transport Layers
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.
COMP2322 Lab 6 TCP Steven Lee Mar 29, 2017.
Chapter 15 Transmission Control Protocol (TCP)
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
TCP.
PART 5 Transport Layer Computer Networks.
Net 221D : Computer Networks Fundamentals
TCP Transport layer Er. Vikram Dhiman LPU.
Process-to-Process Delivery:
TCP - Part I Karim El Defrawy
Process-to-Process Delivery:
Chapter 12 Transmission Control Protocol
Dr. John P. Abraham Professor UTPA
TRANSMISSION CONTROL PROTOCOL
Dr. John P. Abraham Professor UTPA
CPEG514 Advanced Computer Networkst
Chapter 15 Transmission Control Protocol (TCP)
PART V Transport Layer.
PART 5 Transport Layer.
CS4470 Computer Networking Protocols
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
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Data Link Control (DLC) Services
Computer Networks Protocols
Transport Layer 9/22/2019.
Presentation transcript:

CS4470 Computer Networking Protocols 11/30/2018 CS4470 Computer Networking Protocols 14. TCP Huiping Guo Department of Computer Science California State University, Los Angeles

Outline TCP services TCP segment format 11/30/2018 Outline TCP services TCP segment format TCP connection establishment and termination TCP state diagram 14. TCP CS4470

TCP services Process-to-Process communication 11/30/2018 TCP services Process-to-Process communication Using port number Full-duplex communication Data can flow in both directions at the same time Stream delivery service Connection-oriented service 14. TCP CS4470

Stream delivery service TCP is a stream oriented protocol It allows the sending process to deliver data as a stream of bytes and the receiving process to obtain data as stream of bytes The two processes seem to be connected by an imaginary tube that carries their data across the Internet Note: most of the following diagrams are from chap12 , “TCP/IP Protocol Suite, 3rded” 14. TCP CS4470

Stream delivery service Both the sender and the receiver keep two buffers: sending buffer and receiving buffer They may not write or read data at the same speed TCP need buffers for storage 14. TCP CS4470

Stream delivery service At the sending site The buffer has 3 types of chambers The white area empty chambers that can be filled by the sending process The blue area holds bytes that have been sent but not yet acknowledged. TCP keeps these bytes in the buffer until it receives an ACK After the bytes are acked, the chambers are recycled and available for use by the the sender The pink area contains bytes to be sent by the sending TCP At the receiver site The white area contains empty chambers to be filled by bytes received from the network The colored sections contain received bytes that can be read by the receiving process When a byte is read by the receiving process, the chamber is recycled and added to the pool of empty chambers 14. TCP CS4470

Stream delivery service The IP layter needs to send data in packets, not as a stream of bytes TCP groups a number of bytes together into a packet called a segment The segments are not necessarily the same size TCP adds a header to each segment and delivers the segment to the IP layer for transmission The segments are encapsulated in an IP datagram and transmitted The entire operation is transparent to the receiving process 14. TCP CS4470

TCP segment structure 14. TCP CS4470

Seq. Num. and Ack. Num. Byte number Sequence number TCP numbers all data bytes that that are transmitted in a connection Numbering is independent in each direction The numbering does not necessarily start from 0 TCP generates a random number for the first byte Sequence number After bytes are numbered, TCP assigns a sequence number to each segment that is being sent. The sequence number for each segment is the byte number of the first byte carried in that segment 14. TCP CS4470

Example Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10001. What are the sequence numbers for each segment if data is sent in five segments, each carrying 1000 bytes? Segment 1 ➡ Sequence Number: 10,001 (range: 10,001 to 11,000) Segment 2 ➡ Sequence Number: 11,001 (range: 11,001 to 12,000) Segment 3 ➡ Sequence Number: 12,001 (range: 12,001 to 13,000) Segment 4 ➡ Sequence Number: 13,001 (range: 13,001 to 14,000) Segment 5 ➡ Sequence Number: 14,001 (range: 14,001 to 15,000) 14. TCP CS4470

Seq. Num. and Ack. Num. Acknowledge number for a segment The sequence number of the next byte the receiver is expecting from the other party Ex. A receives a segment (byes 0 - 535) from B A puts 536 in the ack. Num. field of the segment it sends to B TCP provides cumulative acknowledgments Ex. A receives a segment(0-535) and another segment (900-1,000) from B A’s next segment to B will contain 536 in the ack. Num. field 14. TCP CS4470

Example: Telnet A popular application-layer protocol used for remote login It runs over TCP It’s an interactive application The user at the client side typed a character The character is sent to the server The server sends the same character back to the client The “echo back” ensures that the characters seen by the telnet user have already been received and processed at the remote site Each character traverses the network twice 14. TCP CS4470

simple telnet scenario Seq. Num. and Ack. Num. Host A Host B User types ‘C’ Seq=42, ACK=79, data = ‘C’ host ACKs receipt of ‘C’, echoes back ‘C’ Seq=79, ACK=43, data = ‘C’ host ACKs receipt of echoed ‘C’ Seq=43, ACK=80 time simple telnet scenario 14. TCP CS4470

Exercise Host A Host B Seq=42, ACK=79 100 bytes 14. TCP CS4470

TCP segment structure 14. TCP CS4470

Control field The field defines 6 different control bits These bits enable flow control, connection establishment and termination, connection abortion, and the mode of data transfer 14. TCP CS4470

TCP is connected-oriented When a process A at site A wants to send and receive data from another process at B The two TCP establish a connection between them Data are exchanged in both direction The connection is terminated The connection is a virtual connection Both parties keep buffers and some state information (variables) The connection information is invisible to the intermediate routers 14. TCP CS4470

Connection establishment TCP transmits data in full-duplex mode Each party must initialize communication and get approval from the other party before any data is transferred Server and client The connection establishment is TCP is called three-way handshaking Server request for a passive open The server tells its TCP that it’s ready to accept a connection Client issues a request for an active open TCP can now starts a three-way handshake process 14. TCP CS4470

Three-way handshake 1. The client sends the first segment, a SYN segment SYN is set to 1 specifies initial seq. number: client_isn (8000) no data 2. Server receives SYN server allocates buffers and variables replies with SYNACK segment Both ACK and SYN are set to 1 specifies server initial seq. number: server_isn (15000) ack = client_isn+1 No data 14. TCP CS4470

Three-way handshake 3. client receives SYNACK allocate buffers and variables replies with ACK segment ACK is set to 1 SYN is set to 0 ack =server_isn+1 The segment may contain data 14. TCP CS4470

Three-way handshake 14. TCP CS4470

Connection terminate Any of the two parties can close the connection Two options for connection termination Three-way handshake Normal situation Four-way handshake with a half-close option One end can stop sending data while still receiving data Either the server or the client can issue a half-close requestion. 14. TCP CS4470

Connection termination using three-way handshake 14. TCP CS4470

Connection termination using four-way handshake (half close) Seg: y-1 The 2nd seg consumes no sequence number Though the client has received sequence number y-1 and is expecting y, the server sequence number is still y-1 Then the connection finally closes, the sequence number of the last ACK is still x, because no sequence number are consumed during data transfer in that direction 14. TCP CS4470

TCP State diagram To keep track of all the different events happening during connection establishment, connection termination, and data transfer, the TCP software is implemented as a finite state machine A finite state machine is a machine that goes through a limited number of states At any moment, the machine is in one of the states It remains in that state until an event happens The event can take the machine to a new state and can also make the machine perform some actions 14. TCP CS4470

TCP State diagram 14. TCP CS4470

TCP state transition diagram 14. TCP CS4470

TCP state transition diagram The ovals represent the states The directed lines represent the transition from one state to another Each line has two strings separated by a slash The first string is the input, what TCP receives The second string is the output, what TCP sends The diagram is for both client and server The dotted black lines represent the transition that a server normally goes through The solid black lines shows the transitions that a client normally goes through In some situations, a server transitions through a solid line or a client transitions through a dotted line The colored lines show special situations 14. TCP CS4470

Common scenario 1 Connection termination using 4-way handshake The common value for MSL is between 30 seconds and 1 minute 14. TCP CS4470

Common scenario 2 Connection termination using 3-way handshake 14. TCP CS4470

Common scenario 3:Simultaneous close 14. TCP CS4470

Common scenario 4: Denying a connection 14. TCP CS4470