Wireless Controller Area Network Using Token Frame Scheme Wei Lun Ng, Chee Kyun Ng, Borhanuddin Mohd. Ali, and Nor Kamariah Noordin Department of Computer and Communication Systems Engineering, Faculty of Engineering, University Putra Malaysia, UPM Serdang, 43400 Selangor, Malaysia
[email protected], {mpnck,borhan,nknordin}@eng.upm.edu.my
Abstract. The controller area network (CAN) has been long regarded as the pioneer in standardizing vehicle bus standard. Its influence has even been reached out to various applications in industrial automation; which includes military, aviation, electronics and many others. With wireless technology becoming more pervasive, there is a need for CAN too to migrate and evolve to its wireless counterpart. In this paper, a new wireless protocol named wireless controller area network (WCAN) is introduced. WCAN is an adaptation of its wired cousin, controller area network (CAN) protocol which has not being properly defined. The proposed WCAN uses the concept introduced in wireless token ring protocol (WTRP); a MAC protocol for wireless networks and efficient in a sense to reduce the number of retransmission due to collisions. Additionally, it follows most of its wired cousin attributes on message-based communication. Message with higher priority has the first priority in transmitting their message into the medium. In WCAN, stations or nodes take turns in transmitting upon receiving the token frame that are circulating around the network for a specified amount of time. WCAN was tested in a simulation environment and is found that it outperform IEEE 802.11 in a ring network environment. Keywords: MAC, controller area network, wireless controller area network, wireless token ring protocol, token.
1 Introduction The Controller area network (CAN) was created by Robert Boush in mid-1980s as a new vehicle bus communication between control units in automobile industries. In the past, vehicle bus communication uses point to point wiring systems; which cause wiring to become more complex, bulky, heavy and expensive with increasing electronics and controllers deployed in a vehicle [1]. This problem can be seen in Fig 1(a), where the abundance of wiring required makes the whole circuit even more complicated. CAN solves this abundance problem by utilizing twisted pair cable which all control units shares as shown in Fig 1(b). This allows the overall connection to be less
A. Abd Manaf et al. (Eds.): ICIEIS 2011, Part III, CCIS 253, pp. 544–556, 2011. © Springer-Verlag Berlin Heidelberg 2011
Wireless Controller Area Network Using Token Frame Scheme
DEVICE
DEVICE
DEVICE
545
DEVICE
DEVICE
DEVICE
MASTER DEVICE
MASTER DEVICE DEVICE
DEVICE (a)
(b)
Fig. 1. The differences between (a) traditional wiring and (b) CAN methods
complex. Additionally, CAN protocol allow microcontrollers, devices and sensors to communicate within a vehicle without a host computer. Having the advantages of high immunity towards electrical interference and ability to self diagnose, CAN was seen deployed in various automation industry that requires high quality of service (QoS) [1] - [4]. Wireless network on the other hand, has become so pervasive that there are huge demands for higher data rate and better QoS to support services. Unfortunately, the features of wired CAN cannot be adopted in providing ubiquitous service. This paper presents a new approach in utilizing the advantageous of CAN into a wireless network system called wireless controller area network (WCAN). The proposed protocol follows the concept of token as shown in [14] - [17]. It is proven that using token concept has its advantages; in terms of improving efficiency by reducing the number of retransmissions due to collisions; and more fair as all stations use the channel for the same amount of time. The outline of the paper is as follows. Section 2 presents an overview of CAN protocol. An overview of different method in defining WCAN is shown in Section 3. The proposed wireless protocol of WCAN using token frame scheme is described in Section 4. The performance evaluations are discussed in Section 5 and finally this paper is concluded in the last section.
2 CAN Protocol Controller area network (CAN) was first defined by Robert Boush in mid-1980s as a new robust serial communication between control units in automobile such as cars, trucks, and many others. CAN not only reduce the wiring complexity but also made it possible to interconnect several devices using only single pair of wires and allowing them to have simultaneous data exchange [5], [6]. CAN protocol is a message-based protocol, meaning that messages are not transmitted from one node to another based on addresses. Instead, all nodes in the network receive the transmitted messages in the bus and decide whether the message received is to be discarded or processed. Depending on the system, a message can be destined to either one node or many
546
W. Lun Ng et al.
nodes [1] - [3]. This has several important consequences such as system flexibility, message routing and filtering, multicast, together with data consistency [4]. In CAN, collisions of messages are resolved through bit-wise arbitration based on priority of the message. This means that higher priority messages are remain intact even if collisions are detected. Uniquely in CAN, the lower identifier value has the highest priority. This is because the identifier bit value is located at the beginning of the packet and the electrical signal for zero is designed to overwrite the signal for one. Therefore, the logic bit ‘0’ is defined as the dominant bit whereas logic bit ‘1’ as the recessive bit [7]. Figure 2 shows an example of CAN bus arbitration process between 3 nodes with different identifier value.
Fig. 2. CAN bus arbitration [8]
In Fig 2, all nodes start transmitting simultaneously by sending SOF bits first and followed by corresponding identifier bits. The 8th bit of Node 2 is in the recessive state or ‘1’, while the corresponding bits of Nodes 1 and 3 are in the dominant state or ‘0’. Therefore Node 2 stops transmitting and returns to receive mode. The receiving phase is indicated by the grey field. The 10th bit of Node 1 is in the recessive state, while the same bit of Node 3 is in dominant state. Thus Node 1 stops transmitting and returns to receive mode. The bus is now left for Node 3, which can send its control and data fields at will.
3 Wireless Controller Area Network The wireless controller area network (WCAN) is a new approach of using CAN message-based protocol in wireless network. Various ideas have been proposed by
Wireless Controller Area Network Using Token Frame Scheme
547
researchers to allow an ease of transition from CAN into WCAN [9] - [13]. Most research centered on the MAC layer in providing protocol to WCAN. 3.1 WCAN Using RTS / CTS Scheme Dridi et. al in [9] - [11] proposed to apply contention based WCAN protocol using RTS/CTS mechanism that are used in IEEE 802.11 protocol. The RTS/CTS mechanism is used to reduce frame collisions introduced by the hidden node problem. Dridi et. al uses RTS/CTS mechanism in managing priority considerations between nodes. Changes are done to the standard RTS/CTS frame that allows message identifier. The MAC-addresses in RTS and CTS frame are replaced by the 29-bit CAN message identifier to allow message-based protocol. Additionally, RTS/CTS mechanism is used to enable a station or node to reserve the medium for a specified amount of time by specifying the duration field that the station/node requires for a subsequent transmission. This reservation information is stored in all stations in a variable called Network Allocation Variable (NAV) and represents the Virtual Carrier Sense. Inter- Frame Space (IFS) are used to control the priority access of the station to the wireless medium and it represents the time interval between each transmission of frames with Short IFS (SIFS) as the smallest type of IFS. 3.2 WCAN with RFMAC and WMAC Access Method The authors in [12], [13] propose RFMAC and WMAC protocols to be operated in both centralized and distributed WCAN networks. The RFMAC protocol operates in a centralized WCAN manner that consists of a master node and a number of slave nodes that are in the range of master node. The RFMAC method uses the Idle Signal Multiple Access (ISMA) as its reference method. This access method enables upstream (to central node) and downstream (to terminals) to be transmitted on a same shared channel. Instead of using the message identifier, the central or master node periodically broadcast out remote frames to all terminals in the network. If the master node wishes to have data from any node, it broadcast a remote frame to the channel. All nodes on the network receive the remote frame and decide whether the remote frame belongs to the node by using acceptance filtering. If the remote frame identifier does not match with the acceptance filter, the terminal node stays idle. Else, a data frame is sent out by the terminal node with the same frame identifier. Fig. 3 displays how the remote frame traffic works in RFMAC.
Fig. 3. Remote frame message traffic
548
W. Lun Ng et al.
The WMAC WCAN on the other hand, allows several nodes to communicate with each other without the assistance of a central node. Contention situation is solved by utilizing different Priority IFS (PIFS) for each message. Each node must wait messages for PIFS time before they are allowed to send their message. PIFS times provide message priority and are derived from the scheduling method which is performed by the user application. The shortest PIFS takes the highest priority as it requires the shortest delay to access the channel. Figure 4 shows how PIFS provides channel access to two nodes.
Fig. 4. WMAC timing diagram
In Fig 4, node B and node C tries to access the channel at the same time. As node C has the shortest PIFS, it sense the channel is idle and starts transmitting its message. After a short while, node B’s PIFS expires and it sense that the channel is currently occupied by node C. Therefore, node B waits for node C to conclude its transmission before transmit out its message packet.
4 Wireless Controller Area Network Using Token Frame Inspired by the token frame scheme introduced in [14] - [17], WCAN uses token frame in transmitting messages around the network. Also, the token defines the ring network by setting the successor and predecessor field present in each node. Following the scheme, the proposed WCAN is a wireless based distributed medium access control (MAC) protocol for ad-hoc network. Having a wireless based distributed MAC has its advantageous of being robust against single node failure as it can recover gracefully from it. Additionally, nodes are connected in a loose and partially connected manner.
Wireless Controller Area Network Using Token Frame Scheme
549
4.1 WCAN Token Format Transmission of messages proceeds in one direction along the ring network of WCAN. As such, each node requires a unique successor and predecessor present in the network. The token is the crucial part in WCAN network as it allows a smooth transmission of packet between nodes. Furthermore, it defines the current mode of operation running in the network. Fig 5 shows the proposed token format used in WCAN. FC 4
RA 6
DA 6
SA 6
Seq 4
bytes
Fig. 5. WCAN token frame
The Frame Control (FC) contains the frame type indicator and message identifier CAN format. The frame type indicator allows the receiving node identifies the type of token received; such as Token, Soliciting Successor, Data Token, Token Delete Token, Implicit Acknowledgement, Set Successor and Set Predecessor. Message identifier of the token follows the principal as used in CAN protocol, which is a message broadcast. In addition to FC, the token also includes the ring address (RA), destination address (DA), and the source address (SA) that defines the direction and the flow of the token frame. RA refers to the ring which the token frame belongs to. The sequence number is used to build an ordered list and determine the number of stations or nodes that present in the ring. As previously stated, the WCAN token allows a smooth transmission of packet between nodes in the wireless medium. Therefore, in order for a node to gain access to the medium, the node must first capture the token that circulates around the network. The token is generated first by a ring master assigned in the network. Once a token is captured, a node wins the arbitration by comparing the message identifier located in FC. The arbitration access follows the same concept as in CAN which is lower message identifier value has the highest priority. Once a node wins the arbitration, it will place its message identifier into the FC field and start transmitting its data to the next node on its list. The next node captures the token and examines the message identifier first. If the message identifier of the receiving node has lower priority than the token had, the node will relay the token to the next node on its ordered list. However, if the node wants to transmit a message or information which is in turn having higher priority, it will replace the message identifier in the token with its own and transmits it to the next node. A node will only know if its transmission is successful when the token it receives next contains the same message identifier it has. Otherwise, it will be in receiving mode until it receives the token back with a lower priority message identifier. Fig 6 shows an example of how the token transmission works in the network. In Fig 6, station D monitors the successive token transmission from B to C before the token comes back to E. At time 0, D transmits the token with sequence number 0. At time 1, E transmits the token with the sequence number 1 and so on. D will not hear the transmission from F and A but when it hears transmission from B, it will notice that the sequence number has been increased by 3 instead of 1, This indicates that
550
W. Lun Ng et al.
Fig. 6. The ordered list and system architecture of station D
there were two stations that it could not hear between A and F. With this information, station D could build an ordered list of nodes that are available in the ring as shown in the connectivity of D. 4.2 WCAN Operation The WCAN operation can be divided into two main operations; namely the normal operation and the soliciting operation. The normal operation only involves data packet transmission within WCAN network with a set number of nodes. The soliciting operation however engages a lot of decision making as it involves soliciting operation with nodes that are outside of the network. 4.2.1 Normal Operation In normal operation, nodes only made certain changes on its operating module. In this operation, there is no joining process, which means either the ring is full or there is no station outside of the ring. When a node gets the token in its idle state, it goes to have token and monitoring state. The station goes back to the idle state from the monitoring state when it receives the implicit ack. 4.2.2 Soliciting Operation The soliciting operation involves many procedures in order for a node to join or leave the network. In order for the ring to be flexible in its network topology, partial connectivity has been introduced. Nodes are allowed to join the ring in a dynamic manner. Nodes can join if the rotation time (sum of token holding times per node) would not grow unacceptably with the addition of the new node. A different approach is done to enable a node to leave the network. For a node to leave the network, it must first inform its successor and predecessor that it is leaving the network.
Wireless Controller Area Network Using Token Frame Scheme
551
Fig. 7. Node G joining the network
Fig 7 illustrates an example of node G joining the network. Node B invites node G to join by sending out a SOLICIT_SUCCESSOR token. Node G accepts the token and responds by sending out a SET_SUCCESSOR token to node B. The node B will then transmit yet another token, SET_PREDECESSOR to node G indicating that node C will be node G predecessor node. Node G sends the SET_PREDECESSOR token to node C and brings the joining process to completion.
Fig. 8. Node C leaving the network
On the other hand, Fig 8 illustrates how node C leaves the ring network. Firstly, node C waits for the right to transmit. Upon reception of the right to transmit, node C sends the SET_SUCCESSOR token to its predecessor node B with the address of its new predecessor node D. If B can hear D, B tries to connect to node D by sending a SET_PREDECESSOR token. If B cannot be connected to node D, node B will find the following connected node and send the SET_PREDECESSOR token. 4.3 Timing
Fig. 9. Timing diagram of WCAN
552
W. Lun Ng et al.
As stated earlier, the transmission of messages in WCAN proceeds in one direction along the ring network. Fig 9 shows the timing diagram of WCAN token and message. Assume that there are N nodes on the said ring network. Also, Tn and Tt is
defined as the time needed in transmitting messages and token respectively. Out of the total N nodes in the network, another assumption is that only n active nodes are actively operating while the other nodes are inactively operating. By assuming the propagation delay (PROP) as DCF interframe space (DIFS), the token rotation time (TRT) can be calculated as (1) In WCAN, the active nodes may send one packet and one token in a token rotation cycle, while the inactive nodes just forward the token. Thus, the aggregate throughput, S for a token ring network with n active nodes may derive as (2) 4.4 WCAN Implementation The proposed WCAN protocol is simulated and deployed using QualNet simulator. The QualNet simulator is chosen for its many model libraries for well-known protocol and its performance evaluation technique. Additionally, the simulator allows programmer to build a new protocol over its existing libraries easily using C++ programming. Moreover, it reduces costs by providing support for visual and hierarchal model design. A snapshot of one of the scenario built using QualNet can be seen in Fig 10.
Fig. 10. The snapshot of implementation of WCAN in QualNet
The proposed WCAN protocol is compared with the standard IEEE 802.11 using QualNet simulator. Table 1 shows the simulation scenario parameter for both IEEE 802.11 and WCAN standards. In terms of network size, the simulation is done from 10 to 70 nodes which covers scenario from small to large networks. As for the node placement, the nodes are all placed in a ring manner. The IEEE 802.11b has been chosen as the physical layer for both the standards.
Wireless Controller Area Network Using Token Frame Scheme
553
Table 1. Simulation parameter of WCAN and IEEE 802.11 in QualNet simulator Parameter Traffic type Nodes Simulation Time MAC layer protocol Physical layer radio type Packet payload Node Placement
Value CBR 10 to 70 nodes 25 seconds WCAN and IEEE 802.11b IEEE 802.11b 512 bytes Ring Network
5 Performance Evaluation of Simulated WCAN The performances of WCAN are evaluated in terms of its throughput and the average end-to-end delay. The performances metric are simulated out using QualNet simulator as discussed previously. Throughput is defined as the average rate of data packets received at destination successfully. It is often in the measurement of bits per second (bit/s or bps), and occasionally in data packets per second. In other words, throughput is the total amount of data that a receiver receives from the sender divided by the time it takes for the receiver to get the last packet. Lower throughput is obtained with a high delay in the network. The other affecting factors which are out of the scope of this study include bandwidth, area, routing overhead and so on. Throughput provides the ratio of the channel capacity utilized for positive transmission and is one of the useful network dimensional parameters.
Fig. 11. The throughput performance between WCAN and IEEE 802.11
554
W. Lun Ng et al.
From Fig 11, it can be seen that WCAN protocol slightly maintains its throughput regardless of its number of nodes in a ring environment. However, the IEEE 802.11 protocol has an irregular throughput value in the same environment. Additionally, its overall throughput is lower than that of WCAN in a ring network environment. This may be due to the placement of nodes that causes the nodes to have contentions between its neighboring nodes [18]. Another possible situation is the unusual role of wireless node as router and hosts simultaneously that cause this abnormality [19]. On the other hand, the average end-to-end delay is defined as the time taken for a particular packet transmitting from the source to destination and the discrepancy is computed between send times and received time. The delay metric includes delays due to transfer time, queuing, route discovery, propagation and so on; meaning that it is regarded as how long it took for a packet to travel across a network from source node to destination node. Commonly, lower end-to-end delay shows that a said protocol to be good in its performance due to lack of network congestion.
Fig. 12. The average end-to-end delay performance between WCAN and IEEE 802.11.
Looking at Fig 12, it can be seen that the average end-to-end delay of WCAN increases linearly with increasing number of nodes in a ring network. However, the IEEE 802.11 shows a much lower value for its average end-to-end delay. This is because the packet in WCAN environment is passed through each of the nodes present in the ring network in a circular motion. Comparing to IEEE 802.11, the packets are directly transmitted to the destination node using mesh network capability.
Wireless Controller Area Network Using Token Frame Scheme
555
6 Conclusion This paper presents a new wireless protocol namely wireless controller area network (WCAN). WCAN uses the token frame scheme as depicted in [26 - 29] with some modification on the token format and its operation. Furthermore, the flexibility of topologies allows nodes to join and leave the network dynamically. This characteristic gives rise to easier and more versatile design of a home automation system. The developed WCAN is built on the MAC layer as a wireless based distributed MAC protocol for ad-hoc network. WCAN was deployed using QualNet simulator and achieve mixed reaction results. Simulation results show that WCAN outperform IEEE 802.11 in terms of throughput in a ring network environment. However, in terms of average end-to-end delay, WCAN increases linearly with increasing number of nodes and is slightly higher than IEEE 802.11. This is due to the fact that every node takes turn in transmitting the token around the ring network causing the overall delay to increase. From the results, it’s shown that WCAN provide ‘fair’ share for all nodes by scheduling the transmission with token reception. Additionally, WCAN is advantageous by reducing collision probability, by distributing the resource fairly among each node.
References 1. Pazul, K.: Controller Area Network (CAN) Basics. Microchip Technology Inc. (1999) 2. Chen, H., Tian, J.: Research on the Controller Area Network. In: International Conference on Networking and Digital Society, vol. 2, pp. 251–254 (2009) 3. Corrigan, S.: Introduction to the Controller Area Network (CAN). Texas Instrument, Application Report (2008) 4. Robert Bosch GmbH.: CAN Specification, Version 2.0 (1991) 5. Farsi, M., Ratcliff, K., Barbosa, M.: An overview of controller area network. Computing & Control Engineering Journal 10, 113–120 (1999) 6. Lee, K.C., Lee, H.H.: Network-based fire-detection system via controller area network for smart home automation. IEEE Transactions on Consumer Electronics 50, 1093–1100 (2004) 7. Pérez Acle, J., Sonza Reorda, M., Violante, M.: Early, Accurate Dependability Analysis of CAN-Based Networked Systems. IEEE Design and Test of Computers 23(1), 38–45 (2006) 8. Ng, W.L., Ng, C.K., Noordin, N.K., Rokhani, F.Z., Ali, B.M.: Home appliances controller using wireless controller area network (WCAN) system. In: 2010 International Conference on Computer and Communication Engineering (ICCCE), pp. 1–6 (2010) 9. Dridi, S., Gouissem, B., Hasnaoui, S.: Performance Analysis of Wireless Controller Area Network with Priority Scheme. In: The Sixth Annual Mediterranean Ad Hoc Networking Workshop, pp. 153–158 (2007) 10. Dridi, S., Kallel, O., Hasnoui, S.: Performance Analysis of Wireless Controller Area Network. International Journal of Computer Science and Network Security (2007) 11. BenGouissem, B., Dridi, S.: Data centric communication using the wireless Control Area Networks. In: IEEE International Conference on Industrial Technology, pp. 1654–1658 (2006)
556
W. Lun Ng et al.
12. Kutlu, A., Ekiz, H., Powner, E.T.: Performance analysis of MAC protocols for wireless control area network. In: Proceedings of Second International Symposium on Parallel Architectures, Algorithms, and Networks, pp. 494–499 (1996) 13. Kutlu, A., Ekiz, H., Powner, E.T.: Wireless control area network. In: IEE Colloquium on Networking Aspects of Radio Communication Systems, pp. 3/1 –3/4 (1996) 14. Ergen, M., Lee, D., Sengupta, R., Varaiya, P.: WTRP - wireless token ring protocol. IEEE Transactions on Vehicular Technology 53(6), 1863–1881 (2004) 15. Ergen, M., Lee, D., Sengupta, R., Varaiya, P.: Wireless token ring protocol-performance comparison with IEEE 802.11. In: Eighth IEEE International Symposium on Computers and Communication, pp. 710–715 (2003) 16. Lee, D., Puri, A., Varaiya, P., Sengupta, R., Attias, R., Tripakis, S.: A wireless token ring protocol for adhoc networks. In: IEEE Aerospace Conference Proceedings, vol. 3, pp. 31219 – 3-1228 (2002) 17. Lee, D., Attias, R., Puri, A., Sengupta, R., Tripakis, S., Varaiya, P.: A wireless token ring protocol for intelligent transportation systems. IEEE Intelligent Transportation Systems, 1152–1157 (2001) 18. Akyildiz, I.F., Wang, X.: A Survey on Wireless Mesh Networks. IEEE Commun. Mag. 43(9), S23–S30 (2005) 19. Sichitiu, M.L.: Wireless mesh networks: Opportunities and challenges. In: Proceedings of World Wireless Congress (2005)