A Comparison between TDMA and CSMA access technique for a
linear topology of sensor nodes
Sivamoorthy Ranjan II
a
, Shumao Ou
b,
a
Computing and Communications Department, Oxford Brookes University, Oxford, United Kingdom
b
Computer Communications and Netw orks Department, Oxford Brookes University, Oxford, United Kingdom
Abstract
Most of the works involving designing MAC protocols for a wireless sensor network have considered a random topology; a
chain type topology of wireless sensor network is a less explored area. Although the chain topology is not widely desired
topology for a wireless sensor network, certain applications such as highway traffic monitoring, underground tunnel surveillance
deploy a chain topology of wireless sensor networks. This paper takes the first step in designing a novel TDMA based protocol
for a chain type wireless sensor network which achieves a possible minimum delay and energy consumption while achieving
maximum throughput. A comparison between CSMA and TDMA mode is made. A comparison on throughput and delay of the
nodes in a linear topology for both the access mechanisms is given. These comparisons would add proof to the intuitive belief
that TDMA modeis more suitable for a linear chain topology with large number of nodes.
1. Introduction
Wireless sensor network is a collective coordination among
several sensor nodes usually for gathering environmental
data (such as light intensity, pressure, temperature, humidity)
for a particular region. Wireless sensor networks are an
interface between Humans and the environment. While,
Other networks such as Cellular networks are more human
centric, WSN (Wireless Sensor Networks) are essentially
data centric: they are designed based on the data they handle.
Fixed chain topology finds its application in traffic
monitoring in highways. It can provide an excellent support
to the ITS(Intelligent Transportation System) where there is
ad-hoc vehicle to vehicle communication. In emergency
cases such as accidents, vehicles travelling towards the
accident area can be alerted well before to take an alternate
route. Another area of application can be in the mining field
where there are long and potentially dangerous tunnels.
Sensors deployed here can be used to alert the employers
about fire, poisonous gases or any other life threatening
activity.
Much of the research in the area of wireless sensor networks
is done or being done in the area of random topology, as the
random topology provides flexibility in
message forwarding process. However, in the application
concerning traffic management, random topology is not
suitable as the area to be covered is along a straight line.
Designing of an energy efficient MAC protocol for a linear
sensor topology is a novel approach.
Figure 1: Structure of sensor network
The title of the project is Comparison of CSMA/CA and
TDMA access technique for low-power wireless sensors in
fixed chain topology. The main idea is first to create a chain
topology of sensor nodes with one or several Road Side
Units (RSU), to which the corresponding sensor nodes report
through multi-hop communication. And then to we create a
scenario in which the linear chain type nodes communicate
with CSMA/CA and TDMA mode and make comparisons of
their performances on the basis of throughput and delay.
Before moving into the design and implementation of
topology and comparisons between CSMA/CA and TDMA,
let us discuss about existing mechanisms used in a typical
protocolfor wireless sensor network.
The protocols for WSN can either be contention based (non-
schedule based) or contention free (schedule based). Certain
protocols are hybrid protocols that use both contention based
and contention free methods at various stages of traffic flow.
Contention based protocols are generally based on CSMA
(Carrier Sense Multiple Access). They need to sense the
channel and ensure it is available before transmitting. One of
the main advantages of the contention based protocol is that
the nodes need not be time synchronised with each other.
Whenever a node needs to send a message, it sends an RTS
(request to send) and sends the message upon receiving a
CTS (clear to send). Contention based protocols are
generally considered suitable when there is low traffic.
During high traffic conditions there can be an increase in
collisions and overhead, which results in more energy
consumption and delay. Contention free protocols are
generally TDMA (Time Division Multiple Access) based.
Each node uses a fixed time slot to transmit their data. Time
synchronisation among nodes is needed. They are suitable
for reasonable amount of traffic, ideally in a periodic sensing
environment. Network scalability here is difficult.
The reason for the preference of TDMA over CSMA in the
implementation of the protocol is that, we are concerned
with a special topology of sensor nodes: a chain type
topology also the number of nodes are considerable high.
The application favours a periodic and predictable traffic.
Therefore TDMA becomes automatic choice of preference
since TDMA performance better with the following
scenarios [1].
1. When thetopology is large and relatively stable.
2. Traffic is comparatively high (as the topology is
large the traffic is considered to be high).
3. A periodic data flow.
One of the main issues with wireless sensor networks is
energy consumption by the sensor nodes while transmitting
messages. All the sensor nodes are battery operated. Due to
this fact any protocol involving the sensor nodes has to be
energy efficient. The medium access control (MAC) layer is
one area where energy efficiency can be achieved by
implementing energy saving protocols. The new MAC
protocol aims to deliver the energy efficiency by making the
sensor nodes to sleep as much as possible without affecting
the normal operation for which the sensor network is
intended for. One other reason why we are attracted to
TDMA technique is that it provides more opportunities to
achieve energy efficiency than CSMA.
2. Literature Review
There are some early works on the development of protocol
for chain type topology, PEGASIS [2] (Power Efficient Data
Gathering in Sensor Information Systems) is one such
approach. In this approach, each node would forward its data
along the chain to a particular node (Leader Node) which
communicates directly to the sink. The data are fused from
one node to another therefore the data size is same for each
node this helps in equal consumption of energy by each node.
The Leader Node is then switched to other nodes in turns to
equally distribute energy.
One of the earliest works in energy efficient MAC protocol
for multi-hop protocol is the PAMAS [3] (power aware
medium access with signalling). In this protocol separate
channels for control and data was used. The node senses the
channel with the control channel if it discovers that a
neighbouring node is transmitting it goes to sleep if not data
is transmitted using the data channel. Since the data and
control channels are different there is no collision between
data and control signal. This protocol is well suited for low
load conditions. One of the major drawbacks of PAMAS is
that it requires two separate radios for data and control
channel which makes the hardware expensive and moreover
it is difficult to implement practically.
One of the protocols that is closely related to ours is LC-
MAC [4] or the Long Chain MAC. As the name suggests this
protocol is designed for a chain type topology. In this
protocol the end node sends the LDP (Location Detect
Package), adding its address, to the neighbouring node. Upon
receiving this message, the neighbouring node will add its
address and sends to its neighbour. This continues until the
packet receives the sink. The sink, then transmits the packet
back along the path, thus all nodes will gather all location
information.
After location identification a staggered wakeup schedule
(SWS) is created. During the message relay all nodes follow
the SWS and the messaged is relayed to the sink. It is to be
noted that there are no RTS and CTS message exchange as
the nodes follow an agreed schedule so there is no possibility
of a collision. A super sync message SSYNC is passed prior
to actual data exchange. This SSYNC message contains the
information when and how much each node would transmit.
This is done similar to the LDP message each node would
update when and how much it would transmit in the SSYNC
and passes until the message receives the sink. The authors
show that LC-MAC performs considerably better in terms of
latency, throughput and energy than S-MAC (discussed in
the following section).
There are several energy efficient protocols developed for
wireless sensor networks. One of the most early and
significant protocols is the S-MAC [5] which is contention
based. For the first time, a listen and sleep mode was
introduced. In listen mode the node operates normally. In
sleep mode the node switches off its radio, saving power.
The duration of sleep and listen is fixed for all nodes.
Neighbouring nodes with the same sleep and listen schedule
formed a virtual cluster. The data was sent with RTS and
CTS messages to avoid collision (since it is contention
based).
T-MAC[6] and DS-MAC[7] are improved versions of S-
MAC. T-MAC makes use of different listen/sleep duration
depending upon the traffic conditions. DS-MAC changes the
duty cycle according to the traffic.
B-MAC[8] is another contention based protocol where the
nodes chose their own sleep duration. They wake to sense
the channel for any data destined to them. If there is no data
for them they go back to sleep. When a node needs to send a
message it first sends a preamble which contains the address
of the destination node. The destination node wakes up and
senses the channel; it would sense the preamble and stay
awake to receive the data. Although this protocol was simple
and seemed to save energy, the preamble had to be
transmitted for a long time for the destination node to sense
it. Long preamble consumed more energy. This short coming
was solved by Wise-MAC[9], which made the nodes
remember its neighbours sampling offsets. By knowing the
sampling offsets the start time of the preamble is adjusted to
match the wake up time of the destination node, thereby
reducing the length of thepreamble.
Z-MAC[10] is a hybrid protocol which operates in both
contention based and contention free mode. A node uses the
time slot allocated for it to transfer data. It can also use other
node’s slots to transfer data if it is free. Generally all nodes
use back-offs before sending their data. If the node is
sending in its own time slot then it uses less number of back-
offs than other nodes which are contending for the same time
slot, thereby the slot owner gets priority. This protocol
makes use of the best of both contention based and
contention free modes. Another hybrid protocol is the µ-
MAC[11]. It has a contention period where the nodes send
data in their respective time slots and a contention free
period in which the nodes compete for a time slot. This
protocolis a high level protocoland is application specific.
DEE-MAC[12] is a TDMA based protocol. In this protocol
time is divided into sessions. Each session have a contention
period and a transmission period. The nodes send request to
the cluster head in the contention period and the cluster head
allocates slots for the nodes in the transmission period. A
node contends only when it has a data to transmit. In this
way unused time slots are eliminated.
3. Methodology
Considering our requirements, we need to test the
performance of CSMA/CA and TDMA in a chain topology.
The CSMA/CA access technique is employed in the Wi-Fi
module of ns-3 while the TDMA module is supported by a
special module developed for ns-3.19 called Simple TDMA
module. We propose to develop and analyse the contention
based and schedule based protocols using the Wi-Fi and
Simple TDMA moduleavailable in ns-3.
3.1 The Wi-Fi module
This module consists of the following components.
1. Phy layer models
2. MAC Low level models
3. MAC High level models
4. Rate control algorithms (Aarf, Arf, Cara, Onoe,
Rraa, ConstantRate, and Minstrel)
The Phy layer model is responsible for the transmission and
reception of data frames. It is guided by the
InterferenceModel/ErrorRateModel to determine the
probability of successful reception of frames. The MAC Low
level model implements the DCF and EDCF with the help of
the DcfManager. This layer determines the duration and
timings of RTS/CTS/ACK messages. The MAC High level
model takes care of beacon generation, probing and associate
state machines. The Rate control algorithms are used by the
MAC Low level models. Figure gives the detailed working
structureof the Wi-Fi Module.
3.2 The TDMA module
The TDMA module is much simpler than the Wi-Fi module.
TDMA module for ns-3 is not officially released but it has
been extensively tested before being proposed. This module
uses a Simple Wireless Channel which takes only the
transmission distance as the only criteria.
The total channel bandwidth available for the nodes is
equally divided among the participating nodes. Each node is
allotted with dedicated time slots, usually of fixed lengths.
The nodes transmit their packets only in their allotted time
slots. Each transmission slot is separated by a guard interval.
This is to ensure that the data transmission in one slot does
not interfere with the neighbouring slot. Generally the guard
time is the time taken for a data packet to travel the specified
transmission distance. It is specified by the Simple Wireless
channel used in the model. This module assumes that the
nodes are synchronised with each other. Figure 3-1 shows the
default time slot allocation in TDMA module.
Figure 3-1: TDMA Default Time Slot Allocation
4. Results
4.1 Throughput Analysis
We create the chain topology of nodes as explained
previously. We employ TDMA and CSMA access
technology and calculate the average throughput achieved by
both the techniques. The various parameters for the
simulation are given in Table 4-1 below. It is to be noted that
the transmission distance is chosen to be a large value so that
all nodes are able to reach the Sink in one hop. We compare
the throughput of TDMA and CSMA in three scenarios of 5,
10, 50 nodes.
Parameters Value
Simulation time 100 secs
Data rate 8kbps
Data start time 50secs
Txp distance 400m
Packet Size 1000 bytes
Slot time (TDMA) 1000µs
Inter frame gap (TDMA) 0
Guard time (TDMA) 0
Table 4-1: Simulation Parameters
Scenario 1
There are 5 nodes in total out of which one node is Sink. The
topology is as shown in Figure 4-1. Each node is separated
by a distance of 10m with their neighbour. The maximum
transmission distance is 400m well above the distance
between their neighbours.
Figure 4-2: One-Hop Transmission topology of 5 nodes
The data rate is set to 8Kbps for all nodes. The packet size is
1000bytes or 8000bits. Therefore each node can send one
packet per second. There are 4 nodes excluding the sink.
Therefore 4 packets are sent every second. Both the modes
received thesepackets successfully.
Scenario 2
There are 9 nodes excluding the sink. Therefore 9 packets
are sent by all nodes in one second. All other parameters are
the same as in the previous scenario. The topology is as
shown in Figure 4-2.
Figure 4-3: One-Hop Transmission topology of 10 nodes
In TDMA mode all packets (9 packets) were received by the
sink whereas in CSMA mode only 6 packets were received
on average. This may be due to the overload of RTS/CTS
message exchange.
Scenario 3
There were 49 nodes placed linearly at 10m distance from
the nearest neighbours. The topology is as shown in Figure
4-3.
Figure 4-4: One-Hop Transmission topology of 50 nodes
As per the set data rate and packet size, there should be 49
packets received every second by the sink. Nodes when
operating in TDMA mode managed to receive all the 49
packets but when operating under CSMA they managed to
receive only 21 packets per second. Therefore their
throughput dropped.
The comparison between all thescenarios is given below in
Figure 4-5.
Figure 4-4: Throughput Comparison between TDMA and
CSMA, Traffic:1 packet/sec
It can be noted that the throughput of both CSMA and
TDMA were equal when number of nodes were 5. As the
number of nodes increased the throughput for CSMA mode
decreased. The gap between CSMA and TDMA widened as
the number of nodes increased. When the traffic was
increased to 2 packets per second, and 8 packets per second,
by increasing the data rates to 16 and 64 Kbps respectively,
the trend remained the same.
4.2 Delay Analysis
The delay analysis is done in two different instances. In one
instance the transmitting nodes are able to reach the sink in
one hop. In other instance the data packets are forwarded
from transmitting node to sink by the intermediate nodes,
multi-hop transmission.
We first consider the first instance were the nodes reach the
sink in one hop. We consider the time taken by the extreme
node in the topology to transmit its packets to the sink. We
do this by analysing the trace file generated. Since its one
hop the results were almost identical in three scenarios
(Figure 4-7).
Figure 4-7: Delay comparison between TDMA and CSMA:
One hop
Delay in TDMA is 0. This is because; no time is wasted for
sensing the channel. The total available bandwidth is equally
divided among the participating nodes. There is no wastage
of the bandwidth. Moreover, the TDMA parameters are set
such that the guard times between the slots are 0. Since the
nodes are transmitting shorter packet the guard time is not
necessary.
Delay in multi-hoptransmission
In NS-3 the data forwarding is done automatically using the
routing protocol implemented in the program. The program
implements DSDV protocol. All nodes perform neighbour
discovery. The protocol requires the nodes to update
information about the neighbouring nodes every 15 secs. In
this program first 50 seconds is set aside for the routing
protocol to discover routes to all nodes in the network; that is
to form the routing table. The data transfer starts only after
50 seconds and the total simulation is run for 100 seconds.
By default the nodes send data in packets of size 1000bytes
at the rate of 8kbps. Therefore, every node would send one
packet to the sink every second. As in the case of throughput
analysis we consider three scenarios of 5, 10 and 50 nodes
for analysis. The criterion for analysis is that we calculate
the time taken for a data packet transmitted by the furthest
node in thenetwork to reach the sink.
Scenario 1
We consider a total of 5 nodes in a chain topology separated
by a distance of 10m with one sink. The maximum
transmission distance is set to 12m so that only the nearest
node to the sink can send data to it. These parameters were
fixed for all the scenarios. The topology is shown in Figure
4-8.
Figure 4-8: Data forwarding in a topology of 5 nodes
Each packet sent from Node 4 to Sink is forwarded by Node
3 and all these packets sent were analysed from the trace file
generated and the average delay taken by the packets in
TDMA and CSMA mode were calculated with the help of
awk files. The results show that the delay in TDMA is more
than that of CSMA.
Scenario 2
We consider 10 nodes separated by a distance of 10m with
one sink. Each packet from Node 9 sent to the sink is
forwarded by the intermediate nodes these packets were
analysed to estimate the average delay in TDMA and CSMA.
Figure 4-9 shows this scenario.
Figure 4-9: Data forwarding in a topology of 5 nodes
Scenario 3
We consider 50 nodes separated by 10m distance with one
sink. Each packet sent by the Node 49 that reached Sink was
analysed for TDMA and CSMA mode and the average delay
taken by the packets in these modes were recorded. Figure
4-10 shows this scenario.
Figure 4-10: Data forwarding in a topology of 5 nodes
The average delay for TDMA and CSMA using 5, 10, 50
nodes are given in a graphical depiction in Figure 4-11.
Figure 4-11: Delay comparison between TDMA and CSMA:
Multi-hop
The delay considering the packet transmission from the
extreme last node to the Sink, in a chain topology was found
to be considerably more in TDMA than in CSMA. This
happens because the slot allocation in TDMA is one slot per
node as explained in the TDMA module section. The time
slot allocation mechanism in the module developed did not
allow allocating multiple time slots for a node. The module
maintained a rule that the time slot must be exclusively used
by one node and provided error on multiple allocations.
Thus we were not able to utilise the spatial reuse concept.
The spatial reuse concept is by which a fourth node that is
two hops away from the first node can utilise the time slot of
the first node. The spatial reuse concept is explained in
Figure 4-13. The slots in pink color are reusable time slots.
These slots would not interfere with the transmission of the
other node. This would greatly improve the efficiency of
data forwarding and minimise the delay in TDMA. Also one
other reason for such massive delay is that the slot allocation
is done in forward direction and the data trickles down the
reverse direction, Figure 4-12. This means that the node has
to wait one full cycle for the next time slot to transmit, thus
amounting to more delay. If both data and time slot
allocation are in the same direction the delay would be
reduced. The spatial reuse concept can be introduced by
modifying the TDMA module and allowing multiple time
slot allocation.
Figure 4-12: Mismatch between direction of slot assignment
and data trickle
Figure 4-13: Spatial reuse of time slots
5. Conclusion
In this project we considered a specific and a rare type of
wireless sensor network topology, chain type topology. We
state the importance of this topology in certain applications
and the lack of research in this area. In the quest to develop a
new protocol for this type of topology, we try to provide
evidence for justifying the choice of TDMA access
technique for this type of topology. We develop a simulation
environment consisting of linear chain of sensor nodes and
test throughput and delay parameters using TDMA and
CSMA access technique.
We find that a high throughput is achieved with TDMA
access technique than CSMA access technique. This was
attributed to the high traffic load of RTS/CTS message
exchange. Initially, when the number of nodes were less the
throughput for both the technique remained identical, but
when the number of nodes were increased throughput of
nodes employing CSMA access technique decreased. Lots of
data packets were lost due to traffic congestion. The
throughput decreased as we increased number of nodes. The
trend remained constant when the data rate was increased.
When we consider a periodic sensing environment, it is most
advantageous to use TDMA since we actually know when
the node is going to generate a packet and we can allocate the
time slots accordingly.
We then analysed the delay aspect of TDMA and CSMA.
The delay predictably was more in CSMA than TDMA when
‘one hop to sink’ criterion was considered. The delay in
CSMA was caused by the overhead of RTS/CTS message
exchange. When ‘ multi-hop to sink ’ criterion was
considered, unexpectedly we find the delay in TDMA is
more than in CSMA. This was attributed to the inability to
make use of the spatial reuse of time slots and mismatch
between the time slot allocation direction and data packet
propagation direction. The proposed methods to improve the
delay are to tweak the module to allow multiple time slot
allocation for the nodes and take advantage of the spatial
reuse concept.
References
1. L. Wang, X. Yan, and Y. Yan, ‘A MAC protocol for
chain-type wireless sensor network based on the token’,
Sensors and Transducers, vol. 154, pp. 15–23, Jul. 2103.
2. S. Lindsey, C. Raghavendra, and K. Sivalingam, ‘Data
gathering in sensor networks using the energy*delay
metric ’ , Proceedings 15th International Parallel and
Distributed Processing Symposium. IPDPS 2001, 2001.
3. S. Singh and C. S. Raghavendra, ‘PAMAS: Power-aware
multi-access protocol with signaling ’ , ACM Comput.
Commun, 1998.
4. C. Fang, H. Liu, and L. Qian, ‘LC-MAC: An Efficient
MAC Protocol for the Long-Chain Wireless Sensor
Networks ’ , 2011 Third International Conference on
Communications and Mobile Computing, Apr. 2011.
5. W. Ye, et al., “An energy-efficient MAC protocol for
wireless sensor networks”, Proceedings of the Joint
Conference of the IEEE Computer and Communications
Societies (InfoCom), vol. 3, 2002, pp. 214–226.
6. T. van Dam, K. Langendoen, “An adaptive energyefficient
MAC protocol for wireless sensor networks”, Proceedings of
the International Conference on Embedded Networked
Sensor Systems (SenSys), 2003, pp. 171–180.
7. P. Lin, et al., “Medium access control with a dynamic duty
cycle for sensor networks”, Proceedings of the IEEE
Wireless Communications and Networking Conference
(WCNC), vol. 3, 2004, pp. 1534–1539.
8. J. Polastre, J. Hill, D. Culler, “Versatile low power media
access for wireless sensor networks”, Proceedings of the
International Conference on Embedded Networked Sensor
Systems (SenSys), 2004, pp. 95–107.
9. A. El-Hoiydi, J.-D. Decotignie, “WiseMAC: an ultra low
power MAC protocol for multi-hop wireless sensor
networks”, Proceedings of the International Workshop on
Algorithmic Aspects of Wireless Sensor Networks
(Algosensors), 2004, pp. 18–31.
10. Rhee I, Warrier A, Aia M, et al. “Z-MAC: a Hybrid
MAC for Wireless Sensor Networks”, IEEE/ACM
Transactions, 2008, vol. 16(3), pp. 511 – 524.
11. Barroso A, Roedig U, and Sreenan C., “μ-MAC: an
energy efficient medium access control for wireless sensor
networks”, Proc. of the Second European Workshop on
Wireless Sensor Networks, Istanbul, 2005, pp. 70 – 80.
12. Cho Sungrae, et al, “Dynamic energy-efficient TDMA-
based MAC protocol for wireless sensor networks”,
Autonomic and Autonomous Systems and International
Conference on Networking and Services, Papeete, Tahiti,
Joint International Conference, Oct. 2005, pp.48 48.

