The Z-Wave protocol is a low-bandwidth, half-duplex transmission protocol designed for wireless communications in highly reliable, low-power mesh networks. The main purpose of the protocol is to reliably transmit short control information between the control unit and one or more node units.
The protocol is divided into 5 layers from bottom to top: physical layer, MAC layer, transport layer, routing layer, and application layer. The MAC layer is responsible for the establishment, maintenance, and termination of wireless data links between devices. At the same time, control channel access, frame verification, and time slot management are reserved. In order to improve the reliability of data transmission, when a node performs data transmission, the media medium layer also adopts a carrier sense multiple access, collision avoidance (CSMA/CA) mechanism to prevent other nodes from transmitting signals.
The transport layer is mainly used to provide reliable data transmission between nodes. The main functions include retransmission, frame verification, frame confirmation, and traffic control. The routing layer controls the routing of data frames between nodes, ensures that data frames can be repeatedly transmitted between different nodes, scans the network topology, and maintains routing tables. The application layer is responsible for the execution of decoding and instructions in the Z-Wave network. The main functions include Manchester decoding, instruction identification, allocation of HomeID and Node ID, replication of controllers in the network, and control of the payload of transmitting and receiving frames. Wait.
1) Physical layer
Z-Wave is a low-rate wireless technology that focuses on low-rate applications and has two transmission rates of 9.6 Kbit/s and 40 Kbit/s. The former is used to transmit control commands, while the latter provides more advanced network security mechanisms. . Its operating frequency band is flexible. It is in the 900 MHz (ISM (Industrial Scientific Medical) band), 868.42 MHz (Europe), and 908.42 MHz (United States). Relatively few devices operate in these bands, and 2.4 GHz is used by ZigBee or Bluetooth. Bands are becoming increasingly crowded and interference with each other is unavoidable, so the Z-Wave technology can better guarantee the reliability of communications.
Z-Wave's power consumption is extremely low. It uses Frequency-Shift Keying (FSK) wireless communication, which is suitable for use in smart home networks. The battery-powered nodes usually stay in a sleep state, wake up once every once in a while, and monitor whether there is data that needs to be received. Ordinary batteries on the 7th can be used for up to 10 years, eliminating the need for frequent charging and replacing the battery, ensuring long-term stability of the application.
Z-Wave's system complexity is smaller than ZigBee, much smaller than Bluetooth devices, the protocol is simple, and the required storage space is small. The standard Z-Wave module is designed with 32KB of flash memory for storing the protocol, while the equivalent ZigBee module requires at least 128KB to use, Bluetooth requires more. Therefore, the cost of the Z-Wave module is lower than that of a ZigBee or Bluetooth device.
The Z-Wave network capacity is a single network with a maximum of 232 nodes, far lower than the 65,535 ZigBee. Z-Wave nodes typically cover indoor 30m and outdoor 100m, supporting up to four levels of routing. The general applicability of the application is worse than that of ZigBee, and a single technology cannot be used to establish a large-scale network. But for smart home applications, it is enough to cover the entire range. Using virtual node technology, Z-Wave networks can also communicate with other types of networks.
2) MAC layer
Z-Wave's MAC layer controls the wireless medium. The data stream is Manchester encoded, and the data frame contains the previous code, frame header, frame data, and frame trailer. Frame data is the part of the frame passed to the transport layer. All data is transmitted in little-endian mode. The MAC layer is independent of the wireless medium, frequency, and modulation method, but requires the frame data or the entire binary signal to be obtained from the Manchester coded bit stream or the decoded bit stream when data is received. The data is transmitted via an 8-bit data block. The first bit is the Most Significant Bit (MSB). The data is Manchester encoded to obtain a DC-free signal.
The MAC layer has a collision avoidance mechanism to prevent nodes from starting data transmission when other nodes send data. The collision avoidance mechanism is implemented by the following method: let the node that is not transmitting data enter the receive mode; if the MAC layer is in the receiving data phase, the transmission is delayed, and the collision avoidance mechanism is activated on all types of nodes. When the medium is busy, the transmission of the frame is delayed by a random number of milliseconds.
The core of the MAC layer collision avoidance mechanism is CSMA/CA, which includes carrier sense, inter-frame spacing and random back-off mechanism. Each node uses a Carrier Sense Multiple Access (CSMA) mechanism for distributed access, allowing each node to contend for the channel to obtain transmission rights. The CSMA/CA mode uses a two-way handshake mechanism, that is, an ACK (Acknowledgement) mechanism: When a receiver correctly receives a frame, it immediately sends an acknowledgment frame ACK, and the sender receives the acknowledgment frame. It knows that the frame has been successfully transmitted. . If the idle time is greater than or equal to the frame interval, the data is transmitted, otherwise the transmission is delayed.
The basis of CSMA/CA is carrier sense. The physical carrier monitoring is completed at the physical layer, and the effective signal received by the antenna is detected. If such a valid signal is detected, the physical carrier monitoring determines that the channel is busy, MAC carrier monitoring is completed at the MAC layer, and the continuous domain in the MAC frame is detected. carry out. Data can be sent only when the channel is idle. If the channel is busy, a backoff algorithm is performed, and then the channel is re-detected to avoid collision of shared media. The time when the medium busy state just ended is the peak time of the collision. Many nodes in the county wait for the medium and the media is idle. All nodes try to send and cause a lot of collisions. Therefore, CSMA/CA uses random backoff time to control each node frame. Send.
3) Transport layer
The transport layer is mainly used to provide reliable data transmission between nodes. The main functions include retransmission, frame verification, frame verification, and traffic control. There are three types of transport layer frames.
Unicast Frame: A unicast frame is sent to a specified node. If the target node successfully receives this frame, it will reply with a reply frame ACK. If the unicast frame or response frame is lost or damaged, the unicast frame will be retransmitted. In order to avoid collisions with other systems, retransmission frames will have a random delay. The random delay must be the same as the time it takes to transmit the maximum frame length and receive the response frame. Unicast frames can choose to turn off the answering mechanism in systems that do not require reliable transmission. The response frame is a type of Z-Wave unicast frame whose length of the data field is o.
Multicast frames: Multicast frames will be transmitted to several of nodes 1 through 232 in the network. The multicast frame destination address specifies all destination nodes without sending a separate frame to each node. Multicast does not respond, so this type of frame cannot be used in systems that require reliable transmission. If multicast frames must require reliability, multicast frames need to be followed by unicast frames.
Broadcast frames : Broadcast frames are transmitted to all nodes in the network, and no node responds to the frame. As with multicast frames, it cannot be used in systems that require reliable transmission. Like multicast frames, if broadcast frames must require reliability, then broadcast frames need to be followed by unicast frames.
4) Routing layer
The routing layer controls the routing of a node's frame to another node. Both controllers and nodes participate in the routing of frames. They are always listening and have a fixed position. This layer is responsible for sending frames through a correct forwarding table, and it also ensures that frames are forwarded between nodes and nodes. The routing layer also scans the network topology and maintains the routing tables in the controller.
The routing layer of Z-Wave technology adopts Dynamic Source Routing (DSR) protocol. The DSR protocol is an on-demand routing protocol that allows nodes to dynamically discover routes to a destination node. The header of each data frame is appended with the list of nodes that are required to reach the destination node. That is, the data packet contains the destination node. Complete routing. Different from the traditional routing methods, traditional routing methods, such as the Ad Hoc On-demand Distance Vector Routing (AODV) protocol, only include the next-hop node and the destination node address in the packet, so the DSR does not require a periodic broadcast network topology. Information, to avoid large-scale network updates, can effectively reduce network bandwidth overhead and save energy consumption.
When a route is discovered, the source node sends a route request frame containing a source route list. At this time, the route list has only the source node. The node that received the frame continues to send the frame forward and adds its own node address to the route list. Until you reach the target node. Each node has a storage area that holds the most recently received routing request.
Therefore, the received request frame may not be repeatedly transmitted. Some nodes (if they have additional external storage space) will store the obtained source routing table to reduce the routing overhead. When receiving the request frame, it first checks whether there is a suitable route in the stored routing table. If there is no further forwarding, the route is returned to the source node directly. If the request is forwarded to the target node, the target node will return a return. routing.
When the source node wants to communicate with the target node, the source node first broadcasts a RREQ message with a unique ID, and is received by one or more intermediate nodes with routing information to the target node in the wireless coverage of the source node, and returns the routing information. To the source node. Each node's routing buffer records the routing information that the node is listening to. When a node receives a RREQ message, it discards the request if the request is included in the node's most recent request; if the RREQ route record contains the address of the current node, no processing is performed to prevent a loop; if the current If the node is the target node, then a return route is sent to the source node; in other cases, the node adds its own address in the RREQ and broadcasts the frame.
When a node on the route list moves or loses power, the network topology changes and the route becomes unavailable. When the upstream node discovers that the connection is not available through the MAC layer protocol, it sends RERR to all upstream nodes. After receiving the RERR, the source node removes the invalid route from the route store. If necessary, the source node will initiate the route discovery process again to establish a new route.
The DSR protocol does not need to periodically exchange routing information, which can reduce network overhead. Nodes can enter sleep mode to save battery power. The data frame contains complete routing information. The node can obtain some useful information contained in the complete route. For example, routes A through B to C contain routing information from B to C. Node B does not need to initiate route discovery for C. This saves the overhead required for route discovery. At the same time, the size of the DSR protocol network is limited because many packets carry routing information. Excessive routing tables can significantly increase network packet overhead, given the limitation and maximum number of 232 nodes in a Z-Wave network. Supporting 4-hop routing, the overhead of the DSR protocol is not very serious. The enhanced node type also has a larger external storage space to store recently used routing information, and also uses hardware overhead to compensate for network performance.
5) Application layer
The application layer is responsible for the execution of decoding and instructions in the Z-Wave network. The main functions include Manchester decoding, instruction identification, assigning Home ID and Node ID, replicating controllers in the network, and carrying payloads for transmitting and receiving frames. Control etc. Z-Wave technology focuses on the interoperability of devices and the convenience of vendor development, and introduces related mechanisms in the application layer to achieve this.
In order to realize the interaction of many subsystems in the smart home control system and enhance the interoperability of manufacturers' products in various fields, Z-Wave provides a standardized method to realize the interaction between equipment and equipment. This allows the remote control made by a certain manufacturer to provide the dimming function of the lighting subsystem and control the light node made by another manufacturer. In this way, all manufacturers only need to concentrate on developing products that they are good at. They can work well in a Z-Wave network without having to install a whole set of smart home systems on their own, which provides convenience for the development of manufacturers.
For more information on smart background music control systems and smart security alarm systems , click here!
related suggestion:
A: The technical principle of smart fingerprint lock, how much do you know?
Recommended: smart door lock brand join smart lock machine smart door lock ranking
Kitchen Appliance,Double/Single Burners Stove,Smart Kitchen Appliance,Save Energy Induction Cooker
JOYOUNG COMPANY LIMITED , https://www.globaljoyoung.com