0% found this document useful (0 votes)
10 views38 pages

Network Communication

The transport layer is responsible for delivering messages between processes, ensuring they arrive intact and in order, with protocols like TCP (connection-oriented) and UDP (connectionless). It utilizes port numbers for addressing and supports multiplexing and demultiplexing. SCTP is another reliable protocol that combines features of both TCP and UDP, providing additional services such as multiple streams.

Uploaded by

Anas Anas
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)
10 views38 pages

Network Communication

The transport layer is responsible for delivering messages between processes, ensuring they arrive intact and in order, with protocols like TCP (connection-oriented) and UDP (connectionless). It utilizes port numbers for addressing and supports multiplexing and demultiplexing. SCTP is another reliable protocol that combines features of both TCP and UDP, providing additional services such as multiple streams.

Uploaded by

Anas Anas
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/ 38

Computer Network Systems

Transport Layer

Edited Slides
Transport Layer
• The transport layer is responsible for the delivery of a message from one
process to another (segments).

• A process is an application program running on a host.

• It ensures that the whole message arrives intact (complete) and in order.

• The network layer oversees source-to-destination delivery of individual


packets.

TCP creates a relationship between the segments using sequence numbers


Transport Layer (cont’d)
• A transport layer protocol:
• connectionless (UDP) :User Datagram Protocol
• connection-oriented (TCP) : Transmission Control Protocol

• A connectionless treats each segment as an independent


packet and delivers it to the transport layer at the
destination machine.
• A connection-oriented makes a connection with the
transport layer at the destination machine. After all the data
is transferred, the connection is terminated.
Transport Layer (cont’d)
• Real communication takes place between two
processes (application programs).
• We need process-to-process delivery.
• The Internet model has three protocols at the
transport layer:
1. UDP
2. TCP
)
3. SCTP(Stream Control Transmission Protocol .
Transport Layer (cont’d)
Client/Server Paradigm
• The most common way to achieve process-to-process
communication is through the client/server paradigm.
• For communication, we must define the following:
1. Local host
2. Local process The client/server paradigm divides
software into two categories, clients
and servers. A client is software that
3. Remote host initiates a connection and sends
requests, whereas a server is software

4. Remote process that listens for connections and


processes requests

The client/server paradigm divides software into two categories, clients and servers.
A client is software that initiates a connection and sends requests, whereas a server is software that listens for connections and processes requests
Addressing
• Whenever we need to deliver something to one specific
destination among many, we need an address.
• To choose among multiple processes running on the
destination host (port numbers for source and destination).
• The port numbers are 16-bit integers between 0 and 65,535.
• A client( randomly) and a server( well-known) choose the
port number.
Socket Addresses
• Process-to-process delivery needs two identifiers, IP address and the
port number, at each end to make a connection.
• The combination of an IP address and a port number is called a socket
address.
lANA Ranges
• lANA (Internet Assigned Number Authority) has divided the port
numbers into three ranges:
1) Well-known ports: 0 to 1023 are assigned and controlled by lANA.
2) Registered ports: 1024 to 49,151 are not assigned or controlled by
lANA. They can only be registered with lANA to prevent duplication.
3) Dynamic ports: 49,152 to 65,535 are neither controlled nor
registered. They can be used by any process.
Multiplexing and Demultiplexing
• The addressing mechanism allows multiplexing and demultiplexing by
the transport layer.
Connectionless vs Connection-Oriented
Service
Connectionless Service:
• The packets are sent from one party to another with no need
for connection establishment.
• The packets are not numbered; they may be delayed or lost
or may arrive out of sequence.
• There is no acknowledgment either.
•UDP
Connectionless vs Connection-Oriented
Service
Connection-Oriented Service:
• A connection is first established between the sender
and the receiver.
• Data are transferred.
• At the end, the connection is released.
•TCP and SCTP (Stream Control Transmission Protocol).
Reliable vs Unreliable
• The transport layer service can be reliable (using TCP)
or unreliable (using UDP).
• We use a reliable transport layer protocol by
implementing flow and error control at the transport
layer(a slower and more complex).
• If the application program doesn't need reliability,
then we use UPD like in real time application.
Transport Layer Protocols
USER DATAGRAM PROTOCOL (UDP)
• 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.
•BUT a very simple protocol using a minimum of
overhead( small message).
Well-Known Ports for UDP
User Datagram
• UDP packets, called user datagrams, have a fixed-size header of 8
bytes.
User Datagram (cont’d)
• User Datagram (UDP) has four fields:
1. Source port number.
2. Destination port number.
3. Length
4. Checksum
User Datagram (cont’d)
Source port number(16 bits):
• This is the port number used by the process running
on the source host.
• If the source host is the client (a client sending a
request), it is selected randomly.
• If the source is the server, the port number, in most
cases, is a well-known port number.
User Datagram (cont’d)
Destination port number(16 bits):
• This is the port number used by the process running on the
destination host.
Length:
• This is a 16-bit field that defines the total length of the user
Checksum:
• This field is used to detect errors over the entire user datagram
(header plus data).
User Datagram (cont’d)
UDP Operations
1. Connectionless Services
2. Flow and Error Control
3. Encapsulation and Decapsulation
4. Queuing
User Datagram (cont’d)
UDP Operation
• Connectionless Services:
• Each user datagram sent by UDP is an independent
datagram.
• The user datagrams are not numbered.
• No connection establishment and no connection.
• UDP is a very simple, unreliable transport protocol
User Datagram (cont’d)
•Flow and Error Control:
• UDP is a very simple, unreliable transport protocol( no
flow or error Control).
• The process using UDP should provide these
mechanisms.
Transmission Control Protocol (TCP)
• It is a process-to-process (program-to-program)
protocol.
• Uses port numbers but connection oriented protocol.
• It creates a virtual connection between two TCPs to
send data.
• TCP uses flow and error control mechanisms.
The flag field contains 6 bits. The ACK bit is used to indicate that the value carried in the acknowledgement for a segment that has been successfully received. The RST, SYN, and
FIN bits are used for connection setup and teardown. Setting the PSH bit indicates that the receiver should pass the data to the upper layer immediately. Finally, the URG bit is
used to indicate that there is data in this segment that the sending-side upper-layer entity has marked as “urgent”. The location of the last byte of this urgent data is indicated by
the 16-bit urgent data pointer field. TCP must inform the receiving-side upper-layer entity when urgent data exists and pass it to a pointer to the end of the urgent data.In practice,
the PSH, URG, and the urgent data pointer are not used. However, we mention these fields for completeness).
TCP (cont’d)
TCP Services
• Process-to-Process Communication using port number.
• Stream Delivery Service:
sending process to deliver data as a stream of bytes and
allows the receiving process to obtain data as a stream of
bytes.
• Process-to-Process Communication using port number.
TCP (cont’d)
• Sending and Receiving Buffers:
• Because the sending and the receiving processes may
not write or read data at the same speed.
• The sending buffer
• The receiving buffer
• Full-Duplex Communication:
• Data can flow in both directions at the same time.
TCP (cont’d)
•Reliable Service:
• It uses an acknowledgment mechanism to check the safe
and sound arrival of data.
•Connection-Oriented Service:
1. The two TCPs establish a connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
TCP (cont’d)
TCP Features
• Numbering System:
• The bytes of data being transferred in each connection are numbered by
TCP.
• The numbering starts with a randomly generated number.

