hagio.org - 日記

Powered by PENS


Index

2009: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2010: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2011: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2012: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2013: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2014: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2015: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2016: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2017: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2018: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2019: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2020: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2021: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2022: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2023: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2024: 1月(1)(2) 2月(1)(2) 3月(1)(2)

今月のアルバム U.S. Beers! [ 投稿 | 編集 ]


編集

January 2012

Jan 12 (Thu)

22:53

年が変わったことで、写メを PENS/kAlbum に投稿する Python スクリプトのバグを発見。

Python で mkdir -p と同等の関数は、 os.makedirs(path) のようだ。

そろそろ複数の添付ファイルにも対応させんといかんなぁ。

20:46

ICMP の一部のタイプのパケットは、デフォルトで送信制限がかけられているようだ。

# sysctl -a | grep icmp_rate net.ipv4.icmp_ratelimit = 1000 net.ipv4.icmp_ratemask = 6168

icmp_ratelimit - INTEGER Limit the maximal rates for sending ICMP packets whose type matches icmp_ratemask (see below) to specific targets. 0 to disable any limiting, otherwise the minimal space between responses in milliseconds. Default: 1000 icmp_ratemask - INTEGER Mask made of ICMP types for which rates are being limited. Significant bits: IHGFEDCBA9876543210 Default mask: 0000001100000011000 (6168) Bit definitions (see include/linux/icmp.h): 0 Echo Reply 3 Destination Unreachable * 4 Source Quench * 5 Redirect 8 Echo Request B Time Exceeded * C Parameter Problem * D Timestamp Request E Timestamp Reply F Info Request G Info Reply H Address Mask Request I Address Mask Reply * These are rate limited by default (see default mask above)

どれくらいで制限されるかと言うと、 デフォルト (最大) で 6000 ms の持ち時間があって、 送信毎に (前回送信からの経過時間 - 1000 ms) が加算される。 すなわち、1 秒より短い間隔で送信すると持ち時間が失われていき、 持ち時間が 1000 ms を下回ると制限がかかる。 つまり、バーストすると 7 回目以降は送信されない (1 秒に 1 度のみ送信) ということですな。 ちなみに、dst_entry 毎の制限であって、システム全体ではない。

275 #define XRLIM_BURST_FACTOR 6 276 int xrlim_allow(struct dst_entry *dst, int timeout) 277 { 278 unsigned long now; 279 int rc = 0; 280 281 now = jiffies; 282 dst->rate_tokens += now - dst->rate_last; 283 dst->rate_last = now; 284 if (dst->rate_tokens > XRLIM_BURST_FACTOR * timeout) 285 dst->rate_tokens = XRLIM_BURST_FACTOR * timeout; 286 if (dst->rate_tokens >= timeout) { 287 dst->rate_tokens -= timeout; 288 rc = 1; 289 } 290 return rc; 291 } "./net/ipv4/icmp.c"

21:33:36.520852 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520871 IP 192.168.1.1 > 192.168.1.2: ICMP 192.168.1.1 udp port 55555 unreachable, length 37 21:33:36.520874 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520880 IP 192.168.1.1 > 192.168.1.2: ICMP 192.168.1.1 udp port 55555 unreachable, length 37 21:33:36.520885 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520890 IP 192.168.1.1 > 192.168.1.2: ICMP 192.168.1.1 udp port 55555 unreachable, length 37 21:33:36.520893 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520898 IP 192.168.1.1 > 192.168.1.2: ICMP 192.168.1.1 udp port 55555 unreachable, length 37 21:33:36.520901 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520906 IP 192.168.1.1 > 192.168.1.2: ICMP 192.168.1.1 udp port 55555 unreachable, length 37 21:33:36.520908 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520913 IP 192.168.1.1 > 192.168.1.2: ICMP 192.168.1.1 udp port 55555 unreachable, length 37 21:33:36.520916 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520920 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1 21:33:36.520923 IP 192.168.1.2.57937 > 192.168.1.1.55555: UDP, length 1

Jan 11 (Wed)

00:04

腹を立てている暇があるなら建設的な行動を!

Jan 6 (Fri)

07:27

負けず嫌いって健全だよね。

Jan 5 (Thu)

20:35

今年の仕事初め。うーーーーーーーーーんんん。

年明け早々 PC が立ち上がらず、午前中は復旧作業。 騙し騙しもそろそろ限界だろうかね。

12 月(2) へ


↑戻る