0% found this document useful (0 votes)
4 views

ComputerNetworkNotesFYCSPillais

Uploaded by

amang22cs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

ComputerNetworkNotesFYCSPillais

Uploaded by

amang22cs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Unit 4-Transport layer protocol

The transport layer is responsible for process-to-process delivery of the entire message.
A process is an application program or part of it which is currently running on a computer.
Network layer oversees source-to-destination delivery of individual packets, it does not
recognize any relationship between those packets. It treats each one independently, as though
each piece belonged to a separate message, whether or not it does.
Transport layer, on the other hand, ensures that the whole message arrives intact and in order,
overseeing both error control and flow control at the source-to-destination level.

“The transport layer is responsible for the delivery of a message from one process to another.”

Transport layer header must include a type of address called a service-point address in the OSI
model and port number or port addresses in the Internet and TCP/IP protocol suite. Transport
layer protocol can be either connectionless or connection-oriented.

Connectionless transport layer treats each segment as an independent packet and delivers it to the
transport layer at the destination machine.
Connection-oriented transport layer makes a connection with the transport layer at the
destination machine first before delivering the packets. After all the data is transferred, the
connection is terminated.

In the transport layer, a message is normally divided into transmittable segments.


Connectionless protocol, such as UDP, treats each segment separately.
Connection oriented protocol, such as TCP, creates a relationship between the segments using
sequence numbers.
Like the data link layer, the transport layer may be responsible for flow and error control.
However, flow and error control at this layer is performed end to end rather than across a single
link.

Internet Assigned Number Authority (IANA) has divided the port numbers into three
ranges: well known, registered, and dynamic (or private)

1.Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by lANA.
These are the well-known ports.

2.Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by
lANA. They can only be registered with lANA to prevent duplication.

3. 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 ephemeral ports.

Socket address - 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. A transport layer protocol needs a pair of socket addresses: the client
socket address and the server socket address. These four pieces of information are part of the IP
header and the transport layer protocol header. The IP header contains the IP addresses; the UDP
or TCP header contains the port numbers.

Connectionless Versus Connection-Oriented Service


A transport layer protocol can either be connectionless or connection-oriented.

Connectionless Service
In a connectionless service, 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. There is no acknowledgment either.

Connection~Oriented Service
In a connection-oriented service, a connection is first established between the sender and the
receiver. Data are transferred. At the end, the connection is released.

Reliable Versus Unreliable


The transport layer service can be reliable or unreliable. If the application layer program needs
reliability, we use a reliable transport layer protocol by implementing flow and error control at
the transport layer. This means a slower and more complex service. On the other hand, if the
application program does not need reliability because it uses its own flow and error control
mechanism or it needs fast service or the nature of the service does not demand flow and error
control (real-time applications), then an unreliable protocol can be used.
UDP is connectionless and unreliable; TCP and SCTP are connection oriented and reliable.

The User Datagram Protocol (UDP) is called 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. Also, it performs very limited error checking.
Disadvantage of UDP is it is powerless but it is a very simple protocol using a minimum of
overhead. If a process wants to send a small message and does not care much about reliability, it
can use UDP. Sending a small message by using UDP takes much less interaction between the
sender and receiver than using TCP or SCTP.

User Datagram
UDP packets, called user datagrams, have a fixed-size header of 8 bytes.
The fields are as follows:
1.Source port number. This is the port number used by the process running on the source host. It
is 16 bits long, which means that the port number can range from 0 to 65,535. If the source host
is the client (a client sending a request), the port number, in most cases, is an ephemeral port
number requested by the process and chosen by the UDP software running on the source host. If
the source host is the server (a server sending a response), the port number, in most cases, is a
well-known port number.

2. Destination port number. This is the port number used by the process running on the
destination host. It is also 16 bits long. If the destination host is the server (a client sending a
request), the port number, in most cases, is a well-known port number. If the destination host is
the client (a server sending a response), the port number, in most cases, is an ephemeral port
number. In this case, the server copies the ephemeral port number it has received in the request
packet.
3. 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 0 to 65,535 bytes. However, the total length needs to
be much less because a UDP user datagram is stored in an IP datagram with a total length of
65,535 bytes.
The length field in a UDP user datagram is actually not necessary. A user datagram is
encapsulated in an IP datagram. There is a field in the IP datagram that defines the total length.
There is another field in the IP datagram that defines the length of the header. So if we subtract
the value of the second field from the first, we can deduce the length of a UDP datagram that is
encapsulated in an IP datagram.
UDP length = IP length - IP header's length

4. Checksum. This field is used to detect errors over the entire user datagram (header plus data).

User datagram format


Header (8 bytes) Data
Source address (16 bits) Destination address (16 bits)
Total length (16 bits) Checksum (16 bits)

UDP Operation
Connectionless Services
UDP provides a connectionless service. This means that each user datagram sent by UDP is an
independent datagram. There is no relationship between the different user datagrams even if they
are coming from the same source process and going to the same destination program. The user
datagrams are not numbered.
Also, there is no connection establishment and no connection termination, as is the case for TCP.
This means that each user datagram can travel on a different path.
One of the ramifications of being connectionless is that the process that uses UDP cannot send a
stream of data to UDP and expect UDP to chop them into different related user datagrams.
Instead each request must be small enough to fit into one user datagram. Only those processes
sending short messages should use UDP.

Flow and Error Control


UDP is a very simple, unreliable transport protocol. There is no flow control and hence no
window mechanism. The receiver may overflow with incoming messages. There is no error
control mechanism in UDP except for the checksum. This means that the sender does not know
if a message has been lost or duplicated. When the receiver detects an error through the
checksum, the user datagram is silently discarded. The lack of flow control and error control
means that the process using UDP should provide these mechanisms.

Encapsulation and Decapsulation


To send a message from one process to another, the UDP protocol encapsulates and decapsulates
messages in an IP datagram.
Use of UDP
The following lists some uses of the UDP protocol:
1.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.
2. 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. It can easily
use UDP.
3. UDP is a suitable transport protocol for multicasting. Multicasting capability is embedded in
the UDP software but not in the TCP software.
4. UDP is used for management processes such as SNMP.
5. UDP is used for some route updating protocols such as Routing Information Protocol (RIP)

The Transmission Control Protocol (TCP) . TCP, like UDP, is a process-to-


process (program-to-program) protocol. TCP, therefore, like UDP, uses port numbers. Unlike
UDP, TCP is a connection oriented protocol; it creates a virtual connection between two TCPs to
send data. In addition, TCP uses flow and error control mechanisms at the transport level.
In brief, TCP is called a connection-oriented, reliable transport protocol. It adds connection-
oriented and reliability features to the services of IP.

TCP Services
Process-to-Process Communication
Like UDP, TCP provides process-to-process communication using well known port numbers.

Stream Delivery Service


TCP, unlike UDP, is a stream-oriented protocol. In UDP, a process (an application program)
sends messages, with predefined boundaries, to UDP for delivery. UDP adds its own header to
each of these messages and delivers them to IP for transmission. Each message from the process
is called a user datagram and becomes, eventually, one IP datagram. Neither IP nor UDP
recognizes any relationship between the datagrams. TCP, on the other hand, 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.

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.

Connection-Oriented Service
TCP, unlike UDP, 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:
1. The two TCPs establish a connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
Note that this is a virtual connection, not a physical connection. The TCP segment is
encapsulated in an IP datagram and can be sent out of order, or lost, or corrupted, and then
resent. Each may use a different path to reach the destination. There is no physical connection.
TCP creates a stream-oriented environment in which it accepts the responsibility of delivering
the bytes in order to the other site. The situation is similar to creating a bridge that spans multiple
islands and passing all the bytes from one island to another in one single connection.

Reliable Service
TCP is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe and
sound arrival of data.

TCP segment consists of a 20- to 60-byte header, followed by data from the application program.
The header is 20 bytes if there are no options and up to 60 bytes if it contains options.

1. Source port address. This is a 16-bit field that defines the port number of the application
program in the host that is sending the segment. This serves the same purpose as the source port
address in the UDP header.

2. Destination port address. This is a 16-bit field that defines the port number of the application
program in the host that is receiving the segment. This serves the same purpose as the destination
port address in the UDP header.

3. Sequence number. This 32-bit field defines the number assigned to the first byte of data
contained in this segment. TCP is a stream transport protocol. To ensure connectivity, each byte
to be transmitted is numbered. The sequence number tells the destination which byte in this
sequence comprises the first byte in the segment.

4. Acknowledgment number. This 32-bit field defines the byte number that the receiver of the
segment is expecting to receive from the other party. If the receiver of the segment has
successfully received byte number x from the other party, it defines x + I as the acknowledgment
number. Acknowledgment and data can be piggybacked together.

5. Header length. This 4-bit field indicates the number of 4-byte words in the TCP header. The
length of the header can be between 20 and 60 bytes. Therefore, thevalue of this field can be
between 5 (5 x 4 =20) and 15 (15 x 4 =60).

6. Reserved. This is a 6-bit field reserved for future use.

7. Control. This field defines 6 different control bits or flags. One or more of these bits can be set
at a time.

TCP segment format-


Header (8 bytes) Data
Source address (16 bits) Destination address (16 bits)
Sequence number (32 bits)
Acknowledge number (32 bits)
HLEN Reserved Flags Window size(16 bits)
Checksum(16 bits) Urgent pointer (16 bits)
Options ad padding

You might also like