• Sequence Number:
• After the bytes have been numbered, 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.
TCP (cont’d)
• Acknowledgment Number:
• To confirm the bytes it has received and it defines the number of
the next byte that the party expects to receive.
• The acknowledgment number is cumulative
• 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.
Cumulative acknowledgement is a process in which the receiver sends a single acknowledgement in response to a finite number of frames received. T
hrough this, the receiver acknowledges that it has correctly received all previous frames or packets. ... It reduces the time and bandwidth wasted for sending acknowledgement
TCP (cont’d)
• Congestion Control
• TCP, unlike UDP, takes into account congestion
(crowding) 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.
TCP (cont’d)
• Error Control:
• TCP provides reliability using error control.
• Error control includes mechanisms for detecting
corrupted segments, lost segments, out-of-order
segments, and duplicated segments.
• It also includes a mechanism for correcting errors
after they are detected.
TCP (cont’d)
• Error detection and correction in TCP is achieved through the
use of three simple tools:
1. Checksum
2. Acknowledgment
3. Time-out
• Corrupted and lost segments are retransmitted, and duplicate
segments are discarded.
• Data may arrive out of order and are temporarily stored by the
receiving TCP, but TCP guarantees that no out-of-order segment is
delivered to the process.
Stream Control Transmission Protocol (SCTP)
•SCTP is a message-oriented, reliable protocol
that combines the good features of UDP and TCP.
• It provides additional services not provided by
UDP or TCP, such as multiple stream.
• It also has congestion control and flow control
mechanisms.

You might also like