Spring 2006 CPE 0907532: Transport Layer Overview2-1 Special Topics in Computer Engineering The Transport Layer in the Internet: Overview Some of these.

Slides:



Advertisements
Similar presentations
Transport Layer3-1 Transport Overview and UDP. Transport Layer3-2 Goals r Understand transport services m Multiplexing and Demultiplexing m Reliable data.
Advertisements

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 A.
CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT Class Location:
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Computer Communication Digital Communication in the Modern World Transport Layer Multiplexing, UDP
Chapter 3: Transport Layer
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Lecture 8 Chapter 3 Transport Layer
CPSC 441: Intro, UDP1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes.
1 Internet transport-layer protocols r reliable, in-order delivery (TCP) m congestion control m flow control m connection setup r unreliable, unordered.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Electronic Mail: SMTP, POP3, IMAP DNS Socket programming with TCP.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
8-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer m flow.
Transport Layer Transport Layer. Transport Layer 3-2 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet,
Previous Lecture r P2P file sharing r Socket programming with TCP r Socket programming with UDP.
IP-UDP-RTP Computer Networking (In Chap 3, 4, 7) 건국대학교 인터넷미디어공학부 임 창 훈.
The Transport Layer: TCP and UDP
1 Chapter Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
1 Transport Layer Computer Networks. 2 Where are we?
Review: –What is AS? –What is the routing algorithm in BGP? –How does it work? –Where is “policy” reflected in BGP (policy based routing)? –Give examples.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 12 Omar Meqdadi Department of Computer Science and Software Engineering University.
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Network LayerII-1 RSC Part III: Transport Layer 1. Basic Concepts Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are,
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.
Transport Layer and UDP Tahir Azim Ref:
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 2.5 Internetworking Chapter 25 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
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 Part.
Chapter 3 Transport Layer
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
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 A.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Transport Layer1 Ram Dantu (compiled from various text books)
1 Transport Layer Lecture 7 Imran Ahmed University of Management & Technology.
Lecture91 Administrative Things r Return homework # 1 r Review some problems in homework # 1 r Questions about grading? Yona r WebCT for CSE245 is working!
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
CS 3830 Day 13 Introduction 1-1. Announcements r Quiz 3: Wednesday, Oct 10 r Prog3 due Wednesday, Oct 10 Transport Layer 3-2.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July A.
Transport Layer 3-1 Chapter 3 Outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP.
Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
Transport Layer 3-1 Internet Transport Layer Lecture 8 Dr. Najla Al-Nabhan.
Prof. Younghee Lee 1 1 Computer Networks u Lecture 5: Transport services and protocols Prof. Younghee Lee * Some part of this teaching materials are prepared.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
Application Layer 2-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Introduction 1-1 source application transport network link physical HtHt HnHn M segment HtHt datagram destination application transport network link physical.
2: Transport Layer 11 Transport Layer 1. 2: Transport Layer 12 Part 2: Transport Layer Chapter goals: r understand principles behind transport layer services:
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
CSEN 404 Transport Layer I Amr El Mougy Lamia Al Badrawy.
Transport Layer3-1 Transport Layer Never take life seriously. Nobody gets out alive anyway.
1 Chapter 24 Internetworking Part 4 (Transport Protocols, UDP and TCP, Protocol Port Numbers)
Chapter 3 Transport Layer
Introduction to Networks
Chapter 3 Transport Layer
Transport Layer Slides are originally from instructor: Carey Williamson at University of Calgary Very minor modification are made Notes derived from “Computer.
Chapter 3 outline 3.1 Transport-layer services
06- Transport Layer Transport Layer.
CS 1652 Jack Lange University of Pittsburgh
Introduction to Networks
Internet and Intranet Protocols and Applications
Transport Layer Our goals:
September 19th, 2013 CS1652 Jack Lange University of Pittsburgh
Transport Layer Our goals:
Chapter 3 Transport Layer
Transport Layer Our goals:
Presentation transcript:

