⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad_hoc.txt

📁 283个中文RFC文档
💻 TXT
📖 第 1 页 / 共 5 页
字号:
- it receives an AODV message with new information about the
sequence number for a destination node, or

- the path towards the destination node expires or breaks.

6.2. Route Table Entries and Precursor Lists

When a node receives an AODV control packet from a neighbor, or
creates or updates a route for a particular destination or subnet, it
checks its route table for an entry for the destination. In the
event that there is no corresponding entry for that destination, an
entry is created. The sequence number is either determined from the
information contained in the control packet, or else the valid
sequence number field is set to false. The route is only updated if
the new sequence number is either

(i) higher than the destination sequence number in the route
table, or

(ii) the sequence numbers are equal, but the hop count (of the
new information) plus one, is smaller than the existing hop
count in the routing table, or

(iii) the sequence number is unknown.

The Lifetime field of the routing table entry is either determined
from the control packet, or it is initialized to
ACTIVE_ROUTE_TIMEOUT. This route may now be used to send any queued
data packets and fulfills any outstanding route requests.

Each time a route is used to forward a data packet, its Active Route
Lifetime field of the source, destination and the next hop on the
path to the destination is updated to be no less than the current
time plus ACTIVE_ROUTE_TIMEOUT. Since the route between each
originator and destination pair is expected to be symmetric, the
Active Route Lifetime for the previous hop, along the reverse path
back to the IP source, is also updated to be no less than the current
time plus ACTIVE_ROUTE_TIMEOUT. The lifetime for an Active Route is
updated each time the route is used regardless of whether the
destination is a single node or a subnet.

For each valid route maintained by a node as a routing table entry,
the node also maintains a list of precursors that may be forwarding
packets on this route. These precursors will receive notifications
from the node in the event of detection of the loss of the next hop
link. The list of precursors in a routing table entry contains those
neighboring nodes to which a route reply was generated or forwarded.

6.3. Generating Route Requests

A node disseminates a RREQ when it determines that it needs a route
to a destination and does not have one available. This can happen if
the destination is previously unknown to the node, or if a previously
valid route to the destination expires or is marked as invalid. The
Destination Sequence Number field in the RREQ message is the last
known destination sequence number for this destination and is copied
from the Destination Sequence Number field in the routing table. If
no sequence number is known, the unknown sequence number flag MUST be
set. The Originator Sequence Number in the RREQ message is the
node's own sequence number, which is incremented prior to insertion
in a RREQ. The RREQ ID field is incremented by one from the last
RREQ ID used by the current node. Each node maintains only one RREQ
ID. The Hop Count field is set to zero.

Before broadcasting the RREQ, the originating node buffers the RREQ
ID and the Originator IP address (its own address) of the RREQ for
PATH_DISCOVERY_TIME. In this way, when the node receives the packet
again from its neighbors, it will not reprocess and re-forward the
packet.

An originating node often expects to have bidirectional
communications with a destination node. In such cases, it is not
sufficient for the originating node to have a route to the
destination node; the destination must also have a route back to the
originating node. In order for this to happen as efficiently as
possible, any generation of a RREP by an intermediate node (as in
section 6.6) for delivery to the originating node SHOULD be
accompanied by some action that notifies the destination about a
route back to the originating node. The originating node selects
this mode of operation in the intermediate nodes by setting the 'G'
flag. See section 6.6.3 for details about actions taken by the
intermediate node in response to a RREQ with the 'G' flag set.

A node SHOULD NOT originate more than RREQ_RATELIMIT RREQ messages
per second. After broadcasting a RREQ, a node waits for a RREP (or
other control message with current information regarding a route to
the appropriate destination). If a route is not received within
NET_TRAVERSAL_TIME milliseconds, the node MAY try again to discover a
route by broadcasting another RREQ, up to a maximum of RREQ_RETRIES

times at the maximum TTL value. Each new attempt MUST increment and
update the RREQ ID. For each attempt, the TTL field of the IP header
is set according to the mechanism specified in section 6.4, in order
to enable control over how far the RREQ is disseminated for the each
retry.

