Part 8: eBPF Datapath Internals Quiz
Cilium 1.20.2 · 2026-10-15
In Cilium 1.20, which attach mechanism is used for per-device programs when the kernel supports it, and what happens otherwise?
- A) Legacy
clsactfilters always; tcx is only used with netkit - B) tcx
bpf_link(kernel 6.6 or newer); otherwiseclsact+cls_bpfdirect-action - C) XDP on every veth; otherwise the agent refuses to start
- D) cgroup hooks on every interface; otherwise iptables
Show Answer
Answer: B) tcx
bpf_link(kernel 6.6 or newer); otherwiseclsact+cls_bpfdirect-actionbpf.enableTCXdefaults to true. The link is pinned under/sys/fs/bpf/cilium/...and updated atomically on reload. The agent only fails when neither tc-bpf nor tcx works.- A) Legacy
Same-node pod-to-pod traffic uses BPF host routing and
bpf_redirect_peer. Where is the destination pod's ingress policy enforced?- A) In the sender's
bpf_lxcprogram, which tail-callscilium_call_policy[destination endpoint ID] - B) In the destination veth's tc egress hook, using the policy map pinned for the sender endpoint
- C) In an iptables chain in the destination netns, installed by the agent for each endpoint
- D) In the XDP program on the node's NIC, before the packet reaches any veth
Show Answer
Answer: A) In the sender's
bpf_lxcprogram, which tail-callscilium_call_policy[destination endpoint ID]redirect_peerskips the destination's tc egress hook, so the destination'scil_lxc_policyis stored in a global prog array and called by the sender. An empty slot producesDROP_EP_NOT_READY.- A) In the sender's
What are the type and key structure of the per-endpoint policy map
cilium_policy_v3_<id>?- A) HASH keyed by the remote Pod IP address and destination port
- B) ARRAY indexed by port number, with one slot per protocol
- C) PROG_ARRAY indexed by policy rule number, tail-calling one program per rule
- D) LPM_TRIE keyed by identity, direction, protocol and a port prefix
Show Answer
Answer: D) LPM_TRIE keyed by identity, direction, protocol and a port prefix
The key has
sec_label, anegressbit,protocolanddport. The port prefix lets a port range be stored as a few entries, and asec_labelof 0 acts as an L3 wildcard.A tutorial tells you to inspect
cilium_tunnel_mapto find the remote node for an overlay destination in Cilium 1.20. What is correct?- A) Use
cilium-dbg bpf tunnel listto dump the node-to-endpoint table - B) The map exists but is only populated when IPsec or WireGuard encryption is enabled
- C) The map no longer exists; the tunnel endpoint is a field in the
cilium_ipcache_v2value - D) The map is now per-endpoint, named
cilium_tunnel_map_<id>, with one entry per node
Show Answer
Answer: C) The map no longer exists; the tunnel endpoint is a field in the
cilium_ipcache_v2valueNo 1.20 BPF code references
cilium_tunnel_map.cilium_ipcache_v2(LPM_TRIE) returnssec_identityandtunnel_endpointwithflag_has_tunnel_ep. Usecilium-dbg bpf ipcache list.- A) Use
What is the default of
--bpf-map-dynamic-size-ratioin 1.20.2, and which maps does it size?- A) 0.0025 of RAM; CT, NAT, NodePort neighbor and socket reverse-NAT maps
- B) 0 (disabled); only the policy maps, sized by
--bpf-policy-map-max - C) 0.25 of RAM; every BPF map including LB maps and the ipcache
- D) 0.0025 of RAM; only the ipcache and the policy maps
Show Answer
Answer: A) 0.0025 of RAM; CT, NAT, NodePort neighbor and socket reverse-NAT maps
Dynamic sizing is on by default. Setting a size flag such as
--bpf-ct-global-tcp-maxdisables dynamic sizing for that map only. LB maps use--bpf-lb-map-maxinstead.What does
--bpf-lb-map-max(default 65536) control?- A) Only the
cilium_lb4_services_v2map, leaving backends and rev-NAT at their own defaults - B) The number of backends per Service, rejecting additional endpoints once exceeded
- C) The Maglev lookup table size, which must be a prime number from a fixed list
- D) The fallback size for six per-LB-map flags (services, backends, rev-NAT, affinity, source-range, Maglev)
Show Answer
Answer: D) The fallback size for six per-LB-map flags (services, backends, rev-NAT, affinity, source-range, Maglev)
Each of the six per-map flags defaults to 0, meaning "use
lb-map-max". The Maglev table size is a separate flag. Resizing recreates the maps and disrupts connections until they repopulate.- A) Only the
With socket-LB enabled, where is a ClusterIP translated, and how does the application still see the Service address on replies?
- A) At the veth by DNAT for every packet;
cilium_lb4_reverse_natrestores it on the reply path - B) At
connect()/sendmsg()by cgroup hooks;recvmsg/getpeernamehooks usecilium_lb4_reverse_skto restore it - C) By kube-proxy iptables DNAT in the host netns; conntrack restores the original address
- D) At the NIC by XDP before the stack sees the packet; the Hubble relay restores it
Show Answer
Answer: B) At
connect()/sendmsg()by cgroup hooks;recvmsg/getpeernamehooks usecilium_lb4_reverse_skto restore itNo DNAT happens on the wire, so
tcpdumpin the pod shows the backend IP. The per-packet path withcilium_lb4_reverse_natis used only when socket-LB is not applicable (for example host-namespace-only mode, L7 LB, SCTP).- A) At the veth by DNAT for every packet;
A packet arrives on
cilium_vxlanin overlay mode. How doescil_from_overlaylearn the source identity?- A) It reads the tunnel ID (VNI) with
bpf_skb_get_tunnel_key, which the sender set to its source identity - B) It looks up the outer source IP in
cilium_lxc, which maps node IPs to identities - C) It reads an HTTP header that the local Envoy proxy injected into the request
- D) It parses the identity from the source Pod name using the endpoint label cache
Show Answer
Answer: A) It reads the tunnel ID (VNI) with
bpf_skb_get_tunnel_key, which the sender set to its source identityAn identity of host in the tunnel ID is rejected with
DROP_INVALID_IDENTITY. In native routing there is no VNI, so the source identity comes fromcilium_ipcache_v2by source IP (or from marks with IPsec/WireGuard).- A) It reads the tunnel ID (VNI) with
An administrator edits a CiliumNetworkPolicy. What does the agent do to the datapath?
- A) Recompiles
bpf_lxc.cwith clang for each affected endpoint and reloads the program on its veth - B) Replaces the pinned tcx links on all devices so that the new policy takes effect atomically
- C) Updates entries in
cilium_policy_v3_<id>; it reloads programs only if the endpoint or node config hash changes - D) Restarts the Cilium agent Pod so that all endpoints regenerate their programs
Show Answer
Answer: C) Updates entries in
cilium_policy_v3_<id>; it reloads programs only if the endpoint or node config hash changesPolicy changes are map operations (
RegenerateWithoutDatapath). Template objects are cached per template-config hash, and per-endpoint values live in.rodata.config.- A) Recompiles
Which statement about the Hubble event pipeline in 1.20 is correct?
- A) BPF writes to a ring buffer that Hubble Relay reads directly from each node's BPF filesystem
- B) Events go to
cilium_events(perf array), then the agent monitor and a Hubble queue, into an in-memory ring (4095 flows) - C) Flows are persisted to disk by the agent and replayed to Hubble Relay after a restart
- D) L7 events are emitted by the
bpf_lxctail programs when the proxy redirect map matches
Show Answer
Answer: B) Events go to
cilium_events(perf array), then the agent monitor and a Hubble queue, into an in-memory ring (4095 flows)Losses can occur at the perf buffer (
perf_event_ring_buffer) or at the observer queue (observer_events_queue). L7 records come from Envoy and the DNS proxy as agent events, not from BPF.