Spring 2006 CPE : Transport Layer Overview2-1 Special Topics in Computer Engineering The Transport Layer in the Internet: Overview Some of these Slides are Based on Slides by Kurose and Ross Prepared for Sections 3.1, 3.2, 3.3.1, 3.4.1, 3.5.1, of the Book Computer Networking: A Top Down Approach Featuring the Internet

Spring 2006 CPE : Transport Layer Overview2-2 Transport services and protocols  provide logical communication between app processes running on different hosts  transport protocols run in end systems  send side: breaks app messages into segments, passes to network layer  rcv side: reassembles segments into messages, passes to app layer  more than one transport protocol available to apps  Internet: TCP and UDP application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport

Spring 2006 CPE : Transport Layer Overview2-3 Internet transport-layer protocols  reliable, in-order delivery (TCP)  congestion control  flow control  connection setup  unreliable, unordered delivery: UDP  no-frills extension of “best-effort” IP application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport

Spring 2006 CPE : Transport Layer Overview2-4 Transport layer addressing  Communications endpoint addressed by:  IP address (32 bit) in IP Header  Port number (16 bit) in TP Header 1  Transport protocol (TCP or UDP) in IP Header 1 TP => Transport Protocol (UDP or TCP)

Spring 2006 CPE : Transport Layer Overview2-5 Some standard services and port numbers PORT NUMBERS (last updated 24 February 2006)

Spring 2006 CPE : Transport Layer Overview2-6 Socket API (Application Programming Interface)  introduced in BSD4.1 UNIX, 1981BSD  explicitly created, used, released by apps  client/server paradigm  two types of transport service via socket API:  unreliable datagram  reliable, byte stream- oriented a host-local, application-created, OS-controlled interface (a “door”) into which application process can both send and receive messages to/from another application process socket

Spring 2006 CPE : Transport Layer Overview2-7 Example: Socket-programming using TCP Socket: a door between application process and end- end-transport protocol (UCP or TCP) TCP service: reliable transfer of bytes from one process to another process TCP with buffers, variables socket controlled by application developer controlled by operating system host or server process TCP with buffers, variables socket controlled by application developer controlled by operating system host or server internet

Spring 2006 CPE : Transport Layer Overview2-8 Socket programming with TCP Client must contact server  server process must first be running  server must have created socket (door) that welcomes client’s contact Client contacts server by:  creating client-local TCP socket  specifying IP address, port number of server process  When client creates socket: client TCP establishes connection to server TCP  When contacted by client, server TCP creates new socket for server process to communicate with client  allows server to talk with multiple clients  source port numbers used to distinguish clients TCP provides reliable, in-order transfer of bytes (“pipe”) between client and server application viewpoint

Spring 2006 CPE : Transport Layer Overview Multiplexing/demultiplexing application transport network link physical P1 application transport network link physical application transport network link physical P2 P3 P4 P1 host 1 host 2 host 3 = process= socket delivering received segments to correct socket Demultiplexing at rcv host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) Multiplexing at send host:

Spring 2006 CPE : Transport Layer Overview2-10 How demultiplexing works  host receives IP datagrams  each datagram has source IP address, destination IP address  each datagram carries 1 transport-layer segment  each segment has source, destination port number  host uses IP addresses & port numbers to direct segment to appropriate socket source port #dest port # 32 bits application data (message) other header fields TCP/UDP segment format

Spring 2006 CPE : Transport Layer Overview2-11 Connectionless demultiplexing  Create sockets with port numbers: DatagramSocket mySocket1 = new DatagramSocket(12534); DatagramSocket mySocket2 = new DatagramSocket(12535);  UDP socket identified by two-tuple: ( dest IP address, dest port number)  When host receives UDP segment:  checks destination port number in segment  directs UDP segment to socket with that port number  IP datagrams with different source IP addresses and/or source port numbers directed to same socket

