Open In App

Difference between Token based and Non-Token based Algorithms in Distributed System

Improve
Improve
Like Article
Like
Save
Share
Report

A distributed system is a system in which components are situated in distinct places, these distinct places refer to networked computers which can easily communicate and coordinate their tasks by just exchanging asynchronous messages with each other. These components can communicate with each other to conquer one common goal as a task. There are many algorithms are used to achieve Mutual Exclusion ,where there are multiple processes(or sites) requesting access for a single shared resource(often called as Critical Section)  ,and these are broadly divided into 2 categories: Token-Based Algorithms and Non-Token Based Algorithms. Difference between Token based and Non-Token based Algorithms in Distributed System:

S.No. Token Based Algorithms Non-Token Based Algorithms
1. In the Token-based algorithm, a unique token is shared among all the sites in Distributed Computing Systems. In Non-Token based algorithm, there is no token even not any concept of sharing token for access.
2. Here, a site is allowed to enter the Critical Section if it possesses the token. Here, two or more successive rounds of messages are exchanged between sites to determine which site is to enter the Critical Section next.
3. The token-based algorithm uses the sequences to order the request for the Critical Section and to resolve the conflict for the simultaneous requests for the System. Non-Token based algorithm uses the timestamp (another concept) to order the request for the Critical Section and to resolve the conflict for the simultaneous requests for the System.
4. The token-based algorithm produces less message traffic as compared to Non-Token based Algorithm. Non-Token based Algorithm produces more message traffic as compared to the Token-based Algorithm.
5. They are free from deadlock (i.e. here there are no two or more processes are in the queue in order to wait for messages that will actually can’t come) because of the existence of unique token in the distributed system. They are not free from the deadlock problem as they are based on timestamp only.
6. Here, it is ensured that requests are executed exactly in the order as they are made in. Here there is no surety of execution order.
7. Token-based algorithms are more scalable as they can free your server from storing session state and also they contain all the necessary information which they need for authentication. Non-Token based algorithms are less scalable than the Token-based algorithms because server is not free from its tasks.
8. Here the access control is quite Fine-grained because here inside the token roles, permissions and resources can be easily specifying for the user. Here the access control is not so fine as there is no token which can specify roles, permission, and resources for the user.
9. Token-based algorithms make authentication quite easy. Non-Token based algorithms can’t make authentication easy.
10.

Examples of Token-Based Algorithms are:

(i) Singhal’s Heuristic Algorithm
(ii) Raymonds Tree Based Algorithm
(iii) Suzuki-Kasami Algorithm    

Examples of Non-Token Based Algorithms are:

(i) Lamport’s Algorithm
(ii) Ricart-Agarwala Algorithm
(iii) Maekawa’s Algorithm 

Last Updated : 21 Jun, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads