[Click] Why all fwd_rate are 0 on 802.11n mode

欧阳鑫 yuanmmsip at gmail.com
Thu Mar 31 09:56:41 EDT 2011


Hi, everyone.
      I am running roofnet experiments on 2 Ubuntu hosts with 2.6.32-26
kernel. Both are AR5416 cards with ath9k driver, and I have updated ath9k
driver to compat-wireless-2011-03-16. All cards run in Monitor mode. The
roofnet can run on mode b and mode g. But now I want to run on mode n. I
have test that ath9k driver has supported 802.11n mode, so I only need
modify click-1.8.0 source files to support 11n mode.
      I modified some source files refer to ath9k driver source fiels, the
important modifications radiotapencap.cc, radiotapdecap.cc, settxrate.cc,
ettstat.cc and gen_conf_roofnet.pl are as bottom.  I think these
modifications are right, but I am not sure. Would you help me check them if
there are some errors.

      The I run Command "read srcr/es.bcast_stats" shows:
      200 Read handler 'srcr/es.bcast_stats' OK
DATA 953
5.32.61.218 00-27-19-20-3D-DA seq 1301576225 period 30000 tau 300000 sent 45
last_rx 0.717227
5.32.61.218 00-27-19-20-3D-DA [ 30 500 0 100 209 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 60 500 0 100 210 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 90 500 0 100 211 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 120 500 0 100 209 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 180 500 0 100 211 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 240 1500 0 100 211 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 270 1500 0 0 -1 -1 ]
5.32.61.218 00-27-19-20-3D-DA [ 300 1500 0 0 -1 -1 ]
5.32.61.218 00-27-19-20-3D-DA [ 60 1500 0 100 211 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 120 1500 0 100 211 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 180 1500 0 100 212 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 240 1500 0 100 211 0 ]
5.32.61.218 00-27-19-20-3D-DA [ 360 1500 0 0 -1 -1 ]
5.32.61.218 00-27-19-20-3D-DA [ 480 1500 0 0 -1 -1 ]
5.32.61.218 00-27-19-20-3D-DA [ 540 1500 0 0 -1 -1 ]
5.32.61.218 00-27-19-20-3D-DA [ 600 1500 0 0 -1 -1 ]

I do not know why all fwd_rate are 0 and some rev_rate are 0. Does somebody
know some reason?

I run tcpdump on two PCs, but the result is a little strange. Part result as
follows:

20:44:08.695966 30.0 Mb/s 63dBm tx power 540.0 Mb/s (MCS 31, 40 MHz, Long
GI) Broadcast > 00:27:19:20:3d:da (oui Unknown) SNAP Unnumbered, ui, Flags
[Command], length 1494
20:44:08.695966 1.0 Mb/s [bit 15] Broadcast > 00:27:19:20:3d:da (oui
Unknown) SNAP Unnumbered, ui, Flags [Command], length 1494

21:18:06.847953 26.0 Mb/s 63dBm tx power 540.0 Mb/s (MCS 31, 40 MHz, Long
GI) Broadcast > 00:27:19:20:3d:da (oui Unknown) SNAP Unnumbered, ui, Flags
[Command], length 494
21:18:06.847953 1.0 Mb/s [bit 15] Broadcast > 00:27:19:20:3d:da (oui
Unknown) SNAP Unnumbered, ui, Flags [Command], length 494

  It seemed that each packet was caught by tcpdump 2 times, and the 2 copies
share the same timestamp but different rates.
  My second question is why packet was caught with a rate of 30.0Mb/s first,
and then with a rate of 1Mb/s.


 ettstat.cc
+++  410, 6  voidETTStat::send_probe()

  struct click_wifi_extra *ceh = (struct click_wifi_extra *) p->user_anno();
  ceh->magic = WIFI_EXTRA_MAGIC;
  ceh->rate = rate;
  +  ceh->flags |= WIFI_EXTRA_RX_FLAG_HT;
  +   ceh->flags |= WIFI_EXTRA_RX_FLAG_40MHZ;
  +   ceh->flags |= WIFI_EXTRA_RX_FLAG_SHORT_GI;
  +   ceh->flags |= WIFI_EXTRA_RX_FLAG_GF;
  +   ceh->rateidx = _ads_rs_index;
  +   ceh->max_tries = 6;

 settxrate.cc
