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

networking unit 5

The document discusses the Transport Layer of the TCP/IP model, detailing its role in end-to-end communication, data segmentation, and the protocols it utilizes, namely TCP and UDP. It outlines the responsibilities of the Transport Layer, including process-to-process delivery, connection establishment, multiplexing, congestion control, data integrity, and flow control. Additionally, it compares TCP and UDP, highlighting their characteristics, functionalities, and use cases.

Uploaded by

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

networking unit 5

The document discusses the Transport Layer of the TCP/IP model, detailing its role in end-to-end communication, data segmentation, and the protocols it utilizes, namely TCP and UDP. It outlines the responsibilities of the Transport Layer, including process-to-process delivery, connection establishment, multiplexing, congestion control, data integrity, and flow control. Additionally, it compares TCP and UDP, highlighting their characteristics, functionalities, and use cases.

Uploaded by

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

UNIT V:Transport and Application Layer

TRANSPORT LAYER
● The transport Layer is the second layer in the TCP/IP model and the fourth layer
in the OSI model.
● It is an end-to-end layer used to deliver messages to a host.
● It is termed an end-to-end layer because it provides a point-to-point connection
rather than hop-to-hop, between the source host and destination host to deliver
the services reliably.
● The unit of data encapsulation in the Transport Layer is a segment.

Working of Transport Layer


The transport layer takes services from the Application layer and provides services to
the Network layer.
At the sender’s side: The transport layer receives data (message) from the Application
layer and then performs Segmentation, divides the actual message into segments, adds
the source and destination’s port numbers into the header of the segment, and
transfers the message to the Network layer.

At the receiver’s side: The transport layer receives data from the Network layer,
reassembles the segmented data, reads its header, identifies the port number, and
forwards the message to the appropriate port in the Application layer.

Responsibilities of a Transport Layer


● The Process to Process Delivery
● End-to-End Connection between Hosts
● Multiplexing and Demultiplexing
● Congestion Control
● Data integrity and Error correction
● Flow control

1. The Process to Process Delivery

While Data Link Layer requires the MAC address (48 bits address contained inside the
Network Interface Card of every host machine) of source-destination hosts to correctly
deliver a frame and the Network layer requires the IP address for appropriate routing
of packets, in a similar way Transport Layer requires a Port number to correctly deliver
the segments of data to the correct process amongst the multiple processes running on
a particular host. A port number is a 16-bit address used to identify any client-server
program uniquely.
Process to Process Delivery

2. End-to-end Connection between Hosts

The transport layer is also responsible for creating the end-to-end Connection between
hosts for which it mainly uses TCP and UDP. TCP is a secure, connection-oriented
protocol that uses a handshake protocol to establish a robust connection between two
end hosts. TCP ensures the reliable delivery of messages and is used in various
applications. UDP, on the other hand, is a stateless and unreliable protocol that ensures
best-effort delivery. It is suitable for applications that have little concern with flow or
error control and requires sending the bulk of data like video conferencing. It is often
used in multicasting protocols.

End to End Connection.


3. Multiplexing and Demultiplexing

Multiplexing(many to one) is when data is acquired from several processes from the
sender and merged into one packet along with headers and sent as a single packet.
Multiplexing allows the simultaneous use of different processes over a network that is
running on a host. The processes are differentiated by their port numbers. Similarly,
Demultiplexing(one to many is required at the receiver side when the message is
distributed into different processes. Transport receives the segments of data from the
network layer and delivers it to the appropriate process running on the receiver’s
machine.

Multiplexing and Demultiplexing

4. Congestion Control

Congestion is a situation in which too many sources over a network attempt to send data
and the router buffers start overflowing due to which loss of packets occurs. As a
result, the retransmission of packets from the sources increases the congestion
further. In this situation, the Transport layer provides Congestion Control in different
ways. It uses open-loop congestion control to prevent congestion and closed-loop
congestion control to remove the congestion in a network once it occurred. TCP provides
AIMD – additive increases multiplicative decrease and leaky bucket technique for
congestion control.
Leaky Bucket Congestion Control Technique

5. Data integrity and Error Correction

The transport layer checks for errors in the messages coming from the application layer
by using error detection codes, and computing checksums, it checks whether the
received data is not corrupted and uses the ACK and NACK services to inform the
sender if the data has arrived or not and checks for the integrity of data.

Error Correction using Checksum


6. Flow Control

The transport layer provides a flow control mechanism between the adjacent layers of
the TCP/IP model. TCP also prevents data loss due to a fast sender and slow receiver by
imposing some flow control techniques. It uses the method of sliding window protocol
which is accomplished by the receiver by sending a window back to the sender informing
the size of data it can receive.

Transport Layer Protocols:


There are mainly two transport layer protocols that are used on the Internet-
1. Transmission Control Protocol (TCP)
2. User Datagram Protocol (UDP)

1. UDP PROTOCOL

● UDP is short for User Datagram Protocol.


● It is the simplest transport layer protocol.
● It has been designed to send data packets over the Internet.
● It simply takes the datagram from the network layer, attaches its header and
sends it to the user.

UDP Header

The UDP header is as simple as its function.

UDP header contains four main parameters:


1. Source Port - This 16 bits information is used to identify the source port of the
packet.
2. Destination Port - This 16 bits information is used to identify application level
service on the destination machine.
3. Length - Length field specifies the entire length of UDP packet (including
header). It is a 16-bits field and the minimum value is 8-byte, i.e. the size of the
UDP header itself.
4. Checksum - This field stores the checksum value generated by the sender before
sending. IPv4 has this field as optional so when the checksum field does not
contain any value it is made 0 and all its bits are set to zero.
Characteristics of UDP
● It is a connectionless protocol.
● It is a stateless protocol.
● It is an unreliable protocol.
● It is a fast protocol.
● It offers the minimal transport service.
● It is almost a null protocol.
● It does not guarantee order delivery.
● It does not provide a congestion control mechanism.
● It is a good protocol for data flowing in one direction.
● Suitable for streaming applications such as VoIP, multimedia streaming.
● UDP is used when acknowledgement of data does not hold any significance.
● UDP is a good protocol for data flowing in one direction.
● UDP is simple and suitable for query based communications.

UDP applications
● Domain Name Services
● Simple Network Management Protocol
● Trivial File Transfer Protocol
● Routing Information Protocol
● Kerberos
● Chatting and online games
● Bootp/DHCP
● Broadcasting and Multicasting applications.

2.TCP PROTOCOL
● TCP stands for Transmission Control Protocol.
● It is a transport layer protocol that facilitates the transmission of packets from
source to destination.
● It is a connection-oriented protocol that means it establishes the connection prior
to the communication that occurs between the computing devices in a network.
● This protocol is used with an IP protocol, so together, they are referred to as a
TCP/IP.
● The main functionality of the TCP is to take the data from the application layer.
Then it divides the data into a several packets, provides numbering to these
packets, and finally transmits these packets to the destination.
● The TCP, on the other side, will reassemble the packets and transmits them to the
application layer.
Services by TCP
Following are some of the services offered by the Transmission Control Protocol (TCP)
to the processes at the application layer:

1. Stream Delivery Service.


2. Sending and Receiving Buffers.
3. Bytes and Segments.
4. Full Duplex Service
5. Connection Oriented Service.
6. Reliable Service.

All the above mentioned TCP services are explained below in detail.

1. Stream Delivery Service

● TCP is a stream-oriented protocol. It enables the sending process to deliver data


as a stream of bytes and the receiving process to acquire data as a stream of
bytes.
● TCP creates a working environment so that the sending and receiving procedures
are connected by an imaginary "tube", as shown in the figure below:
2. Sending and Receiving Buffers

● The sending and receiving processes cannot produce and receive data at the same
speed. Hence, TCP needs a buffer for storage.
● There are two methods of buffers used in each dissection, which are as follows:
➔ Sending Buffer
➔ Receiving Buffer
● A buffer can be implemented by using a circular array of 1-byte location, as shown
in the figure below. The figure shows the movement of data in one direction on
the sending side.
● In practice, the TCP may send only a port of data due to the slowness of the
receiving process or congestion in the network.
● The buffer at the receiver is divided into two parts as mentioned below:
➔ The part was containing empty locations.
➔ The part was containing the received bytes, which the sending process can
consume.
● The buffer has three types of locations, which are as follows:
➔ Empty Locations.
➔ Locations that contain the bytes which have been sent, but not
acknowledged. These bytes are kept in the buffer till an acknowledgment is
received.
➔ The location that contains the bytes which are to be sent by the sending TCP
3. Bytes and Segments

● Buffering is used to handle the difference between the speed of data


transmission and data consumption. But only buffering is not enough.
● We need one more step before sending the data on the Internet Protocol (IP)
layer as a TCP service provider. It needs to send data in the form of packets and
not as a stream of bytes.
● At the transport layer, TCP groups several bytes into a packet and this is called a
segment. A header is added to each segment to exercise control.
● The segment is encapsulated in an IP diagram and then transmitted. The entire
operation is transparent to the receiving process. The segment may be deceived
out of order, lost or corrupted when it receives the receiving end.
● The segments are not of the same size. Each segment can carry hundreds of
bytes.
● The figure given below shows how the segments are created from the bytes in the
buffers:
4. Full-Duplex Service

● TCP offers a full-duplex service where the data can flow in both directions
simultaneously.
● Each TCP will then have a sending buffer and receiving buffer. The TCP segments
are sent in both directions.

5. Connection-Oriented Service

● We are already aware that the TCP is a connection-oriented protocol. When a


process wants to communicate (send and receive) with another process (process
-2), the sequence of operations is as follows:
○ TCP of process-1 informs TCP of process-2 and gets its approval.
○ TCP of process-1 tells TCP of process-2 to exchange data in both directions.
○ After completing the data exchange, when buffers on both sides are empty,
the two TCPs destroy their buffers
● The type of connection in TCP is not physical, but it is virtual. The TCP segment
encapsulated in an IP datagram can be sent out of order. These segments can get
lost or corrupted and may have to be resend. Each segment may take a different
path to reach the destination.

6. Reliable Service

● TCP is a reliable protocol as it follows the flow and error control mechanism. It
also supports the acknowledgment mechanism, which checks the state and sound
arrival of the data.
● In the acknowledgment mechanism, the receiver sends either positive or negative
acknowledgment to the sender so that the sender can get to know whether the
data packet has been received or needs to resend.

Features of TCP

● TCP is a reliable protocol. That is, the receiver always sends either positive or
negative acknowledgement about the data packet to the sender, so that the
sender always has a bright clue about whether the data packet has reached the
destination or it needs to resend it.
● TCP ensures that the data reaches the intended destination in the same order it
was sent.
● TCP is connection oriented. TCP requires that connection between two remote
points be established before sending actual data.
● TCP provides error-checking and recovery mechanisms.
● TCP provides end-to-end communication.
● TCP provides flow control and quality of service.
● TCP operates in Client/Server point-to-point mode.
● TCP provides a full duplex server, i.e. it can perform roles of both receiver and
sender.

TCP Header Format

○ Source port: It defines the port of the application, which is sending the data. So,
this field contains the source port address, which is 16 bits.
○ Destination port: It defines the port of the application on the receiving side. So,
this field contains the destination port address, which is 16 bits.
○ Sequence number: This field contains the sequence number of data bytes in a
particular session.
○ Acknowledgement number: When the ACK flag is set, then this contains the next
sequence number of the data byte and works as an acknowledgment for the
previous data received. For example, if the receiver receives the segment number
'x', then it responds 'x+1' as an acknowledgment number.
○ HLEN: It specifies the length of the header indicated by the 4-byte words in the
header. The size of the header lies between 20 and 60 bytes. Therefore, the value
of this field would lie between 5 and 15.
○ Reserved: It is a 4-bit field reserved for future use, and by default, all are set to
zero.
○ Flags
There are six control bits or flags:
1. URG: It represents an urgent pointer. If it is set, then the data is
processed urgently.
2. ACK: If the ACK is set to 0, then it means that the data packet does not
contain an acknowledgment.
3. PSH: If this field is set, then it requests the receiving device to push the
data to the receiving application without buffering it.
4. RST: If it is set, then it requests to restart a connection.
5. SYN: It is used to establish a connection between the hosts.
6. FIN: It is used to release a connection, and no further data exchange will
happen.
​ Window size
It is a 16-bit field. It contains the size of data that the receiver can accept. This
field is used for the flow control between the sender and receiver and also
determines the amount of buffer allocated by the receiver for a segment. The
value of this field is determined by the receiver.
​ Checksum
It is a 16-bit field. This field is optional in UDP, but in the case of TCP/IP, this
field is mandatory.
​ Urgent pointer
It is a pointer that points to the urgent data byte if the URG flag is set to 1. It
defines a value that will be added to the sequence number to get the sequence
number of the last urgent byte.
​ Options
It provides additional options. The optional field is represented in 32-bits. If this
field contains the data less than 32-bit, then padding is required to obtain the
remaining bits.
COMPARISON OF TCP VS UDP

Key UDP TCP

Full form It stands for User Datagram It stands for Transmission Control
Protocol. Protocol.

Design UDP is a connectionless protocol. TCP is a connection-oriented protocol.

UDP, on the other hand, provides only TCP is more reliable as it provides
basic error checking support using error checking support and also
Reliability checksum. So, the delivery of data to guarantees delivery of data to the
the destination cannot be guaranteed destination router.
in UDP as in case of TCP.

There is no sequencing of data in UDP In TCP, the data is transmitted in a


Data in order to implement ordering it has particular sequence which means that
transmission to be managed by the application packets arrive in-order at the receiver.
layer.

UDP is faster and more efficient than TCP is slower and less efficient in
TCP. performance as compared to UDP. Also
Performance
TCP is heavy-weight as compared to
UDP.

Retransmission of packets is not Retransmission of data packets is


Retransmissi
possible in UDP. possible in TCP in case packet get lost
on
or need to resend.

In UDP, there is no data sequencing. The Transmission Control Protocol has


The application layer must control the a function that allows data to be
Sequencing order if it is necessary. sequenced (TCP). This implies that
packets arrive at the recipient in the
sequence they were sent.

UDP has a fixed-length header of 8 TCP uses a variable-length (20-60)


Header size
bytes. bytes header.

It's a connectionless protocol, which Handshakes such as SYN, ACK, and


Handshake
means it doesn't require a handshake. SYNACK are used.

Broadcasting Broadcasting is supported by UDP. Broadcasting is not supported by TCP.


DNS, DHCP, TFTP, SNMP, RIP, and HTTP, HTTPs, FTP, SMTP, and Telnet
Examples
VoIP use UDP. use TCP.

Overhead Very low. Low but higher than UDP.

This protocol is used in situations


This protocol is primarily utilized in
where quick communication is
situations when a safe and
necessary but where dependability is
Applications trustworthy communication procedure
not a concern, such as VoIP, game
is necessary, such as in email, on the
streaming, video, and music
web surfing, and in military services.
streaming, etc.
APPLICATION LAYER

Introduction :
● Application Layer of the internet model i.e TCP/IP model . This is the layer where
all the intersecting applications are found. The application layer allows people to
use the internet.
● The layers below the application layer provide reliable transport but they don’t do
any real work for the users.

Functions of Application layer :

1) Client server paradigm :


