From owner-freebsd-net@FreeBSD.ORG Fri Aug 19 16:20:55 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B42BA1065670 for ; Fri, 19 Aug 2011 16:20:55 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5AF1E8FC26 for ; Fri, 19 Aug 2011 16:20:54 +0000 (UTC) Received: by gyd10 with SMTP id 10so2697606gyd.13 for ; Fri, 19 Aug 2011 09:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WaW5f/8UhV/i/Tv3KT8F691SiLOKaaPj7tiULejj1vQ=; b=v5cmNuUSwLLj+7X5E7b4qZmIhse9tMqRME6cwghSV4IQq3cPaOT1V5OJVegLbZzwtm WhD6/5jlFtxd0z4Qi6Aisy9O3NuAK9MoYldG58wNW24gnveVjfKdYaeizjz4DUEhTSbx 1OLnJDUE5QhWH+uajzpzme6nEQz0FJPe6FAoM= MIME-Version: 1.0 Received: by 10.150.74.10 with SMTP id w10mr2503839yba.224.1313770854258; Fri, 19 Aug 2011 09:20:54 -0700 (PDT) Received: by 10.151.98.3 with HTTP; Fri, 19 Aug 2011 09:20:54 -0700 (PDT) In-Reply-To: References: <4E4E3522.6030207@gmail.com> Date: Fri, 19 Aug 2011 09:20:54 -0700 Message-ID: From: Kevin Oberman To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Cc: Ben Gray , freebsd-net@freebsd.org Subject: Re: Test tools for new network driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2011 16:20:55 -0000 On Fri, Aug 19, 2011 at 4:00 AM, Adrian Chadd wrote: > Cool! > > I don't think there's a random MAC address function call; I see > homebrewed versions of those in various drivers. :) > > I'm not sure about a packet fuzz tester; but that sounds like it'd be > a great addition to the tools/ directory. /dev/random will do fine, but please be aware that the Ethernet (actually 802.1) spec says that the second bit on the wire (the bit after the "group address" bit (better known as the multicast) bit should be set for all "locally assigned" MAC addresses, so you should OR the first byte if the address with 0x2. This requirement is often overlooked and I don't think the MAC police will haul you off to jail(8) if you ignore it, but I do like to remind people that the rule is there. (OK, I am probably a bit OCD.) > On 19 August 2011 18:04, Ben Gray wrote: >> Hi, >> >> I'm not sure if this the right list to post to, but here goes ... >> >> I'm currently writing a driver for the SMSC LAN95xx range of USB to >> Ethernet adapter chips >> (http://www.smsc.com/index.php?tid=300&pid=135&tab=1). The basic RX/TX works >> and now I'm trying to get the H/W checksum offload working, however I've >> come across some problems with the H/W implementation, e.g. it doesn't work >> with small (<64 byte) packets. >> >> So I was wondering if anyone knows of any test tools I can use to fire >> all the different unusual sort of packets at the interface to see how the >> H/W csum reacts, i.e. runt packets, packets with IP options, IPv6 packets >> with extension headers, etc. >> >> Another question I had was; is there a kernel function to generate a >> random MAC address ? Or is there a FreeBSD (or FOSS equivalent) Ethernet >> manufacturer ID I could use for randomly generated MAC addresses ? >> >> The primarily purpose is for the range of Texas Instruments ARM >> development boards (Pandaboard & Beagleboard), however there does exist at >> least one USB dongle you can buy for the PC which uses this chipset. >> >> Thanks in advance, >> Ben -- R. Kevin Oberman, Network Engineer - Retired E-mail: kob6558@gmail.com