© Janice Regan, CMPT 128, 2007-2012 CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.

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

Introduction 1-1 Chapter 3 Transport Layer Intro and Multiplexing Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
CCNA – Network Fundamentals
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Socket Programming 0.
Chapter 7 – Transport Layer Protocols
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
Chapter 3: Transport Layer
UDP - User Datagram Protocol UDP – User Datagram Protocol Author : Nir Shafrir Reference The TCP/IP Guide - ( Version Version.
Transport Layer3-1 Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable data transfer.
William Stallings Data and Computer Communications 7 th Edition (Selected slides used for lectures at Bina Nusantara University) Transport Layer.
TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
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.
Gursharan Singh Tatla Transport Layer 16-May
Process-to-Process Delivery:
University of Calgary – CPSC 441.  UDP stands for User Datagram Protocol.  A protocol for the Transport Layer in the protocol Stack.  Alternative to.
1 CMPT 471 Networking II Some important Internetworking concepts © Janice Regan, 2013.
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.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
ES Module 4 Transport Layer Protocols. Last Lecture(s) Routing and IP Addressing Domain Name System.
Jaringan Komputer Dasar OSI Transport Layer Aurelio Rahmadian.
Transport Layer Layer #4 (OSI-RM). Transport Layer Main function of OSI Transport layer: Accept data from the Application layer and prepare it for addressing.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
University of the Western Cape Chapter 12: The Transport Layer.
Routers and Routing Basics CCNA 2 Chapter 10.
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.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
User Datagram Protocol (UDP) Chapter 11. Know TCP/IP transfers datagrams around Forwarded based on destination’s IP address Forwarded based on destination’s.
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.
Networking Basics CCNA 1 Chapter 11.
Institute of Technology Sligo - Dept of Computing Chapter 12 The Transport Layer.
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,
Protocol Layering Chapter 11.
MULTIPLEXING/DEMULTIPLEXING, CONNECTIONLESS TRANSPORT.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
UDP: User Datagram Protocol Chapter 12. Introduction Multiple application programs can execute simultaneously on a given computer and can send and receive.
Transport Layer3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing/demultipl exing m reliable.
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).
Introduction 1-1 source application transport network link physical HtHt HnHn M segment HtHt datagram destination application transport network link physical.
Cisco I Introduction to Networks Semester 1 Chapter 7 JEOPADY.
Process-to-Process Delivery:
Ch 3. Transport Layer Myungchul Kim
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Chapter 11 User Datagram Protocol
The Transport Layer Implementation Services Functions Protocols
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
CMPT 371 Data Communications and Networking
06- Transport Layer Transport Layer.
CS 1652 Jack Lange University of Pittsburgh
Subject Name: Computer Communication Networks Subject Code: 10EC71
Transport Layer Our goals:
September 19th, 2013 CS1652 Jack Lange University of Pittsburgh
Process-to-Process Delivery:
TCP/IP Protocol Suite: Review
CPEG514 Advanced Computer Networkst
CSCD 330 Network Programming
Chapter 5 Transport Layer Introduction
Chapter 5 Transport Layer Introduction
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Chapter 3 Transport Layer
Transport Layer 9/22/2019.
Transport Layer Our goals:
Presentation transcript:

© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0

Transport Layer  Common protocols TCP and UDP  UDP is best effort, no reliable delivery  TCP insures reliable delivery  Remember the Transport layer is above a network layer that does provides an unreliable transmission channel (when IP is used)  TCP must compensate for the underlying unreliable channel to provide reliable transmission. This makes TCP much more complicated Janice Regan © Sept

Delivery  No flow control (UDP, best effort transmission):  Send data and hope receiver can process fast enough or buffer (with no overruns) Packets are lost when queues/buffers overrun.  Slowing send speed enough to ensure reception will reduce utilization (efficiency) of the link  Flow control (TCP, reliable delivery)  TCP manages how fast packets are sent so that packet do not Arrive faster than they can be processed Overrun buffers / overwrite data Janice Regan © Sept

3 The transport layer  Processes use a transport protocol to communicate end to end. (reliably using TCP or best effort using UDP)  Data-link and network layer protocols communicate hop by hop, forming a communications channel for the transport layer  The transport layer shields the application processes from the details of the underlying communications channel  The transport layer specifies a particular application process as the source or destination. Lower layers specify at most the protocol in the next layer up Janice Regan © Sept

4 Transport layer protocols  Provide a logical (conceptual) link directly from the source to the receiver.  Applications using the transport layer interface see transport layer services that appear to connect them directly with applications on the destination host  The transport layer uses an interface to the network layer to initiate the physical transfer from host to host through the network to the destination. The details of these host to host transfers are not part of the transport layer.  The transport layer segments pass through multiple hosts on the way to the destination but the transport layer itself need not be directly aware of this since it is handled by lower layers in the protocol stack. Janice Regan © Sept

