Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Lecture 9

Process-to-Process Delivery

1
TCP/IP protocol suite

BGP OSPF
IP …

2
PROCESS-TO-PROCESS DELIVERY

Transport layer is responsible for process-to-process delivery


- The delivery of a packet from one process to another
- The processes communicate in client/server relationship

Topics discussed in this section:


Client/Server Paradigm
Connectionless Versus Connection-Oriented
Reliable Versus Unreliable
Transport Layer Protocols

3
Data delivery

The transport layer is responsible for


process-to-process delivery
4
Client/Server Paradigm

Port numbers Example:


➢ The client process (Daytime client) can use a temporary
(ephemeral) port number to identify itself.
➢ The server process (Daytime server) use the well-known
(permanent) port number to identify itself.
7
Client/Server Paradigm
IP addresses
versus
Port numbers

The port number


defines one of the
processes on this
particular host.

The destination
IP address
defines the host
among the
different hosts in
the world.

8
Port numbers
port numbers ranges

IANA: Internet Assigned Numbers Authority

The client uses a Dynamic (temporary) port number


requested by the client process and chosen by the
transport layer software running on the host.

9
Port numbers
The port numbers are 16-bit integers between 0 and 65,535.
Well-known ports:
The ports ranging from 0 to 1023 are assigned and controlled by the
internet authority (lANA).
25 SMTP — email routing between email servers
80 HTTP — world wide web server
Registered ports:
The ports ranging from 1024 to 49,151 are registered with lANA to
prevent duplication.
1293 IPSec (Internet Protocol Security)
1720 H.323 Call signaling
Dynamic ports:
The ports ranging from 49,152 to 65,535 are neither controlled nor
registered. They can be used by any process. These are the temporary
ports for dynamic or private use (transport layer).
10
Socket Address

Socket address:
• The combination of an IP address and a port number.
• The IP header contains the IP addresses.
• The UDP or TCP header contains the port numbers.
12
Connectionless Versus Connection-Oriented
Connectionless Service (UDP):
The packets are sent from one party to another with
no connection establishment or connection release.
The packets may be delayed, lost, or arrive out of
sequence.

Connection-Oriented Service (TCP):


A connection is first established between the sender
and the receiver. Data are transferred and arrive in
order. At the end of transmission, the connection is
released.

13
Reliable Versus Unreliable
Reliable Service (TCP):
If the application layer program needs reliability, use a
reliable transport layer protocol which implement flow
and error control (via acknowledgments). This means a
slower and more complex service.

Unreliable Service (UDP):


Unreliable protocol is used when application program
does not need reliability because:
1) it uses its own flow and error control mechanism or
2) it needs fast service or the nature of the service does
not demand flow and error control.

14
Error control

Question: If the data link layer is reliable and has flow and error control, do we
need this at the transport layer?
Answer: Yes. Reliability at the data link layer is between two nodes; we need
reliability between two ends. Because the network layer in the Internet is
unreliable (best-effort delivery), we need to implement reliability at the transport
layer. I.e., error control at the data link layer does not guarantee error control at
the transport layer.
15
Position of UDP, TCP in Protocol suite

BGP OSPF

16
UDP
USER DATAGRAM PROTOCOL

17
UDP - USER DATAGRAM PROTOCOL
The User Datagram Protocol 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.
• It is very simple protocol using minimum overhead.
Topics discussed in this section:
User Datagram
UDP Operation
Use of UDP
UDP Ports

18
User datagram format

UDP user datagrams have a fixed-size header of 8 bytes.

19
User datagram format
• 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.
• Checksum:
This field is used to detect errors over the entire user datagram
(header plus data).
• Total Length:
This is a 16-bit field that defines the total length of the user
datagram (header plus data).
• The 16 bits can define a total length of up to 65,535 bytes.
• The total length needs to be less because a UDP user
datagram is stored in an IP datagram.
• The total length of IP datagram is 65,535 bytes.
20
User datagram format

