General Tasks of the Neighboring Infrastructure
This section describes a few general concepts that you should be familiar with before delving into specific functions within the neighboring infrastructure: caching , reference counting, and timers.
Caching
The neighboring layer implements two kinds of caching:
- Neighbor mappings
As with any other kind of data that can be used multiple times, it makes sense to cache the results of the L3-to-L2 mappings. Negative results (where an attempt to resolve the address failed) are not cached. But the
neighbourstructures associated with failed mappings are set to theNUD_FAILEDstate so that the garbage collection timer can clean them up (see the section "Garbage Collection").- L2 headers
The neighboring infrastructure caches L2 headers to speed up the time required to encapsulate an L3 packet into an L2 frame. Otherwise, the infrastructure would have to initialize each field of the L2 header one by one.
Because the caching of neighbor mappings is central to the operation of the
neighboring subsystem , this section describes it in detail. (The later
section "L2 Header Caching" describes
L2 header caching.) The contents of a neighbour
structure are described in the section "neighbour Structure" in Chapter
29, and the structure's creation and deletion are described in later sections in
this chapter. Here we will stay at a higher level, describing how those structures are
organized and accessed by the neighboring infrastructure.
The neighboring infrastructure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access