Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-2008, 09:40 PM
tbroberg@hifn.com
 
Posts: n/a
Debugging bridge behavior

I have a bridge between two ports where a packet comes into one port
destined for the other, but never seems to reach the bridge.

I am trying to implement a VPN test network using VirtualBox hosting
various VMs on an x_64 Fedora 8 host running on a Xeon.

One VPN device is a bump-in-the-wire device configured with ethernet
packets physically connected to eth1 on the VM host system.

I have used the VirtualBox usility to create a vbox0 interface which
connects to the VM, and a bridge, br0 which connects eth1 and vbox0
together.

When I run the configuration utility in the VM (...or even on the VM
host), it sends a stimulus packet to the BITW VPN, and a response
comes back through eth1, but it does not pass back through the bridge.

tcpdump shows the following on eth1:
[root@cld-interop bin]# tcpdump -i eth1 -n
tcpdump: WARNING: eth1: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol
decode
l istening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
13:34:07.917327 00:80:52:00:ff:ff > 00:80:52:00:00:00, ethertype
Unknown (0x814f), length 64:
0x0000: 0000 0000 0002 0000 0000 0000 0000
0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 0000
0000 ................
0x0020: 0000 0000 0000 0000 0000 0000 0000
0000 ................
0x0030: 0000 ..
13:34:07.917400 00:00:00:00:00:00 > 00:80:52:00:ff:ff, ethertype
Unknown (0x814f), length 60:
0x0000: 0081 4000 0000 0002 0000 0009 0000
0000 ..@.............
0x0010: 0000 0000 0000 0000 0000 0000 0000
0000 ................
0x0020: 0000 0000 0000 0000 0000 0000
0000 ..............

The first packet is the stimulus to the BITW VPN, the second is the
response back to the config utility.

If I do tcpdump at br0 or vbox0, the outbound traffic appears, but not
the response.

Likewise, if I run the config utility directly from the VM host, it
doesn't see the response either whereas it did before I setup the
bridge. It's like something is jerking the packets right out of the
stack after tcpdump sees them but before they can get to the bridge /
config utility.

I can see that the return address is being entered into the bridge, so
if the packet got there, I would expect it to forward:
[root@cld-interop bin]# brctl showmacs br0
port no mac addr is local? ageing timer
1 00:15:17:14:b9:60 yes 0.00
2 00:80:52:00:ff:ff no 2.52
2 00:ff:69:9a:ec:8d yes 0.00

eth1 doesn't report dropping the packet.

iptables is disabled - it's a test network and I don't need the
headaches.

