0% found this document useful (0 votes)
18 views41 pages

31-12-24 02-01-25 Lecture Notes (Wk-14)

Uploaded by

Maaz Bhatti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views41 pages

31-12-24 02-01-25 Lecture Notes (Wk-14)

Uploaded by

Maaz Bhatti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Computer Networks

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

 transport protocols run in end systems


 sender side: breaks app messages into
segments, passes to network layer
 receiver side: reassembles segments into
messages, passes to application layer
Overview of Transport layer Protocols:
1) User Datagram Protocol (UDP), is a connectionless protocol
that transmits user datagrams without first creating a logical
connection.
Connectionless means each user datagram is independent
without being related to previous or next one

2) Transmission Control Protocol (TCP), is a connection-oriented


protocol that first establishes a logical connection between
transport layers at two hosts before transferring data.
a) Connection-oriented means a connection must be established
between both ends of a transmission before either can transmit data.
b) Provides flow control, error control, congestion control
3) Stream Control Transmission Protocol (SCTP) is designed to
respond to new applications that are emerging in the multimedia.

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

 relies on, enhances, network


layer services
Internet Transport Layer Protocols

Reliable, in-order delivery


(TCP)
 congestion control
 flow control
 connection setup
unreliable, unordered
delivery: UDP
 extension of
best-effort IP
Multiplexing/Demultiplexing

Transport layer creates a unique connection via socket


(combination of IP and port number)
1-USER DATAGRAM PROTOCOL (UDP)

 The User Datagram Protocol (UDP) is called a connectionless,


unreliable transport protocol.
 Provide process-to-process communication instead of host-to-host
communication.
 It performs very limited error checking.
 Packets may be lost or delivered out of order
 Not buffered -- UDP accepts data and transmits immediately (no
buffering before transmission)
 Full duplex -- concurrent transfers can take place in both directions

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

1) Connectionless Services: This means that each user datagram


sent by UDP is an independent datagram.

2) Flow and Error Control: There is no error control mechanism in


UDP except for the checksum. The lack of flow control and error
control means that the process using UDP should provide these
mechanisms
3) Encapsulation and De-capsulation: To send a message from one
process to another, the UDP protocol encapsulates and
decapsulates messages in an IP datagram.

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.

 TCP is called a connection-oriented, reliable transport protocol. It adds


connection-oriented and reliability features to the services of IP.

 Used in the accurate transmission of large amount of data

 Slower compared to UDP because of additional error checking being


performed

18
Ports

TCP requires port numbers on the host and destination for


communication

Standard port numbers have been assigned by the Internet


Assigned Number Authority (IANA)
Standard access for web browsing
Ganesan.calstatela.edu
Default port of 80 is used in this case
Non-standard access
http://ganesan.calstatela.edu:5002
The port number 5002 is used in this case to host the above web server
Port numbers
Sample TCP Port Numbers

20 FTP Data Channel


21 FTP Control Channel
23 Telnet
80 HTTP on WWW
135 RPC
139 NetBIOS Session
Services
Note: There are port numbers applicable to UDP as well.
IP addresses versus port numbers
IANA ranges

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

 TCP offers full-duplex service, in which data can flow in both


directions at the same time.
 Each TCP then has a sending and receiving buffer, and segments
move in both directions

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

 TCP is a reliable transport protocol.


 It uses an acknowledgment mechanism to check the safe and
sound arrival of data.

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)

 Stream Control Transmission Protocol (SCTP) is a new


reliable, message-oriented transport layer protocol.
 SCTP, is mostly designed for Internet applications
that have recently been introduced such as:
• IUA (ISDN over IP),
• M2UA and M3UA (telephony signaling)
• H.248 (media gateway control)
• H.323 (IP telephony) and
• SIP (IP telephony)
 SCTP need a more sophisticated service than TCP can
provide.
 SCTP provides this enhanced performance and reliability.
 SCTP (Stream Control Transmission Protocol) does
everything that TCP does while adding new features
that TCP doesn't have. 35
SCTP Services
 All services provided by TCP are also provided by SCTP
except multi-homing and Multi-streaming
 The first feature that SCTP adds to the mix is multi-homing.
Multi-homing allows the two endpoints of a connection to
declare multiple interfaces (IP addresses).

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

Attribute TCP UDP SCTP

Reliability Reliable Unreliable Reliable


Connection Connection-oriented Connectionless Connection-oriented
Management
Transmission Byte-oriented Message-oriented Message-oriented
Flow Control Yes No Yes
Congestion Control Yes No Yes
Fault Tolerance No No Yes
Data Delivery Strictly Ordered Unordered Partially ordered
Security Yes Yes Improved

41

You might also like