Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 .. include:: replace.txt | |
2 | |
3 TDMA MAC Protocol | |
4 ----------------- | |
5 | |
6 Time division multiple access (TDMA) model is a contention free link layer model built on top of· | |
7 ``ns3::SimpleWirelessChannel`` model. | |
8 | |
9 | |
10 TDMA MAC Overview | |
11 ***************** | |
12 | |
13 Time division multiple access is a contention-free medium access protocol. The c hannel bandwidth that is· | |
14 shared by all nodes in the network is partitioned into time slots for dedicated use among those nodes.· | |
15 Each node transmits data only during this dedicated time slot allotted to it. Th e transmission slots are· | |
16 usually of fixed time intervals. Each transmission slot is separated by a guard interval so that the· | |
17 transmissions do not overlap. The value of the guard interval is decided by the simple-wireless channel model.· | |
18 It is usually the amount of time it takes for a packet to travel the distance sp ecified by the transmission· | |
19 range. In this simple TDMA model, it is assumed that the clocks of the nodes are synchronized. | |
20 | |
21 Implementation of TDMA | |
22 ********************** | |
23 | |
24 The ns-3 implementation of TDMA has a centralized TDMA controller that assigns t ransmission slots to various· | |
25 nodes in the network. Figure 3.10 shows the class-interaction diagram between va rious classes used in the· | |
26 implementation. ``ns3::TdmaController``, ``ns3::TdmaCentralMac``, and ``ns3:Tdma MacQueue`` are the major· | |
27 classes in this implementation. ``ns3::TdmaController`` controls the scheduling aspect of the protocol.· | |
28 TDMA frame processing, creating MAC headers and trailers, and MAC callback mecha nisms are handled by· | |
29 ``ns3::TdmaCentralMac``. ``ns3::TdmaMacQueue`` takes care of the packet queuing and dequeuing. | |
30 | |
31 .. _tdmamacclassinteraction: | |
32 | |
33 .. figure:: figures/tdmamacclassinteraction.png | |
34 | |
35 TDMA MAC model classes overview | |
36 | |
37 ``ns3::TdmaCentralMac`` | |
38 ======================= | |
39 | |
40 ``ns3::TdmaMac`` is the base class from which ``ns3::TdmaCentralMac`` is derived . The current implementation· | |
41 considers a simple centralized TDMA MAC. However, considering the other possible implementations of· | |
42 distributed TDMA models, we created a common base class so that other implementa tions could be derived from· | |
43 it. All the data packets ready for transmission by the node are sent down either from IP to· | |
44 ``ns3::TdmaCentralMac``. ``ns3::TdmaCentralMac`` upon receiving the packets, enq ueues them and waits for· | |
45 its turn to transmit. As soon as this node gets its turn to transmit, ``ns3::Tdm aCentralMac`` looks up the· | |
46 ``ns3::TdmaMacQueue`` for any queued packets. It then iteratively dequeues packe ts, attaches the MAC headers· | |
47 and trailers and them sends them to ``ns3::SimpleWirelessChannel``. Before sendi ng them, TdmaCentralMac· | |
48 calculates the transmission time required based on the packet size and data rate . It adds up the transmission· | |
49 times of all the packets sent and compares it with the **SlotTime** allotted to it by the· | |
50 ``ns3::TdmaController``. If it could not transmit any more packets in that slot, the loop terminates stopping· | |
51 further transmissions. Simple-wireless channel forwards the packets to all the n odes which are within the· | |
52 **MaxRange** attribute value specified by the user at the start of simulation. ` `ns3::TdmaCentralMac`` also· | |
53 takes care of the packets received from simple-wireless channel. It removes the attached MAC headers and· | |
54 trailers and forwards the packet to IP. | |
55 | |
56 ``ns3::TdmaMacQueue`` | |
57 ===================== | |
58 | |
59 TDMA maintains a drop-tail queue to store packets received from the network laye r until it gets its· | |
Tom Henderson
2011/08/16 05:39:49
does it require a drop-tail queue? Could it use t
| |
60 transmission slot. The attributes that can me modified for this class are **MacQ ueueLength** and· | |
Tom Henderson
2011/08/16 05:39:49
be modified
| |
61 **MacQueueTime**. So all the packets trying to be enqueued after the queue size reaches **MacQueueLength**· | |
62 are be dropped and packets stored in the queue for a time-interval longer than * *MacQueueTime** are also· | |
63 dropped. | |
64 | |
65 ``ns3::TdmaController`` | |
66 ======================= | |
67 | |
68 ``ns3::TdmaController`` takes care of all the scheduling aspects of the protocol . It initiates the TDMA· | |
69 sessions and authorizes the nodes to transmit in the slots specified by it. The number of slots alloted for· | |
Tom Henderson
2011/08/16 05:39:49
allotted
| |
70 transmission along with the slots durations are provided to it as attributes spe cified by the user at start of simulation. The list· | |
71 of attributes along with their default values associated with ``ns3::TdmaControl ler`` are shown below. A· | |
72 ``ns3::TdmaHelper`` takes all these attributes along with a list on nodes and in itializes the TdmaController.· | |
73 ``ns3::TdmaController`` maintains a list of MAC pointers associated with all the nodes. Based on the slot· | |
74 assignment provided by the user, this list is populated by ``ns3::TdmaHelper`` c lass before the simulation· | |
75 starts. The user can provide the slot assignments for nodes either through the s imulation script or an· | |
76 external file. After the simulation starts, the ``ns3::TdmaController`` initiate s scheduling of TDMA sessions based on· | |
77 the node ids. It calls the ``ns3::TdmaCentralMac`` from its list of MAC pointers and instructs the node that it· | |
78 could transmit for a particular **SlotTime**. As soon as the transmission slot f or that node is complete, the· | |
79 ``ns3::TdmaController`` waits for **GaurdTime** and then calls the next node fro m the list and so on. Once all the nodes· | |
80 from the list are assigned a transmission slot, the controller waits for **Inter FrameTime** before starting· | |
81 with the same procedure again. | |
82 | |
83 +-----------------+---------------------+ | |
84 | Attribute | Default Value | | |
85 +-----------------+---------------------+ | |
86 | DataRate | 11 mb/s | | |
87 +-----------------+---------------------+ | |
88 | SlotTime | 1100 us | | |
89 +-----------------+---------------------+ | |
90 | GuardTime | 100 us | | |
91 +-----------------+---------------------+ | |
92 | InterFrameTime | 0 us | | |
93 +-----------------+---------------------+ | |
OLD | NEW |