Deep understanding of Linux Network Technology Insider reading notes---Routing

Source: Internet
Author: User

First, the main data structure of the middle of the Linux kernel

  1. struct Fib_result: Returns the structure after lookup of the routing table, its contents are not simple to contain the next hop information, and contains other features, such as Policy routing required more parameters.
  2. struct Fib_rule: Represents a rule that is routed by policy to select a routing table when routing traffic
  3. struct Fib_node: a route table entry. For example, this data structure is used to store information generated when a route is added by the route add or the IP route add command.
  4. struct Fn_zone: A zone representing a set of routes with the same subnet mask length
  5. struct fib_table: Represents a single route table
  6. struct Fib_info: There are parameters that can be shared between different routing table entries, stored in the Fib_info data structure, and when a new routing table entry uses parameters that match the parameters used by an already existing route table entry. The fib_info structure that already exists is reused. A reference technique used to track the number of times the structure is reused
  7. struct Fib_alias: routes that reach the same network, because other parameters differ, such as TOS, where different routes are distinguished by Fib_alias instances
  8. struct FIB_NH: Indicates the next hop
  9. struct Fn_hash: This structure contains pointers to 33 fn_zone linked headers, as well as a list of links. This list links the active zone (active zone, which is the zone with at least one element), and the elements in the list are arranged in descending order of the subnet mask length
  10. struct Fn_zone_list: non-empty fn_zone buckets are linked together, the head of the linked list is saved in Fn_zone_list
  11. struct Fib_info_hash: All fib_info structures are inserted into this hash table, using the Fib_find_info function to find the table
  12. struct Fib_info_laddrhash: The FIB_INFO structure is inserted into this table only if there is a preferred source address for the routing table entry. This hash table is primarily intended for easy removal of routes affected by the deletion of a locally configured IP address

Each individual subnet corresponds to a Fib_node instance, identified by the variable Fn_key, and its value represents that subnet. For example, for a subnet 10.1.1.0/24,fn_key of 10.1.1. The destination subnet shares the same fib_node with different routes (that is, the same fn_key). Each route has its own fib_alias structure. Each Fib_alias instance is associated with a fib_info structure that holds the actual routing information (that is, how to reach the destination).

Second, the routing table initialization

    1. The following two routing tables are always created at system startup, regardless of the kernel configuration options:
      1. Ip_fib_local_table: The kernel places the route of the local address in the table, including the route to the associated subnet network address and the subnet broadcast address. The routing table cannot be configured directly by the user.
      2. Ip_fib_main_table: All other routing table entries (including user-configured static routes, dynamic routes generated by the routing protocol) are placed within the table.

Deep understanding of Linux Network Technology Insider reading notes---Routing

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.