Data packets waiting for a route (i.e., waiting for a RREP after a
RREQ has been sent) SHOULD be buffered. The buffering SHOULD be
"first-in, first-out" (FIFO). If a route discovery has been
attempted RREQ_RETRIES times at the maximum TTL without receiving any
RREP, all data packets destined for the corresponding destination
SHOULD be dropped from the buffer and a Destination Unreachable
message SHOULD be delivered to the application.

To reduce congestion in a network, repeated attempts by a source node
at route discovery for a single destination MUST utilize a binary
exponential backoff. The first time a source node broadcasts a RREQ,
it waits NET_TRAVERSAL_TIME milliseconds for the reception of a RREP.
If a RREP is not received within that time, the source node sends a
new RREQ. When calculating the time to wait for the RREP after
sending the second RREQ, the source node MUST use a binary
exponential backoff. Hence, the waiting time for the RREP
corresponding to the second RREQ is 2 * NET_TRAVERSAL_TIME
milliseconds. If a RREP is not received within this time period,
another RREQ may be sent, up to RREQ_RETRIES additional attempts
after the first RREQ. For each additional attempt, the waiting time
for the RREP is multiplied by 2, so that the time conforms to a
binary exponential backoff.

6.4. Controlling Dissemination of Route Request Messages

To prevent unnecessary network-wide dissemination of RREQs, the
originating node SHOULD use an expanding ring search technique. In
an expanding ring search, the originating node initially uses a TTL =
TTL_START in the RREQ packet IP header and sets the timeout for
receiving a RREP to RING_TRAVERSAL_TIME milliseconds.
RING_TRAVERSAL_TIME is calculated as described in section 10. The
TTL_VALUE used in calculating RING_TRAVERSAL_TIME is set equal to the
value of the TTL field in the IP header. If the RREQ times out
without a corresponding RREP, the originator broadcasts the RREQ
again with the TTL incremented by TTL_INCREMENT. This continues
until the TTL set in the RREQ reaches TTL_THRESHOLD, beyond which a
TTL = NET_DIAMETER is used for each attempt. Each time, the timeout
for receiving a RREP is RING_TRAVERSAL_TIME. When it is desired to
have all retries traverse the entire ad hoc network, this can be
achieved by configuring TTL_START and TTL_INCREMENT both to be the
same value as NET_DIAMETER.

The Hop Count stored in an invalid routing table entry indicates the
last known hop count to that destination in the routing table. When
a new route to the same destination is required at a later time
(e.g., upon route loss), the TTL in the RREQ IP header is initially
set to the Hop Count plus TTL_INCREMENT. Thereafter, following each
timeout the TTL is incremented by TTL_INCREMENT until TTL =
TTL_THRESHOLD is reached. Beyond this TTL = NET_DIAMETER is used.
Once TTL = NET_DIAMETER, the timeout for waiting for the RREP is set
to NET_TRAVERSAL_TIME, as specified in section 6.3.

An expired routing table entry SHOULD NOT be expunged before
(current_time + DELETE_PERIOD) (see section 6.11). Otherwise, the
soft state corresponding to the route (e.g., last known hop count)
will be lost. Furthermore, a longer routing table entry expunge time
MAY be configured. Any routing table entry waiting for a RREP SHOULD
NOT be expunged before (current_time + 2 * NET_TRAVERSAL_TIME).

6.5. Processing and Forwarding Route Requests

When a node receives a RREQ, it first creates or updates a route to
the previous hop without a valid sequence number (see section 6.2)
then checks to determine whether it has received a RREQ with the same
Originator IP Address and RREQ ID within at least the last
PATH_DISCOVERY_TIME. If such a RREQ has been received, the node
silently discards the newly received RREQ. The rest of this
subsection describes actions taken for RREQs that are not discarded.

First, it first increments the hop count value in the RREQ by one, to
account for the new hop through the intermediate node. Then the node
searches for a reverse route to the Originator IP Address (see
section 6.2), using longest-prefix matching. If need be, the route
is created, or updated using the Originator Sequence Number from the
RREQ in its routing table. This reverse route will be needed if the
node receives a RREP back to the node that originated the RREQ
(identified by the Originator IP Address). When the reverse route is
created or updated, the following actions on the route are also
carried out:

