TCP and UDP Transport Layer

Similar documents
Transport Layer Protocols

Computer Networks. Chapter 5 Transport Protocols

Ethernet. Ethernet. Network Devices

Transport Layer. Chapter 3.4. Think about

Chapter 5. Transport layer protocols

ICOM : Computer Networks Chapter 6: The Transport Layer. By Dr Yi Qian Department of Electronic and Computer Engineering Fall 2006 UPRM

Computer Networks UDP and TCP

[Prof. Rupesh G Vaishnav] Page 1

Network Security TCP/IP Refresher

q Connection establishment (if connection-oriented) q Data transfer q Connection release (if conn-oriented) q Addressing the transport user

Objectives of Lecture. Network Architecture. Protocols. Contents

Networking Test 4 Study Guide

IP Network Layer. Datagram ID FLAG Fragment Offset. IP Datagrams. IP Addresses. IP Addresses. CSCE 515: Computer Network Programming TCP/IP

Chapter 11. User Datagram Protocol (UDP)

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

PART OF THE PICTURE: The TCP/IP Communications Architecture

TCP/IP and the Internet

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

Algorithms and Techniques Used for Auto-discovery of Network Topology, Assets and Services

B-2 Analyzing TCP/IP Networks with Wireshark. Ray Tompkins Founder of Gearbit

TCP/IP Fundamentals. OSI Seven Layer Model & Seminar Outline

Protocols and Architecture. Protocol Architecture.

Introduction to TCP/IP

Indian Institute of Technology Kharagpur. TCP/IP Part I. Prof Indranil Sengupta Computer Science and Engineering Indian Institute of Technology

DO NOT REPLICATE. Analyze IP. Given a Windows Server 2003 computer, you will use Network Monitor to view and analyze all the fields of IP.

Access Control: Firewalls (1)

Overview of TCP/IP. TCP/IP and Internet

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

RARP: Reverse Address Resolution Protocol

IP address format: Dotted decimal notation:

Network Programming TDC 561

EITF25 Internet Techniques and Applications L5: Wide Area Networks (WAN) Stefan Höst

Basic Networking Concepts. 1. Introduction 2. Protocols 3. Protocol Layers 4. Network Interconnection/Internet

Module 7 Internet And Internet Protocol Suite

2.1 Introduction. 2.2 Voice over IP (VoIP)

The OSI Model and the TCP/IP Protocol Suite

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

How do I get to

Internet Protocols. Background CHAPTER

We will give some overview of firewalls. Figure 1 explains the position of a firewall. Figure 1: A Firewall

Chapter 9. IP Secure

Session Hijacking Exploiting TCP, UDP and HTTP Sessions

Title: DEVELOPING TCP/IP AND UDP TRAFFIC MONITORING TOOL. RAFIQ BIN CHE MAT ( )

Kap. 2. Transport - Schicht

524 Computer Networks

IP - The Internet Protocol

Understanding Layer 2, 3, and 4 Protocols

1 An application in BPC: a Web-Server

Architecture and Performance of the Internet

EE984 Laboratory Experiment 2: Protocol Analysis

8.2 The Internet Protocol

What is a DoS attack?

Internet Architecture and Philosophy

Lecture 28: Internet Protocols

Address Resolution Protocol (ARP), Reverse ARP, Internet Protocol (IP)

Data Link Layer Overview

Networks: IP and TCP. Internet Protocol

Gary Hecht Computer Networking (IP Addressing, Subnet Masks, and Packets)

COMP 3331/9331: Computer Networks and Applications. Lab Exercise 3: TCP and UDP (Solutions)

CS155 - Firewalls. Simon Cooper <sc@sgi.com> CS155 Firewalls 22 May 2003

CPS221 Lecture: Layered Network Architecture

The present and the future of TCP/IP

Internet Control Protocols Reading: Chapter 3

