CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 8 Introduction to Networks and the Internet.

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.
CSCI 4550/8556 Computer Networks
Transmission Control Protocol (TCP)
Intermediate TCP/IP TCP Operation.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
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.
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.
CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 7 Introduction to Networks and the Internet.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 9 Introduction to Networks and the Internet.
Winter CMPE 155 Week 3. Winter Project 3: Basic Servers Telnet Rlogin FTP Web In this context, let’s look at the underlying protocols…
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Winter 2004 Lecture 21 Introduction to Networks and the Internet.
CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Winter 2004 Lecture 19 Introduction to Networks and the Internet.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
Computer Networks Transport Layer. Topics F Introduction  F Connection Issues F TCP.
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.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
Gursharan Singh Tatla Transport Layer 16-May
What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.
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.
1 Chapter Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
1 Transport Layer Computer Networks. 2 Where are we?
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 All.
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.
University of the Western Cape Chapter 12: The Transport Layer.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
ECE453 – Introduction to Computer Networks Lecture 14 – Transport Layer (I)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
CSE679: Computer Network Review r Review of the uncounted quiz r Computer network review.
Chapter 24 Transport Control Protocol (TCP) Layer 4 protocol Responsible for reliable end-to-end transmission Provides illusion of reliable network to.
1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)
4343 X2 – The Transport Layer Tanenbaum Ch.6.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
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 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
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
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 Networks
Process-to-Process Delivery, TCP and UDP protocols
TCP.
TCP - Part I Karim El Defrawy
Transport Layer Unit 5.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Process-to-Process Delivery:
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
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:

CMPE 80N - Introduction to Networks and the Internet 1 CMPE 80N Spring 2003 Week 8 Introduction to Networks and the Internet

CMPE 80N - Introduction to Networks and the Internet 2 Announcements Library presentation on Internet History video.

CMPE 80N - Introduction to Networks and the Internet 3 Today Transport Layer

CMPE 80N - Introduction to Networks and the Internet 4 The Transport Layer

CMPE 80N - Introduction to Networks and the Internet 5 The Transport Layer End-to-end. –Communication from source to destination host. –Only hosts run transport-level protocols. –Under user’s control as opposed to network layer which is controlled/owned by network provider.

CMPE 80N - Introduction to Networks and the Internet 6 The Transport Layer Transport Entity Application Layer Network Layer Transport/ network interface Application/ transport interface Transport Entity Application Layer Network Layer TPDU Source host Destination host

CMPE 80N - Introduction to Networks and the Internet 7 Types of Transport Services Provided to the application layer. Connection-less versus connection-oriented. Connection-less service: no logical connections, no flow, congestion, or error control. Connection-oriented: –Based on logical connections: connection setup, data transfer, connection teardown. –Flow and error control. –Reliability and in-order delivery.

CMPE 80N - Introduction to Networks and the Internet 8 TPDU Transport protocol data unit. Messages sent between transport entities. TPDUs contained in network-layer packets, which in turn are contained in DLL frames. Frame header Packet header TPDU header TPDU payload

CMPE 80N - Introduction to Networks and the Internet 9 Transport Protocol Addressing Address of the transport-level entity. Several transport-level entities may be running on single machine. Source-destination address pair not enough to uniquely identify transport entity. Port number: uniquely identifies transport entity. “Well-known” port numbers.

CMPE 80N - Introduction to Networks and the Internet 10 The Internet Transport Protocols: TCP and UDP UDP: user datagram protocol (RFC 768). –Connection-less protocol. TCP: transmission control protocol (RFCs 793, 1122, 1323). –Connection-oriented protocol.

CMPE 80N - Introduction to Networks and the Internet 11 TCP Reliable end-to-end communication. TCP transport entity: –Interfaces to the IP layer. – Manages TCP streams. Accepts user data, breaks it down and sends it as separate IP datagrams. At receiver, reconstructs original byte stream from IP datagrams.

CMPE 80N - Introduction to Networks and the Internet 12 Features of TCP Connection oriented: An application requests a “connection” to destination and uses connection to transfer data. –IP does not uses “connections” - each datagram is sent independently! Point-to-point: A TCP connection has two endpoints (no broadcast/multicast). Reliability: TCP guarantees that data will be delivered without loss, duplication or transmission errors.

CMPE 80N - Introduction to Networks and the Internet 13 Features of TCP (cont’d) Full duplex: Endpoints can exchange data in both directions simultaneously. Connection setup: TCP guarantees reliable, synchronized startup between endpoints (using “three-way handshake”) Graceful connection tear-down: TCP guarantees delivery of all data after endpoint shutdown.

CMPE 80N - Introduction to Networks and the Internet 14 TCP segments travel in IP datagrams. Internet routers only look at IP header to forward datagrams. Delivering TCP Segments TCP segment IP headerPayload

CMPE 80N - Introduction to Networks and the Internet 15 Delivering TCP TCP at destination interprets TCP messages

CMPE 80N - Introduction to Networks and the Internet 16 TCP Connection Setup 3-way handshake. Host 1 Host 2 SYN (SEQ=x) SYN(SEQ=y,ACK=x+1) (SEQ=x+1, ACK=y+1)

CMPE 80N - Introduction to Networks and the Internet 17 TCP Connection Release Graceful release: –Each side of the connection released independently. Either side send TCP segment with FIN=1. When FIN acknowledged, that direction is shut down for data. Connection released when both sides shut down. –4 segments: 1 FIN and 1 ACK for each direction; 1st. ACK+2nd. FIN combined.

CMPE 80N - Introduction to Networks and the Internet 18 TCP Reliability Reliable delivery. – Acknowledgements.. – Timeouts and retransmissions. Ordered delivery. –Sequence numbers.

CMPE 80N - Introduction to Networks and the Internet 19 Lost Packets Recipient sends acknowledgment control message (ACK) to sender to verify successful receipt of data –ACKs usually are carried onboard other TCP packets. –However, even if an application has nothing to transmit, it must transmit acknowledgment packets for each packet it receives. Thus, for each packet sent, a host expects to receive an acknowledgment, which ensures that the packet did not get lost. –What if the packet or the acknowledgment get lost?

CMPE 80N - Introduction to Networks and the Internet 20 Lost Packets (cont’d) Retransmission timer –When a data segment is sent, a timer is started –If the segment is acknowledged before the timer expires, the timer is stopped and reset –Otherwise, the segment is retransmitted (and the timer is reset and started again) The choice of the timeout is critical! –If timeout is too long: overall throughput may be reduced (always waiting for acknowledgments) –If timeout is too short: too many packets get retransmitted (may increase network congestion)

CMPE 80N - Introduction to Networks and the Internet 21 Lost Packets (cont’d) IMPORTANT: packet retransmission (especially if it has to be carried out on an end-to-end basis) significantly increases latency (delay) For real-time video or audio transmission, delay is a more important performance issue than error rate Thus, in many cases it is preferable to forget the error and simply work with the received data stream

CMPE 80N - Introduction to Networks and the Internet 22 Lost Packets - Example

CMPE 80N - Introduction to Networks and the Internet 23 TCP Transmission Sender process initiates connection. Once connection established, TCP can start sending data. Sender writes bytes to TCP stream. TCP sender breaks byte stream into segments. – Each byte assigned sequence number. – Segment sent and timer started.

CMPE 80N - Introduction to Networks and the Internet 24 TCP Transmission (cont’d) If timer expires, retransmit segment. –After retransmitting segment for maximum number of times, assumes connection is dead and closes it. Receiving TCP decides when to pass received data to upper layer.

CMPE 80N - Introduction to Networks and the Internet 25 Flow Control Flow control is necessary so that source doesn’t transmit too fast for given receiver. –E.g., a fast server trying to send 1Gb/s data to a small PC. –Without some form of control, some data will get lost.

CMPE 80N - Introduction to Networks and the Internet 26 TCP Flow Control Sliding window. –Receiver’s advertised window. Size of advertised window related to receiver’s buffer space. Sender can send data up to receiver’s advertised window.

CMPE 80N - Introduction to Networks and the Internet 27 TCP Sliding Window

CMPE 80N - Introduction to Networks and the Internet 28 TCP Flow Control: Example 2K;SEQ=0 ACK=2048; WIN=2048 2K; SEQ=2048 ACK=4096; WIN=0 ACK=4096; WIN=2048 1K; SEQ=4096 App. writes 2K of data 4K 2K 0 App. reads 2K of data 2K 1K App. does 3K write Sender blocked Sender may send up to 2K

CMPE 80N - Introduction to Networks and the Internet 29 Congestion Network with 1 Mb/s lines and 1000 computers, half of which are trying to transfer files at 100 Kb/s to the other half. –The total offered traffic exceeds what the network can handle (congestion). Congestion collapse: –When congestion occurs, packets get dropped. –Due to packet loss, packets get retransmitted. –Congestions gets worse and worse!

