Routing cache queue of the routing protocol (1)

Source: Internet
Author: User

The use of the routing protocol is often in some complex programs. So how can we understand the use of these protocols and the meaning of some code functions? Next we will discuss this issue. First of all, we will understand that in NS2.27, the routing protocol of the eighth-party routing service mainly includes the following components:

1. protocol entity

2. Route table

3. Timer

(1) broadcast Timer

(2) Periodic Hello message broadcast Timer

(3) timer for neighbor Management

(4) timer used for routing Cache

(5) timer for local repair

(6) cache broadcast ID Timer

4. Logger

5. Route cache queue

First, let's take a look at the basic process of the routing protocol from receiving a group 。

When the Protocol receives a group, that is, the recv (Packet *, Handler *) function is called, the function calls different processing functions according to the group type for processing 。

1. If it is a protocol group, the ttl value of the group is reduced by 1 and recvoscar (Packet *) is called *) function 。

(1) If a route request group is received, call the recvRequest (Packet *) function for processing 。

If the group is generated by or received by the node, It is discarded by the node and processed 。

Otherwise, the node caches the serial number of the group, adds the path sent by the Group to the reverse route, and forwards it to the corresponding group, the node determines based on the target address of the group and calls different functions for processing 。

If the node itself is the target node, call the sendReply (nsaddr_t, u_int32_t, nsaddr_t, u_int32_t, u_int32_t, double) function to respond, however, if you know the route to the target node, call the sendReply function to respond and insert it to the next hop node of the source and target in the source and target precursor lists. Otherwise, you cannot directly respond to the request, add 1 to the number of hops and call the forward (AODV_rt_entry *, Packet *, double) function to forward the packets 。

In the sendReply function, the node first finds the route that arrives at the target node (that is, the node that sends the route request group), creates and fills the group, and then calls Scheduler: instance (). schedule () function to send the group 。

(2) If a route Response Group is received, call the recvReply (Packet *) function for processing 。

The node first queries the route entry to the target node of the group. If no route entry exists, a route entry is added. Then, the node updates the route entry to the target node and sends the route entries to all relevant groups 。

If the node is the target node, update the route to find the delay and send all relevant groups. If the node is not the target node, but knows the route to the target node, add 1 to the number of hops, call the forward function to forward the group and modify the response precursor list. If the node is not the target node and does not know the route to the target node, the group is discarded 。

(3) If a route error group is received, the routing protocol of the eighth version calls the recvError (Packet *) function for processing 。


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.