[ ¸®´ª½º - ³×Æ®¿öÅ© ] random drop / rando dealy / jitter

   Á¶È¸ 1169   Ãßõ 0    

구글링으로 리눅스 서버 또는 클라이언트에서 시험 용도로 사용할 만한 해당 툴이 있나 살펴 보았는데, 검색에 실패 하였습니다.

아시는 분의 조언 부탁 드려 봅니다.



감사합니다.

ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
Ǫ»Ç 2023-11
Áú¹®±Û º¸°í Àúµµ Å×½ºÆ®·Î µå·ÓÀ̳ª µô·¹ÀÌ ÇÒ ¼ö ÀÖÀ¸¸é ÁÁ°Ú´Ù°í »ý°¢Çؼ­ °Ë»öÇغ¸´Ï,
tc ¸í·É¿¡¼­ netem(³×Æ®¿öÅ© ¿¡¹Ä·¹ÀÌÆ®) À¸·Î µå·ÓÀ̳ª µô·¹ÀÌ ÇÒ ¼ö ÀÖ´Ù°í ÇÕ´Ï´Ù.

https://www.pico.net/kb/how-can-i-simulate-delayed-and-dropped-packets-in-linux/

    Add 10ms of delay to every packet transmitted on eth0:
    $ tc qdisc add dev eth0 root netem delay 10ms

    Add 10ms of delay and 20ms of jitter to every packet bridged by br0:
    $ tc qdisc add dev br0 root netem delay 10ms 20ms

    Randomly drop approximately one percent of packets transmitted on eth1:
    $ tc qdisc add dev eth1 root netem loss 1%
iptables·Î dropÀÇ °æ¿ì´Â, È®·üÀ» ÁöÁ¤Çؼ­ µÇ±ä ÇÏ´õ¶ó±¸¿ä

====

## DROP packet with ratio
❯ uname -mrs
Linux 5.10.199-190.747.amzn2.x86_64 x86_64

❯ sudo iptables -A INPUT -p icmp --icmp-type echo-request -m statistic --mode random --probability 0.50 -j DROP

❯ sudo iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target    prot opt source              destination
1    DROP      icmp --  anywhere            anywhere            icmp echo-request statistic mode random probability 0.500000
00000 # <================== !!!

Chain FORWARD (policy DROP)
....

❯ ping -c 10 43.200.105.82
0 ▁ 10 ▂ 20 ▃ 30 ▄ 40 ▅ 50 ▆ 60 ▇ 70 █ 80 ▁ 90 ▂ 100 ▃ 110 ▄ 120 ▅ 130 ▆ 140 ▇ 150 █ 160 ▁ 170 ▂ 180 ▃ 190 ▄ 200 ▅ 210 ▆ 220 ▇
230 █ ¡Ä
PING 43.200.105.82 (43.200.105.82): 56 data bytes
▁▁!▁!▁▁!!
 4/  9 (44%) lost;    3/  4/  5ms; last:    5ms
 4/  9 (44%) lost;    3/  4/  5/  1ms (last 5)
--- 43.200.105.82 ping statistics ---
10 packets transmitted, 5 packets received, 50.0% packet loss # <============ !!!
round-trip min/avg/max/stddev = 3.628/4.190/5.252/0.619 ms


QnA
Á¦¸ñPage 91/5684
2014-05   4958940   Á¤ÀºÁØ1
2015-12   1495408   ¹é¸Þ°¡
05-08   1130   ¹Ì´ã
2023-01   1131   ¸®Å°ÆÄ¿ï·¯
03-22   1131   ¹Ì´ã
06-07   1131   JJ25
04-02   1132   Æ۽̱Û
08-20   1132   DavinciKim
2022-12   1132   ½Ã°ñ³ëÀÎ
05-19   1132   ¹üÀÌ´Ô
05-20   1132   ¼­¿ïI±èµ¿¼ö
08-05   1132   ¾Ð±¸Á¤³ë·©ÀÌ
08-22   1132   ¶Ñ¶Ñ±è´ë¿ø
2023-12   1133   ÃÖâÇö
2023-02   1133   ¸á¶û²Ã¸µ
2023-02   1133   ¾ÆÄí
02-29   1133   ½ÅÀº¿Ö
2023-11   1133   ±è¹ÎöGC
08-03   1133   Ç×°ø¸ðÇÔ
2022-07   1133   ºí·ç¿µ»ó
01-27   1133   HEJYS
07-01   1133   chotws