ShortPaper

  • 1.
    A Comparison betweenTDMA and CSMA access technique for a linear topology of sensor nodes Sivamoorthy Ranjan II a , Shumao Ou b, a Computing and Communications Department, Oxford Brookes University, Oxford, United Kingdom b Computer Communications and Netw orks Department, Oxford Brookes University, Oxford, United Kingdom Abstract Most of the works involving designing MAC protocols for a wireless sensor network have considered a random topology; a chain type topology of wireless sensor network is a less explored area. Although the chain topology is not widely desired topology for a wireless sensor network, certain applications such as highway traffic monitoring, underground tunnel surveillance deploy a chain topology of wireless sensor networks. This paper takes the first step in designing a novel TDMA based protocol for a chain type wireless sensor network which achieves a possible minimum delay and energy consumption while achieving maximum throughput. A comparison between CSMA and TDMA mode is made. A comparison on throughput and delay of the nodes in a linear topology for both the access mechanisms is given. These comparisons would add proof to the intuitive belief that TDMA modeis more suitable for a linear chain topology with large number of nodes. 1. Introduction Wireless sensor network is a collective coordination among several sensor nodes usually for gathering environmental data (such as light intensity, pressure, temperature, humidity) for a particular region. Wireless sensor networks are an interface between Humans and the environment. While, Other networks such as Cellular networks are more human centric, WSN (Wireless Sensor Networks) are essentially data centric: they are designed based on the data they handle. Fixed chain topology finds its application in traffic monitoring in highways. It can provide an excellent support to the ITS(Intelligent Transportation System) where there is ad-hoc vehicle to vehicle communication. In emergency cases such as accidents, vehicles travelling towards the accident area can be alerted well before to take an alternate route. Another area of application can be in the mining field where there are long and potentially dangerous tunnels. Sensors deployed here can be used to alert the employers about fire, poisonous gases or any other life threatening activity. Much of the research in the area of wireless sensor networks is done or being done in the area of random topology, as the random topology provides flexibility in message forwarding process. However, in the application concerning traffic management, random topology is not suitable as the area to be covered is along a straight line. Designing of an energy efficient MAC protocol for a linear sensor topology is a novel approach. Figure 1: Structure of sensor network The title of the project is Comparison of CSMA/CA and TDMA access technique for low-power wireless sensors in fixed chain topology. The main idea is first to create a chain topology of sensor nodes with one or several Road Side Units (RSU), to which the corresponding sensor nodes report through multi-hop communication. And then to we create a scenario in which the linear chain type nodes communicate with CSMA/CA and TDMA mode and make comparisons of their performances on the basis of throughput and delay.
  • 2.
    Before moving intothe design and implementation of topology and comparisons between CSMA/CA and TDMA, let us discuss about existing mechanisms used in a typical protocolfor wireless sensor network. The protocols for WSN can either be contention based (non- schedule based) or contention free (schedule based). Certain protocols are hybrid protocols that use both contention based and contention free methods at various stages of traffic flow. Contention based protocols are generally based on CSMA (Carrier Sense Multiple Access). They need to sense the channel and ensure it is available before transmitting. One of the main advantages of the contention based protocol is that the nodes need not be time synchronised with each other. Whenever a node needs to send a message, it sends an RTS (request to send) and sends the message upon receiving a CTS (clear to send). Contention based protocols are generally considered suitable when there is low traffic. During high traffic conditions there can be an increase in collisions and overhead, which results in more energy consumption and delay. Contention free protocols are generally TDMA (Time Division Multiple Access) based. Each node uses a fixed time slot to transmit their data. Time synchronisation among nodes is needed. They are suitable for reasonable amount of traffic, ideally in a periodic sensing environment. Network scalability here is difficult. The reason for the preference of TDMA over CSMA in the implementation of the protocol is that, we are concerned with a special topology of sensor nodes: a chain type topology also the number of nodes are considerable high. The application favours a periodic and predictable traffic. Therefore TDMA becomes automatic choice of preference since TDMA performance better with the following scenarios [1]. 1. When thetopology is large and relatively stable. 2. Traffic is comparatively high (as the topology is large the traffic is considered to be high). 3. A periodic data flow. One of the main issues with wireless sensor networks is energy consumption by the sensor nodes while transmitting messages. All the sensor nodes are battery operated. Due to this fact any protocol involving the sensor nodes has to be energy efficient. The medium access control (MAC) layer is one area where energy efficiency can be achieved by implementing energy saving protocols. The new MAC protocol aims to deliver the energy efficiency by making the sensor nodes to sleep as much as possible without affecting the normal operation for which the sensor network is intended for. One other reason why we are attracted to TDMA technique is that it provides more opportunities to achieve energy efficiency than CSMA. 2. Literature Review There are some early works on the development of protocol for chain type topology, PEGASIS [2] (Power Efficient Data Gathering in Sensor Information Systems) is one such approach. In this approach, each node would forward its data along the chain to a particular node (Leader Node) which communicates directly to the sink. The data are fused from one node to another therefore the data size is same for each node this helps in equal consumption of energy by each node. The Leader Node is then switched to other nodes in turns to equally distribute energy. One of the earliest works in energy efficient MAC protocol for multi-hop protocol is the PAMAS [3] (power aware medium access with signalling). In this protocol separate channels for control and data was used. The node senses the channel with the control channel if it discovers that a neighbouring node is transmitting it goes to sleep if not data is transmitted using the data channel. Since the data and control channels are different there is no collision between data and control signal. This protocol is well suited for low load conditions. One of the major drawbacks of PAMAS is that it requires two separate radios for data and control channel which makes the hardware expensive and moreover it is difficult to implement practically. One of the protocols that is closely related to ours is LC- MAC [4] or the Long Chain MAC. As the name suggests this protocol is designed for a chain type topology. In this protocol the end node sends the LDP (Location Detect Package), adding its address, to the neighbouring node. Upon receiving this message, the neighbouring node will add its address and sends to its neighbour. This continues until the packet receives the sink. The sink, then transmits the packet back along the path, thus all nodes will gather all location information. After location identification a staggered wakeup schedule (SWS) is created. During the message relay all nodes follow the SWS and the messaged is relayed to the sink. It is to be noted that there are no RTS and CTS message exchange as the nodes follow an agreed schedule so there is no possibility of a collision. A super sync message SSYNC is passed prior to actual data exchange. This SSYNC message contains the information when and how much each node would transmit. This is done similar to the LDP message each node would update when and how much it would transmit in the SSYNC and passes until the message receives the sink. The authors show that LC-MAC performs considerably better in terms of latency, throughput and energy than S-MAC (discussed in the following section). There are several energy efficient protocols developed for wireless sensor networks. One of the most early and significant protocols is the S-MAC [5] which is contention based. For the first time, a listen and sleep mode was introduced. In listen mode the node operates normally. In sleep mode the node switches off its radio, saving power. The duration of sleep and listen is fixed for all nodes. Neighbouring nodes with the same sleep and listen schedule formed a virtual cluster. The data was sent with RTS and CTS messages to avoid collision (since it is contention based).
  • 3.
    T-MAC[6] and DS-MAC[7]are improved versions of S- MAC. T-MAC makes use of different listen/sleep duration depending upon the traffic conditions. DS-MAC changes the duty cycle according to the traffic. B-MAC[8] is another contention based protocol where the nodes chose their own sleep duration. They wake to sense the channel for any data destined to them. If there is no data for them they go back to sleep. When a node needs to send a message it first sends a preamble which contains the address of the destination node. The destination node wakes up and senses the channel; it would sense the preamble and stay awake to receive the data. Although this protocol was simple and seemed to save energy, the preamble had to be transmitted for a long time for the destination node to sense it. Long preamble consumed more energy. This short coming was solved by Wise-MAC[9], which made the nodes remember its neighbours sampling offsets. By knowing the sampling offsets the start time of the preamble is adjusted to match the wake up time of the destination node, thereby reducing the length of thepreamble. Z-MAC[10] is a hybrid protocol which operates in both contention based and contention free mode. A node uses the time slot allocated for it to transfer data. It can also use other node’s slots to transfer data if it is free. Generally all nodes use back-offs before sending their data. If the node is sending in its own time slot then it uses less number of back- offs than other nodes which are contending for the same time slot, thereby the slot owner gets priority. This protocol makes use of the best of both contention based and contention free modes. Another hybrid protocol is the µ- MAC[11]. It has a contention period where the nodes send data in their respective time slots and a contention free period in which the nodes compete for a time slot. This protocolis a high level protocoland is application specific. DEE-MAC[12] is a TDMA based protocol. In this protocol time is divided into sessions. Each session have a contention period and a transmission period. The nodes send request to the cluster head in the contention period and the cluster head allocates slots for the nodes in the transmission period. A node contends only when it has a data to transmit. In this way unused time slots are eliminated. 3. Methodology Considering our requirements, we need to test the performance of CSMA/CA and TDMA in a chain topology. The CSMA/CA access technique is employed in the Wi-Fi module of ns-3 while the TDMA module is supported by a special module developed for ns-3.19 called Simple TDMA module. We propose to develop and analyse the contention based and schedule based protocols using the Wi-Fi and Simple TDMA moduleavailable in ns-3. 3.1 The Wi-Fi module This module consists of the following components. 1. Phy layer models 2. MAC Low level models 3. MAC High level models 4. Rate control algorithms (Aarf, Arf, Cara, Onoe, Rraa, ConstantRate, and Minstrel) The Phy layer model is responsible for the transmission and reception of data frames. It is guided by the InterferenceModel/ErrorRateModel to determine the probability of successful reception of frames. The MAC Low level model implements the DCF and EDCF with the help of the DcfManager. This layer determines the duration and timings of RTS/CTS/ACK messages. The MAC High level model takes care of beacon generation, probing and associate state machines. The Rate control algorithms are used by the MAC Low level models. Figure gives the detailed working structureof the Wi-Fi Module. 3.2 The TDMA module The TDMA module is much simpler than the Wi-Fi module. TDMA module for ns-3 is not officially released but it has been extensively tested before being proposed. This module uses a Simple Wireless Channel which takes only the transmission distance as the only criteria. The total channel bandwidth available for the nodes is equally divided among the participating nodes. Each node is allotted with dedicated time slots, usually of fixed lengths. The nodes transmit their packets only in their allotted time slots. Each transmission slot is separated by a guard interval. This is to ensure that the data transmission in one slot does not interfere with the neighbouring slot. Generally the guard time is the time taken for a data packet to travel the specified transmission distance. It is specified by the Simple Wireless channel used in the model. This module assumes that the nodes are synchronised with each other. Figure 3-1 shows the default time slot allocation in TDMA module. Figure 3-1: TDMA Default Time Slot Allocation 4. Results 4.1 Throughput Analysis We create the chain topology of nodes as explained previously. We employ TDMA and CSMA access technology and calculate the average throughput achieved by both the techniques. The various parameters for the simulation are given in Table 4-1 below. It is to be noted that the transmission distance is chosen to be a large value so that all nodes are able to reach the Sink in one hop. We compare the throughput of TDMA and CSMA in three scenarios of 5, 10, 50 nodes.
  • 4.
    Parameters Value Simulation time100 secs Data rate 8kbps Data start time 50secs Txp distance 400m Packet Size 1000 bytes Slot time (TDMA) 1000µs Inter frame gap (TDMA) 0 Guard time (TDMA) 0 Table 4-1: Simulation Parameters Scenario 1 There are 5 nodes in total out of which one node is Sink. The topology is as shown in Figure 4-1. Each node is separated by a distance of 10m with their neighbour. The maximum transmission distance is 400m well above the distance between their neighbours. Figure 4-2: One-Hop Transmission topology of 5 nodes The data rate is set to 8Kbps for all nodes. The packet size is 1000bytes or 8000bits. Therefore each node can send one packet per second. There are 4 nodes excluding the sink. Therefore 4 packets are sent every second. Both the modes received thesepackets successfully. Scenario 2 There are 9 nodes excluding the sink. Therefore 9 packets are sent by all nodes in one second. All other parameters are the same as in the previous scenario. The topology is as shown in Figure 4-2. Figure 4-3: One-Hop Transmission topology of 10 nodes In TDMA mode all packets (9 packets) were received by the sink whereas in CSMA mode only 6 packets were received on average. This may be due to the overload of RTS/CTS message exchange. Scenario 3 There were 49 nodes placed linearly at 10m distance from the nearest neighbours. The topology is as shown in Figure 4-3. Figure 4-4: One-Hop Transmission topology of 50 nodes As per the set data rate and packet size, there should be 49 packets received every second by the sink. Nodes when operating in TDMA mode managed to receive all the 49 packets but when operating under CSMA they managed to receive only 21 packets per second. Therefore their throughput dropped. The comparison between all thescenarios is given below in Figure 4-5. Figure 4-4: Throughput Comparison between TDMA and CSMA, Traffic:1 packet/sec It can be noted that the throughput of both CSMA and TDMA were equal when number of nodes were 5. As the number of nodes increased the throughput for CSMA mode decreased. The gap between CSMA and TDMA widened as the number of nodes increased. When the traffic was increased to 2 packets per second, and 8 packets per second, by increasing the data rates to 16 and 64 Kbps respectively, the trend remained the same. 4.2 Delay Analysis The delay analysis is done in two different instances. In one instance the transmitting nodes are able to reach the sink in one hop. In other instance the data packets are forwarded from transmitting node to sink by the intermediate nodes, multi-hop transmission. We first consider the first instance were the nodes reach the sink in one hop. We consider the time taken by the extreme node in the topology to transmit its packets to the sink. We do this by analysing the trace file generated. Since its one hop the results were almost identical in three scenarios (Figure 4-7).
  • 5.
    Figure 4-7: Delaycomparison between TDMA and CSMA: One hop Delay in TDMA is 0. This is because; no time is wasted for sensing the channel. The total available bandwidth is equally divided among the participating nodes. There is no wastage of the bandwidth. Moreover, the TDMA parameters are set such that the guard times between the slots are 0. Since the nodes are transmitting shorter packet the guard time is not necessary. Delay in multi-hoptransmission In NS-3 the data forwarding is done automatically using the routing protocol implemented in the program. The program implements DSDV protocol. All nodes perform neighbour discovery. The protocol requires the nodes to update information about the neighbouring nodes every 15 secs. In this program first 50 seconds is set aside for the routing protocol to discover routes to all nodes in the network; that is to form the routing table. The data transfer starts only after 50 seconds and the total simulation is run for 100 seconds. By default the nodes send data in packets of size 1000bytes at the rate of 8kbps. Therefore, every node would send one packet to the sink every second. As in the case of throughput analysis we consider three scenarios of 5, 10 and 50 nodes for analysis. The criterion for analysis is that we calculate the time taken for a data packet transmitted by the furthest node in thenetwork to reach the sink. Scenario 1 We consider a total of 5 nodes in a chain topology separated by a distance of 10m with one sink. The maximum transmission distance is set to 12m so that only the nearest node to the sink can send data to it. These parameters were fixed for all the scenarios. The topology is shown in Figure 4-8. Figure 4-8: Data forwarding in a topology of 5 nodes Each packet sent from Node 4 to Sink is forwarded by Node 3 and all these packets sent were analysed from the trace file generated and the average delay taken by the packets in TDMA and CSMA mode were calculated with the help of awk files. The results show that the delay in TDMA is more than that of CSMA. Scenario 2 We consider 10 nodes separated by a distance of 10m with one sink. Each packet from Node 9 sent to the sink is forwarded by the intermediate nodes these packets were analysed to estimate the average delay in TDMA and CSMA. Figure 4-9 shows this scenario. Figure 4-9: Data forwarding in a topology of 5 nodes Scenario 3 We consider 50 nodes separated by 10m distance with one sink. Each packet sent by the Node 49 that reached Sink was analysed for TDMA and CSMA mode and the average delay taken by the packets in these modes were recorded. Figure 4-10 shows this scenario. Figure 4-10: Data forwarding in a topology of 5 nodes The average delay for TDMA and CSMA using 5, 10, 50 nodes are given in a graphical depiction in Figure 4-11. Figure 4-11: Delay comparison between TDMA and CSMA: Multi-hop The delay considering the packet transmission from the extreme last node to the Sink, in a chain topology was found to be considerably more in TDMA than in CSMA. This happens because the slot allocation in TDMA is one slot per node as explained in the TDMA module section. The time slot allocation mechanism in the module developed did not
  • 6.
    allow allocating multipletime slots for a node. The module maintained a rule that the time slot must be exclusively used by one node and provided error on multiple allocations. Thus we were not able to utilise the spatial reuse concept. The spatial reuse concept is by which a fourth node that is two hops away from the first node can utilise the time slot of the first node. The spatial reuse concept is explained in Figure 4-13. The slots in pink color are reusable time slots. These slots would not interfere with the transmission of the other node. This would greatly improve the efficiency of data forwarding and minimise the delay in TDMA. Also one other reason for such massive delay is that the slot allocation is done in forward direction and the data trickles down the reverse direction, Figure 4-12. This means that the node has to wait one full cycle for the next time slot to transmit, thus amounting to more delay. If both data and time slot allocation are in the same direction the delay would be reduced. The spatial reuse concept can be introduced by modifying the TDMA module and allowing multiple time slot allocation. Figure 4-12: Mismatch between direction of slot assignment and data trickle Figure 4-13: Spatial reuse of time slots 5. Conclusion In this project we considered a specific and a rare type of wireless sensor network topology, chain type topology. We state the importance of this topology in certain applications and the lack of research in this area. In the quest to develop a new protocol for this type of topology, we try to provide evidence for justifying the choice of TDMA access technique for this type of topology. We develop a simulation environment consisting of linear chain of sensor nodes and test throughput and delay parameters using TDMA and CSMA access technique. We find that a high throughput is achieved with TDMA access technique than CSMA access technique. This was attributed to the high traffic load of RTS/CTS message exchange. Initially, when the number of nodes were less the throughput for both the technique remained identical, but when the number of nodes were increased throughput of nodes employing CSMA access technique decreased. Lots of data packets were lost due to traffic congestion. The throughput decreased as we increased number of nodes. The trend remained constant when the data rate was increased. When we consider a periodic sensing environment, it is most advantageous to use TDMA since we actually know when the node is going to generate a packet and we can allocate the time slots accordingly. We then analysed the delay aspect of TDMA and CSMA. The delay predictably was more in CSMA than TDMA when ‘one hop to sink’ criterion was considered. The delay in CSMA was caused by the overhead of RTS/CTS message exchange. When ‘ multi-hop to sink ’ criterion was considered, unexpectedly we find the delay in TDMA is more than in CSMA. This was attributed to the inability to make use of the spatial reuse of time slots and mismatch between the time slot allocation direction and data packet propagation direction. The proposed methods to improve the delay are to tweak the module to allow multiple time slot allocation for the nodes and take advantage of the spatial reuse concept. References 1. L. Wang, X. Yan, and Y. Yan, ‘A MAC protocol for chain-type wireless sensor network based on the token’, Sensors and Transducers, vol. 154, pp. 15–23, Jul. 2103. 2. S. Lindsey, C. Raghavendra, and K. Sivalingam, ‘Data gathering in sensor networks using the energy*delay metric ’ , Proceedings 15th International Parallel and Distributed Processing Symposium. IPDPS 2001, 2001. 3. S. Singh and C. S. Raghavendra, ‘PAMAS: Power-aware multi-access protocol with signaling ’ , ACM Comput. Commun, 1998. 4. C. Fang, H. Liu, and L. Qian, ‘LC-MAC: An Efficient MAC Protocol for the Long-Chain Wireless Sensor Networks ’ , 2011 Third International Conference on Communications and Mobile Computing, Apr. 2011. 5. W. Ye, et al., “An energy-efficient MAC protocol for wireless sensor networks”, Proceedings of the Joint Conference of the IEEE Computer and Communications Societies (InfoCom), vol. 3, 2002, pp. 214–226. 6. T. van Dam, K. Langendoen, “An adaptive energyefficient MAC protocol for wireless sensor networks”, Proceedings of
  • 7.
    the International Conferenceon Embedded Networked Sensor Systems (SenSys), 2003, pp. 171–180. 7. P. Lin, et al., “Medium access control with a dynamic duty cycle for sensor networks”, Proceedings of the IEEE Wireless Communications and Networking Conference (WCNC), vol. 3, 2004, pp. 1534–1539. 8. J. Polastre, J. Hill, D. Culler, “Versatile low power media access for wireless sensor networks”, Proceedings of the International Conference on Embedded Networked Sensor Systems (SenSys), 2004, pp. 95–107. 9. A. El-Hoiydi, J.-D. Decotignie, “WiseMAC: an ultra low power MAC protocol for multi-hop wireless sensor networks”, Proceedings of the International Workshop on Algorithmic Aspects of Wireless Sensor Networks (Algosensors), 2004, pp. 18–31. 10. Rhee I, Warrier A, Aia M, et al. “Z-MAC: a Hybrid MAC for Wireless Sensor Networks”, IEEE/ACM Transactions, 2008, vol. 16(3), pp. 511 – 524. 11. Barroso A, Roedig U, and Sreenan C., “μ-MAC: an energy efficient medium access control for wireless sensor networks”, Proc. of the Second European Workshop on Wireless Sensor Networks, Istanbul, 2005, pp. 70 – 80. 12. Cho Sungrae, et al, “Dynamic energy-efficient TDMA- based MAC protocol for wireless sensor networks”, Autonomic and Autonomous Systems and International Conference on Networking and Services, Papeete, Tahiti, Joint International Conference, Oct. 2005, pp.48 48.