The application layer programs are based upon the concept of clients and servers.
2) Addressing:
For communication between client and server , addressing is needed. When a client
requests a service from the server , it has to include the server's address as the
destination address and its own address as source address. When the server
responds, it reverses the addresses.DNS is used for addressing .
3) Applications:
Some of the important applications are as:
i. Electronic mail
ii. www
iii. remote file transfer and access
iv. Multimedia etc.

World Wide Web


The World Wide Web or Web is basically a collection of information that is linked
together from points all over the world. It is also abbreviated as WWW.

● World wide web provides flexibility, portability, and user-friendly features.


● It mainly consists of a worldwide collection of electronic documents (i.e, Web
Pages).
● It is basically a way of exchanging information between computers on the
Internet.
● The WWW is mainly the network of pages consisting of images, text, and sounds
on the Internet which can be simply viewed on the browser by using the browser
software.
● It was invented by Tim Berners-Lee.
Components of WWW

The Components of WWW mainly falls into two categories:

1. Structural Components
2. Semantic Components

Architecture of WWW

The WWW is mainly a distributed client/server service where a client using the browser
can access the service using a server. The Service that is provided is distributed over
many different locations commonly known as sites/websites.
● Each website holds one or more documents that are generally referred to as web
pages.
● Where each web page contains a link to other pages on the same site or at other
sites.
● These pages can be retrieved and viewed by using browsers.
In the above case, the client sends some information that belongs to site A. It generally
sends a request through its browser (It is a program that is used to fetch the
documents on the web).

