Unlike contention based MAC protocol (802.11, for example), a TDMA MAC protocol allocates different time slots for nodes to send and receive packets. The superset of these time slots is called a TDMA frame.
Currently, ns supports a single hop, preamble-based TDMA MAC protocol. With this protocl, a TDMA frame contains preamble besides the data transmission slots. Within the preamble, every node has a dedicated subslot and uses it to broadcast the destination node id of outgoing packet. Other nodes listen in the preamble and record the time slots to receive packets. Like other common TDMA protocols (GSM, for example), each node has a data transmission slot to send packets.
To avoid unnecessary power consumption, each node turns its radio on and off explicitly by invoking node API set_node_sleep(). The radio only needs to be on when: in the pramble phase (takes one slot time) and there is a packet to send and receive.
The preamble is implemented as a central data structure tdma_preamble_, which is accessible to all the nodes. At the beginning of a frame, each node writes the destination node id into its subslot in preamble if it has a packet to send. Following preamble phase, each node sends packet in its data transmission slot and checks the preamble to determine if there is a packet to receive in other slots.
The following parameters are user configurable: the wireless link bandwidth bandwith_, the slot length packet_slot_len_, and the number of nodes max_node_num_. See ~ns/mac-tdma.{cc,h} for implementation details.
Tom Henderson 2014-12-17