[root@cld-interop bin]# iptables
iptables v1.3.8: no command specified
Try `iptables -h' or 'iptables --help' for more information.
[root@cld-interop bin]# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Any brilliant ideas as to where the packet is going or how to track
his progress through the system?

TIA,
- Tim.
Reply With Quote
  #2 (permalink)  
Old 07-10-2008, 09:42 AM
Pascal Hambourg
 
Posts: n/a
Re: Debugging bridge behavior

Hello,

tbroberg@hifn.com a écrit :
>
> When I run the configuration utility in the VM (...or even on the VM
> host), it sends a stimulus packet to the BITW VPN, and a response
> comes back through eth1, but it does not pass back through the bridge.
>
> tcpdump shows the following on eth1:
> [root@cld-interop bin]# tcpdump -i eth1 -n
> tcpdump: WARNING: eth1: no IPv4 address assigned
> tcpdump: verbose output suppressed, use -v or -vv for full protocol
> decode
> l istening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
> 13:34:07.917327 00:80:52:00:ff:ff > 00:80:52:00:00:00, ethertype
> Unknown (0x814f), length 64:
> 13:34:07.917400 00:00:00:00:00:00 > 00:80:52:00:ff:ff, ethertype
> Unknown (0x814f), length 60:


> The first packet is the stimulus to the BITW VPN, the second is the
> response back to the config utility.
>
> If I do tcpdump at br0 or vbox0, the outbound traffic appears, but not
> the response.
>
> Likewise, if I run the config utility directly from the VM host, it
> doesn't see the response either whereas it did before I setup the
> bridge. It's like something is jerking the packets right out of the
> stack after tcpdump sees them but before they can get to the bridge /
> config utility.
>
> Any brilliant ideas as to where the packet is going


Maybe the bridge code does not like the 00:00:00:00:00:00 source address
for some reason (is it a valid source MAC address ?).

> or how to track his progress through the system?


If ebtables is available you can log frames in the kernel log at each
step through the bridge framework.

ebtables -t broute -A BROUTING --log-prefix "eb_brt_brt "
ebtables -t nat -A PREROUTING --log-prefix "eb_nat_pre "
ebtables -t nat -A OUTPUT --log-prefix "eb_nat_out "
ebtables -t nat -A POSTROUTING --log-prefix "eb_nat_pst "
ebtables -t filter -A INPUT --log-prefix "eb_flt_inp "
ebtables -t filter -A FORWARD --log-prefix "eb_flt_fwd "
ebtables -t filter -A OUTPUT --log-prefix "eb_flt_out "

To flush all rules when done :
iptables -t mangle -F
iptables -t mangle -X
iptables -t nat -F
iptables -t nat -X
iptables -t filter -F
iptables -t filter -X
Reply With Quote
  #3 (permalink)  
Old 07-11-2008, 05:03 AM
tbroberg@hifn.com
 
Posts: n/a
Re: Debugging bridge behavior

On Jul 10, 2:42*am, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
wrote:
> Maybe the bridge code does not like the 00:00:00:00:00:00 source address
> for some reason (is it a valid source MAC address ?).


Actually, I think you hit it right on the head here, Pascal. The
release notes for the device mention this exact issue and its impact
on Linux bridging.

> If ebtables is available you can log frames in the kernel log at each
> step through the bridge framework.


I tried this, and I can see the traffic filtering through all the
various layers on the way out, and nothing at all shows up on the way
in, which I suppose indicates that the bridge never gets the packet,
which seems odd because the traffic got through before I enabled
bridging.

I still have problems now, but at least I know what they are.

Thanks, Pascal.
- Tim.
Reply With Quote
  #4 (permalink)  
Old 07-11-2008, 08:55 AM
Pascal Hambourg
 
Posts: n/a
Re: Debugging bridge behavior

tbroberg@hifn.com a écrit :
> On Jul 10, 2:42 am, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
> wrote:
>
>>Maybe the bridge code does not like the 00:00:00:00:00:00 source address
>>for some reason (is it a valid source MAC address ?).

>
> Actually, I think you hit it right on the head here, Pascal. The
> release notes for the device mention this exact issue and its impact
> on Linux bridging.
>
>>If ebtables is available you can log frames in the kernel log at each
>>step through the bridge framework.

>
> I tried this, and I can see the traffic filtering through all the
> various layers on the way out, and nothing at all shows up on the way
> in, which I suppose indicates that the bridge never gets the packet,
> which seems odd because the traffic got through before I enabled
> bridging.


Actually the bridge code receives the frame, but checks the source MAC
address and drops it if it's considered invalid before passing it to the
first ebtables chain. I hoped that the drop occured later (for instance
the output ethernet device driver being unable to send frames with an
all-zero address) so it may have been possible to modify the source MAC
address with ebtables, but no luck. You may consider hacking the bridge
code in the kernel source if you want to allow those packets through.

============== Found in net/bridge/br_input.c =======================

int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
const unsigned char *dest = eth_hdr(skb)->h_dest;

if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
goto err;

============== Found in include/linux/etherdevice.h =================

/**
* is_valid_ether_addr - Determine if the given Ethernet address is valid
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
* a multicast address, and is not FF:FF:FF:FF:FF:FF.
*
* Return true if the address is valid.
*/
static inline int is_valid_ether_addr(const u8 *addr)
{
/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
* explicitly check for it here. */
return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
}
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:01 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109