Routing algorithm

can be thought of an hierarchical routing strategy with table-driven optimizations applied where possible. The routing layer is said to start with the well-studied publicdomain algorithm Ad hoc On Demand Distance Vector (AODV) and Motorola’s Cluster-Tree algorithm. We summarize AODV and Cluster-Tree in Section ??.

5.1 AODV: Ad hoc On Demand Distance Vector

AODV is a pure on-demand route acquisition algorithm: nodes that do not lie on active paths neithermaintain any routing information nor participate in any periodic routing table exchanges. Further, anode does not have to discover and maintain a route to another node until the two need to communicate,unless the former node is offering services as an intermediate forwarding station to maintainconnectivity between two other nodes.
The primary objectives of the algorithm are to broadcast discovery packets only when necessary,to distinguish between local connectivity management and general topology maintenance and to disseminate information about changes in local connectivity to those neighboring mobile nodes that are likely to need the information. When a source node needs to communicate with another node for which it has no routing information in its table, the Path Discovery process is initiated. Every node maintains two separate counters: sequence number and broadcast id. The source node initiates path discovery by broadcasting a route request (RREQ) packet to its neighbors, which includes source addr, source sequence number, broadcast id, dest addr, dest sequence number, hop cnt. (Source sequence number is for maintaining freshness information about the reverse route whereas the destination sequence number is for maintaining freshness of the route to the destination before it can be accepted by the source.) The pair source addr, broadcast id uniquely identifies a RREQ, where broadcast id is incremented whenever the source issues a new RREQ.When an intermediate node receives a RREQ, if it has already received a RREQ with the same broadcast id and source address, it drops the redundant RREQ and does not rebroadcast it. Otherwise, it rebroadcasts it to its own neighbors after increasing hop cnt. Each node keeps the following information: destination IP address, source IP address, broadcast id, expiration time for reverse path route entry and source node’s sequence number. As the RREQ travels from a source to destinations, it automatically sets up the reverse path from all nodes back to the source. To set up a reverse path, a node records the address of the neighbor from which it received the first copy of RREQ. These reverse path route entries are maintained for at least enough time for the RREQ to traverse the network and produce a reply to the sender.


Figure 5.1: Reverse and forward path formation in AODV protocol.

When the RREQ arrives at a node, possibly the destination itself, that possesses a current route to the destination, the receiving node first checks that the RREQ was received over a bi-directional link. If this node is not destination but has route to the destination, it determines whether the route is current by comparing the destination sequence number in its own route entry to the destination sequence number in the RREQ. If RREQ’s sequence number for the destination is greater than that recorded by the intermediate node, the intermediate node must not use this route to respond to the RREQ, instead rebroadcasts the RREQ. If the route has a destination sequence number that is greater than that contained in the RREQ or equal to that contained in the RREQ but a smaller hop count, it can unicasts a route reply packet (RREP) back to its neighbor from which it received the RREQ. A RREP contains the following information: source addr, dest addr, dest sequence number, hop cnt and lifetime. As the RREP travels back to the source, each node along the path sets up a forward pointer to the node from which the RREP came, updates its timeout information for route entries to the source and destination, and records the latest destination sequence number for the requested destination. Nodes that are along the path determined by the RREP will timeout after route request expiration timer and will delete the reverse pointers since they are not on the path from source to destination as shown in Figure 5.1. The value of this timeout time depends on the size of the ad hoc network. Also, there is the routing caching timeout that is associated with each routing entry to show the time after which the route is considered to be invalid. Each time a route entry is used to transmit data from a source toward a destination, the timeout for the entry is reset to the current time plus active-route-timeout. The source node can begin data transmission as soon as the first RREP is received, and can later update its routing informa ion if it learns of a better route. Each routing table entry includes the following fields: destination, next hop, number of hops (metric), sequence number for the destination, active neighbors for this route, expiration time for the route table entry. For path maintenance, each node keeps the address of active neighborsthrough which packets for the given destination are received is maintained. This neighbor is considered active if it originates or relays at least one packet for that destination within the last active-timeout period. Once the next hop on the path from source to the destination becomes unreachable (hello messages are not received for a certain time, hello messages also ensures that only nodes with bidirectional connectivity are considered to be neighbors, therefore each hello message included the nodes from which the node has heard), the node upstream of the break propagates an unsolicited RREP with a fresh sequence number and hop count of 1to all active upstream nodes. This process continues until all active source nodes are notified. Upon receiving the notification of a broken link, the source nodes can restart the discovery process if they still require a route to the destination. If it decides that it would like to rebuild the route to the destination, it sends out an RREQ with a destination sequence number of one greater than the previously known sequence number, to ensure that it builds a new, viable route and that no nodes reply if they still regard the previous route as valid.

5.2 Cluster-Tree Algorithm

The cluster-tree protocol is a protocol of the logical link and network layers that uses link-state packets to form either a single cluster network or a potentially larger cluster tree network. The network is basically self-organized and supports network redundancy to attain a degree of fault resistance and self-repair. Nodes select a cluster head and form a cluster according to the self-organized manner. Then self-developed clusters connect to each other using the Designated Device (DD).

5.2.1 Single Cluster Network