Spring 2006 CPE : Transport Layer Overview2-12 Connectionless demux (cont) DatagramSocket serverSocket = new DatagramSocket(6428); Client IP:B P2 client IP: A P1 P3 server IP: C SP: 6428 DP: 9157 SP: 9157 DP: 6428 SP: 6428 DP: 5775 SP: 5775 DP: 6428 SP provides “return address”

Spring 2006 CPE : Transport Layer Overview2-13 Connection-oriented demux  TCP socket identified by 4-tuple:  source IP address  source port number  dest IP address  dest port number  recv host uses all four values to direct segment to appropriate socket  Server host may support many simultaneous TCP sockets:  each socket identified by its own 4-tuple  Web servers have different sockets for each connecting client  non-persistent HTTP will have different socket for each request

Spring 2006 CPE : Transport Layer Overview2-14 Connection-oriented demux (cont) Client IP:B P1 client IP: A P1P2P4 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P5P6P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B

Spring 2006 CPE : Transport Layer Overview2-15 Connection-oriented demux: Threaded Web Server Client IP:B P1 client IP: A P1P2 server IP: C SP: 9157 DP: 80 SP: 9157 DP: 80 P4 P3 D-IP:C S-IP: A D-IP:C S-IP: B SP: 5775 DP: 80 D-IP:C S-IP: B

Spring 2006 CPE : Transport Layer Overview2-16 UDP: User Datagram Protocol [RFC 768]  “no frills,” “bare bones” Internet transport protocol  “best effort” service, UDP segments may be:  lost  delivered out of order to the application  connectionless:  no handshaking between UDP sender, receiver  each UDP segment handled independently of others Why is there a UDP?  no connection establishment (which can add delay)  simple: no connection state at sender, receiver  small segment header  no congestion control: UDP can blast away as fast as desired

Spring 2006 CPE : Transport Layer Overview2-17 UDP Port Management  Source (client)  Obtains a free port number  Specifies “IP:port” of destination (server)  Destination  Receives datagram  Sends datagram to destination “IP:port”  Can send replies to source “IP:port”

Spring 2006 CPE : Transport Layer Overview2-18 UDP: more  often used for streaming multimedia apps  loss tolerant  rate sensitive  other UDP uses (why?):  DNS DNS  SNMP SNMP  reliable transfer over UDP: add reliability at application layer  application-specific error recover! source port #dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header

Spring 2006 CPE : Transport Layer Overview2-19 UDP checksum Sender:  treat segment contents as sequence of 16-bit integers  checksum: addition (1’s complement sum) of segment contents  sender puts checksum value into UDP checksum field Receiver:  compute checksum of received segment  check if computed checksum equals checksum field value:  NO - error detected  YES - no error detected. But may be errors nonetheless? More later Goal: detect “errors” (e.g., flipped bits) in transmitted segment

Spring 2006 CPE : Transport Layer Overview2-20 Transmission Control Protocol (TCP)  Connection-oriented service  Full-duplex communication  Stream interface (no message boundary !)  Stream divided into segments for transmission  Each segment encapsulated in IP datagram  Uses protocol ports to identify applications

Spring 2006 CPE : Transport Layer Overview2-21 TCP Port Management  When a connection is established  Source (client) Obtains a free port number Specifies IP:port of destination (server)  Destination Receives connection request Sends data to destination IP:port  The 4-tuple (source IP:port, destination IP:port) identifies where data goes (i.e. identifies the socket used by the application)

Spring 2006 CPE : Transport Layer Overview2-22 TCP Segment Sequence number specifies where in stream data belongs Few segments contain options

Spring 2006 CPE : Transport Layer Overview2-23 TCP Segment Format  Segment divided into two parts  Header  Payload area (zero or more bytes of data)  Header contains  Protocol port numbers to identify Sending application Receiving application  Bits to specify items such as SYN FIN ACK  Fields for window advertisement, acknowledgment, etc.

