31-12-24 02-01-25 Lecture Notes (Wk-14)
31-12-24 02-01-25 Lecture Notes (Wk-14)
Week # 14
M.Nadeem Akhtar
CS & IT Department
The University of Lahore
Email: [email protected]
URL- https://sites.google.com/view/nadeemuolcscn/home/course-material
Powerpoint Templates 1
ACKNOWLEDGMENTS
Mostly adopted from lecture slides by Behrouz A.
Forouzan and Computer Networking: A Top Down
Approach 7th Edition, Global Edition Jim Kurose, Keith
Ross Pearson April 2016
Week 14- Course Plan
Transport Layer Protocols Overview:
User Datagram Protocol (UDP)
Transmission Control Protocol (TCP)
Stream Control Transmission Protocol (SCTP)
2
TRANSPORT LAYER IN TCP/IP MODEL
Transport layer is responsible for giving services to the application
layer: to get a message from an application program running on the
source host and deliver it to the corresponding application program
on the destination host.
Transport Layer performs reliable “process-to-process”
delivery of a message
3
Transport Layer Services
5
Position of UDP, TCP, and SCTP in TCP/IP suit
Transport Layer Services and Protocols
Transport Vs Network
network layer:
communication between hosts
transport layer:
Logical communication between
processes
11
UDP Header Format
12
UDP Header details
UDP Destination Port: identifies destination process
UDP Source Port: optional -- identifies source process
for replies
Message Length: length of datagram in bytes,
including header and data
Checksum: optional
UDP Services
14
UDP Services Continue !
4-Queuing:
In UDP, queues are associated with ports.
At the client site, when a process starts, it requests a port number
from the operating system. Some implementations create both an
incoming and an outgoing queue associated with each process.
At the server site, the mechanism of creating queues is different. In
its simplest form, 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.
15
Use of UDP
Used for the transmission of small amount of data
Accuracy is not of prime concern
Used in video and audio multicasting and broad casting, also used for
multimedia transmission
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
UDP is used for some route updating protocols such as Routing Information
Protocol (RIP) .
16
Well-known ports used with UDP
23.17
2-Transmission Control Protocol (TCP)
TCP is a connection oriented protocol; it creates a virtual connection between
two TCPs to send data.
TCP uses flow and error control mechanisms at the transport level.
18
Ports
Socket Address
Multiplexing and demultiplexing
TCP Services:
A. Process-to-Process Communication
B. Stream Delivery Service
C. Full-Duplex Communication
D. Connection-Oriented Service
E. Reliable Service
25
TCP Services:
(A-Process-to-Process Communication)
provides process-to-process communication using port numbers.
Table –Below, lists some well-known port numbers used by TCP.
26
B-Stream Delivery Service
TCP allows the sending process to deliver data as a stream of
bytes and allows the receiving process to obtain data as a stream of
bytes.
TCP creates an environment in which the two processes seem to be
connected by an imaginary "tube“ that carries their data across the
Internet.
The sending process produces (writes to) the stream of bytes, and
the receiving process consumes (reads from) them.
27
Sending and receiving buffers
C-Full-Duplex Communication
29
TCP segments
D-Connection-Oriented Service
TCP, is a connection-oriented protocol. When a process at site A wants
to send and receive data from another process at site B, the following
occurs ( This is also called 3- way handshake ):
1. The two TCPs establish a connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
31
E-Reliable Service
32
TCP Features:
Flow Control:
TCP, unlike UDP, provides flow control. The receiver of the data controls the amount of
data that are to be sent by the sender. This is done to prevent the receiver from being
overwhelmed with data. The numbering system allows TCP to use a byte-oriented flow
control.
Error Control:
To provide reliable service, TCP implements an error control mechanism. Although
error control considers a segment as the unit of data for error detection (loss or corrupted
segments), error control is byte-oriented.
Congestion Control:
TCP, unlike UDP, 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.
33
TCP Format
Packet in TCP is called a segment.
The format of a segment is shown in Figure
34
3- Stream Control Transmission Protocol (SCTP)
36
Multi-homing in SCTP
If the sender or receiver is a multi homed host (connected to more
than one physical address with multiple IP addresses in SCTP, the
sending and receiving host can define multiple IP addresses in each
end for an association.
In this fault-tolerant approach, when one path fails, another interface
can be used for data delivery without interruption.
This fault-tolerant feature is very helpful when we are sending and
receiving a real-time payload such as Internet telephony
37
Multi-streaming
SCTP allows multi-stream service in each connection, which is called association in
SCTP terminology. If one of the streams is blocked, the other streams can still deliver
their data.
The idea is similar to multiple lanes on a highway. Each lane can be used for a different
type of traffic. For example, one lane can be used for regular traffic, another for car
pools.
If the traffic is blocked for regular vehicles, car pool vehicles can still reach their
destinations. Figure below shows the idea of multiple-stream delivery.
38
Some SCTP applications
23.39
SCTP Header Format
40
Differences between TCP, UDP, and SCTP
41