diff --git a/content/articles/2025-05-03-containerlab-1.md b/content/articles/2025-05-03-containerlab-1.md index fa86d22..7bab914 100644 --- a/content/articles/2025-05-03-containerlab-1.md +++ b/content/articles/2025-05-03-containerlab-1.md @@ -248,10 +248,32 @@ eth1@if530577 UP 02:42:c0:00:02:02 02:42:c0:00:02:02 +00:07:03:979306: ip4-input + ICMP: 192.0.2.1 -> 192.0.2.2 + tos 0x00, ttl 64, length 84, checksum 0x5e92 dscp CS0 ecn NON_ECN + fragment id 0x5813, flags DONT_FRAGMENT + ICMP echo_request checksum 0xc16 id 21197 +00:07:03:979315: ip4-lookup + fib 0 dpo-idx 9 flow hash: 0x00000000 + ICMP: 192.0.2.1 -> 192.0.2.2 + tos 0x00, ttl 64, length 84, checksum 0x5e92 dscp CS0 ecn NON_ECN + fragment id 0x5813, flags DONT_FRAGMENT + ICMP echo_request checksum 0xc16 id 21197 +00:07:03:979322: ip4-receive + fib:0 adj:9 flow:0x00000000 + ICMP: 192.0.2.1 -> 192.0.2.2 + tos 0x00, ttl 64, length 84, checksum 0x5e92 dscp CS0 ecn NON_ECN + fragment id 0x5813, flags DONT_FRAGMENT + ICMP echo_request checksum 0xc16 id 21197 +00:07:03:979323: ip4-icmp-input + ICMP: 192.0.2.1 -> 192.0.2.2 + tos 0x00, ttl 64, length 84, checksum 0x5e92 dscp CS0 ecn NON_ECN + fragment id 0x5813, flags DONT_FRAGMENT + ICMP echo_request checksum 0xc16 id 21197 +00:07:03:979323: ip4-icmp-echo-request + ICMP: 192.0.2.1 -> 192.0.2.2 + tos 0x00, ttl 64, length 84, checksum 0x5e92 dscp CS0 ecn NON_ECN + fragment id 0x5813, flags DONT_FRAGMENT + ICMP echo_request checksum 0xc16 id 21197 +00:07:03:979326: ip4-load-balance + fib 0 dpo-idx 5 flow hash: 0x00000000 + ICMP: 192.0.2.2 -> 192.0.2.1 + tos 0x00, ttl 64, length 84, checksum 0x88e1 dscp CS0 ecn NON_ECN + fragment id 0x2dc4, flags DONT_FRAGMENT + ICMP echo_reply checksum 0x1416 id 21197 +00:07:03:979325: ip4-rewrite + tx_sw_if_index 1 dpo-idx 5 : ipv4 via 192.0.2.1 eth1: mtu:1500 next:3 flags:[] 0242099728c60242c00002020800 flow hash: 0x00000000 + 00000000: 0242099728c60242c00002020800450000542dc44000400188e1c0000202c000 + 00000020: 02010000141652cd00018143166800000000399d0900000000001011 +00:07:03:979326: eth1-output + eth1 flags 0x02180005 + IP4: 02:42:c0:00:02:02 -> 02:42:09:97:28:c6 + ICMP: 192.0.2.2 -> 192.0.2.1 + tos 0x00, ttl 64, length 84, checksum 0x88e1 dscp CS0 ecn NON_ECN + fragment id 0x2dc4, flags DONT_FRAGMENT + ICMP echo_reply checksum 0x1416 id 21197 +00:07:03:979327: eth1-tx + af_packet: hw_if_index 1 tx-queue 0 + tpacket3_hdr: + status 0x1 len 108 snaplen 108 mac 0 net 0 + sec 0x0 nsec 0x0 vlan 0 vlan_tpid 0 + vnet-hdr: + flags 0x00 gso_type 0x00 hdr_len 0 + gso_size 0 csum_start 0 csum_offset 0 + buffer 0xf97c4: + current data 0, length 98, buffer-pool 0, ref-count 1, trace handle 0x0 + local l2-hdr-offset 0 l3-hdr-offset 14 + IP4: 02:42:c0:00:02:02 -> 02:42:09:97:28:c6 + ICMP: 192.0.2.2 -> 192.0.2.1 + tos 0x00, ttl 64, length 84, checksum 0x88e1 dscp CS0 ecn NON_ECN + fragment id 0x2dc4, flags DONT_FRAGMENT + ICMP echo_reply checksum 0x1416 id 21197 +``` + +Well, that's a mouthfull, isn't it! Here, I get to show you VPP in action. After receiving the +packet on its `af-packet-input` node from 192.0.2.1 (Summer, who is pinging us) to 192.0.2.2 (the +VPP container), the packet traverses the dataplane graph. It goes through `ethernet-input`, then +`ip4-input`, which sees it's destined to an IPv4 address configured, so the packet is handed to +`ip4-receive`. That one sees that the IP protocol is ICMP, so it hands the packet to +`ip4-icmp-input` which notices that the packet is an ICMP echo request, so off to +`ip4-icmp-echo-request` our little packet goes. The ICMP plugin in VPP now answers by +`ip4-rewrite`'ing the packet, sending the return to 192.0.2.1 at MAC address `02:42:09:97:28:c6` +(this is Summer, the host doing the pinging!), after which the newly created ICMP echo-reply is +handed to `eth1-output` which marshalls it back into the kernel's AF_PACKET interface using +`eth1-tx`. + +Boom. I could not be more pleased. + ## What's Next This was a nice exercise for me! I'm going this direction becaue the @@ -334,4 +455,10 @@ Once we have that, there's still quite some work for me to do. Notably: `vppcfg.yaml`, as well as some manual pre- and post-flight configuration for the more esoteric stuff. Building the plumbing for this is a TODO for now. -First order of business: get it to ping at all :) +## Acknowledgements + +I wanted to give a shout-out to Nardus le Roux who inspired me to contribute this Containerlab VPP +node type, and to Roman Dodin for his help getting the Containerlab parts squared away when I got a +little bit stuck. + +First order of business: get it to ping at all ... it'll go faster from there on out :)