From owner-freebsd-net@FreeBSD.ORG Thu Feb 9 12:38:53 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0334016A420 for ; Thu, 9 Feb 2006 12:38:53 +0000 (GMT) (envelope-from geir.egeland@gmail.com) Received: from uproxy.gmail.com (uproxy.gmail.com [66.249.92.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E58C43D46 for ; Thu, 9 Feb 2006 12:38:51 +0000 (GMT) (envelope-from geir.egeland@gmail.com) Received: by uproxy.gmail.com with SMTP id m2so66346uge for ; Thu, 09 Feb 2006 04:38:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:x-enigmail-version:content-type:content-transfer-encoding; b=i9peV+FjgJc2PLd3i4SmNESAGxBw9BX2XZNw4bOtch7TAGwZYZflzABiN4m0IQMfWWF49x/EAPw389fCMOVdrnuRNkufMaJL4iGcPB2lnOED+tgEl/Fy2SljHKRKTDP+MYfwbpGj33T4qGSwXnuKqQ8w/EENmJxoFDfLcBZ+TIA= Received: by 10.67.26.6 with SMTP id d6mr4049849ugj; Thu, 09 Feb 2006 04:32:13 -0800 (PST) Received: from ?128.39.21.12? ( [128.39.21.12]) by mx.gmail.com with ESMTP id k30sm387000ugc.2006.02.09.04.32.13; Thu, 09 Feb 2006 04:32:13 -0800 (PST) Message-ID: <43EB3640.8090906@gmail.com> Date: Thu, 09 Feb 2006 13:32:00 +0100 From: Geir Egeland User-Agent: Thunderbird 1.5 (X11/20060112) MIME-Version: 1.0 To: freebsd-net@freebsd.org, freebsd-questions@freebsd.org X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: IEEE 802.11 Wireless Multimedia Extension (WME) and raw sockets 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: Thu, 09 Feb 2006 12:38:53 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I've been playing around with WME to test various network performance, and come across a problem that I can't quite understand. I have an application that generates traffic with various TOS (BACKGROUND, BEST EFFORT, VOICE, VIDEO). It uses raw sockets to transmit the IP packets. This all works well if ip->ip_len is less than 192 bytes. If ip_>ip_len is larger than 192, the call to ieee80211_classify (/usr/src/sys/net80211/ieee80211_output.c) will classify the packet as "BEST EFFORT" no matter what value my application set the TOS field as. Debugging ieee80211_classify, I see that both ip->ip_tos and ip->ip_len are set to zero when a I send a packet with ip->ip_len larger than 192 bytes. Sniffing the network, I can see my packets have the correct TOS and length, but they don't get the correct WME classification. - -------------ieee80211_output.c(iee80211_classify)------------ if (eh->ether_type == htons(ETHERTYPE_IP)) { const struct ip *ip = (struct ip *) (mtod(m, u_int8_t *) + sizeof (*eh)); /* * IP frame, map the TOS field. */ //added by myself printf("IP_TOS: %d, IP_LEN: %d\n",ip->ip_tos,ntohl(ip->ip_len)); //end switch (ip->ip_tos) { case 0x08: case 0x20: d_wme_ac = WME_AC_BK; /* background */ break; case 0x28: case 0xa0: d_wme_ac = WME_AC_VI; /* video */ break; case 0x30: /* voice */ case 0xe0: case 0x88: /* XXX UPSD */ case 0xb8: d_wme_ac = WME_AC_VO; break; default: d_wme_ac = WME_AC_BE; break; } - ----------------------------------------------------- When I use SOCK_DGRAM socket instead of raw, everything works fine. I use FreeBSD 6.0-STABLE and my wireless NIC uses an atheros chipset. Has anyone got an idea what is going on ? regards, Geir Egeland -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD6zZAAsOHgqjtXwERAqO6AKDVrEBmrlBvIu5qEx/1WSsYryQTGQCgidwv 6U4vVby9nDjEabmtsPzZoeE= =r/wF -----END PGP SIGNATURE-----