Veseo vNet Network Virtualization Layer for Arduino and Android User Guide VT-U
Veseo vNet Network Virtualization Layer for Arduino and Android User Guide VT-UxSI-01 Copyright (C) 2011 Veseo This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Originally written by Dario Di Maio Printed in Italy Veseo Napoli Revision Control Description Author Date Rev. First draft Dario Di Maio 2011 Nov 24 A II Index 1 Purpose and Intended Audience .......................................................................................................4 1.1 Download Source Code.............................................................................................................4 1.2 Base Code..................................................................................................................................4 1.3 Credits........................................................................................................................................4 2 Overview ..........................................................................................................................................5 2.1 Peer to Peer Network.................................................................................................................5 2.2 Supported Network Architectures..............................................................................................5 2.2.1 Single Media......................................................................................................................6 2.2.2 Bridged Networks..............................................................................................................6 2.2.3 Routed Network.................................................................................................................6 2.2.4 Bridged and Routed Networks...........................................................................................7 3 Network Configuration Rules............................................................................................................8 3.1 Addressing Rules.......................................................................................................................8 3.2 Address Translation....................................................................................................................9 3.3 Routing and Bridging Rules......................................................................................................9 4 Application Methods........................................................................................................................11 4.1 vNet Drivers.............................................................................................................................12 4.1.1 Ethernet TCP/IP W5100...................................................................................................12 4.1.2 Chibiduino - 2.4 GHz IEEE 802.15.4..............................................................................13 4.1.3 Future drivers...................................................................................................................13 5 vNet Configuration..........................................................................................................................14 5.1 Drivers Configuration..............................................................................................................15 6 vNet for Android (in progress)........................................................................................................17 7 Souliss Project – Distributed Home Automation.............................................................................18 III Veseo vNet User Guide Doc. No.: VT-UxSI-01 1 Purpose and Intended Audience This document help developers to proper set a vNet network, is intended for people with a basic knowledge of electronics and telecommunication, focused on: wireless and wired networks, IPv4 networks. 1.1 Download Source Code Source code is available on SourceForge from VeseoTech account. 1.2 Base Code The vNet layer code is based on: • Chibiduino Library by FreakLabs, • Ethernet Library by Arduino. 1.3 Credits The vNet code is developed by Veseo and distributed as open source, you can use and modify it as per General Public License GPL v3. 4/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 2 Overview vNet is a network virtualization layer, that allow every application run over different communication media without any change in the code. As additional feature, vNet frames are routed and bridged automatically without any action on the application side, creating a network of devices running over different communication medias, but connected together. vNet is developed for Arduino based platform, but the code can be easily ported over different platforms. It support also Android based devices as node for the virtual network. 2.1 Peer to Peer Network vNet is intended as a software layer for P2P communication, so all the drivers for the available communication media are forced as P2P. There is no concept of server/client, master/slave or similar. Protocols behind vNet must have their own addressing and filtering rules to identify owner and destination. The applications on the top of vNet can use server/client, master/slave or similar concept. 2.2 Supported Network Architectures Basically vNet work all the architecture (out of ring, that is not fully supported) that you can have with the supported media, the configuration may require different detail based on the number of nodes and their interconnection. 5/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 Detail on supported communication media is given in next paragraph, in the below example just consider M1 as communication media one (as instance, wired) and M2 as communication media two (as instance, wireless). 2.2.1 Single Media In this architecture all the nodes has the same communication media, could be either M1 or M2. Refer to example number 2 for an application of this architecture. 2.2.2 Bridged Networks In this architecture there are three types of nodes: first type are nodes with M1 communication media, second type are nodes with M2 communication media, third type are nodes with both M1 and M2. In the simplest case, there are three nodes one for each type. Nodes first and second type can exchange data via the third type, all nodes share the same application and the vNet layer. One or more bridges are supported. Refer to example number 3, 4 for an application of this architecture. 2.2.3 Routed Network In this architecture there are two type of nodes, both share the same communication media. Former type of nodes are standard, latter are SuperNode and are able to repeat a message to cover longer distances. This solution is applicable for wireless networks. SuperNodes can identify automatically the routed path to reach the destination node or may require definition of routing tables in case of more complex networks. 6/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 Refer to example number 1 for an application of this architecture. 2.2.4 Bridged and Routed Networks Is a case where the wireless networks use Nodes and SuperNodes, and one or more bridge to the wired network. Refer to example number 5 for an application of this architecture. 7/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 3 Network Configuration Rules Bridging and routing facility are provided assuming the use of simple network configuration rules, these allow a node to identify how bridge or route a message and if these action are required. 3.1 Addressing Rules The addressing rules used for vNet are mainly the same of IPv4 with one difference, the length of the address. In vNet are used only two bytes (instead of 4 bytes as in IPv4). Furthermore, in vNet the addresses are split by media, this make easy identify which media has to be used for the communication. In the following table are shown the available ranges for all the media, the code support up to five different media (not all are used up to now). A comparison of an address with these ranges is used to find out the media of the relevant address. Media First Address Last Address M1 - Ethernet TCP/IP W5100 0x0000 0x64FF M2 - Chibiduino - 2.4 GHz IEEE 802.15.4 0x6500 0xAAFF M3 – Not Used 0xAB00 0xBBFF M4 – Not Used 0xBC00 0xCCFF M5 – Not Used 0xCE00 0xFEFF Each media has an associated subnet mask, using a bit-wise AND between address and subnet mask, is obtained the subnet of the device. 8/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 3.2 Address Translation vNet addresses use only two bytes, that should be translated in addresses usable for the used media. As example, IPv4 protocol use four byte addresses and a translation from two to four bytes is required. From a math point of view this translation cannot be univalent, so some bytes should be forced using a “base address”. Basically the “base address” is added to two bytes that came from the vNet address. An address translation could create troubles, for example IPV4 routing will no longer work, same for NAT. Is supported IP over the same subnet and VPNs. Actually, only for IP based connection is required a translation because Chibiduino has a two byte address. 3.3 Routing and Bridging Rules Each communication interface has an its own subnet mask and is part of the relevant subnet. As per IPv4 a bit-wise AND operation between the address and the subnet mask give the subnet address. Device within the same subnet must be in listening range, the concept of listening range should be referred to the communication media that are used for the device. As instance, for device that use wireless communication a listening range is the area where the radio are able to send and receive message; for device that use a wired Ethernet a listening range is the switched/routed IP network. As per IPv4, frame that has a destination out of the own subnet are send to a device with routing and/or bridging capability. In this case this device is called SuperNode (and not Gateway) that will bridge or route the message. A SuperNode address is typically the first available address for the subnet, so if you are 9/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 looking for the SuperNode of subnet subn you will send a message to “subn & 0x0001”. Additionally a routing table can be set to force preferred paths or not standard addressing. A device with two or more communication media is not automatically set as bridge, to be a bridge require a SuperNode configuration. A SuperNode with two or mode communication media, is able to bridge frames within its own media without any additional configuration. 10/20 Veseo vNet User Guide Doc. No.: VT-UxSI-01 4 Application Methods As described before, every application that use vNet can be used regardless the communication media without any change in the code. The following schematic shown the vNet structure, whatever is running on the “Application Layer” can access one or more “Media Interface” through the “vNet Layer”. Application Layer vNet Layer Media Int. 1 Media Int. 2 Media Int. 3 Media Int. 4 Media Int. 5 The “vNet Layer” is not able to auto identify the available hardware, so an additional configuration uploads/S4/ vnet-user-guide.pdf
Documents similaires
-
85
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Mai 01, 2022
- Catégorie Law / Droit
- Langue French
- Taille du fichier 0.1709MB