Top Banner
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331
32

TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Dec 25, 2015

Download

Documents

Maryann Walton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

TRANSPORT LAYER

T.Najah Al-Subaie

Kingdom of Saudi Arabia

Prince Norah bint Abdul Rahman University

College of Computer Since and Information System

NET331

Page 2: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Introduction

The Internet model has three protocols at the transport layer: UDP, TCP, and SCTP.

UDP: Is the simplest of the three. TCP: A complex transport layer protocol. SCTP: The new transport layer protocol

that is designed for specific applications such as multimedia.

Page 3: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Process-to-process Delivery

Real communication takes place between two processes (application programs). We need process-to-process delivery.

We need a mechanism to deliver data from one of these processes running on the source host to the corresponding process running on the destination host.

The transport layer is responsible for process-to-process delivery.

Page 4: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Types of Data Delivery

Page 5: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connectionless Versus Connection-Oriented Service

A transport layer protocol can either be connectionless or connection-oriented.

Connectionless Service In a connectionless service, the packets are sent

from one party to another with no need for connection establishment or connection release.

The packets are not numbered; they may be delayed or lost or may arrive out of sequence.

There is no acknowledgment . UDP is a connectionless transport layer

protocols.

Page 6: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connectionless Versus Connection-Oriented Service

Connection Oriented Service In a connection-oriented service, a

connection is first established between the sender and the receiver.

Data are transferred. At the end, the connection is released. TCP

and SCTP are connection-oriented protocols.

Page 7: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Reliable Versus Unreliable

The transport layer service can be reliable or unreliable. If the application layer program needs

reliability, we use a reliable transport layer protocol by implementing flow and error control at the transport layer. This means a slower and more complex service.

On the other hand, if the application program does not need reliability then an unreliable protocol can be used.

Page 8: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Transport Layer Protocols

UDP is connectionless and unreliable; TCP and SCTP are connection oriented and reliable.

These three protocols can respond to the demands of the application layer programs.

Page 9: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Error Control

Page 10: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

User Datagram Protocol (UDP)

UDP is a connectionless, unreliable transport protocol.

It does not add anything to the services of IP except to provide process-to process communication instead of host-to-host communication.

UDP is a very simple protocol using a minimum of overhead. If a process wants to send a small message and does

not care much about reliability, it can use UDP. Sending a small message by using UDP takes much

less interaction between the sender and receiver than using TCP or SCTP.

Page 11: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

User Datagram

UDP packets, called user datagrams, have a fixed size header of 8 bytes.

Page 12: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

User Datagram

Source port number: This is the port number used by the process running on the source host.

Destination port number: This is the port number used by the process running on the destination host.

Length: This is a 16-bit field that defines the total length of the user datagram.

Checksum: This field is used to detect errors over the entire user datagram (header plus data).

Page 13: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connectionless Services

UDP provides a connectionless service: no relationship between the different user

datagram even if they are coming from the same source process and going to the same destination program.

The user datagrams are not numbered. Also, there is no connection establishment

and no connection termination. Each user datagram can travel on a

different path.

Page 14: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connectionless Services

There is no flow control: The receiver may overflow with incoming messages.

There is no error control mechanism in UDP except for the checksum.

The sender does not know if a message has been lost or duplicated.

When the receiver detects an error through the checksum, the user datagram is discarded.

Page 15: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Use of UDP

UDP is suitable for a process that requires simple request-response communication with little concern for flow and error control.

UDP is suitable for a process with internal flow and error control mechanisms. For example, the Trivial File Transfer Protocol (TFTP) process includes flow and error control.

UDP is used for management processes such as SNMP.

Page 16: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Transmission Control Protocol(TCP)

TCP is called a connection-oriented, reliable transport protocol. It adds connection-oriented and reliability features to the services of IP.

TCP uses flow and error control mechanisms at the transport level.

Page 17: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connection-oriented Services TCP creates an environment in which the

two processes seem to be connected by an imaginary "tube“ that carries their data across the Internet.

Page 18: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connection-oriented Services When a process at site A wants to send

and receive data from another process at site B, the following occurs:1. The two processes establish a connection

between them.2. Data are exchanged in both directions.3. The connection is terminated.

Page 19: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Reliable Transport Protocol

TCP is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe arrival of data.

Flow Control: The receiver of the data controls the amount of

data that are to be sent by the sender. Error Control. Congestion Control:

The amount of data sent by a sender is controlled by the level of congestion in the network.

Page 20: 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 Segment Format

Page 21: 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 Segment Format

The segment consists of a 20-60-byte header.

Source port address: This is a 16-bit field , it defines the port

number of the application program in the host that is sending the segment.

Destination port address: This is a 16-bit field, it defines the port

number of the application program in the host that is receiving the segment.

Page 22: 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 Segment Format

Sequence number: This 32-bit field defines the number

assigned to the first byte of data contained in this segment.

Acknowledgment number: This 32 bit field defines the number of the

next byte a party expects to receive. Header length:

A 4-bit field that indicates the number of 4-byte words in the TCP header.

Page 23: 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 Segment Format

Control. This field defines 6 different control bits or flags. One or more of these bits can be set at a time.

Page 24: 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 Segment Format

Page 25: 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 Connection

A Connection-oriented transport protocol establishes a virtual path between the source and destination.

In TCP, connection-oriented transmission requires three phases: connection establishment, data transfer, and connection termination.

Page 26: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connection Establishment

TCP transmits data in full-duplex mode Example: Client-server communication using

TCP as the transport layer protocol.1. The server issues a request for a passive open:

The server program tells its TCP that it is ready to accept a connection.

2. The client program issues a request for an active open:

A client that wishes to connect to an open server tells its TCP that it needs to be connected to that particular server.

Page 27: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Three-step Connection Establishment1. The client sends the first segment, a SYN segment:

A SYN segment does not carry data, but it consumes one sequence number.

2. The server sends the second segment, a SYN +ACK segment. It is a SYN segment for communication in the other direction and

an acknowledgment for the SYN segment. A SYN +ACK segment cannot carry data, but does consume one

sequence number.

3. The client sends the third segment. This is just an ACK segment. It acknowledges the receipt of the second segment.

An ACK segment, if carrying no data, consumes no sequence number.

Page 28: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Three-step Connection Establishment Using Three-way Handshaking

Page 29: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Data Transfer

Page 30: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Connection Termination Using Three-way Handshaking

Page 31: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Lost Segment

Page 32: TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.

Notes

The FIN segment consumes one sequence number if it does not carry data.

The FIN + ACK segment consumes one sequence number if it does not carry data.

The FIN + ACK segment consumes one sequence number if it does not carry data.

No retransmission timer is set for an ACK segment. Data may arrive out of order and be temporarily

stored by the receiving TCP, but TCP guarantees that no out-of-order segment is delivered to the process.