Using a relay (router) Janice Regan © Sept Physical Data link network transport application Network Data link Physical Data link network transport application

6 Relay through intermediate hosts  As the packet travels from the source to the destination it will be processed by intermediate hosts.  Intermediate hosts may be other systems (computers) that use a full protocol stack Only some layers in the stack will be used to relay the packet to its next destination along its path to the destination The transport and application layers will be used only for packets who originate or are destined for the host Janice Regan © Sept

Using a relay (switch) Janice Regan © Sept Physical Data link network transport application Data link Physical Data link network transport application

8 Relay through intermediate hosts  As the packet travels from the source to the destination it will be processed by intermediate hosts.  Intermediate hosts may be routers, switches, or hubs Such devices will have only a partial protocol stack (only the layers needed to relay the packet) Routers and network level switches will include the network layer and all layers below it. Link layer switches and hubs will include only the link and physical layers Janice Regan © Sept

9 Transport layer protocols  May provide best effort delivery of packets (UDP)  Application accepts responsibility for reliability, connectionless  May provide a connection oriented reliable communication channel (TCP) either  On top of a best effort packet switched network (IP with unacknowledged connectionless link layer)  On top of a reliable network service (IP with acknowledged connectionless services in link layer) Janice Regan © Sept

10 Transport layer protocols  Support multiplexing  Combine multiple low rate flows through 1 port  Spread high rate flow between multiple ports Janice Regan © Sept

11 Responsibilities: transport level protocols  Addressing  Multiplexing  Flow control  Logical connection establishment  Logical connection maintenance  Logical connection termination  error control  ordered delivery to the application Connection oriented only Connection oriented and connectionless Janice Regan © Sept

12 Addressing  User specified by:  User identification Specify Host and Port (socket or communication endpoint in TCP or UDP) Port represents particular process or protocol, or a particular connection inside a process with more than one connection Host is specified by an IP address Several processes on a given machine may be multiplexed together and use a single protocol port Janice Regan © Sept

13 Addressing  Each port is identified by an integer usually one port for of each protocol type (HTTP, FTP …). Note that many of these ports will use TCP or UDP since many of the messages from application level protocols are transported using TCP or UDP Janice Regan © Sept

14 Responsibilities: transport layer protocols  Addressing  Multiplexing  Flow control (for TCP only, none for UDP)  Logical connection management (TCP only)  Error control If underlying network is best effort  Assure ordered delivery to the application if the underlying network is packet oriented Janice Regan © Sept

15 Multiplexing: application layer  Each connection is made between two sockets (communications endpoints) that each consist of a port:IP address pair. To describe the connection we need two port:IP address pairs.  Usually one port is used for of each application level protocol type on each host. So all segments for the particular application level protocol will pass through the same port (even if they are destined for different processes).  Determining which process (and connection within process) is done by the server for that process in the application layer of the host Janice Regan © Sept

16 Multiplexing: transport layer to application layer  Within the transport layer the UDP (or TCP) segments all arrive at the protocol process that processes UDP (or TCP) segments.  This process (part of the protocol stack) will demultiplex (separate) the TCP segments or UDP packets by port (protocol)  The segments or packets can then be sent to the correct server for the particular application level protocol. (sent through the correct port to the application layer) Janice Regan © Sept

17 Multiplexing: Janice Regan © Sept Transport layer Application layer Network layer UDP process in protocol stack Protocol 3 Port C Application X Port B Protocol 1 Port A Arriving UDP packets are sent to the correct application or protocol implementation based on port #

18 Multiplexing: transport layer to application layer  Many application level protocols are transported using UDP (or TCP). When segments arrive in the transport layer by UDP (or TCP) the port number may indicate that contents of the segment are destined for a particular application protocol.  Usually one port is used for of each application level protocol type on each host. So all segments for the particular application level protocol will leave the transport layer through the same port Janice Regan © Sept

19 Finding Port Addresses: 1  Static configuration:  Know address ahead of time  Universal assignment:  Central authority (IANA) assigns port numbers to common protocols. The list is published  All software should use this list of protocols/ports  Any host receiving a particular application layer protocol will have a server process for that protocol running in its application layer. This server can be accessed through the assigned protocol port number  Ports are reserved for this IANA list  Ports are registered (use list exists) not reserved Janice Regan © Sept

20 Finding Port Addresses: 2  Name server: Server on a well known port can be queried to determine the port for the particular application. Name servers are generally used for providing different kinds of directory service Janice Regan © Sept

21 Well Know port numbers Janice Regan © Sept

TCP server (Python) for socket import * serverPort = 1200 serverSocket = socket.socket(AF_INET, SOCK_STREAM) serverSocket.bind((‘ ‘,serverPort)) serverSocket.listen(1) print ‘The server is ready to receive’ while 1; connectionSocket.addr = serverSocket.accept() sentence = connetionSocket.recv(1024) capitalizedSentence = sentence.upper() connectionSocket.send(capitalizedSentence) connection Socket.close() : Janice Regan ©

