The vxlan interface encapsulates the Ethernet frame by prepending IP/UDP and vxlan headers. For statistics, only the payload, i.e. the encapsulated (inner) frame should be counted.
Details
Details
Setup two vxlan boxes (should test both tunnel over IPv4 and IPv6), verify the cumulative statistics for output while ping
One session ping:
root@:~ # ping -s 100 -c 4 10.10.20.0 PING 10.10.20.0 (10.10.20.0): 100 data bytes 108 bytes from 10.10.20.0: icmp_seq=0 ttl=64 time=0.922 ms 108 bytes from 10.10.20.0: icmp_seq=1 ttl=64 time=1.368 ms 108 bytes from 10.10.20.0: icmp_seq=2 ttl=64 time=1.299 ms 108 bytes from 10.10.20.0: icmp_seq=3 ttl=64 time=1.499 ms --- 10.10.20.0 ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.922/1.272/1.499/0.214 ms
while another netstat:
root@:~ # netstat -w1 -I vxlan0 input vxlan0 output packets errs idrops bytes packets errs bytes colls 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 142 1 0 142 0 0 0 0 142 1 0 142 0 0 0 0 142 1 0 142 0 0 0 0 142 1 0 142 0 0 0 0 0 0 0 0 0
The output bytes per ICMP request packet should be ethernet(14) + IP(20) + ICMP(8) + payload(100) = 142
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
The IPv4/IPv6 over IPv6 vxlan looks good after test.
- Rebase
- Update as @bryanv suggested.
sys/net/if_vxlan.c | ||
---|---|---|
2638–2639 |
ip6_output() will set payload length (ip6_plen) correctly. 558 plen = m->m_pkthdr.len - sizeof(*ip6); 559 560 /* If this is a jumbo payload, insert a jumbo payload option. */ 561 if (plen > IPV6_MAXPACKET) { 562 if (!hdrsplit) { 563 if ((error = ip6_splithdr(m, &exthdrs)) != 0) { 564 m = NULL; 565 goto freehdrs; 566 } 567 m = exthdrs.ip6e_ip6; 568 ip6 = mtod(m, struct ip6_hdr *); 569 hdrsplit = true; 570 } 571 if ((error = ip6_insert_jumboopt(&exthdrs, plen)) != 0) 572 goto freehdrs; 573 ip6->ip6_plen = 0; 574 } else 575 ip6->ip6_plen = htons(plen); |