Lecture 21 and 22 5/29/2019.

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

CCNA – Network Fundamentals
© 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)
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
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.
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.
UNIT 07 Process – to – Process Delivery: UDP,TCP and SCTP
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
Chapter 14 User Datagram Program (UDP)
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
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.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
Transport Layer: UDP, TCP
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
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).
Chapter 14 User Datagram Protocol (UDP) Introduction  Responsibilities of Transport Layer to create a process-to-process communication l using.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Chapter 9: Transport Layer
(Kapitel 23: Congestion control and QoS översiktligt.)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Introduction to Networks
Transport Control Protocol
5. End-to-end protocols (part 1)
Transport Layer.
Process-to-Process Delivery, TCP and UDP protocols
Process-to-Process Delivery
Chapter 5: Transport Protocols
TCP.
Chapter 14 User Datagram Program (UDP)
PART 5 Transport Layer Computer Networks.
TCP Transport layer Er. Vikram Dhiman LPU.
User Datagram Protocol (UDP)
TCP - Part I Karim El Defrawy
Transport Layer Our goals:
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Chapter 14 User Datagram Protocol (UDP)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Process-to-Process Delivery:
Transport Layer Our goals:
Transport Control Protocol
Transport Protocols An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Chapter 5 Transport Layer Introduction
PART V Transport Layer.
Chapter 14 User Datagram Program (UDP)
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
Transport Protocols: TCP Segments, Flow control and Connection Setup
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Layer 9/22/2019.
Presentation transcript:

Lecture 21 and 22 5/29/2019

Overview TCP = Transmission Control Protocol Connection-oriented protocol Provides a reliable unicast end-to-end byte stream over an unreliable internetwork. 5/29/2019

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 5/29/2019

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 byte that is transmitted has a sequence number 5/29/2019

TCP header fields Port Number: A port number identifies the endpoint of a connection. A pair <IP address, port number> identifies one endpoint of a connection. Two pairs <client IP address, server port number> and <server IP address, server port number> identify a TCP connection. 5/29/2019

TCP overview TCP is the most widely used Internet protocol Web, Peer-to-peer, FTP, telnet, … A two way, reliable, byte stream oriented end-to-end protocol Includes flow and congestion control Closely tied to the Internet Protocol (IP) A focus of intense study for many years. 5/29/2019

TCP Features Connection-oriented Byte-stream Reliable data transfer app writes bytes TCP sends segments app reads bytes Reliable data transfer Full duplex Flow control: keep sender from overrunning receiver Congestion control: keep sender from overrunning network Application process W rite bytes TCP Send buffer Segment T ransmit segments Read Receive buffer … 5/29/2019

TCP Format TCP segments have a 20 byte header with >= 0 bytes of data. 5/29/2019

Segment Format 5/29/2019

Segment Format Each connection identified with 4-tuple: (SrcPort, SrcIPAddr, DsrPort, DstIPAddr) 5/29/2019

TCP header fields Sequence Number (SeqNo): Sequence number is 32 bits long. So the range of SeqNo is 0 <= SeqNo <= 232 -1  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 5/29/2019

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 0-1500 is AckNo=1501 5/29/2019

TCP header fields Acknowledge Number (cont’d) Example: TCP uses the sliding window flow protocol (see CS 457) 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 “1..1500” and “1501..3000”, but receiver only gets the second segment. In this case, the receiver cannot acknowledge the second packet. It can only send AckNo=1 5/29/2019

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

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 5/29/2019

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 5/29/2019

TCP header fields Window Size: TCP Checksum: Urgent Pointer: 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 216-1= 65535 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 5/29/2019

TCP Connection-oriented Sets up the connection prior to data transmission SYN and 3-way handshake Guarantees delivery of data Sender holds a copy of the data for retransmission if necessary Receiver ACKS specific byte positions in the stream so sender can resend from any byte position 5/29/2019

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 initial sequence number (ISN) of client (2) PASSIVE OPEN: Server responds with a segment with initial sequence number of server ACK for ISN of client (3) Client acknowledges by sending a segment with: ACK ISN of server (* counts as one byte) 5/29/2019

Connection Establishment Active participant Passive participant (client) (server) SYN, SequenceNum = x y , + 1 SYN + ACK, SequenceNum = x Acknowledgment = ACK, Acknowledgment = y + 1 5/29/2019

Connection Termination Active participant Passive participant (server) (client) FIN, SequenceNum = x + 1 x Acknowledgment = y FIN, SequenceNum= Acknowledgment = y + 1 5/29/2019

UDP 5/29/2019

User datagram format 5/29/2019

Example 14.1 The following is a dump of a UDP header in hexadecimal format. a. What is the source port number? b. What is the destination port number? c. What is the total length of the user datagram? d. What is the length of the data? e. Is the packet directed from a client to a server or vice versa? f. What is the client process? 5/29/2019

Example 14.1 Continued Solution a. The source port number is the first four hexadecimal digits (CB84)16 or 52100. b. The destination port number is the second four hexadecimal digits (000D)16 or 13. c. The third four hexadecimal digits (001C)16 define the length of the whole UDP packet as 28 bytes. d. The length of the data is the length of the whole packet minus the length of the header, or 28 – 8 = 20 bytes. e. Since the destination port number is 13 (well-known port), the packet is from the client to the server. f. The client process is the Daytime (see Table 14.1). 5/29/2019

5/29/2019

Figure 14.5 Encapsulation and decapsulation 5/29/2019

Figure 14.7 Multiplexing and demultiplexing 5/29/2019

UDP APPLICATION A client-server application such as DNS uses the services of UDP because a client needs to send a short request to a server and to receive a quick response from it. The request and response can each fit in one user datagram. Since only one message is exchanged in each direction, the connectionless feature is not an issue; the client or server does not worry that messages are delivered out of order. 5/29/2019

Example A client-server application such as SMTP, which is used in electronic mail, cannot use the services of UDP because a user can send a long e-mail message, which may include multimedia (images, audio, or video). If the application uses UDP and the message does not fit in one single user datagram, the message must be split by the application into different user datagrams. Here the connectionless service may create problems. The user datagrams may arrive and be delivered to the receiver application out of order. The receiver application may not be able to reorder the pieces. This means the connectionless service has a disadvantage for an application program that sends long messages. 5/29/2019

Example Assume we are downloading a very large text file from the Internet. We definitely need to use a transport layer that provides reliable service. We don’t want part of the file to be missing or corrupted when we open the file. The delay created between the delivery of the parts are not an overriding concern for us; we wait until the whole file is composed before looking at it. In this case, UDP is not a suitable transport layer. 5/29/2019

Example Assume we are watching a real-time stream video on our computer. Such a program is considered a long file; it is divided into many small parts and broadcast in real time. The parts of the message are sent one after another. If the transport layer is supposed to resend a corrupted or lost frame, the synchronizing of the whole transmission may be lost. The viewer suddenly sees a blank screen and needs to wait until the second transmission arrives. This is not tolerable. However, if each small part of the screen is sent using one single user datagram, the receiving UDP can easily ignore the corrupted or lost packet and deliver the rest to the application program. That part of the screen is blank for a very short period of the time, which most viewers do not even notice. However, video cannot be viewed out of order, so streaming audio, video, and voice applications that run over UDP must reorder or drop frames that are out of sequence. 5/29/2019