Beruflich Dokumente
Kultur Dokumente
Process-to-Process Delivery:
UDP and TCP
(Chapter 23)
23.1
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
23-1 PROCESS-TO-PROCESS DELIVERY
23.3
Client/ Server Paradigm - Addressing
• Most common way to achieve process-to-process delivery is through
client/ server paradigm
• In the Internet model, the port numbers are 16-bit integers between 0
and 65,535. The client program defines itself with a port number,
chosen randomly by the transport layer software running on the client
host. This is the ephemeral (temporary) port number.
• Universal port numbers called well-known port numbers are used for
servers.
23.4
Client/ Server Paradigm - Addressing
• In Fig.23.2, the Daytime client process uses an ephemeral (temporary)
port number 52,000 and the Daytime server process uses the well-
known (permanent) port number13.
Port number:
Defines 1 of the processes on
this particular host
23.6
IANA ranges
Range: 0 - 1023
Well-known ports
Assigned and controlled by IANA.
Range: 1024 - 49,151
Registered ports Not assigned/ controlled by IANA. They can
only be registered with IANA to prevent
duplication.
Range: 49,152 - 65,535
Dynamic port
(ephemeral ports) Not assigned/ controlled by IANA. They can be
used by any process.
23.7
Socket address
• Process-to-process delivery needs two identifiers:
• IP address and
• the port number at each end to make a connection.
23.8
Multiplexing and Demultiplexing
Sender’s site
1. Protocol accepts messages from
different processes
2. Adds header
3. Passes packet to network layer
Receiver’s site
1. Transport layer receives datagram from
network layer
2. Performs error checking
3. Drops header
4. Delivers each message to appropriate
process based on the port number
23.9
Connectionless vs. Connection-Oriented Service
Transport layer protocol can either be
• Connectionless: UDP
• 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.
• Connection-oriented: TCP
• a connection is first established between the sender
and receiver before data transfer. At the end, the
connection is released.
23.10
Reliable vs. Unreliable
• UDP: connectionless & unreliable
• TCP: connection-oriented & reliable
23.14
Table 23.1 Well-known ports used with UDP
User Datagram
UDP packet is called user datagram with a fixed size header of 8 bytes
23.19
23-3 TCP
23.21
Table 23.2 Well-known ports used by TCP
Stream Delivery Services
• In TCP, process delivers data as a stream of bytes and receiver
receives data in stream of bytes
23.25
Example 23.3
23.26
Segment
In TCP packet is called segment which consists of 20 – 60 bytes header
Control fields
Window size Windows size determined by receiver that the sender must maintain
Checksum Used for error checking (Protocol field value for TCP is 6)
Urgent pointer Used when segment contains urgent data (only valid if urgent pointer is set)
Options/ Padding Can be up to 40 bytes of optional information
23.28
Table 23.3 Description of flags in the control field
23.
29
TCP Connection
3 phases
1st phase: Connection Establishment
a. Server request passive open
b. Client program request active open
c. 3 way handshaking starts
• SYN segment
A SYN segment cannot carry
data, but it consumes one
sequence number.
• ACK segment
An ACK segment, if carrying no
data, consumes no sequence
Figure 23.18 Connection establishment using
number.
three-way handshaking
23.30
2nd phase: Data Transfer
Eg:
Client sends 2000 bytes in 2 segments
Server then sends 2000 bytes in 1
segment
• ACK segment
Figure 23.20 Connection termination using
three-way handshaking
23.32
Flow Control
Open: allow new bytes in the buffer that are eligible for sending
Close: some bytes have been acknowledged
Shrink: revoke eligibility of some bytes for sending
Solution
• The value of rwnd = 5000 − 1000 = 4000.
• Host B can receive only 4000 bytes of data before
overflowing its buffer.
• Host B advertises this value in its next segment to A.
23.34
Example 23.5
Solution
The size of the window is the smaller of rwnd and cwnd,
which is 3000 bytes.
23.35
Example 23.6
Normal operation
eg: A bidirectional data transfer
between 2 systems
23.39
Lost segment
The receiver TCP delivers only ordered data to the process.