+++  127, 5   Packet *SetTXRate::simple_action(Packet *p_in)

  struct click_wifi_extra *ceh = WIFI_EXTRA_ANNO(p_in);
  ceh->magic = WIFI_EXTRA_MAGIC;

  + ceh->rateidx = (_rateidx == -1) ? 0 : _rateidx;
  + ceh->rate = IEEE80211_RADIOTAP_MCS_RATE[_rateidx][1] / 5;
  + ceh->max_tries = _tries;
  + ceh->flags |=  WIFI_EXTRA_RX_FLAG_HT;
  + ceh->flags |=  WIFI_EXTRA_RX_FLAG_40MHZ;
  + ceh->flags |=  WIFI_EXTRA_RX_FLAG_SHORT_GI;
  + ceh->flags |=  WIFI_EXTRA_RX_FLAG_GF;
  +  ceh->rateidx = _rateidx;

 radiotapencap.cc
+++  122, 15   Packet *RadiotapEncap::simple_action(Packet *p)
     crh->wt_rts_retries = 0;
     if (ceh->max_tries > 0) {
        crh->wt_data_retries = ceh->max_tries - 1;
     }

    + if (ceh->flags & WIFI_EXTRA_RX_FLAG_HT) {
    +    crh->wt_ihdr.it_present |= CLICK_RADIOTAP_MCS_PRESENT;
    +
    +      crh->wt_known = IEEE80211_RADIOTAP_MCS_HAVE_BW | \
    +        IEEE80211_RADIOTAP_MCS_HAVE_MCS | \
    +        IEEE80211_RADIOTAP_MCS_HAVE_GI | \
    +        IEEE80211_RADIOTAP_MCS_HAVE_FMT | \
    +        IEEE80211_RADIOTAP_MCS_HAVE_FEC;
    +    crh->wt_mcs = ceh->rateidx;
    +    if (ceh->flags & WIFI_EXTRA_RX_FLAG_40MHZ)
    +        crh->wt_flags |= IEEE80211_RADIOTAP_MCS_BW_40;
    +    if (ceh->flags & WIFI_EXTRA_RX_FLAG_SHORT_GI)
    +        crh->wt_flags |= IEEE80211_RADIOTAP_MCS_SGI;
    +    if (ceh->flags & WIFI_EXTRA_RX_FLAG_GF)
    +        crh->wt_flags |= IEEE80211_RADIOTAP_MCS_FMT_GF;
    +  }
radiodecap.cc
+++  190, 18   Packet *RadiotapDecap::simple_action(Packet *p)

          if (flags & IEEE80211_RADIOTAP_F_FCS) {
              p->take(4);
         }
    }

     +   if (rt_el_present(th, IEEE80211_RADIOTAP_MCS)) {
     +      u_int16_t flags = le16_to_cpu(*((u_int16_t *) rt_el_offset(th,
     +       IEEE80211_RADIOTAP_MCS) + 1));
     +
     +      ceh->flags |= WIFI_EXTRA_RX_FLAG_HT;
     +       if (flags & IEEE80211_RADIOTAP_MCS_BW_40)
     +           ceh->flags |= WIFI_EXTRA_RX_FLAG_40MHZ;
     +       if (flags & IEEE80211_RADIOTAP_MCS_SGI)
     +           ceh->flags |= WIFI_EXTRA_RX_FLAG_SHORT_GI;
     +       if (flags & IEEE80211_RADIOTAP_MCS_FMT_GF)
     +           ceh->flags |= WIFI_EXTRA_RX_FLAG_GF;
     +       if (flags & IEEE80211_RADIOTAP_MCS_FEC_LDPC)
     +          ceh->flags |= WIFI_EXTRA_RX_FLAG_LDPC;
     +
     +       u_int16_t rateidx = le16_to_cpu(*((u_int16_t *)rt_el_offset(th,
IEEE80211_RADIOTAP_MCS) + 2));
     +       ceh->rateidx = rateidx;
     +       ceh->rate = IEEE80211_RADIOTAP_MCS_RATE[ceh->rateidx][1] /
5;
     +  }


       These problems have troubled  me for a long time. So I urgently need
your help.  Thank you very much.

Yours,

                                                        Ouyang


More information about the click mailing list