The cluster formation process begins with cluster head selection. After a cluster head is selected , the cluster head expands links with other member nodes to form a cluster. After a node turns on, it scans the channels to search for a HELLO message form other nodes (HELLO messages correspond to beacons in MAC layer of IEEE 802.15.4). If it can’t get any HELLO messages for a certain time, then it turns to a cluster head as shown in Figure 5.2 and sends out HELLO messages to its neighbors. The new cluster head wait for responses from neighbors for a while. If it hasn’t received any connection requests, it turns back to a regular node and listens again. The cluster head can also be selected based on stored parameters of each node, like transmission
range, power capacity, computing ability or location information. After becoming the cluster head (CH), the node broadcasts a periodic HELLO message that contains a part of the cluster head MAC address and node ID 0 that indicates the cluster head. The nodes that receive this message send a CONNECTION REQUEST message to the cluster head. When the CH receives it, it responds to the node with a CONNECTION RESPONSE message that contains a node ID for the node (node ID corresponds to the short address at the MAC layer). The node that is assigned a node ID replies with an ACK message to the cluster head. The message exchange is shown in Figure 5.3. If all nodes are located in the range of the cluster head, the topology of connection becomes a star and every member nodes are connected to the cluster head with one hop. A cluster can expand into a multi-hop structure when each node supports multiple connections. The message exchange for the multihop cluster set up procedure is shown in Figure 5.4. If the cluster head has run out of all node IDs or the cluster has reached some other defined limit, it should reject connection requests from new nodes. The rejection is through the assignment of a special ID to the node. The entry of the neighbor list and the routes is updated by the periodic HELLO message. If a node entry does not update until a certain timeout limit, it should be eliminated.

Figure 5.2: Cluster head selection process.

A node may receive a HELLO message from a node that belongs to different cluster. In that case, the node adds the cluster ID (CID) of the transmitting node in the neighbor list and then sends it inside a LINK STATE REPORT to the CH so that CH knows which clusters its cluster hasintersection. The LINK STATE REPORT message also contain the neighbors node ID list of the node so that the CH knows the complete topology to make topology optimizations. If the topology change is required, then the CH sends a TOPOLOGY UPDATE message. If a member receives a TOPOLOGY UPDATE message that the different parent node is linked to the node, it changes the parent node as indicated in the message. And it also records its child nodes and the nodes below it in the tree at this time. If a member node has trouble and becomes unable to communicate, the tree route of the cluster would be reconfigured. The CH know the presence of a trouble by the periodic LINK STATE REPORT.When the cluster head has trouble, the distribution of HELLO message is stopped and all member nodes know that they have lost the CH. The cluster would then be reconfigured in the same way as the cluster formation process.

5.2.2 Multi-Cluster Network
To form a network, a Designated Device (DD) is needed. The DD has responsibility to assign a unique cluster ID to each cluster head. This cluster ID combined with the node ID that the CH assigns to each node within a cluster forms a logical address and is used to route packets. Another role of the DD is to calculate the shortest route from the cluster to the DD and inform it to all nodes within the network. When the DD joins the network, it acts as the CH of cluster 0 and starts to send HELLO message to the neighborhood. If a CH has received this message, it sends a CONNECTION REQUEST message and joins the cluster 0. After that, the CH requests a CID to the DD. In this case, the CH is
Figure 5.3: Link setup between CH and member node.

a border node that has two logical addresses. One is for a member of the cluster 0 and the other is for a CH. When the CH gets a new CID, it informs its member nodes by the HELLO message. If a member has received the HELLO message from the DD, it adds CID 0 in its neighbor list and reports to its CH. The reported CH selects the member node as a border node to its parent cluster and sends a NETWORK CONNECTION REQUEST message to the member node to set up a connection with the DD. The border node requests a connection and joins the cluster 0 as its member node. Then it sends a CID REQUEST message to the DD. After the CID RESPONSE message arrival, the border node sends NETWORK CONNECTION RESPONSE message that contains a new CID to the CH.When the CH gets a new CID, it informs to its member nodes by the HELLO message.
The clusters not bordering cluster 0 use intermediate clusters to get a CID. Again, either the CH becomes the border node to its parent cluster or the CH names a member node as the border to its parent cluster. These processes are shown in Figures 5.5,5.6,5.7,5.8. Each member node of the cluster has to record its parent cluster, child/lower clusters and the border node IDs associated with both the parent and child clusters. The DD should store the whole tree structure of the clusters. Like the nodes in the clusters, the CHs report their link state information to the DD. The CH periodically sends a NETWORK LINK STATE REPORT message that contains its neighbor cluster CID list to the DD. Then this information can be used to calculate the optimized route and periodically update the topology for the network redundancy. In the same way, the DD can send TOPOLOGY UPDATE message to inform up-to-date route from the DD to the clusters. A backup DD (BDD) can be prepared to prevent network down time due to the DD trouble. Inter-cluster communication, which is shown in Figure 5.9, is realized by routing. The border nodes act as routers that connect clusters and relay packets between the clusters. When a border node receives a packet, it examines the destination address, then forwards to the next border node in the adjacent cluster or to the destination node within the cluster. Only the DD can send a message to all the nodes within its network. The message is forwarded along the tree route of clusters. The border node should forward the broadcast packet from the