TCP client (Python) from socket import * serverName = ‘servername’ serverPort = 1200 clientSocket = socket.socket( AF_INET, SOCK_STREAM ) clientSocket.connect (serverName,serverPort) clientSocket.send (sentence) modifiedSentence = clientSocket.recv(1024) clientSocket.close; Janice Regan ©

24 Sequential server:  Server on a well know port that will process one request at a time. Requests will be queued as they arrive at the server. Useful for applications with low CPU needs or infrequent usage  timeserver, just returns the present time, low cpu usage Janice Regan © Sept

25 Instance or threaded server  Connect to Server through a well know port  Server creates an instance of itself to service the request  Server returns the appropriate port for the client to attach to that instance.  Many instances created by the instance server may run simultaneously.  Useful for heavily used applications and applications with significant processing needs  One example: FTP server, each instance may run for a significant length of time if it transfers a large file Janice Regan © Sept

26 client1 Child server server Child server *:21 *:* : : : : 1501 client : : : :21 Ephemeral port 1500, or 1501 is assigned by the protocol’s software Janice Regan © Sept

27 Responsibilities: transport layer protocols  Addressing  Multiplexing  Flow control (for TCP only, none for UDP)  Logical connection management (TCP only)  Error control If underlying network is best effort  Assure ordered delivery to the application if the underlying network is packet oriented Janice Regan © Sept

28 Error control  Error control includes the list of rules that tell us what to do if a packet contains an error.  Can we correct the error If so correct the error and continue, otherwise  If the packet contains an error it should not be forwarded The error may be in the address, it may get to the wrong destination Janice Regan © Sept

29 Error control  Error control includes the list of rules that tell us what to do if a packet contains an error.  Should we request that the source host retransmit the packet so we can obtain a correct copy of the packet A good approach for reliable transport but not necessary for best effort transport may be more complicated than it first appears  Should we just drop the packet OK for best effort transport Janice Regan © Sept

30 Error detection  Before we can approach error control we need to know how to determine if there has been an error introduced into our packet during transmission  In the transport layer we use a checksum to determine if out packet contains errors.  The checksum is calculated at the source, and placed in the header of the packet  The packet is transmitted  The checksum is recalculated and compared with the checksum from inside the packet. If they match our packet usually does not contain errors. Janice Regan © Sept

31 Error detection  The mathematical theory behind the checksum allows us to assume that if the checksum is unchanged at the destination then the packet does not contain errors  a good assumption but in rare cases it can be false Janice Regan © Sept

Why Checksum in Transport layer  Error detection is used by Ethernet, in the data link layer, to check that packets are not corrupted as they travel between hosts  Other protocols in the data link layer may or may not use error detection  Therefore it is possible that some links are not error checked.  Also errors can occur after reception as when the packet is stored in the routers memory Janice Regan © Sept

33 Structure of a TCP packet Comer 2000: fig 13.7 SOURCE PORT DESTINATION PORT CHECKSUM Janice Regan © Sept

34 Structure of a UDP Packet Janice Regan © Sept

35 The pseudo header: UDP, TCP  The constructed pseudo header is prepended to the TCP segment or UDP datagram before the checksum is calculated  The pseudo header is used to check that the segment has arrived at the correct address on the correct connection  Protocol can be TCP (6) or UDP (17)  Length is the length of the TCP segment including the TCP header or the UDP packet including header Janice Regan © Sept

36 Header + Pseudoheader  The TCP or UDP Header is transmitted with the datagram. The Pseudo header is not transmitted.  The checksum is the ones complement sum of all the 16 bit words in the datagram (data header and pseudo header)  Information in the pseudo header is calculated from information in the header, and from the IP address of the source and receiver from the IP layer (encapsulation?) Janice Regan © Sept

37 CheckSum  The checksum for a TCP segment is calculated in the same manner as the checksum for a UDP packet  The fields in the TCP or UDP header and pseudo header are divided into 16 bit words. These 16 bit words start on all 16 bit boundaries in the pseudo header the header and the data  A ones complement sum of all the 16 bit words in the packet header, the data, and the packet pseudo header is calculated  While this sum is being calculated the contents of the checksum field in the TCP header is set to 0  The ones complement of the ones complement sum is inserted into the checksum field Janice Regan © Sept

38 the ones complement sum (1)  To find the ones complement sum of a series of binary numbers  Do a binary addition  Shift the sum 16 places to the right (gives 1 for this example) Janice Regan © Sept

39 the ones complement sum (2)  Add the shifted value (1 in this case) to the binary sum  =  Take the least significant 16 digits to give the ones complement sum  The ones complement of this ones complement sum is the checksum Janice Regan © Sept