Spring 2006 CPE : Transport Layer Overview2-24 Reliability in an Unreliable World  IP offers best-effort (unreliable) delivery  TCP uses IP  TCP provides completely reliable transfer  How is this possible? How can TCP realize:  Reliable connection startup?  Reliable data transmission?  Graceful connection shutdown?

Spring 2006 CPE : Transport Layer Overview2-25 Reliable Data Transmission  Positive acknowledgment  Receiver returns short message when data arrives  Called acknowledgment  Retransmission  Sender starts timer whenever message is transmitted  If timer expires before acknowledgment arrives, sender retransmits message

Spring 2006 CPE : Transport Layer Overview2-26 TCP seq. #’s and ACKs Seq. #’s:  byte stream “number” of first byte in segment’s data ACKs:  seq # of next byte expected from other side  cumulative ACK Q: how receiver handles out-of-order segments  A: TCP spec doesn’t say, - up to implementer Host A Host B Seq=42, ACK=79, data = ‘C’ Seq=79, ACK=43, data = ‘C’ Seq=43, ACK=80 User types ‘C’ host ACKs receipt of echoed ‘C’ host ACKs receipt of ‘C’, echoes back ‘C’ time simple telnet scenariotelnet

Spring 2006 CPE : Transport Layer Overview2-27 Timing Problem! The delay required for data to reach a destination and an acknowledgment to return depends on traffic in the internet as well as the distance to the destination. Because it allows multiple application programs to communicate with multiple destinations concurrently, TCP must handle a variety of delays that can change rapidly. How does TCP handle this.....

Spring 2006 CPE : Transport Layer Overview2-28 Solving Timing Problem  Keep estimate of round trip time on each connection  Use current estimate to set retransmission timer  Known as adaptive retransmission  Key to TCP’s success

Spring 2006 CPE : Transport Layer Overview2-29 TCP Flow Control  Receiver  Advertises available buffer space  Called window  Sender  Can send up to entire window before ACK arrives  Each acknowledgment carries new window information  Called window advertisement  Can be zero (called closed window)  Interpretation: I have received up through X, and can take Y more octets

Spring 2006 CPE : Transport Layer Overview2-30 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of free buffer space  RcvWindow field in TCP segment sender: keeps the amount of transmitted, unACKed data less than most recently received RcvWindow sender won’t overrun receiver’s buffers by transmitting too much, too fast flow control receiver buffering RcvBuffer = size of TCP Receive Buffer RcvWindow = amount of spare room in Buffer

Spring 2006 CPE : Transport Layer Overview2-31 Why Startup/ Shutdown (of a TCP Connection) Difficult ?  Segments can be  Lost  Duplicated  Delayed  Delivered out of order  Either side can crash  Either side can reboot  Need to avoid duplicate ‘‘shutdown’’ message from affecting later connection

Spring 2006 CPE : Transport Layer Overview2-32 TCP’s Startup/ Shutdown Solution  Uses three-message exchange known as 3- way handshake  Necessary and sufficient for  Unambiguous, reliable startup  Unambiguous, graceful shutdown  SYN used for startup, FIN used for shutdown

Spring 2006 CPE : Transport Layer Overview2-33 TCP Connection Management (OPEN) client SYN server SYN / ACK ACK opening established

Spring 2006 CPE : Transport Layer Overview2-34 TCP Connection Management (CLOSE) client FIN server ACK FIN closing closed timed wait closed

Spring TCP Connection Management (cont) TCP client lifecycle TCP server lifecycle send / receive messages

Spring 2006 CPE : Transport Layer Overview2-36 Transport Protocol Summary  Transport protocols fit between applications and Internet Protocol  Two transport protocols in TCP/IP suite  User Datagram Protocol (UDP)  Transmission Control Protocol (TCP)  UDP  Unreliable  Message-oriented interface  TCP  Major transport protocol used in Internet  Complete reliability  Stream-oriented interface  Uses adaptive retransmission