Proxmox VEにcpupowerをインストールする

Proxmox VEのホスト鯖は常時起動させているので、
熱とかもろもろ考えて、CPUのクロックなどを下げて運用しようと思います。

CPUの制御をするため「linux-cpupower」をインストール。
「cpupower」ではないので注意。

#apt-get install linux-cpupower

現状の確認。

# pveversion 
pve-manager/9.1.2/9d436f37a0ac4172 (running kernel: 6.17.2-2-pve)
#
# cpupower frequency-info
analyzing CPU 10:
  driver: intel_cpufreq
  CPUs which run at the same hardware frequency: 10
  CPUs which need to have their frequency coordinated by software: 10
  maximum transition latency: 20.0 us
  hardware limits: 1.20 GHz - 3.90 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.20 GHz and 3.90 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.20 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    3700 MHz max turbo 4 active cores
    3700 MHz max turbo 3 active cores
    3700 MHz max turbo 2 active cores
    3900 MHz max turbo 1 active cores

バグらしいが、どうやらProxmoxVEのlinux-cpupowerには、
バージョンによりサービス関係のファイルが含まれていない。
https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=894906

なので、rc.localに書いてお茶を濁す。
今回は、ガバナーを「powersave」、最大周波数を「2GHz」としました。

# vi /etc/rc.local

#!/bin/sh
/usr/bin/cpupower frequency-set -g powersave
/usr/bin/cpupower frequency-set -u 2GHz

権限

# chmod 700 /etc/rc.local

続きを読む

NMOSのRDSサーバを立ててみる

仕事柄、SMPTE2110をちょっと触っているので、
NMOSもやらざるをえず。。。。

RDSサーバが必要なので自前で立ててみようかと。
検証でよく使われているそうなのでこれを使ってみます。
https://github.com/sony/nmos-cpp

Hyper-Vのクイック作成を使ってUbuntu20.04作ったので、
最小構成だとほかにもインストールしないといけないものがあるかもしれません。。。
(あたりまでだけど仮想スイッチでも問題ないです)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

さて必要なものをざっくりインストールしていきます。

$ sudo  apt-get update
$ sudo apt-get install build-essential g++ libcpprest-dev libc6 libavahi-compat-libdnssd-dev libnss-mdns avahi-utils git

続きを読む

マルチキャストテストツール

マルチキャストパケットをテストするためのツール。
ただ、igmp v2なのでPIM-SSMのテストはできなさそうです。

1)Linux

msend – send UDP messages to a multicast group
mreceive – receive UDP multicast messages and display them

https://github.com/troglobit/mtools/blob/master/README.md

# apt-get install libcurl4-openssl-dev libexpat1-dev
# apt-get install git
# apt-get install make gcc
# git clone https://github.com/troglobit/mtools
# cd mtools
# make
# ls
LICENSE.md  README.md  mreceive.8  mreceive.d    mreceive.o  msend.8  msend.d    msend.o
Makefile    mreceive   mreceive.c  mreceive.map  msend       msend.c  msend.map  ttcp.c
# ./msend -h
msend version 2.3
Usage:  msend [-g GROUP] [-p PORT] [-join] [-i ADDRESS] [-t TTL] [-P PERIOD]
              [-text "text"|-n]
        msend [-v | -h]

  -g GROUP     IP multicast group address to send to.  Default: 224.1.1.1
  -p PORT      UDP port number used in the multicast packets.  Default: 4444
  -i ADDRESS   IP address of the interface to use to send the packets.
               The default is to use the system default interface.
  -join        Multicast sender will join the multicast group.
               By default a sender never joins the group.
  -P PERIOD    Interval in milliseconds between packets.  Default 1000 msec
  -t TTL       The TTL value (1-255) used in the packets.  You must set
               this higher if you want to route the traffic, otherwise
               the first router will drop the packets!  Default: 1
  -text "text" Specify a string to use as payload in the packets, also
               displayed by the mreceive command.  Default: empty
  -n           Encode -text argument as a number instead of a string.
  -v           Print version information.
  -h           Print the command usage.
# ./mreceive -h
mreceive version 2.3
Usage: mreceive [-g GROUP] [-p PORT] [-i ADDRESS ] ... [-i ADDRESS] [-n]
       mreceive [-v | -h]

  -g GROUP     IP multicast group address to listen to.  Default: 224.1.1.1
  -p PORT      UDP port number used in the multicast packets.  Default: 4444
  -i ADDRESS   IP addresses of one or more interfaces to listen for the given
               multicast group.  Default: the system default interface.
  -n           Interpret the contents of the message as a number instead of
               a string of characters.  Use this with `msend -n`
  -v           Print version information.
  -h           Print the command usage.

2)Windows
http://www.dqnetworks.ie/toolsinfo/mcasttest/

MCastTest is a utility for testing IP multicast routing on your network.
You can add multiple tranmitters and listeners on different IP multicast groups.
By running this utility on multiple machines at different points in your network you can check that your multicast traffic is getting to where it is supposed to get to.

PIM-SSMをテストしたいけど、CLIツールがない。。。
たぶん、VLCはできると思います。。。

Dockerのiptables

Dockerサービスが起動したときや、
コンテナを作ったときに、iptablesに自動的にフィルターが入ります。

困ったことに、特に設定しなければ、
INPUTもFORWARDもACCEPTになるため精神衛生上よくありません。
せめてINPUTとFORWARDはDROPとしておきたいです。

それに加えて、DOCKERコンテナへのフィルターを書く場合は、
mangleで設定しなければなりません。(natテーブルでもいけるかもしれません)
https://ja.wikipedia.org/wiki/Iptables#/media/File:Netfilter-packet-flow.svg

続きを読む