Professional Documents
Culture Documents
GN222 Lecture9 Transport Layer
GN222 Lecture9 Transport Layer
Process-to-Process Delivery
1
TCP/IP protocol suite
BGP OSPF
IP …
2
PROCESS-TO-PROCESS DELIVERY
3
Data delivery
The destination
IP address
defines the host
among the
different hosts in
the world.
8
Port numbers
port numbers ranges
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.
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.
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
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
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.
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.
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
32
TCP Features
TCP Numbering System:
34
TCP Features
TCP Acknowledgment 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