Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qt multi- and broadcast (was Re: dhcpcd not working in simh-vax with xq0:nat networking)



On Sun 12 Dec 2021 at 14:33:07 +0100, Anders Magnusson wrote:
> Hm, it was much different threads in this discussion, and I'm not sure what
> the problem is.  Please correct me if I got something wrong.

This issue I observed was that broadcast packets were not received by
NetBSD, unless something like tcpdump put the interface in promiscuous
mode. While you were writing your mail I was writing another with an
experiment that shows that.

> The qt driver comes from 2BSD, and I imported it with very little changes to
> the original (new config etc...).
> I currently do not have any VAX Qbus hardware with qt, but I do run 2.11BSD
> with the qtdriver and it has worked flawlessly for many years :-)
> 
> About broadcast; if someone ARPs for the qt machine it will be broadcast, so
> if broadcast do not work it would be impossible to connect to the machine.
> That would have been noticed immediately :-)
> 
> So, what am I missing? :-)

Perhaps nothing :) I'm not an expert on hardware. It can still be that
the qt driver is fine but the simh emulation isn't. Perhaps it should
receive broadcasts unconditionally. What it seems to do currently is to
apply the multicast filter to them. I think this is the relevant code in
simh, sim_ether.c:

/* line 3674 in _eth_callback() */
  case ETH_API_TAP:
  case ETH_API_VDE:
  case ETH_API_UDP:
  case ETH_API_NAT:
    bpf_used = 0;
    to_me = 0;
    eth_packet_trace (dev, data, header->len, "received");

    for (i = 0; i < dev->addr_count; i++) {
      if (memcmp(data, dev->filter_address[i], 6) == 0) to_me = 1;
      if (memcmp(&data[6], dev->filter_address[i], 6) == 0) from_me = 1;
    }

    /* all multicast mode? */
    if (dev->all_multicast && (data[0] & 0x01)) to_me = 1;

    /* promiscuous mode? */
    if (dev->promiscuous) to_me = 1;

    /* AUTODIN II hash mode? */
    if ((dev->hash_filter) && (!to_me) && (data[0] & 0x01))
      to_me = _eth_hash_lookup(dev->hash, data);
    break;

Actually, I'm starting to be fairly certain that the emulation is
imperfect. I looked the the Digital DELQA-Plus Addendum to DELQA Users
Guide, Part# EK-DELQP-UG-001_Sep89.pdf which is mentioned at the top of
pdp11_xq.c:
http://www.bitsavers.org/pdf/dec/qbus/EK-DELQP-UG-001_Sep89.pdf
Searching for broadcast, I find on page 6-21 about the MODE field:

MR[15] PRO Promiscuous Mode
			    o =  disable promiscuous mode;  that is, 
			    enable reception from  the LAN of only 
			    those packets that match the physical 
			    address (PADR)  or logical  address filter 
			    (LADRF)  fields  in the init block,  or that 
			    are broadcast packets. 

Still, I think that in any case the NetBSD qt driver lies when it says
it supports IFF_MULTICAST.  It doesn't even support IFF_ALLMULTI (in the
above code represented by all_multicast).

> -- R
-Olaf.
-- 
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl@rhialto

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index