Repository : ssh://git@diktynna/doc
On branch : master
commit db18301912b71a3e46588574bfe9a5393061950e Merge: 26ea6f6 20a0ea2 Author: Sven Eckelmann sven@narfation.org Date: Mon Aug 17 00:29:31 2020 +0200
Merge branch 'backup-redmine/2020-08-16'
db18301912b71a3e46588574bfe9a5393061950e batman-adv/Batman-adv-openwrt-config.rst | 70 +- .../Network-wide-multi-link-optimization.rst | 3 +- batman-adv/interface_detection.dia | 757 --------------------- batman-adv/interface_detection.svg | 57 -- batman-adv/primary_flag.dia | 595 ---------------- batman-adv/primary_flag.svg | 61 -- open-mesh/FFTrace.rst | 33 - open-mesh/Gsoc2010-ideas.rst | 211 ------ open-mesh/Gsoc2011-ideas.rst | 281 -------- open-mesh/Gsoc2011-roadmap.rst | 19 - open-mesh/Gsoc2012-ideas.rst | 14 - open-mesh/Kernel_hacking_Debian_image.rst | 1 + open-mesh/MeshLinux.rst | 29 - open-mesh/NetworkingTechnologies.rst | 42 -- open-mesh/News-draft.rst | 107 +-- open-mesh/Wbmv4-batmandev-agenda.rst | 34 - open-mesh/Wbmv5-batmandev-agenda.rst | 31 - open-mesh/Wbmv6-batmandev-agenda.rst | 68 -- open-mesh/WikiStart.rst | 7 - open-mesh/random.rst | 10 - 20 files changed, 38 insertions(+), 2392 deletions(-)
diff --cc batman-adv/Batman-adv-openwrt-config.rst index 7168ee8,0000000..82dc90a mode 100644,000000..100644 --- a/batman-adv/Batman-adv-openwrt-config.rst +++ b/batman-adv/Batman-adv-openwrt-config.rst @@@ -1,320 -1,0 +1,254 @@@ +.. SPDX-License-Identifier: GPL-2.0 + +B.A.T.M.A.N. OpenWrt configuration +================================== + +This page showcases some basic batman-adv configurations on OpenWrt +including wireless & network setups. However, the goal is to provide not +more than a starting point. For a full reference of the OpenWrt uci +system please visit the official `OpenWrt uci +documentation https://wiki.openwrt.org/doc/uci`__. + +The configuration for the following common example is provided: One AP +with a wireless adhoc interface is supposed to run batman-adv +(essentially, the setup explained in our +:doc:`Quick-start-guide <Quick-start-guide>`). + +Batman-adv 2019.0-3 and newer +----------------------------- + +With batman-adv 2019.0-3, the OpenWrt package was modified to better integrate +in the netifd infrastructure. It now provides three different protos: + +* batadv_hardif + + * network interface used by batadv meshif to transport the batman-adv packets + * its master interface is set to the batadv meshif + +* batadv (meshif/softif) + + * virtual interface that emulates a normal 802.3 interface on top + * encapsulates traffic and forwards it via the batadv hardifs + +* batadv_vlan + + * potential VLAN ID on top of batadv meshif + * allows filtering of traffic from specific VIDs + +The wireless configuration in '/etc/config/wireless':: + + config wifi-device 'radio0' + option [..] + + config wifi-iface 'wmesh' + option device 'radio0' + option ifname 'mesh0' + option network 'bat0_hardif_mesh0' + option mode 'mesh' + option mesh_id 'mesh' + option mesh_fwding '0' + option mesh_ttl '1' + option 'mcast_rate' '24000' + + +It is assumed you configured the 'wifi-device' depending on your requirements +and your hardware. The interesting part is the 'wifi-iface' stanza with its +options: + +device + points back to your radio (wifi-device) interface + +ifname + allows you to specify an arbitrary name for your adhoc/meshpoint interface + +network + points to the corresponding stanza in '/etc/config/network' + +mode + defines the wifi mode - 802.11s mesh(point) in our case + +mcast_rate + helps to avoid low bandwidth routes (routes with a lower throughput rate than + the mcast rate will not be visible to batman-adv) + +mesh_id + is a basic wireless settings (like an SSID) you might want to set to + your liking + +More information can be found in the `OpenWrt wireless configuration https://wiki.openwrt.org/doc/uci/wireless`__ + +The first step is to create the "batadv" mesh interface (in our case "bat0") +in /etc/config/network with the optional list of options:: + + config interface 'bat0' + option proto 'batadv' + ## optional settings to override the defaults: + option routing_algo 'BATMAN_IV' + option aggregated_ogms 1 + option ap_isolation 0 + option bonding 0 + option fragmentation 1 + option gw_mode 'off' + #option gw_bandwidth '10000/2000' + #option gw_sel_class 20 + option log_level 0 + option orig_interval 1000 + option bridge_loop_avoidance 1 + option distributed_arp_table 1 + option multicast_mode 1 + option multicast_fanout 16 + option network_coding 0 + option hop_penalty 30 + option isolation_mark '0x00000000/0x00000000' + +The next step is to add actual network device has "batadv_hardif" to the "bat0" +batadv meshif. This is done by specifying a "batadv_hardif" interface section +per network device. Here we add eth0 and the mesh0 (from /etc/config/wireless) +to bat0. It is important to adjust the MTU of the batadv_hardif devices +to avoid fragmentation.:: + + # add *single* wifi-iface with network bat0_hardif_mesh0 as hardif to bat0 + config interface 'bat0_hardif_mesh0' + option proto 'batadv_hardif' + option master 'bat0' + option mtu '1536' + # option ifname is filled out by the wifi-iface + + # add eth0 as hardif to bat0 + config interface 'bat0_hardif_eth0' + option proto 'batadv_hardif' + option master 'bat0' + option mtu '1536' + option ifname 'eth0' + option 'elp_interval' 500 + # change throughput_override to 0 to use automatic detection; also allows kbit suffix + option 'throughput_override' '1mbit' + +The "bat0" batadv meshif can then be used like any other network device. It +can be added to bridges by adding "bat0" to the list of "ifnames" of the bridge. +Or an IP can be configured using:: + + # configure IP on bat0 + config interface 'bat0_lan' + option ifname 'bat0' + option proto 'static' + option ipaddr '192.168.1.1' + option netmask '255.255.255.0' + option ip6assign '60' + +VLAN specific options have to be configured in a separated stanza having +protocol 'batadv_vlan'. + +In this particular section the user has to specify the name of the VLAN +interface (that will be automatically created by netifd) and then list all the +wanted options. At the moment the only available option for this section is +'ap_isolation':: + + config interface 'my_bat_vlan1' + option proto 'batadv_vlan' + option ifname 'bat0.1' + option ap_isolation '1' + +Any VLAN specific option can still be listed in the batadv meshif configuration +for 'bat0' and in that case they will affect the behaviour only for the plain +mesh interface (i.e. bat0 - the untagged LAN). + + - Batman-adv 2013.0.0 and till 2019.0-2 - -------------------------------------- ++Batman-adv 2019.0-2 and older ++------------------------------ + +With batman-adv 2013.0.0 the OpenWrt package was converted to integrate +with OpenWrt's netifd system. This has some impact on the configuration +but not much. + +The wireless configuration in '/etc/config/wireless': + +:: + + config wifi-device 'radio0' + option [..] + + config wifi-iface 'wmesh' + option device 'radio0' + option ifname 'adhoc0' + option network 'bat0_hardif_wlan' + option mode 'adhoc' + option ssid 'mesh' + option 'mcast_rate' '18000' + option bssid '02:CA:FE:CA:CA:40' + +It is assumed you configured the 'wifi-device' depending on your +requirements and your hardware. The interesting part is the 'wifi-iface' +stanza with its options: + +* 'device' points back to your radio (wifi-device) interface +* 'ifname' allows you to specify an arbitrary name for your adhoc + interface (which we are going to re-use later) +* 'network' points to the corresponding stanza in + '/etc/config/network' +* 'mode' defines the wifi mode (adhoc in our case) +* 'mcast_rate' helps to avoid low bandwidth routes (routes with a + lower throughput rate than the mcast rate will not be visible to + batman-adv) +* 'ssid' and 'bssid' are basic wireless settings you might want to + set to your liking + +More information can be found in the `OpenWrt wireless +configuration https://wiki.openwrt.org/doc/uci/wireless`__ + +The network configuration in '/etc/config/network' allows to specify +batman-adv as protocol and the batman-adv interface name. + +:: + + config interface 'bat0_hardif_wlan' + option mtu '1532' + option proto 'batadv' + option mesh 'bat0' + + config interface 'bat0_hardif_eth0' + option mtu '1532' + option proto 'batadv' + option mesh 'bat0' + option ifname 'eth0' + +The batman-adv configuration in '/etc/config/batman-adv' only contains +the batman-adv specific options: + +:: + + config mesh 'bat0' + option 'aggregated_ogms' + option 'ap_isolation' + option [..] + +**Since batman-adv 2014.2.0** VLAN specific options have to be +configured in a separated stanza having protocol 'batadv_vlan'. + +In this particular section the user has to specify the name of the VLAN +interface (that will be automatically created by netifd) and then list +all the wanted options. At the moment the only available option for this +section is 'ap_isolation': + +:: + + config interface 'my_bat_vlan1' + option proto 'batadv_vlan' + option ifname 'bat0.1' + option ap_isolation '1' + +Any VLAN specific option can still be listed in the batman-adv +configuration for 'bat0' and in that case they will affect the behaviour +only for the plain mesh interface (i.e. bat0 - the untagged LAN). + +**Since batman-adv 2016.1** The routing algorithm can be configured via +the network configuration in '/etc/config/network' to override the +kernel module's default: + +:: + + config interface 'bat0_hardif_wlan' + option mtu '1532' + option proto 'batadv' + option mesh 'bat0' + option routing_algo 'BATMAN_V' - - Batman-adv 2012.4.0 and older - ----------------------------- - - The wifi interface needs to be configured in '/etc/config/wireless': - - :: - - config wifi-device 'radio0' - option [..] - - config wifi-iface 'wmesh' - option device 'radio0' - option ifname 'adhoc0' - option network 'bat0_hardif_wlan' - option mode 'adhoc' - option ssid 'mesh' - option 'mcast_rate' '18000' - option bssid '02:CA:FE:CA:CA:40' - - It is assumed you configured the 'wifi-device' depending on your - requirements and your hardware. The interesting part is the 'wifi-iface' - stanza with its options: - - * 'device' points back to your radio (wifi-device) interface - * 'ifname' allows you to specify an arbitrary name for your adhoc - interface (which we are going to re-use later) - * 'network' points to the corresponding stanza in - '/etc/config/network' - * 'mode' defines the wifi mode (adhoc in our case) - * 'mcast_rate' helps to avoid low bandwidth routes (routes with a - lower throughput rate than the mcast rate will not be visible to - batman-adv) - * 'ssid' and 'bssid' are basic wireless settings you might want to - set to your liking - - More information can be found in the `OpenWrt wireless - configuration https://wiki.openwrt.org/doc/uci/wireless`__ - - Configure the MTU in '/etc/config/network' - - :: - - config interface 'bat0_hardif_wlan' - option ifname 'adhoc0' - option mtu '1528' - option proto 'none' - - The stanza's name 'mesh' as well as the ifname option have to match your - wireless configuration. - - Batman-adv is configured through its own configuration in - '/etc/config/batman-adv': - - :: - - config mesh 'bat0' - option interfaces 'adhoc0' - option 'aggregated_ogms' - option 'ap_isolation' - option [..] - - The 'interfaces' option is the key element here, as it tells batman-adv - which interface(s) to run on. All the other options enable / disable / - tweak all the batman-adv features you can also access at runtime through - batctl. diff --cc batman-adv/Network-wide-multi-link-optimization.rst index 62dde4b,0000000..0f72272 mode 100644,000000..100644 --- a/batman-adv/Network-wide-multi-link-optimization.rst +++ b/batman-adv/Network-wide-multi-link-optimization.rst @@@ -1,177 -1,0 +1,176 @@@ +.. SPDX-License-Identifier: GPL-2.0 + +Network Wide Multi Link Optimization (technical documentation) +============================================================== + - The original batman-adv multi link optimization - (:doc:`Multi-link-optimizations-technical <Multi-link-optimize>`) works on a local level - which ++The original batman-adv multi link optimization worked on a local level - which +is fairly easy to implement and works well as long as as all nodes are +configured the same way and have similar link qualities. But local +decision may be suboptimal network wide - for example, consider some +dual radio mesh nodes where the first node starts on 5 GHz, but after +some hops (alternating between 2.4 and 5 GHz) it stops at a 2.4 GHz-only +device. If it had chosen the other (2.4 Ghz) link in the first hop, +choosing the same frequency twice could have been avoided, and the total +path quality would be better. + +|image0| + +This limitation can be solved by relaying the information about +multi-interfaces over the whole mesh. This requires some changes to +routing and forwarding, which are to be described here. + +Routing Table Per Interface +--------------------------- + +The main idea is to use n + 1 routing tables instead of just one, with n +being the number of configured interfaces: + +* a routing table per incoming interface +* an additional 'default' routing table for packets generated locally + (e.g. from the soft-interface) + +The routing table is chosen based on the interface the packet entered +the system by. + +OGM forwarding and penalties +---------------------------- + +To propagate different paths, the OGM forwarding is changed: + +* When there are multiple interfaces and an OGM is forwarded on the + same interface, an additional penalty (e.g. "half duplex penalty) when + re-forwarding the OGM on the same interface + -> the metric with the **applied** penalty is stored locally +* apply the strict "forward only from best neighbor" per interface + +*Path Metric computation* +Each node, creates and sends its own OGMs to let all the other peers +in the network build their routing table + +- on each interface, one OGM is sent as broadcast containing the + initial metric value + +- A generic node receiving an OGM from a neighbor on interface I. When + forwarding, it will consider the output interface O: + + - perform the usual B.A.T.M.A.N. metric computations, including + accepting OGMs only from the best neighbor + - compare incoming interface I and outgoing interface O, and apply + special rules based on that (e.g. a penalty if I and O are the + same, and the interface is a wifi interface) + - mark the computed metric in a special originator table for the + interface O + - forward the OGM with this computed metric only on interface O + +- all metric computations above are also performed for a virtual + 'default' interface O, which is used for local traffic. + +*Traffic forwarding* + +- traffic forwarding works in the reverse direction: + + - When forwarding traffic, use the originator table of the interface + where the packet was received + - for locally generated traffic, use the default originator table + +For example, consider the following illustration: + +|image1| + +We consider all link qualities equal. What should happen according to +the rules (after some OGMs): + +* OGMs from A are sent via A1 and A2 +* B applies the new penalty when forwarding packets from A1 again on + B1, and also when forwarding from A2 on B2 +* therefore, As OGM received on B1 are only forwarded on B2 (because + no penalty is applied here). They are not re-forwarded on B1 because + for this interface, the packets received on B2 have a better quality. +* finally (assuming equal link qualities everywhere), the TQ values + in the OGMs from A forwarded by B are equal too - but the internal + routing table include the interface switching +* putting it all together and assuming the other nodes behave the + same way: If a packet is sent by D on D1, it will follow the dashed + path. If it is sent on D2, it will follow the solid path. The + interface alternation was implemented by local routing table decisions + but forwarded information (unlike the original local-only interface + alternation). + +Another example: path diversity +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +|image2| + +Scenario: + +- Node B is equipped with 2 interfaces (imagine two wifi cards with + sectored antennas) +- Node A is connected to B through B1 and uses B as next hop towards E +- Node F is connected to B through B2 and uses B as next hop towards E +- All the links are perfect +- Packets sent by A intended to E are received by B on B1 and forwarded + using B2 +- Packets sent by F intended to E are received by B on B2 and forwarded + using B1 +- B's nexthop to E using B1 is different from B's nexthop to E using B2 + +The presented example is another consequence of the mechanism +explained in this page. +Since the multi-interface optimisation is not per-link anymore but is +now defined network wide, **packets can possibly be routed through two +completely different paths in order to reach the same destination**. + +This possibility is given by the fact that on the path from A to E B +will choose G as best next-hop, while on the path from F to E B will +choose C. + +The result is that, with this new feature, multi-interface nodes can act +as routing splitting point which leads to a first tempative of real +multi-path routing. + +Debug information +----------------- + +There is an implementation based on the description above currently +pending for review. It offers some debugging facilities: + +The default originator table can be found at its original place, using +''batctl o''. The following examples represents the topology shown in the top +of the page, debug information obtained on node B, using OpenWRT and +virtual machines: + +:: + + root@OpenWrt:/# batctl o + [B.A.T.M.A.N. adv master-b82b9b2, MainIF/MAC: eth0/fe:f0:00:00:02:01 (bat0 BATMAN_IV)] + Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ... + fe:f1:00:00:03:01 0.350s (254) fe:f1:00:00:03:01 [ eth1]: fe:f1:00:00:03:01 (254) + fe:f1:00:00:01:01 0.800s (255) fe:f1:00:00:01:01 [ eth1]: fe:f1:00:00:01:01 (255) + fe:f0:00:00:05:01 0.770s (225) fe:f1:00:00:03:01 [ eth1]: fe:f0:00:00:03:01 (211) fe:f1:00:00:03:01 (225) + fe:f0:00:00:03:01 0.670s (255) fe:f0:00:00:03:01 [ eth0]: fe:f1:00:00:03:01 (255) fe:f0:00:00:03:01 (255) + fe:f0:00:00:04:01 0.520s (234) fe:f1:00:00:03:01 [ eth1]: fe:f1:00:00:03:01 (234) fe:f0:00:00:03:01 (222) + fe:f0:00:00:01:01 0.920s (255) fe:f1:00:00:01:01 [ eth1]: fe:f1:00:00:01:01 (255) fe:f0:00:00:01:01 (254) + +Comparing to the original topology, it shows that for destination E +(fe:f0:00:00:05:01) when packets come in on 2.4 GHz (eth0, first table), +they are preferably forwarded to C (fe:f1:00:00:03:01 ) on 5 GHz (eth1). + +When packets are received on 5 GHz (eth1), there is not much difference +because at node B or at node C, the same interface must be used. +Therefore in the second table for node E (fe:f0:00:00:05:01) the two +choices have pretty much the same TQ values (210 and 211). + +Ideas for the future +-------------------- + +- Theoretically, a node generating traffic instead of using its own + routing table could exploit the path diversity and route its traffic + using all the routing tables of all the interfaces (the selection + policy have to be defined..round robin would not work properly + because when using two different paths TCP reordering may decrease + the performance) + +.. |image0| image:: alternating-limited-view.svg +.. |image1| image:: alternation_chain.svg +.. |image2| image:: net-wide-multiif.svg + diff --cc open-mesh/Kernel_hacking_Debian_image.rst index b03350d,0000000..2ac30e3 mode 100644,000000..100644 --- a/open-mesh/Kernel_hacking_Debian_image.rst +++ b/open-mesh/Kernel_hacking_Debian_image.rst @@@ -1,440 -1,0 +1,441 @@@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel hacking Debian image +=========================== + +The :doc:`OpenWrt image <OpenWrt_in_QEMU>` is an easy way to start multiple +virtual instances. But these instances usually don���t provide the +required infrastructure to test kernel modules extensively. And it also +depends on special toolchains to prepare the used tools/modules which +should tested. + +It is often easier to use the same operating system in the virtual +environment and on the host. Only the kernel is modified here to provide +the necessary helpers for in-kernel development. + +An interested reader might even extend this further to only provide a +modified kernel and use the currently running rootfs also in the virtual +environment. Such an approach is used in `hostap���s test +vm https://w1.fi/cgit/hostap/tree/tests/hwsim/vm`__ but it is out of +scope for this document. + +Create an Image +--------------- + +The debian root filesystem is used here to a minimal system to boot and +run the test programs. It is a simple ext4 filesystem with only +userspace components from Debian. The configuration is changed to: + +* automatically mount the shared folder +* automatically set up a static IPv4 address and hostname on bootup +* start a test-init.sh script from the shared folder on bootup +* disable root password +* prefer batctl binary from shared folder���s batctl subdirectory instead + of virtual environment binary + +The installation is also cleaned up at the end to reduce the required +storage space + +.. code-block:: sh + + qemu-img create debian.img 8G + sudo mkfs.ext4 -O '^has_journal' -F debian.img + sudo mkdir debian + sudo mount -o loop debian.img debian + sudo debootstrap buster debian + sudo chroot debian apt update + sudo chroot debian apt install --no-install-recommends build-essential vim openssh-server less \ + pkg-config libnl-3-dev libnl-genl-3-dev libcap-dev tcpdump rng-tools5 \ + trace-cmd flex bison libelf-dev libdw-dev binutils-dev libunwind-dev libssl-dev libslang2-dev liblzma-dev libperl-dev + + sudo mkdir debian/root/.ssh/ + ssh-add -L | sudo tee debian/root/.ssh/authorized_keys + + sudo mkdir debian/host + sudo sh -c 'cat > debian/etc/fstab << EOF + host /host 9p trans=virtio,version=9p2000.L 0 0 + EOF' + + sudo sh -c 'cat > debian/etc/rc.local << "EOF" + #!/bin/sh -e + + MAC_PART="$(ip link show enp0s1 | awk "/ether/ {print $2}"| sed -e "s/.*://" -e "s/[\n\ ].*//"|awk "{print ("0x"$1)*1 }")" + IP_PART="$(echo $MAC_PART|awk "{ print $1+50 }")" + NODE_NR="$(echo $MAC_PART|awk "{ printf("%02d", $1) }")" + ip addr add 192.168.251.${IP_PART}/24 dev enp0s1 + ip link set up dev enp0s1 + hostname "node"$NODE_NR + ip link set up dev lo + [ ! -x /host/test-init.sh ] || /host/test-init.sh + exit 0 + EOF' + sudo chmod a+x debian/etc/rc.local + + sudo sed -i 's/^root:[^:]*:/root::/' debian/etc/shadow + + ## optionally: allow ssh logins without passwords + # sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' debian/etc/ssh/sshd_config + # sudo sed -i 's/^#PermitEmptyPasswords.*/PermitEmptyPasswords yes/' debian/etc/ssh/sshd_config + # sudo sed -i 's/^UsePAM.*/UsePAM no/' debian/etc/ssh/sshd_config + + ## optionally: enable autologin for user root + #sudo mkdir debian/etc/systemd/system/serial-getty@hvc0.service.d/ + #sudo sh -c 'cat > debian/etc/systemd/system/serial-getty@hvc0.service.d/autologin.conf << EOF + #[Service] + #ExecStart= + #ExecStart=-/sbin/agetty --autologin root -s %I 115200,38400,9600 vt102 + #EOF' + + sudo sh -c 'echo '''PATH="/host/batctl/:$PATH"''' >> debian/etc/profile' + sudo rm debian/var/cache/apt/archives/*.deb + sudo rm debian/var/lib/apt/lists/* + sudo e4defrag -v debian/ + sudo umount debian + sudo fsck.ext4 -fD debian.img + sudo zerofree -v debian.img + sudo fallocate --dig-holes debian.img + + + ## optionally: convert image to qcow2 + #sudo qemu-img convert -c -f raw -O qcow2 debian.img debian.qcow2 + #sudo mv debian.qcow2 debian.img + +Kernel compile +-------------- + +Any recent kernel can be used for the setup. We will use linux-next here +to get the most recent development kernels. It is also assumed that the +sources are copied to the same directory as the debian.img and a x86_64 +image will be used. + +The kernel will be build to enhance the virtualization and debugging +experience. It is configured with: + +* basic kernel features +* support for necessary drivers +* kernel hacking helpers +* kernel address + undefined sanitizers +* support for hwsim + +.. code-block:: sh + + # make sure that libelf-dev is installed or module build will fail with something like "No rule to make target 'net/batman-adv/bat_algo.o'" + + git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git + cd linux-next + + make allnoconfig + cat >> .config << EOF + + # small configuration + CONFIG_SMP=y + CONFIG_EMBEDDED=n + # CONFIG_EXPERT is not set + CONFIG_MODULES=y + CONFIG_MODULE_UNLOAD=y + CONFIG_MODVERSIONS=y + CONFIG_MODULE_SRCVERSION_ALL=y + CONFIG_64BIT=y + CONFIG_X86_VSYSCALL_EMULATION=n + CONFIG_IA32_EMULATION=n + CONFIG_VOP_BUS=y + CONFIG_VOP=y + CONFIG_HW_RANDOM_VIRTIO=y + CONFIG_NET_9P_VIRTIO=y + CONFIG_VIRTIO_MENU=y + CONFIG_SCSI_VIRTIO=y + CONFIG_VIRTIO_BALLOON=y + CONFIG_VIRTIO_BLK=y + CONFIG_VIRTIO_CONSOLE=y + CONFIG_VIRTIO_INPUT=y + CONFIG_VIRTIO_NET=y + CONFIG_VIRTIO_PCI=y + CONFIG_VIRTIO_PCI_LEGACY=y + CONFIG_VIRTIO_BALLOON=y + CONFIG_VIRTIO_BLK_SCSI=y + CONFIG_VIRTIO_INPUT=y + CONFIG_VIRTIO_MMIO=y + CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y + CONFIG_RPMSG_VIRTIO=y + CONFIG_VSOCKETS=y + CONFIG_VIRTIO_VSOCKETS=y + CONFIG_DRM=y + CONFIG_DRM_VIRTIO_GPU=y + CONFIG_CAIF=y + CONFIG_CAIF_VIRTIO=y + CONFIG_CRYPTO_DEV_VIRTIO=y + CONFIG_FUSE_FS=y + CONFIG_VIRTIO_FS=y + CONFIG_IOMMU_SUPPORT=y + CONFIG_VIRTIO_IOMMU=y + CONFIG_LIBNVDIMM=y + CONFIG_VIRTIO_PMEM=y + CONFIG_CRC16=y + CONFIG_LIBCRC32C=y + CONFIG_CRYPTO_SHA512=y + CONFIG_NET=y + CONFIG_INET=y + CONFIG_DEBUG_FS=y + CONFIG_IPV6=y + CONFIG_BRIDGE=y + CONFIG_VLAN_8021Q=y + CONFIG_WIRELESS=n + CONFIG_NET_9P=y + CONFIG_NETWORK_FILESYSTEMS=y + CONFIG_9P_FS=y + CONFIG_9P_FS_POSIX_ACL=y + CONFIG_9P_FS_SECURITY=y + CONFIG_BLOCK=y + CONFIG_BLK_DEV=y + CONFIG_EXT4_FS=y + CONFIG_EXT4_USE_FOR_EXT23=y + CONFIG_TTY=y + CONFIG_HW_RANDOM=y + CONFIG_VHOST_RING=y + CONFIG_GENERIC_ALLOCATOR=y + CONFIG_SCSI_LOWLEVEL=y + CONFIG_SCSI=y + CONFIG_NETDEVICES=y + CONFIG_NET_CORE=y + CONFIG_DEVTMPFS=y + CONFIG_HYPERVISOR_GUEST=y + CONFIG_PVH=y + CONFIG_PARAVIRT=y + CONFIG_PARAVIRT_TIME_ACCOUNTING=y + CONFIG_PARAVIRT_SPINLOCKS=y + CONFIG_KVM_GUEST=y + CONFIG_BINFMT_ELF=y + CONFIG_BINFMT_SCRIPT=y + CONFIG_BINFMT_MISC=y + CONFIG_PCI=y + CONFIG_SYSVIPC=y + CONFIG_POSIX_MQUEUE=y + CONFIG_CROSS_MEMORY_ATTACH=y + CONFIG_UNIX=y + CONFIG_TMPFS=y + CONFIG_CGROUPS=y + CONFIG_BLK_CGROUP=y + CONFIG_CGROUP_CPUACCT=y + CONFIG_CGROUP_DEVICE=y + CONFIG_CGROUP_FREEZER=y + CONFIG_CGROUP_HUGETLB=y + CONFIG_CGROUP_NET_CLASSID=y + CONFIG_CGROUP_NET_PRIO=y + CONFIG_CGROUP_PERF=y + CONFIG_CGROUP_SCHED=y + CONFIG_DEVPTS_MULTIPLE_INSTANCES=y + CONFIG_INOTIFY_USER=y + CONFIG_FHANDLE=y + CONFIG_CFG80211=y + CONFIG_DUMMY=y + CONFIG_PACKET=y + CONFIG_VETH=y + CONFIG_IP_MULTICAST=y + CONFIG_NET_IPGRE_DEMUX=y + CONFIG_NET_IP_TUNNEL=y + CONFIG_NET_IPGRE=y + CONFIG_NET_IPGRE_BROADCAST=y + # CONFIG_LEGACY_PTYS is not set + CONFIG_NO_HZ_IDLE=y + CONFIG_CPU_IDLE_GOV_HALTPOLL=y + CONFIG_PVPANIC=y + + # makes boot a lot slower but required for shutdown + CONFIG_ACPI=y + + + #debug stuff + CONFIG_CC_STACKPROTECTOR_STRONG=y + CONFIG_LOCKUP_DETECTOR=y + CONFIG_DETECT_HUNG_TASK=y + CONFIG_SCHED_STACK_END_CHECK=y + CONFIG_DEBUG_RT_MUTEXES=y + CONFIG_DEBUG_SPINLOCK=y + CONFIG_DEBUG_MUTEXES=y + CONFIG_PROVE_LOCKING=y + CONFIG_LOCK_STAT=y + CONFIG_DEBUG_LOCKDEP=y + CONFIG_DEBUG_ATOMIC_SLEEP=y + CONFIG_DEBUG_LIST=y + CONFIG_DEBUG_PI_LIST=y + CONFIG_DEBUG_SG=y + CONFIG_DEBUG_NOTIFIERS=y + CONFIG_PROVE_RCU_REPEATEDLY=y + CONFIG_SPARSE_RCU_POINTER=y + CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y + CONFIG_X86_VERBOSE_BOOTUP=y + CONFIG_DEBUG_RODATA=y + CONFIG_DEBUG_RODATA_TEST=n + CONFIG_DEBUG_SET_MODULE_RONX=y + CONFIG_PAGE_EXTENSION=y + CONFIG_DEBUG_PAGEALLOC=y + CONFIG_DEBUG_OBJECTS=y + CONFIG_DEBUG_OBJECTS_FREE=y + CONFIG_DEBUG_OBJECTS_TIMERS=y + CONFIG_DEBUG_OBJECTS_WORK=y + CONFIG_DEBUG_OBJECTS_RCU_HEAD=y + CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y + CONFIG_DEBUG_KMEMLEAK=y + CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=8000 + CONFIG_DEBUG_STACK_USAGE=y + CONFIG_DEBUG_STACKOVERFLOW=y + CONFIG_DEBUG_INFO=y + CONFIG_DEBUG_INFO_DWARF4=y + CONFIG_GDB_SCRIPTS=y + CONFIG_READABLE_ASM=y + CONFIG_STACK_VALIDATION=y + CONFIG_WQ_WATCHDOG=y + CONFIG_DEBUG_KOBJECT_RELEASE=y + CONFIG_DEBUG_WQ_FORCE_RR_CPU=y + CONFIG_OPTIMIZE_INLINING=y + CONFIG_ENABLE_MUST_CHECK=y + CONFIG_ENABLE_WARN_DEPRECATED=y + CONFIG_DEBUG_SECTION_MISMATCH=y + CONFIG_UNWINDER_ORC=y + CONFIG_FTRACE=y + CONFIG_FUNCTION_TRACER=y + CONFIG_FUNCTION_GRAPH_TRACER=y + CONFIG_FTRACE_SYSCALLS=y + CONFIG_TRACER_SNAPSHOT=y + CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y + CONFIG_STACK_TRACER=y + CONFIG_UPROBE_EVENTS=y + CONFIG_DYNAMIC_FTRACE=y + CONFIG_FUNCTION_PROFILER=y + CONFIG_HIST_TRIGGERS=y + CONFIG_SYMBOLIC_ERRNAME=y + CONFIG_DYNAMIC_DEBUG=y + CONFIG_PRINTK_TIME=y + CONFIG_PRINTK_CALLER=y + CONFIG_DEBUG_MISC=y + CONFIG_PROVE_RCU_LIST=y ++ CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B=y + + # for GCC 5+ + CONFIG_KASAN=y + CONFIG_KASAN_INLINE=y + CONFIG_UBSAN_SANITIZE_ALL=y + CONFIG_UBSAN=y + CONFIG_UBSAN_NULL=y + EOF + make olddefconfig + + cat >> .config << EOF + # allow to use unsigned regdb with hwsim + CONFIG_EXPERT=y + CONFIG_CFG80211_CERTIFICATION_ONUS=y + # CONFIG_CFG80211_REQUIRE_SIGNED_REGDB is not set + EOF + make olddefconfig + + make all -j$(nproc || echo 1) + +Build the BIOS +-------------- + +The (sea)bios used by qemu is nice to boot all kind of legacy images but +reduces the performance for booting a paravirtualized Linux system. +Something like qboot works better for this purpose: + +.. code-block:: sh + + git clone https://github.com/bonzini/qboot.git + cd qboot + meson build && ninja -C build + cd .. + +.. _open-mesh-kernel-hacking-debian-image-building-the-batman-adv-module: + +Building the batman-adv module +------------------------------ + +The kernel module can be build outside the virtual environment and +shared over the 9p mount. The path to the kernel sources have to be +provided to the make process + +.. code-block:: sh + + make KERNELPATH="$(pwd)/../linux-next" + +The kernel module can also be compiled in a way which creates better +stack traces and increases the usability with (k)gdb: + +.. code-block:: sh + + make EXTRA_CFLAGS="-fno-inline -Og -fno-optimize-sibling-calls" KERNELPATH="$(pwd)/../linux-next" V=1 + +Start of the environment +------------------------ + +virtual network initialization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The +:ref:`virtual-network.sh from the OpenWrt environment <open-mesh-openwrt-in-qemu-virtual-network-initialization>` +can be reused again. + +VM instances bringup +~~~~~~~~~~~~~~~~~~~~ + +The +:ref:`run.sh from the OpenWrt environment <open-mesh-openwrt-in-qemu-vm-instances-bringup>` +can mostly be reused. There are only minimal +adjustments required. + +The BASE_IMG is of course no longer the same because a new image +���debian.img��� was created for our new environment. The image also doesn���t +contain a bootloader or kernel anymore. The kernel must now be supplied +manually to qemu. + +.. code-block:: sh + + BASE_IMG=debian.img + BOOTARGS+=("-bios" "qboot/build/bios.bin") + BOOTARGS+=("-kernel" "linux-next/arch/x86/boot/bzImage") + BOOTARGS+=("-append" "root=/dev/vda rw console=hvc0 nokaslr tsc=reliable no_timer_check noreplace-smp rootfstype=ext4 rcupdate.rcu_expedited=1 reboot=t pci=lastbus=0 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1") + BOOTARGS+=("-device" "virtconsole,chardev=charconsole0,id=console0") + +It is also recommended to use linux-next/vmlinux instead of bzImage with +qemu 4.0.0 (or later) + +Automatic test initialization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The +:ref:`test-init.sh from the OpenWrt environment <open-mesh-openwrt-in-qemu-automatic-test-initialization>` +is always test specific. But its main +functionality is still the same as before. A simple example would be: + +.. code-block:: sh + + cat > test-init.sh << "EOF" + #! /bin/sh + + set -e + + ## get internet access + dhclient enp0s2 + + ## Simple batman-adv setup + + # ip link add dummy0 type dummy + ip link set up dummy0 + + rmmod batman-adv || true + insmod /host/batman-adv/net/batman-adv/batman-adv.ko + /host/batctl/batctl routing_algo BATMAN_IV + /host/batctl/batctl if add dummy0 + /host/batctl/batctl it 5000 + /host/batctl/batctl if add enp0s1 + ip link set up dev enp0s1 + ip link set up dev bat0 + EOF + + chmod +x test-init.sh + +Start +----- + +The startup method +:ref:`from the OpenWrt environment <open-mesh-openwrt-in-qemu-start>` +should be used here. diff --cc open-mesh/News-draft.rst index 47e597c,0000000..008e612 mode 100644,000000..100644 --- a/open-mesh/News-draft.rst +++ b/open-mesh/News-draft.rst @@@ -1,155 -1,0 +1,116 @@@ +.. SPDX-License-Identifier: GPL-2.0 + - DRAFT: Batman-adv 2020.2 released ++DRAFT: Batman-adv 2020.3 released +================================= + - Jul 1th, 2020. Today the B.A.T.M.A.N. team publishes the July 2020 - update to batman-adv, batctl and alfred! This release drops the support - for the end-of-life Linux kernel versions (<4.3). The B.A.T.M.A.N. V - throughput detection for ethernet devices without auto-negotiation was - enabled again to support more configurations out of the box. Most users - will still require a manual setting via the throughput_override for such - devices. The automatic removal of (empty) batadv mesh interfaces during - a batctl meshif bat0 interface del .... was dropped. An explicit batctl - meshif bat0 interface destroy is now required to remove the batadv - interface. Also several bugfixes and code cleanups are included in this - version. ++Aug 25th, 2020. Today the B.A.T.M.A.N. team publishes the August 2020 ++update to batman-adv, batctl and alfred! An additional hop penalty can ++now be configured on a per interface basis. Also several bugfixes and ++code cleanups are included in this version. + +As the kernel module always depends on the Linux kernel it is compiled +against, it does not make sense to provide binaries on our website. As +usual, you will find the signed tarballs in our download section: + - https://downloads.open-mesh.org/batman/releases/batman-adv-2020.2/ ++https://downloads.open-mesh.org/batman/releases/batman-adv-2020.3/ + +Thanks +------ + +Thanks to all people sending in patches: + - * Al Viro viro@zeniv.linux.org.uk - * Antonio Quartulli a@unstable.cc - * Cong Wang xiyou.wangcong@gmail.com - * Marek Lindner mareklindner@neomailbox.ch +* Linus L��ssing linus.luessing@c0d3.blue +* Simon Wunderlich sw@simonwunderlich.de +* Sven Eckelmann sven@narfation.org - * YueHaibing yuehaibing@huawei.com + +and to all those that supported us with good advice or rigorous testing: + - * Andreas Ziegler az@freifunk-altdorf.de - * Matthias Schiffer mschiffer@universe-factory.net - * Taehee Yoo ap420073@gmail.com ++* Antonio Quartulli a@unstable.cc + +batman-adv +---------- + +:: + + $ git describe origin/master - v2020.1-13-ga042622f - $ range=v2020.1..v2020.1-13-ga042622f ++ v2020.2-7-geded19e9 ++ $ range=v2020.2..v2020.2-7-geded19e9 + $ git shortlog --email --no-merges "${range}" + $ git log --no-merges "${range}"|grep -e '(Reported|Tested|Acked|Reviewed-by|Co-authored-by)-by'|sed 's/.*:/*/'|sort|uniq + + - new kernel support - ================== - - batman-adv: Drop support for Linux < 4.4 - + coding style cleanup/refactoring + ================================ + - batman-adv: get rid of pointless access_ok() - batman-adv: use rcu_replace_pointer() where appropriate - batman-adv: partially revert dynamic lockdep key changes - batman-adv: change addr_list_lock back to static key - batman-adv: Fix spelling error in term buffer - batman-adv: trace: Drop unneeded types.h include - batman-adv: Utilize prandom_u32_max for random [0, max) values - batman-adv: Sync config options for external module builds - batman-adv: Use alphabetical order for external build config options ++ batman-adv: Switch mailing list subscription page ++ batman-adv: Fix typos and grammar in documentation + - BATMAN V - ========= ++ various ++ ======= + - batman-adv: Revert "disable ethtool link speed detection when auto negotiation off" ++ batman-adv: Introduce a configurable per interface hop penalty + + bugfixes + ======== + ++ batman-adv: Avoid uninitialized chaddr when handling DHCP ++ batman-adv: Fix own OGM check in aggregated OGMs + + + - - 2020.2 (2020-07-01) ++ 2020.3 (2020-08-25) + =================== + - * support latest kernels (4.4 - 5.8) ++ * support latest kernels (4.4 - 5.9) + * coding style cleanups and refactoring - * dropped support for kernels < 4.4 - * re-enabled link speed detection for interfaces without auto negotiation ++ * introduce a configurable per interface hop penalty ++ * bugs squashed: ++ ++ - avoid uninitialized chaddr when handling DHCP ++ - fix own OGMv2 check in aggregation receive handling + +batctl +------ + +:: + + $ git describe origin/master - v2020.1-8-g51b0746 - $ range=v2020.1..v2020.1-8-g51b0746 ++ v2020.2-3-g2c893e3 ++ $ range=v2020.2..v2020.2-3-g2c893e3 + $ git shortlog --email --no-merges "${range}" + $ git log --no-merges "${range}"|grep -e '(Reported|Tested|Acked|Reviewed-by|Co-authored-by)-by'|sed 's/.*:/*/'|sort|uniq + + + various + ======= + - batctl: Disable automatic destruction of empty meshifs - - coding style cleanup/refactoring - ================================ - - batctl: Change/fix a throughput override function name - - bugfix - ====== - - batctl: fix endianness when reading radiotap header - batctl: Only remove batadv interface on hardif reduction ++ batctl: Add per interface hop penalty command + + - 2020.2 (2020-07-01) ++ 2020.3 (2020-08-25) + =================== + - * coding style cleanups and refactoring - * drop support for automatic destruction of empty meshifs - * bugs squashed: - - - Fix parsing of radiotap headers on big endian systems ++ * add per interface hop penalty command + +alfred +------ + +:: + + $ git describe origin/master - v2020.1-3-g112788d - $ range=v2020.1..v2020.1-3-g112788d ++ v2020.2-2-g921940b ++ $ range=v2020.2..v2020.2-2-g921940b + $ git shortlog --email --no-merges "${range}" + $ git log --no-merges "${range}"|grep -e '(Reported|Tested|Acked|Reviewed-by|Co-authored-by)-by'|sed 's/.*:/*/'|sort|uniq + ++ Sven Eckelmann sven@narfation.org (1): ++ batctl: Sync batman-adv netlink uapi header + - Sven Eckelmann sven@narfation.org (2): - alfred: Switch mailing list subscription page - alfred: Use primary/secondary to describe server roles - - 2020.2 (2020-07-01) ++ 2020.3 (2020-08-25) + =================== + - * Rephrase names of server roles ++ * synchronization of batman-adv netlink header + +Happy routing, + +The B.A.T.M.A.N. team diff --cc open-mesh/WikiStart.rst index c105d27,0000000..df6b2f0 mode 100644,000000..100644 --- a/open-mesh/WikiStart.rst +++ b/open-mesh/WikiStart.rst @@@ -1,60 -1,0 +1,53 @@@ +.. SPDX-License-Identifier: GPL-2.0 + +==================== +Welcome to Open Mesh +==================== + +**This page serves as development platform for a collection of tools to +build free and open mesh networks.** + +B.A.T.M.A.N. +============ + +B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is a routing +protocol for multi-hop ad-hoc mesh networks. This is the main +development website, we have source code, binary packages, documentation +and further information available: + +News +---- + +{{recent_news}} + +- :doc:`news archive <News-archive>` + +Getting Started +--------------- + +- :doc:`Download <Download>` - Get our latest releases, get access to our + Git repositories +- :doc:`How to contribute <Contribute>` - How to report bugs, send + comments, patches or suggestions + +Documentation +------------- + +- :doc:`Branches explained <BranchesExplained>` - learn about the + B.A.T.M.A.N. flavours +- :doc:`B.A.T.M.A.N. Advanced Documentation </batman-adv/index>` +- :doc:`B.A.T.M.A.N. Daemon Documentation </batmand/index>` +- :doc:`A.L.F.R.E.D. </alfred/index>` - Almighty Lightweight Fact Remote Exchange + Daemon, can be used to distribute arbitrary information over a mesh + network +- :doc:`FAQ <FAQ>` - Frequently Asked Questions +- :doc:`Experience <Experience>` - Collection of links to B.A.T.M.A.N. + press reviews, papers and projects using B.A.T.M.A.N. +- :doc:`Mailing List <MailingList>`/:doc:`IRC <IRC>` - contact us + +Merchandise +----------- + +- :doc:`Logos <Logos>` - download logos +- `T-Shirts https://www.freewear.org/?org=B.A.T.M.A.N%2e`__ - get + T-Shirts - - Other Projects on open-mesh.org - ------------------------------- - - - :doc:`FFTrace <FFTrace>` - freifunk traceroute tool - - :doc:`MeshLinux <MeshLinux>` - Linux distribution geared to build mesh - supernodes diff --cc open-mesh/random.rst index 92cc2b7,0000000..89005f6 mode 100644,000000..100644 --- a/open-mesh/random.rst +++ b/open-mesh/random.rst @@@ -1,40 -1,0 +1,30 @@@ +.. SPDX-License-Identifier: GPL-2.0 + +====== +Random +====== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + BATMANConcept + Emulation_Environment - FFTrace + Joker - MeshLinux + Logos + BatmanAdvBootLogo - NetworkingTechnologies + New_papers + News-archive + News-draft + ResearchProposals + Routing_scenarios + The-olsr-story + UsingBatmanGit - Gsoc2010-ideas - Gsoc2011-ideas - Gsoc2011-roadmap - Gsoc2012-ideas - Wbmv4-batmandev-agenda - Wbmv5-batmandev-agenda - Wbmv6-batmandev-agenda + +.. only:: subproject + + Indices + ======= + + * :ref:`genindex`