1. the Originator Sequence Number from the RREQ is compared to the
corresponding destination sequence number in the route table entry
and copied if greater than the existing value there

2. the valid sequence number field is set to true;

3. the next hop in the routing table becomes the node from which the
RREQ was received (it is obtained from the source IP address in
the IP header and is often not equal to the Originator IP Address
field in the RREQ message);

4. the hop count is copied from the Hop Count in the RREQ message;

Whenever a RREQ message is received, the Lifetime of the reverse
route entry for the Originator IP address is set to be the maximum of
(ExistingLifetime, MinimalLifetime), where

MinimalLifetime = (current time + 2*NET_TRAVERSAL_TIME -
2*HopCount*NODE_TRAVERSAL_TIME).

The current node can use the reverse route to forward data packets in
the same way as for any other route in the routing table.

If a node does not generate a RREP (following the processing rules in
section 6.6), and if the incoming IP header has TTL larger than 1,
the node updates and broadcasts the RREQ to address 255.255.255.255
on each of its configured interfaces (see section 6.14). To update
the RREQ, the TTL or hop limit field in the outgoing IP header is
decreased by one, and the Hop Count field in the RREQ message is
incremented by one, to account for the new hop through the
intermediate node. Lastly, the Destination Sequence number for the
requested destination is set to the maximum of the corresponding
value received in the RREQ message, and the destination sequence
value currently maintained by the node for the requested destination.
However, the forwarding node MUST NOT modify its maintained value for
the destination sequence number, even if the value received in the
incoming RREQ is larger than the value currently maintained by the
forwarding node.

Otherwise, if a node does generate a RREP, then the node discards the
RREQ. Notice that, if intermediate nodes reply to every transmission
of RREQs for a particular destination, it might turn out that the
destination does not receive any of the discovery messages. In this
situation, the destination does not learn of a route to the
originating node from the RREQ messages. This could cause the
destination to initiate a route discovery (for example, if the
originator is attempting to establish a TCP session). In order that
the destination learn of routes to the originating node, the
originating node SHOULD set the "gratuitous RREP" ('G') flag in the
RREQ if for any reason the destination is likely to need a route to
the originating node. If, in response to a RREQ with the 'G' flag
set, an intermediate node returns a RREP, it MUST also unicast a
gratuitous RREP to the destination node (see section 6.6.3).

6.6. Generating Route Replies

A node generates a RREP if either:

(i) it is itself the destination, or

(ii) it has an active route to the destination, the destination
sequence number in the node's existing route table entry
for the destination is valid and greater than or equal to
the Destination Sequence Number of the RREQ (comparison
using signed 32-bit arithmetic), and the "destination only"
('D') flag is NOT set.

When generating a RREP message, a node copies the Destination IP
Address and the Originator Sequence Number from the RREQ message into
the corresponding fields in the RREP message. Processing is slightly
different, depending on whether the node is itself the requested
destination (see section 6.6.1), or instead if it is an intermediate
node with an fresh enough route to the destination (see section
6.6.2).

Once created, the RREP is unicast to the next hop toward the
originator of the RREQ, as indicated by the route table entry for
that originator. As the RREP is forwarded back towards the node
which originated the RREQ message, the Hop Count field is incremented
by one at each hop. Thus, when the RREP reaches the originator, the
Hop Count represents the distance, in hops, of the destination from
the originator.

6.6.1. Route Reply Generation by the Destination

If the generating node is the destination itself, it MUST increment
its own sequence number by one if the sequence number in the RREQ
packet is equal to that incremented value. Otherwise, the
destination does not change its sequence number before generating the
RREP message. The destination node places its (perhaps newly
incremented) sequence number into the Destination Sequence Number
field of the RREP, and enters the value zero in the Hop Count field
of the RREP.

The destination node copies the value MY_ROUTE_TIMEOUT (see section
10) into the Lifetime field of the RREP. Each node MAY reconfigure
its value for MY_ROUTE_TIMEOUT, within mild constraints (see section
10).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -