Skip to content

Instantly share code, notes, and snippets.

@leblancd
Created April 14, 2017 19:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leblancd/e550d41cad5a1c0ecb81837dfbc93cc5 to your computer and use it in GitHub Desktop.
Save leblancd/e550d41cad5a1c0ecb81837dfbc93cc5 to your computer and use it in GitHub Desktop.
IPv6 Neighbor Discovery cache resiliency to IPv6 unicast addresses getting recycled
Here is a trace showing that the IPv6 Neighbor Discovery process is resilient to IPv6 unicast addresses being recycled,
because of the use of the "override" flag ("ovr", or "o-bit") in IPv6 Neighbor Advertisements.
In the tshark trace below, a kubernetes pod with IPv6 address 2001:101::2 is trying to ping a pod at 2001:101::3.
However, the previous pod that had been assigned the address 2001:101::3 has just been deleted, and a new pod was brought
up using the same address. After several seconds of ping failure (trying to ping the now-deleted pod), the ping requestor
sends a Neighbor Solicitation for 2001:101::3. The new pod with the this address then responds with a Neighbor Advertisement
with the "ovr" (override) flag set (line 15 in the tshark output) indicating that any Neighbor Discovery cache entries for
this address should be overwritten with the new pods link layer address.
[kube@kube-minion-1 ~]$ sudo tshark -i cbr0
Running as user "root" and group "root". This could be dangerous.
Capturing on 'cbr0'
1 0.000000000 fe80::858:aff:fef4:6504 -> ff02::2 ICMPv6 70 Router Solicitation from 0a:58:0a:f4:65:04
2 4.010852825 fe80::858:aff:fef4:6504 -> ff02::2 ICMPv6 70 Router Solicitation from 0a:58:0a:f4:65:04
3 4.668160112 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=0, hop limit=0
4 5.670822295 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=1, hop limit=0
5 6.672024902 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=2, hop limit=0
6 7.679757238 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=3, hop limit=0
7 8.691255786 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=4, hop limit=0
8 9.681352136 fe80::858:aff:fef4:6502 -> 2001:101::3 ICMPv6 86 Neighbor Solicitation for 2001:101::3 from 0a:58:0a:f4:65:02
9 9.692054034 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=5, hop limit=0
10 10.684291883 fe80::858:aff:fef4:6502 -> 2001:101::3 ICMPv6 86 Neighbor Solicitation for 2001:101::3 from 0a:58:0a:f4:65:02
11 10.694614463 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=6, hop limit=0
12 11.686498799 fe80::858:aff:fef4:6502 -> 2001:101::3 ICMPv6 86 Neighbor Solicitation for 2001:101::3 from 0a:58:0a:f4:65:02
13 11.706576175 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=7, hop limit=0
14 12.707311404 2001:101::2 -> ff02::1:ff00:3 ICMPv6 86 Neighbor Solicitation for 2001:101::3 from 0a:58:0a:f4:65:02
15 12.707390366 2001:101::3 -> 2001:101::2 ICMPv6 86 Neighbor Advertisement 2001:101::3 (sol, ovr) is at 0a:58:0a:f4:65:04
16 12.707407921 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=8, hop limit=0
17 12.707425503 2001:101::3 -> 2001:101::2 ICMPv6 118 Echo (ping) reply id=0x2b00, seq=8, hop limit=0 (request in 16)
18 13.708960301 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=9, hop limit=0
19 13.709022053 2001:101::3 -> 2001:101::2 ICMPv6 118 Echo (ping) reply id=0x2b00, seq=9, hop limit=0 (request in 18)
20 14.709391763 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=10, hop limit=0
21 14.709484582 2001:101::3 -> 2001:101::2 ICMPv6 118 Echo (ping) reply id=0x2b00, seq=10, hop limit=0 (request in 20)
22 15.730040594 2001:101::2 -> 2001:101::3 ICMPv6 118 Echo (ping) request id=0x2b00, seq=11, hop limit=0
23 15.730159938 2001:101::3 -> 2001:101::2 ICMPv6 118 Echo (ping) reply id=0x2b00, seq=11, hop limit=0 (request in 22)
^C 24 17.736764505 fe80::858:aff:fef4:6504 -> 2001:101::2 ICMPv6 86 Neighbor Solicitation for 2001:101::2 from 0a:58:0a:f4:65:04
25 17.736888045 2001:101::2 -> fe80::858:aff:fef4:6504 ICMPv6 78 Neighbor Advertisement 2001:101::2 (sol)
25 packets captured
[kube@kube-minion-1 ~]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment