[Ns-developers] 802.11 wireless LAN on ns-2

mathieu lacage Mathieu.Lacage at sophia.inria.fr
Tue Apr 18 12:59:50 PDT 2006


> enable_next_data is set to send fragments of a single packet.
> Transmission of fragments of a packet continues if enable_next_data ==
> true.
> When ack for last fragment of a packet is recieved, transmission is
> done, and station asks for access again. I suppose enable_next_data
> cannot be used to continue transmission beyond last frame. I achieved
> this by changing DcaTxop::got_ack() in dca-txop.cc:
>        if (burst complete )
>                  m_dcf->notify_access_finished()
> However, my problem is with acks. I do not want to send ack for a
> packet. In current implementation, station does not deque next packet
> until it recieves ack.

If you want to continue the transmssion without waiting for an ACK, you
can call MacLowTransmissionParameters::disable_ack. To make sure that
the other side does not return an ACK, you need to do one of:
   - send a broadcast packet (obviously, broadcast packets don't get an
ack ;-)
   - send a qos data packet with the "no ack" mode.

The first solution is easy: you just need to set the
MacAddress:get_broadcast as destination address for the packet. The
second solution is harder: you need to set the MAC_80211_QOSDATA type on
the packet (by calling ChunkMac80211Hdr::set_type) and then, you need to
add a new method on ChunkMac80211Hdr named set_qos_no_ack which does
something like this:

ChunkMac80211Hdr::set_qos_no_ack (void) const
	m_qos_ack_policy = 1;

then, of course, you need to set the "no ack" policy somewhere. The "no
ack" policy is used in mac-low.cc, MacLow::receive_ok:

        } else if (hdr.get_addr1 () == m_interface->get_mac_address ()) {
                MacStation *station = get_station (hdr.get_addr2 ());
                station->report_rx_ok (rx_snr, tx_mode);

                if (hdr.is_qos_data () && hdr.is_qos_no_ack ()) {
                        TRACE ("rx unicast/no_ack from="<<hdr.get_addr2 ());
                } else if (hdr.is_data () || hdr.is_mgt ()) {
                        TRACE ("rx unicast/send_ack from=" << hdr.get_addr2 ());
                        assert (m_send_ack_event == 0);
                        m_send_ack_event = make_cancellable_event (&MacLow::send_ack_after_data, this,
                                                                   hdr.get_addr2 (),
                                                                   hdr.get_duration_us (),
                                                                   get_ack_tx_mode_for_data (hdr.get_addr2 (), tx_mode),
                                                                   station->snr_to_snr (rx_snr));
                        Simulator::insert_in_us (get_sifs_us (), m_send_ack_event);
                (*m_rx_callback) (packet, &hdr);

Unfortunately, I cannot remember testing this code path so, you might
have to debug a few things or so.


>         >> I have gone through send_data_packets() and recieve_ok() in
>         >> mac-low.cc. No function to dequeue packet is called after
>         recieving 
>         >> ack. So, why does simulation stop if I don't send ack.
>         >> Is it not that generator in
>         samples/main-80211-adhoc  enqueues packets
>         >> for transmission at regular intervals. When are they
>         dequed? 
>         >they are dequeued when access is granted or when you get your
>         ack and
>         >send another packet in aburst.
> How can I continue data transmission without acks.
> start_transmission() calls send_data_packet() Right after this station
> should wait for sifs and dequeue next packet. This way dequeue and
> transmit n data packets at intervals of sifs. then send a data packet
> requesting ack.
> Receiver does nothing on recieving data packets. It sends ack on
> recieving ack request packet. How can this be done?
> >It is nice to see someone go deep in this code. What do you feel
> about it ?
> I suppose this is the only open-source implementation of 802.11a. I
> tried to look for such simulation on Omnet++ as well as NS-2. But,
> Omnet implements only MAC and no PHY. ns-2.28 has simulation of only
> 802.11b .So, this code has really been helpful and it provides a good
> implementation of OFDM. It provides a fair study of throughputs for
> various modes. However, I have an observation. With fragmentation
> disabled, packet size = 2000 data rate = 54Mbps gives a throughput of
> around 28 Mbps. But, if we enable fragmentation with other parameters
> remaining same, with fragmentation threshold = 145, throughput came
> down to about 7Mbps. What fragment size is used in practical
> implementations. I dont suppose it would be as high as 2000. That
> means 54Mbps cards provide throughput lower than 28 Mbps. 
> Now, only if I could burst data without ack. I aim to measure
> throughput in that case. Since it sends 1 ack for n data packets
> instead of an ack for each, throughput must increase.
> Regards,
> Lavina
> -- 
> "Unravelling life's mysteries and discovering life's secrets may take
> the courage and determination found only in a self-motivated
> pursuit." 
> - Peter McWilliams 

More information about the Ns-developers mailing list