Several possible problems can result from the use of certain routing mechanisms in message-passing systems. These include deadlock, livelock, and starvation, which are as follows −
Deadlock − When two messages each hold the resources required by the other to move, both messages will be blocked. This is called a deadlock. It is a phenomenon that occurs whenever there exists a cyclic dependency on resources. Management of resources in a network is the responsibility of the flow control mechanism used. Resources must be allocated in a manner that avoids deadlock.
Livelock − Livelock describes a situation in which a message keeps going around the network and never reaches its destination. It is a phenomenon that results from using adaptive routing algorithms where messages are rerouted in the hope to find another path to their destinations.
When nodes need to communicate, they inject their messages into the network. A static injection model results when all nodes inject their messages at the same moment, with the network clear of messages.
This is to be compared to dynamic injection, according to which nodes can inject their messages at arbitrary times. Livelock can take place if dynamic injection is used. It cannot occur if the static injection is used. Several routing policies can be used to avoid livelock.
Starvation − A node is said to suffer from starvation if it has a message to inject into the network but is never allowed to do so. Starvation cannot arise if the static injection is used. Several routing policies can be used to avoid starvation taking place. The simplest among them is to allow each node to have its injection queue, where it stores the messages it wants to inject into the network.
This queue is considered in the same way as the queues of the incoming links to that node and it competes with them. As long as a fair queue management policy is used, this method prevents starvation from happening. The main disadvantage is that a node with a high message injection rate can slow down all the other nodes in the network.