This sequence diagram was generated with EventStudio System Designer (

NETWORK LAYER/INTERNET PROTOCOLS

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT COMPUTER NETWORKS

User Datagram Protocol - Wikipedia, the free encyclopedia

The OSI and TCP/IP Models. Lesson 2

OSI Model. Application Presentation Session Transport Network Data Link Physical. EE156 Computer Network Architecture

(Refer Slide Time: 02:17)

Mobile IP Network Layer Lesson 02 TCP/IP Suite and IP Protocol

Improved Digital Media Delivery with Telestream HyperLaunch

Written examination in Computer Networks

Understanding TCP/IP. Introduction. What is an Architectural Model? APPENDIX

Midterm Exam CMPSCI 453: Computer Networks Fall 2011 Prof. Jim Kurose

Chapter 1: Introduction

Voice over IP. Demonstration 1: VoIP Protocols. Network Environment

Network Layer: Network Layer and IP Protocol

Internet Concepts. What is a Network?

Per-Flow Queuing Allot's Approach to Bandwidth Management

La couche transport dans l'internet (la suite TCP/IP)

Internet Protocols. Addressing & Services. Updated:

How To Design A Layered Network In A Computer Network

Final for ECE374 05/06/13 Solution!!

Answer FIVE Questions only. Each carries 20 marks.

Unix System Administration

Computer Networks/DV2 Lab

An Introduction to VoIP Protocols

The internetworking solution of the Internet. Single networks. The Internet approach to internetworking. Protocol stacks in the Internet

Internetworking. Agenda Internetworking & universal services Protocols for Internetworking ISO 7-Layer Reference Model TCP/IP Layering Model

Effect of Packet-Size over Network Performance

Computer Networks. Voice over IP (VoIP) Professor Richard Harris School of Engineering and Advanced Technology (SEAT)

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Interconnection of Heterogeneous Networks. Internetworking. Service model. Addressing Address mapping Automatic host configuration

Based on Computer Networking, 4 th Edition by Kurose and Ross

A PPENDIX L TCP/IP and OSI

Transcription:

TCP and UDP Transport Layer Professor Richard Harris School of Engineering and Advanced Technology (SEAT)

Objectives You will be able to identify the fields for the UDP header and how they are obtained. You will be able to identify the fields for the TCP header and show how they are obtained. Computer Networks - 1/2

References Computer Networks by Andrew S. Tanenbaum Chapter 6 of 4 th Edition Data Communications and Networking by Behrouz A. Forouzan Chapter 23 of 4 th Edition Data and Computer Communications by William Stallings, Prentice Hall, 6 th Edition Telecommunications Protocols Travis Russell McGraw Hill Slides and slide extracts from Forouzan s book Computer Networks - 1/3

Presentation Outline Overview of UDP Overview of TCP Computer Networks - 1/4

The Internet Transport Protocols: UDP What is UDP? The UDP Header format Applications of UDP

What is UDP? User datagram protocol or (UDP) is the internetworking protocol that is part of the TCP/IP suite. It resides within Layer 4 (Transport Layer) of the Open Systems Interconnection (OSI) model. UDP is defined in RFC 768. It provides a connectionless service for application-level procedures. Since it is connectionless, UDP is basically an unreliable service, and hence delivery and duplicate protection are not guaranteed. However, this does reduce the overhead of the protocol and adequate in many cases. Computer Networks - 1/6

UDP Listed below are examples when the use of a connectionless service is justified. Inward data collection: involves the periodic active or passive sampling of data sources, such as sensors, and automatic selftest reports from security equipment or network devices. In a real-time monitoring situation, the loss of an occasional data unit would not cause distress, because the next report should arrive shortly. Outward data dissemination: includes broadcast messages to network users, the announcement of a new node or the change of address of a service, and the distribution of real-time clock values. Computer Networks - 1/7

UDP Request-response: applications in which a transaction service is provided by a common server to a number of distributed TS users, and for which a single request-response sequence is typical. Use of the service is regulated at the application level, and lower-level connections are often unnecessary and cumbersome. Real-time applications: such as voice and telemetry, involving a degree of redundancy and/or real-time transmission requirement. These must not have connection-oriented functions such as retransmission. Computer Networks - 1/8

The UDP Header Format Source port: UDP port of sending host. The sending port value is optional. If not used, it is set to zero. Destination port: UDP port of destination host. This provides an endpoint for communications. Length: the size of the UDP message. The minimum UDP packet contains only the header information (8 bytes). Checksum: verifies that the header is not corrupted. The checksum value is optional. If not used, it is set to zero. It is the same algorithm used for TCP and IP. If an error is detected, the entire UDP segment is discarded and no further action is taken. Computer Networks - 1/9

The UDP Header Format Because it is connectionless, the role of UDP is to essentially add a port addressing capability to IP. Computer Networks - 1/10 10

UDP (User Datagram Protocol) Connectionless service for application level procedures Unreliable Delivery and duplication control not guaranteed Reduced overhead e.g. network management and real time communication Computer Networks - 1/11 11

Applications of UDP Client-server situation The client sends a short request to the server and expects a short reply back. If either the request or reply is lost, the client can just time out and try again DNS (Domain Name System). A program that needs to look up the IP address of some host name, for example, www.massey.ac.nz, can send a UDP packet containing the host name to a DNS server. The server replies with a UDP packet containing the host s IP address. No setup is needed in advance and no release is needed afterward. Just two messages go over the network Real time transmission Computer Networks - 1/12 12

Well-known Ports used with UDP Computer Networks - 1/13 13

Pseudo-header for Checksum Computer Networks - 1/14 14

Checksum Calculation The above figure shows the checksum calculation for a very small user datagram with only 7 bytes of data. Since the number of bytes of data is odd, padding is added for checksum calculation. The pseudo-header as well as the padding will be dropped when the user datagram is delivered to IP. Computer Networks - 1/15 15

Queues in UDP Computer Networks - 1/16 16

Some Tutorial Questions Consider the following Hex dump of the UDP header: 06 32 00 0D 00 1C E2 17 Determine 1. Source port number 2. Destination port number 3. Total length of UDP header 4. Is the packet directed from client to server or vice versa? 5. What is the client process? What is the largest possible UDP datagram? What is the smallest possible UDP datagram? Computer Networks - 1/17 17

The Internet Transport Protocols: TCP The TCP Service Model The TCP Segment Header TCP Connection Establishment TCP Connection Release TCP Connection Management Modeling TCP Transmission Policy TCP Congestion Control TCP Timer Management

What is TCP? - 1 TCP is the internetworking protocol that is part of the TCP/IP suite. It resides within Layer 4 (Transport Layer) of the Open Systems Interconnection (OSI) model. TCP is defined in RFC 793. It provides an end-to-end transport of data units using connectionoriented services across multiple packet switching networks. Because it is connection-oriented, TCP provides reliable data transfer through the use of credit-based flow and error control techniques. This technique is somewhat different from the slidingwindow flow control found in X.25 and HDLC. Computer Networks - 1/19 19

What is TCP? - 2 In essence, TCP separates acknowledgments from the management of the size of the sliding window. Although this credit-based mechanism is used for endto-end flow control, it is also used to assist in internetwork congestion control. This is accomplished by reducing the data flow of data onto the Internet until congestion eases. Computer Networks - 1/20

TCP Components Like any protocol standard, TCP is specified in two parts: TCP services The protocol format and mechanisms Computer Networks - 1/21

TCP Services TCP provides two facilities for labelling data: push and urgent. Data stream push: Normally, TCP decides when sufficient data have accumulated to form a segment for transmission. However, the TCP user can require that TCP transmits all outstanding data up to and including that labelled with a push flag. On the receiving end, TCP will deliver this data to the user in the same manner. Urgent data signalling: This provides a means of informing the destination TCP user that significant or urgent data is in the upcoming data stream. However, it is up to the receiving end to determine appropriate action. Computer Networks - 1/22

The TCP Service Model Computer Networks - 1/23

The TCP Service Model Connection oriented Reliable connection startup, duplicate packets used in previous connections will not appear to be valid responses or otherwise interfere with the new connection Graceful connection shutdown, TCP guarantees to deliver all the data reliably before closing connection Point-to-point communication, each TCP connection has exactly two endpoints and the TCP service is obtained through a socket, each socket has a socket number consisting of the IP address and a 16-bit number local to the host known as port With complete reliability, TCP guarantees that the data sent across a connection will be delivered exactly as sent. Full duplex communication, allows data to flow in either direction at any time. Computer Networks - 1/24

TCP Service Primitives and Parameters Similar to IP, TCP services are expressed in terms of: Primitives: the function that is to be performed Parameters: used to pass data and control information The TCP primitives and parameters are more complex because of the richer set of services provided by TCP. TCP provides two primitives at the interface: TCP service request primitive: issued by a TCP user to TCP TCP service response primitive: issued by TCP to a local TCP user Computer Networks - 1/25

TCP Service Request Primitives TCP Service Request { Unspecified Passive Open Fully Specified Passive Open Active Open Active Open with Data Send Allocate Close Abort Status } Computer Networks - 1/26

TCP Service Request Primitives Unspecified Passive Open: listen for connection attempt at specified security and precedence from any remote destination. Fully Specified Passive Open: listen for connection attempt at specified security and precedence from specified destination. Active Open: request connection at a particular security and precedence to a specified destination. Active Open with Data: request connection at a particular security and precedence to a specified destination and transmit data with the request. Computer Networks - 1/27

TCP Service Request Primitives Send: transfer data across named connection. Allocate: issue incremental allocation for receive data to TCP. Close: Close connection gracefully. Abort: Close connection abruptly. Status: Query connection status. Computer Networks - 1/28

TCP Service Response Primitives TCP Service Response { Open ID Open Failure Open Success Deliver Closing Terminate Status Response Error } Computer Networks - 1/29

TCP Service Response Primitives Open ID: informs TCP user of connection name assigned to pending connection requested in an Open primitive. Open Failure: reports failure of an Active Open request. Open Success: reports completion of pending Open request. Deliver: reports arrival of data. Closing: reports that remote TCP user has issued a Close and that all data sent by remote user have been delivered. Computer Networks - 1/30

TCP Service Response Primitives Terminate: reports that the connection has been terminated; a description of the reason for termination is provided. Status Response: reports current status of connection. Error: reports service-request or internal error. Computer Networks - 1/31

The TCP Header Format Computer Networks - 1/32

The TCP Header Format - 1 Source port (16 bits): source TCP user. Destination port (16 bits): destination TCP user. Sequence number (32 bits): sequence number of the first data octet in this segment except when the SYN flag is set. If SYN is set, it is the initial sequence number (ISN) and the first data octet is ISN + 1. Acknowledgement number (32 bits): a piggybacked acknowledgment. Contains sequence number of the next data octet that the TCP entity expects to receive. Data offset (4 bits): number of 32-bit words in the header. Computer Networks - 1/33

The TCP Header Format - 2 Reserved (6 bits): reserved for future use. Flags (6 bits): URG: urgent pointer field significant. ACK: acknowledgment field significant. PSH: push function. RST: reset the connection. SYN: synchronize the sequence numbers. FIN: no more data from sender. Window (16 bits): flow control credit allocation, in octets. Contains the number of data octets beginning with the one indicated in the acknowledgment field that the sender is willing to accept. Computer Networks - 1/34

The TCP Header Format - 3 Checksum (16 bits): the ones complement of the sum modulo 2 16 1 of all the 16-bit words in the segment plus a pseudo-header. Urgent Pointer (16 bits): points to the last octet in a sequence of urgent data. This allows the receiver to know how much urgent data are coming. Options (Variable): encodes the options requested by the sending user. An example is the option that specifies the maximum segment size that will be accepted. Computer Networks - 1/35

TCP Mechanisms TCP mechanisms are grouped into these three categories: Connection Establishment Data Transfer Connection Termination Computer Networks - 1/36

TCP Mechanisms Connection establishment in a TCP session is initialised through a three-way handshake. The following lists the steps for a three-way handshake: The initiating host requests a session by sending out a segment with the synchronization (SYN) flag set to ON SN = X, where X is the initial sequence number (SN). The receiving host acknowledges the request by sending back a segment with both the SYN and acknowledgment (ACK) flags set to ON SN = Y AN = X+1, where AN is the acknowledgment number (AN) Computer Networks - 1/37

TCP Mechanisms Note: The acknowledgment indicates that the receiving host is now expecting to receive a segment from the initiating host beginning with data octet X+1, acknowledging the SYN, which occupied SN = X. Finally, the initiating host responds with a segment with both the SYN and ACK flags set to ON SN = X+1 AN = Y+1 Data transfer is viewed logically as a stream of octets, and normally TCP decides when sufficient data have accumulated to form a segment for transmission. However, the data labels PUSH and URGENT can alter this behaviour. Computer Networks - 1/38

TCP Connection Establishment TCP connection establishment in the normal case Three way handshake Between pairs of ports One port can connect to multiple destinations 1 2 3 Computer Networks - 1/39

TCP Mechanisms A graceful close is expected when terminating a connection. This is accomplished by sending a CLOSE primitive. The transport entity then sets the FIN bit on the last segment it sends out, which also contains the last of the data to be sent on this connection. Computer Networks - 1/40

Some Common Port Numbers Computer Networks - 1/41