Hi John,

> VXLAN tunnel is usually associated with a BD (bridge domain) and always send 
> ethernet packets as payload. So ethernet header should exist on packets 
> received at the remote VXLAN tunnel end point. It is confusing why you stated 
> remote side OVS does not see any L2 header.
I guess it doesn't see it, because it's not there. The route is
configured as "ip route add table 1 0.0.0.0/0 via loop0", so there is
no rewrite data, and the buffer has been advanced past the ethernet
header before going to ip lookup, so when the VxLan is added, along
with it's L3 & L2, it's added where the encapsulated L2 would have
been.

> On VPP side, as packet with DIP of 10.0.0.x is sent from vrf 1 via BVI into 
> BD 13, an ARP request will be sent within BD 13 to request resolution for the 
> IP 10.0.0.x. Once MAC is resolved (say MAC-D), then the packets as sent in BD 
> 13 over VXLAN tunnel should have an Ethernet header with DMAC as MAC-D and 
> SMAC as that of the BVI MAC.
I don't see this ARP occurring. Rather the packet drops straight down
through the BVI into vxlan and gets sent out.
I've attached a trace, and the command listing I used to set up the
example (vpp-vxlan.sh sets up the namespaces, then vpp.txt sets up
vpp. ping 192.168.0.1 from netns ip4).

> The most common way to tunnel IP4 payload into straight ip4-lookup is to use 
> GRE tunnel. VXLAN is designed for L2 bridging, to send Ethernet packets to 
> remote hosts with BDs in the same VXLAN segment. Regarding using VXLAN tunnel 
> to send IP payload straight into ip4-lookup, you can look into VXLAN-GPE 
> tunnel where there is mechanism to specify the VXLAN payload type via a 
> protocol field in the VXLAN-GPE header to be ethernet, IP4, IP6, ... etc.
The thing is, I need the encapsulated L2 also, so VXLAN-GPE isn't what
I want. I have a working solution, by manually adding rewrite data to
the adjacency. It'd just be nice to have something a little more
symmetrical.

-Ivan
------------------- Start of thread 0 vpp_main -------------------
Packet 1

00:04:06:311966: af-packet-input
  af_packet: hw_if_index 1 next-index 1
    tpacket2_hdr:
      status 0x20000001 len 98 snaplen 98 mac 66 net 80
      sec 0x581b80b9 nsec 0x1bad9a53 vlan 0 vlan_tpid 0
00:04:06:311984: ethernet-input
  IP4: de:ad:be:ef:00:01 -> 02:fe:a9:ce:45:d4
00:04:06:312000: ip4-input
  ICMP: 40.0.0.1 -> 192.168.0.1
    tos 0x00, ttl 64, length 84, checksum 0xda4e
    fragment id 0x77b0, flags DONT_FRAGMENT
  ICMP echo_request checksum 0x15cf
00:04:06:312007: ip4-lookup
  fib 1 adj-idx 9 : loop0 flow hash: 0x00000000
  ICMP: 40.0.0.1 -> 192.168.0.1
    tos 0x00, ttl 64, length 84, checksum 0xda4e
    fragment id 0x77b0, flags DONT_FRAGMENT
  ICMP echo_request checksum 0x15cf
00:04:06:312019: ip4-rewrite-transit
  tx_sw_if_index 4 adj-idx 9 : loop0 flow hash: 0x00000000
  0x2800: 40:00:3f:01:db:4e -> 45:00:00:54:77:b0
00:04:06:312025: loop0-output
  loop0
  0x2800: 40:00:3f:01:db:4e -> 45:00:00:54:77:b0
00:04:06:312035: l2-input
  l2-input: sw_if_index 4 dst 45:00:00:54:77:b0 src 40:00:3f:01:db:4e
00:04:06:312040: l2-flood
  l2-flood: sw_if_index 4 dst 45:00:00:54:77:b0 src 40:00:3f:01:db:4e bd_index 1
00:04:06:312044: l2-output
  l2-output: sw_if_index 3 dst 45:00:00:54:77:b0 src 40:00:3f:01:db:4e
00:04:06:312048: vxlan-encap
  VXLAN-ENCAP: tunnel 0 vni 139
00:04:06:312054: ip4-lookup
  fib 0 adj-idx 10 : host-vxlandp
                     IP4: 02:fe:8b:88:a2:5f -> de:ad:be:ef:00:02 flow hash: 
0x00000000
  UDP: 169.254.0.1 -> 169.254.0.2
    tos 0x00, ttl 254, length 120, checksum 0x6875
    fragment id 0x0000
  UDP: 60992 -> 4789
    length 100, checksum 0x0000
00:04:06:312059: ip4-rewrite-transit
  tx_sw_if_index 2 adj-idx 10 : host-vxlandp
                                IP4: 02:fe:8b:88:a2:5f -> de:ad:be:ef:00:02 
flow hash: 0x00000000
  IP4: 02:fe:8b:88:a2:5f -> de:ad:be:ef:00:02
  UDP: 169.254.0.1 -> 169.254.0.2
    tos 0x00, ttl 253, length 120, checksum 0x6975
    fragment id 0x0000
  UDP: 60992 -> 4789
    length 100, checksum 0x0000
00:04:06:312061: host-vxlandp-output
  host-vxlandp
  IP4: 02:fe:8b:88:a2:5f -> de:ad:be:ef:00:02
  UDP: 169.254.0.1 -> 169.254.0.2
    tos 0x00, ttl 253, length 120, checksum 0x6975
    fragment id 0x0000
  UDP: 60992 -> 4789
    length 100, checksum 0x0000

Attachment: vpp-vxlan.sh
Description: Bourne shell script

create host-interface name ip4dp
set int state host-ip4dp up
set int ip table host-ip4dp 1
set int ip address host-ip4dp 20.0.0.2/24
ip route add table 1 40.0.0.0/24 via 20.0.0.1 host-ip4dp

create host-interface name vxlandp
set int state host-vxlandp up
set int ip address host-vxlandp 169.254.0.1/24

create vxlan tunnel src 169.254.0.1 dst 169.254.0.2 vni 139
loopback create mac de:ad:be:ef:00:05
set int state loop0 up
set int l2 bridge vxlan_tunnel0 13 1
set int l2 bridge loop0 13  bvi
set int ip table loop0 1
set int ip table vxlan_tunnel0 1
ip route add table 1 192.168.0.1/24 via loop0


_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to