CMPE 80N - Introduction to Networks and the Internet 30 Congestion Control Why do it at the transport layer? –Real fix to congestion is to slow down sender. Use law of “conservation of packets”. –Keep number of packets in the network constant. –Don’t inject new packet until old one leaves. Congestion indicator: packet loss.

CMPE 80N - Introduction to Networks and the Internet 31 TCP and Congestion Control Interprets packet loss as an indicator of congestion –When it senses packet loss, it slows down the rate of packet transmission –When packets are received correctly, sends packets faster Still within the limits of the sliding window

CMPE 80N - Introduction to Networks and the Internet 32 TCP Congestion Control Like, flow control, also window based. –Sender keeps congestion window (cwin). –Each sender keeps 2 windows: receiver’s advertised window and congestion window. –Number of bytes that may be sent is min(advertised window, cwin).

CMPE 80N - Introduction to Networks and the Internet 33 TCP Congestion Control (cont’d) Slow start [Jacobson 1988]: –Connection’s congestion window starts at 1 segment. –If segment ACKed before time out, cwin=cwin+1. –As ACKs come in, current cwin is increased by 1. –Exponential increase.

CMPE 80N - Introduction to Networks and the Internet 34 TCP Congestion Control (cont’d) Congestion Avoidance: – Third parameter: threshold. – Initially set to 64KB. – If timeout, threshold=cwin/2 and cwin=1. – Re-enters slow-start until cwin=threshold. – Then, cwin grows linearly until it reaches receiver’s advertised window.

CMPE 80N - Introduction to Networks and the Internet 35 TCP Retransmission Timer When segment sent, retransmission timer starts. –If segment ACKed, timer stops. –If time out, segment retransmitted and timer starts again.

CMPE 80N - Introduction to Networks and the Internet 36 How to set timer? Based on round-trip time: time between a segment is sent and ACK comes back. If timer is too short, unnecessary retransmissions. If timer is too long, long retransmission delay.

CMPE 80N - Introduction to Networks and the Internet 37 TCP Segment Header Source port Destination port Sequence number Acknowledgment number Header length UA PRSF Window size ChecksumUrgent pointer Options (0 or more 32-bit words) Data

CMPE 80N - Introduction to Networks and the Internet 38 TCP Header Fields Source and destination ports identify connection end points. Sequence number. Acknowledgment number specifies next byte expected. TCP header length: how many 32-bit words are contained in header. 6-bit unused field.

CMPE 80N - Introduction to Networks and the Internet 39 TCP Header Fields (cont’d) 6 1-bit flags: – URG: indicate urgent data present; urgent pointer gives byte offset from current sequence number where urgent data is. – ACK: indicates whether segment contains acknowledgment; if 0, acknowledgement number field ignored. – PUSH: indicates PUSHed data so receiver delivers it to application immediately.

CMPE 80N - Introduction to Networks and the Internet 40 TCP Header Fields (cont’d) Flags (cont’d): – RST: used to reset connection, reject invalid segment, or refuse to open connection. – SYN: used to establish connection; connection request, SYN=1, ACK=0. – FIN: used to release connection. Window size: how many bytes can be sent starting at acknowledgment number.

CMPE 80N - Introduction to Networks and the Internet 41 TCP Header Fields (cont’d) Checksum: checksums the header+data+pseudo-header. Options: provide way to add extra information. – Examples: Maximum payload host is willing to accept; can be advertised during connection setup. Window scale factor that allows sender and receiver to negotiate larger window sizes.

CMPE 80N - Introduction to Networks and the Internet 42 UDP Provides connection-less, unreliable service. – No delivery guarantees. – No ordering guarantees. – No duplicate detection. Low overhead. – No connection establishment/teardown. Suitable for short-lived connections. –Example: client-server applications.

CMPE 80N - Introduction to Networks and the Internet 43 UDP Segment Format Source port Destination port Length Checksum Data Source and destination ports: identify the end points. Length: 8-byte header+ data. Checksum: optional; if not used, set to zero.

CMPE 80N - Introduction to Networks and the Internet 44 TCP and UDP TCP provides end-to-end communication. It takes care of reliable, error-free transfer of data, and in- sequence delivery UDP has less overhead compared to TCP, but does not guarantee transfers –TCP is preferred to transfer files –UDP is preferred to transfer audio/video streams In real-time streaming, we cannot afford the delay consequent to packet retransmission Both protocols support multiplexing, i.e. they allow several distinct streams of data between two hosts