Message

User Datagram

Datagram

Frame

UDP User Datagram length


= IP Datagram length – IP header length
21
UDP Operation
UDP Connectionless Services
There is no connection establishment in UDP.
Each user datagram can travel on a different path.
Only processes sending short messages should use UDP.
Each request must be small enough to fit into one datagram.

UDP Unreliable Services


There is no flow or 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.

22
Queues in UDP

23
Queues in UDP
• The client process sends messages to the outgoing queue by
using the source port number specified in the request. UDP
removes the messages one by one and, after adding the UDP
header, delivers them to IP.
• An outgoing queue can overflow. If this happens, the client
process is asked to wait before sending any more messages.

• When a message arrives for a client, UDP sends the received user
datagram to the end of the incoming queue.
• If the incoming queue overflow, UDP discards the user datagram
and asks the ICMP protocol to send a port unreachable message
to the server.

• At the server site, a server asks for incoming and outgoing


queues, using its well-known port, when it starts running. The
queues remain open as long as the server is running.

24
The use of UDP
• UDP is suitable for a process that requires simple request-
response communication with little concern for flow and error
control. It is not usually used for a process that needs to send
bulk data.

• UDP is suitable for a process with internal flow and error control
mechanisms (such as TFTP).

• UDP is suitable for a process with short messages and is used for
management processes such as SNMP.

• UDP is used for some route updating protocols such as Routing


Information Protocol (RIP)

25
Well-known ports used by UDP

26
TCP
Transport Control Protocol

27
TCP - Transport Control Protocol
TCP is a connection-oriented protocol
• It creates a virtual connection between two TCPs to
send data.
• It uses flow and error control mechanisms at the
transport level.
Topics discussed in this section:
TCP Services
TCP Features
TCP Segment
TCP Connection
Flow Control
Error Control
28
TCP Services

TCP is a stream-oriented protocol that can be used for


bulk data transfer.
➢ The sending process produces the stream of bytes
➢ The receiving process consumes the stream of bytes
29
TCP Services

TCP needs sending and receiving buffers for storage


because the sending and the receiving processes may
not write or read data at the same speed.
30
TCP Services

The TCP segmentation operation encapsulates segments


into IP datagrams (transparent to the receiving process).
31
TCP Services

TCP offers full-duplex service:


The data can flow in both directions at the same time
(using sending and receiving buffers).

TCP provides connection-oriented services:


1. The two TCPs establish a connection.
2. Data are exchanged in both directions.
3. The connection is terminated.

TCP provides reliable services:


It uses acknowledgment mechanism to check the safe
arrival of data.

32
TCP Features
TCP Numbering System:

TCP assigns a sequence number to each segment that


is being sent. The sequence number for each segment
is the number of the first byte carried in that segment.

The bytes of data being transferred in


each connection are numbered by TCP
Byte Number
The numbering starts with a randomly
generated number
33
TCP Features
Example
A TCP connection is transferring a file of 5000 bytes.
The first byte is numbered 10,001
What are the sequence numbers for each segment if data
are sent in 5 segments, each carrying 1000 bytes?
The following shows the sequence number for each
segment:

34
TCP Features
TCP Acknowledgment Number:

The value of the acknowledgment field


in a segment defines
the number of the next byte
a party expects to receive.

The acknowledgment number is cumulative:


When a party uses a certain acknowledgment number,
it has received all bytes from the beginning up to this
number.

35
TCP Features
Error Control
TCP implements an error control mechanism. Although
error control considers a segment as the unit of data
for error detection, error control is byte-oriented.
Flow Control:
The receiver of the data controls the amount of data
that are to be sent by the sender in order to avoid
overload. The numbering system allows TCP to use
byte-oriented flow control.
Congestion Control
TCP takes into account congestion in the network. The
amount of data sent by a sender is not only controlled
by the receiver (flow control), but is also determined by
the level of congestion in the network.
36
Questions ?

37

You might also like