blog:linux:routing_decisions_in_the_linux_kernel_2_caching
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| blog:linux:routing_decisions_in_the_linux_kernel_2_caching [2023-12-14] – fix typos Andrej Stender | blog:linux:routing_decisions_in_the_linux_kernel_2_caching [2025-01-19] (current) – connected sockets in tx socket caching Andrej Stender | ||
|---|---|---|---|
| Line 77: | Line 77: | ||
| </ | </ | ||
| - | Now let's take a look at the local output path in kernel v3.5, illustrated in Figure {{ref> | + | Now let's take a look at the local output path in kernel v3.5, illustrated in Figure {{ref> |
| Like in the previous article, I again take function '' | Like in the previous article, I again take function '' | ||
| However, no matter whether the routing decision object had just been allocated or came from the routing cache, its attachment to the network packet is actually not handled as part of this whole routing lookup. That happens a few function call layers up in function '' | However, no matter whether the routing decision object had just been allocated or came from the routing cache, its attachment to the network packet is actually not handled as part of this whole routing lookup. That happens a few function call layers up in function '' | ||
| Line 276: | Line 276: | ||
| ===== Socked Caching (TX) ===== | ===== Socked Caching (TX) ===== | ||
| This caching feature is being used on the local output path; thus, only for sending locally | This caching feature is being used on the local output path; thus, only for sending locally | ||
| - | generated packets, not for received or forwarded packets. When a socket on the system | + | generated packets, not for received or forwarded packets. When a connected/ |
| - | (e.g. TCP or UDP socket, client or server) | + | socket on the system (e.g. TCP or UDP socket, client or server) |
| is sending data on the the network, then it is sufficient to only do a routing lookup | is sending data on the the network, then it is sufficient to only do a routing lookup | ||
| - | for the very first packet it sends. After all, the destination IP address | + | for the very first packet it sends. After all, the destination IP address |
| for all following packets it sends and so is the routing decision. Thus, the //routing | for all following packets it sends and so is the routing decision. Thus, the //routing | ||
| decision// object, once obtained from the initial lookup, is being cached within the | decision// object, once obtained from the initial lookup, is being cached within the | ||
| Line 367: | Line 367: | ||
| an existing socket on the system reaches // | an existing socket on the system reaches // | ||
| and this is done within OSI layer 4 handling, e.g. for TCP | and this is done within OSI layer 4 handling, e.g. for TCP | ||
| - | in function | + | in '' |
| - | on network namespace level to switch this feature on/off either globally | + | I described this feature here for IPv4. An equivalent implementation |
| - | for IPv4 within the network namespace or just for TCP and/or UDP (default: on). | + | exists on the IPv6 receive path. Sysctls are implemented on network |
| + | namespace level to switch this feature on/off either globally | ||
| + | and IPv6((Yes, despite their naming, the //sysctls// listed below represent the on/off switches | ||
| + | for //early demux// for both IPv4 and IPv6!)) | ||
| <code bash> | <code bash> | ||
| Line 440: | Line 443: | ||
| ===== Flowtables ===== | ===== Flowtables ===== | ||
| - | // | + | // |
| ===== Cache Invalidation ===== | ===== Cache Invalidation ===== | ||
| Line 554: | Line 557: | ||
| to my attention and of course I'll then fix my content asap accordingly. | to my attention and of course I'll then fix my content asap accordingly. | ||
| - | //published 2022-07-31//, | + | //published 2022-07-31//, |
blog/linux/routing_decisions_in_the_linux_kernel_2_caching.1702583719.txt.gz · Last modified: 2023-12-14 by Andrej Stender