Also the request generally contains other information like the address of the site, web
page(URL).

The server at site A finds the document then sends it to the client. after that when the
user or say the client finds the reference to another document that includes the web
page at site B.

The reference generally contains the URL of site B. And the client is interested to take
a look at this document too. Then after the client sends the request to the new site and
then the new page is retrieved.

DNS (Domain Name System)

● An application layer protocol defines how the application processes running on


different systems pass the messages to each other.
● DNS stands for Domain Name System.
● DNS is a directory service that provides a mapping between the name of a host on
the network and its numerical address.
● DNS is required for the functioning of the internet
● Each node in a tree has a domain name, and a full domain name is a sequence of
symbols specified by dots.
● DNS is a service that translates the domain name into IP addresses. This allows
the users of networks to utilize user-friendly names when looking for other hosts
instead of remembering the IP addresses.
● For example, suppose the FTP site at EduSoft had an IP address of
132.147.165.50, most people would reach this site by specifying ftp.EduSoft.com.
Therefore, the domain name is more reliable than the IP address.
DNS is a TCP/IP protocol used on different platforms. The domain name space
is divided into three different sections: generic domains, country domains, and
inverse domain

Generic Domains
● It defines the registered hosts according to their generic behavior.
● Each node in a tree defines the domain name, which is an index to the DNS
database.
● It uses three-character labels, and these labels describe the organization type.

Country Domain
The format of country domain is the same as a generic domain, but it uses two-
character country abbreviations (e.g., us for the United States) in place of three
character organizational abbreviations.

Inverse Domain
The inverse domain is used for mapping an address to a name. When the server has
received a request from the client, and the server contains the files of only authorized
clients. To determine whether the client is on the authorized list or not, it sends a query
to the DNS server and asks for mapping an address to the Name.

Working of DNS
● DNS is a client/server network communication protocol. DNS clients send requests
to the. server while DNS servers send responses to the client.
● Client requests contain a name which is converted into an IP address known as a
forward DNS lookups while requests containing an IP address which is converted
into a name known as reverse DNS lookups

HTTP (HyperText Transfer Protocol.)

● HTTP stands for HyperText Transfer Protocol.


● It is a protocol used to access the data on the World Wide Web (www).
● The HTTP protocol can be used to transfer the data in the form of plain text,
hypertext, audio, video, and so on.
● This protocol is known as HyperText Transfer Protocol because of its efficiency
that allows us to use it in a hypertext environment where there are rapid jumps
from one document to another document.
● HTTP is similar to the FTP as it also transfers the files from one host to another
host. But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no
control connection to transfer the files.
● HTTP is used to carry the data in the form of MIME-like format.
● HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to
the server and from server to the client. SMTP messages are stored and
forwarded while HTTP messages are delivered immediately.

HTTP Transaction:

The above figure shows the HTTP transaction between client and server. The client
initiates a transaction by sending a request message to the server. The server replies to
the request message by sending a response message.

HTTP messages are of two types:


1. Request Message: The request message is sent by the client that consists of a
request line, headers, and sometimes a body.
2. Response Message: The response message is sent by the server to the client
that consists of a status line, headers, and sometimes a body.

Uniform Resource Locator (URL):


● A client that wants to access the document on the internet needs an address and
to facilitate the access of documents, the HTTP uses the concept of Uniform
Resource Locator (URL).
● The Uniform Resource Locator (URL) is a standard way of specifying any kind of
information on the internet.
● The URL defines four parts: method, host computer, port, and path.
1. Method: The method is the protocol used to retrieve the document from a server.
For example, HTTP.
2. Host: The host is the computer where the information is stored, and the computer
is given an alias name. Web pages are mainly stored in the computers and the
computers are given an alias name that begins with the characters "www". This
field is not mandatory.
3. Port: The URL can also contain the port number of the server, but it's an optional
field. If the port number is included, then it must come between the host and path
and it should be separated from the host by a colon.
4. Path: Path is the pathname of the file where the information is stored. The path
itself contain slashes that separate the directories from the subdirectories and
files.

Question Bank:

1. Write a short note on UDP.(8/10 Marks)


a. Header Format
b. Features(4)
c. Application(4-5)
2. Compare TCP vs UDP (6/8 Marks)
3. Write a short note on TCP. (8/10 Marks).
a. Definition/Description(2)
b. Services provided by TCP(4)
c. Features of TCP(4)
4. What is a domain name system? Explain its types.(6 Marks)
5. Define URL. What are its parts? (6 Marks)

You might also like