ã¾ã æ¹åç¹ã¯å¤ããããã©ãä¸éãã®å®è£ ãã§ããã®ã§å¿ããªããã¡ã«ã¾ã¨ãã¦ããã
å®æãããã®ã¯ãã¡ãã
ã³ãã³ãã©ã¤ã³ã« ARP ãã¼ãã«ã表示ãããããªãã®ã«ããã
gunzi@gunzi-desktop:~/protocol-stack$ make gcc -o arp_test -I ./ test/arp_test.c *.c gunzi@gunzi-desktop:~/protocol-stack$ sudo ./arp_test [sudo] gunzi ã®ãã¹ã¯ã¼ã: Network Address MAC Address 192.168.0.1 A4-12-42-19-DC-B0 192.168.0.2 00-25-DC-FC-43-C7 192.168.0.8 74-DA-88-FE-61-DC
ãã£ãã
å»å¹´ã®9,10æããããããããã¯ã¼ã¯ã®æ§ç¯ã¨ãã¡ãã£ã¨ããè¨è¨ããããã¨ããã£ãã®ã§ãã
家ã§ãä½ããããããã¯ã¼ã¯ã®æ§ç¯ãã§ããããã«ã«ã¼ã¿ã¼ã人ããããã£ãããã¦ãã¾ããã
ãã ããããã¯ã¼ã¯é¢é£ã§ããã°ã©ã ãæ¸ãããã¨ããªãããããã¿ãªãããªã¨èãã¦ããã¨ãã
åéã®ããã¤ããããããã³ã«ã¹ã¿ãã¯èªä½ã¤ã³ã¿ã¼ã³ã«åå ãã¦ãããã¨ãæãåºãã¾ããã
ã¡ãªã¿ã«ãã¡ããä¸ã®ã¤ã³ã¿ã¼ã³ã®ã¡ã³ã¿ã¼ã® pandax ããã®è³æã§ãã
www.slideshare.net
ããã ï¼ï¼ï¼ã¨æãã次åæ©ä¼ãããã°åå ãããããª...ãã¨ä¸ç¬èãããã§ããããããããã¨è² ãã ã¨æããã®ã§èªåã§ä¸ãããããã¨ã«ãã¾ããã
ç®æ¨è¨å®
æåãç®æ¨ã¯ãã¾ãã¯ä¸ã¤ãããã³ã«ãå®è£
ãã¦ã¿ããã¨ãã«è¨å®ãã¾ãããèªåã¨ãã¦ã¯
æåã« ICMP ãå®è£
ããã¤ããã ã£ãã®ã§ãããããããããã¦ãã±ããã®å®å
ãããããªãã¨ã ãã§ã¯ï¼ãã¨æ°ã¥ããã®ã§ ARP ã®å®è£
ãè¡ããã¨ã¸ã¨å¤åãã¾ããã
ãããããã å®è£
ããã«ãã¦ãé¢ç½ããªãã®ã§ãããã¤ãã®ç¸ããè¨ãããã¨ã«ãã¾ããã
(ãã¯ã½ã·ãªã¼ãºã§å¥½ããªç´ æ§ã¯æããããã®æ´¾ã§ã)
- ãããã³ã«ã¹ã¿ãã¯ãå®è£ ãã人ã®ã½ã¼ã¹ãèªã¾ãªã( Pandax ããããã®ä»ã®äººã®å®è£ ãªã©)
- ãããã³ã«ã¹ã¿ãã¯å®è£ ã«ã¤ãã¦æ¸ããã¦ãæ¸ç±ã¯èªã¾ãªã(å°ä¿£å ä¹ããã®æ¸ç±ããã¹ã¿ãªã³ã°TCP/IPã·ãªã¼ãºãªã©)
- 人ã«è³ªåããªã(å®å ¨ã«æè©°ã¾ãã§ã©ããããããªãã¨ãã¯ãã)
- ã§ããã ã man ã Linux ã®ã½ã¼ã¹ã調ã¹ã
- RFC ã¯æéãããã£ã¦ãèªåã§ä¸åº¦ç¿»è¨³ãã¦ã¿ã(æ¥æ¬èªè¨³ãè³æ»ã§ã¿ãªãã§ã¡ããã¨èªãã§ã¿ã)
ãªã人ã®å®è£
ãèªã¾ãªãã®ãã®çç±ã§ãããèªåèªèº«åçµãè¦æãªããã³ã¼ãããã®ã¾ã¾æ¸ãåãã¦å¦ã¶ã¨ å®å
¨ã«ç解ããï¼ããã£ã¦ãªãï¼ ã«ãªã£ã¦ãã¾ãããã§ãã
ã¾ããé£æ度ã¯é«ãã»ããæ°æã¡ããã®ã§ãã¼ãã«ãä¸ãã¾ããã
ã¡ãªã¿ã«ãããè¦ãããã¤ããã«ã¯ RTA ã¨å¼ã°ãã¾ããã
ç»åãè¦ãããã¤ãããã©ãè¦ã¦ã RTA ã ããªãâ¦ã
— ãã㤠(@lrf141) 2020å¹´9æ27æ¥
ä»åå®è£ ãè¡ã£ãã®ã¯ä»¥ä¸4ã¤ã§ãã
- ã¤ã¼ãµããããããã³ã«
- IP ãããã³ã«
- ARP ãããã³ã«
- inet ç³»ã®ãã¼ã«
é²ãæ¹
ä½ããªãã¨ããããçæããã®ã¯è³é£ã®æ¥ãªã®ã§ããã±ããã解æããã¨ããããã¯ããã¾ããã
ã¾ãã¯ãã®è¨äºãä¸éã触ã£ã¦ãã±ããã解æãã¦ã¿ããã¨ã«ãã¾ããã
https://www.opensourceforu.com/2015/03/a-guide-to-using-raw-sockets/
ããã§ä½¿ããã¦ãé¢æ°ã man ã§èª¿ã¹ãããã¤ã³ã¯ã«ã¼ãããã¦ãã linux ã®ãã¡ã¤ã«ã調ã¹ã¦ã½ã¼ã¹ãèªããç¹°ãè¿ãã¦
ã²ãããæ
å ±ãéãã¾ããã åºæ¬çãªæ
å ±ã¯ man ã«ãã£ãã®ã§ããªãå©ããã¾ããã
RFC ã¯ããããå¼ã£å¼µã£ã¦ãã¾ããã
https://tools.ietf.org/rfc/index
å®è£ ã¯ãã±ãã解æãããããã°ã©ã ã§ä½¿ç¨ããã¦ããããããã¡ã¤ã«ãç½®ãæãã¦ããããã«ãã以ä¸ã®æµããç¹°ãè¿ãã¾ããã
- RFC ãèªã
- å®è£
- ãã±ããã解æ
inet ã«å±ããé¢æ°ç¾¤ã¯ man 2 ã§æåã確èªãã¦é¡ããããããã¯åæ§ã®æåã«ãªãããã«å®è£ ãè¡ãã¾ããã ãã¨ã¯ãããã°ã®æ©è½ã§ãããªã®ãã£ãããããªãã¨ãããã®ãå®è£ ãã¦ããã¾ããã
ä½è«ã§ãããéä¸ã§ããã¤ããªãã¼ã¿ãè¦ãããã¤ãããã¨ä¾¿å©ã ãããã¨ã³ãã£ã¢ã³å¨ãã§æ³¨æããã»ããããã㨠ã¢ããã¤ã¹ãã¦ããã人ããã¦é常ã«å©ããã¾ãããæ¬å½ã«ãããã¨ã
å®è£ ãçµãã¦
ç·è©ããã¨ãåãã¦è§¦ããã®ãå¤ããã¦ä½ãããããªãç¶æ
ããå§ããã®ã§ããªãé£ããã£ãã§ãã
ãã ã æ¢åã®æè¡ãããã¯ãã¦èªåãªãã«èå¯ãã¦æ¹åããé¢ç½ãã¯æ®µéãã§ããã
ãã®ããé£æ度è¨å®ãä¸ãã¦ç¸ããã¬ã¤ãããã®ã§ãæå¾ã¾ã§å®è£
ã§ãããæ£ç´ããããªãã£ãã®ã§ããç®æ¨ã¾ã§ããããã¾ããã
ä¸äººã§èª°ã®ç®ããªãã§ããã®ãï¼ã¨ããç¹ãæ¬å½ã«å¿é
ã ã£ããã§ãããèªåã§å¸¸ã«ãã¤ã«ã¹ãã¼ã³ãç½®ãã¦æ¯æ¥ãã¤ãã«è¡ãé»è»ã§RFC ãèªãã ããå®è£
ã«ã¤ãã¦èãã¦ããã®ã§å
¨ãåé¡ãªãã£ãã§ãã
å人çã«ä¸çªè¯ãã£ããã¤ã³ããªãã§ãã èªåã®ä½ã£ã ARP ãªã¯ã¨ã¹ããã±ããã« ARP ãªãã©ã¤ãè¿ã£ã¦ããã¨ããã tcpdump ã§è¦ãæã¯æåãã¾ããã
ãã¨å®æçã«ãããããã®ãã®è¨äºãä½åº¦ãèªã¿è¿ãã¦ã¢ããã¼ã·ã§ã³ãä¿ã£ã¦ãã¾ããã
ä½ã¬ã¤ã¤ã¼ã®ã¢ããã¼ã·ã§ã³ãè½ã¡ã¦ãããèªã¿è¿ãã®ãããããã§ãã(ã¦ã¼ã¶ã¼ã¹ãã¼ã¹ã§åãã¦ãããä½ã¬ã¤ã¤ã¼ã§ã¯ãªãã¨ãã主張ã¯ç¡è¦ãã¦ãã)
ãã¨å®è£
ä¸ã¯ evernote ã§è³æã¨ã socket ã®è¨å®ã¨ãè²ã
ã¡ã¢ãã¦ãããã¼ãã®æ°ã14åã«ãªã£ã¦ã¾ããã
ã¡ã¢åã£ã¦ããã¨ãã¨ã§è¦è¿ããæã«æ¥½ãªã®ã§ããããã§ãã
é£ããã¨æããé¨å
ãããã°é¢é£ã¯ããªãè¦å´ããé¨åãå¤ãã£ãã§ããããããã©ããã£ã¦éä¿¡ãããã±ããããããã°ãããã ï¼ã¨ãã
tcpdump ããããµãã³ããããã¼ã¿ãé¢æ°ã®è¿ãå¤ããæ¨æ¸¬ãã¦è¡ãã¾ãããåºæ¬çãªã¨ããã§è¡ãã° man ãåç
§ãã¦ãªã«ãããããã¨ãã»ã¨ãã©ãªãã£ãã®ã§ããããå°ã大å¤ã§ããã
æè¨ã¨ãã¦å¾ãã®ã¯é¢¨éªã®ã¨ãã®ããã«å·éãªå¤æãé£ããã¨ãã¯ä¼ããã¨ãããã§ããé ãåããªãã®ã§åéããå¢ãã¾ããããã§1é±é溶ãã¾ãã
次ã®ç®æ¨
ç²ãé¨åãå¤ãã®ã§ãã®ã¸ãã®ä¿®æ£ããªãããªããã¨ããã®ãã¾ã第ä¸ã
ICMP ã®å®è£
ãã§ããã ping pong ããã¨ããã¾ã§ã wiki ãªãã«ã¾ã¨ãã¦è³æåããäºå®ã§ãã
Part2 以éã®ç®æ¨ã¨ã㦠ICMP, TCP, UDP ãªã©æåãªãããã³ã«ããã¨ããã¤ãå®è£
ãã¦ã¿ããã¨èãã¦ãã¾ãã
ããã«å ãã¦ããã«ã¼ãã«ã«è¿ãé¨åã®ä½ã¬ã¤ã¤ã¼ã«æãå
¥ãã¦ããããã®ã§ãããã¤ã¹ãã©ã¤ãæ¬ãèªã¿é²ãã¦å®éã«ã¤ã¼ãµããããã¼ãã®ãã©ã¤ããæ¸ãã¦ã¿ããã¨æãã¾ãã
ãã¨ã¯ããã¯ãã¿ãæ¢ãã¦çè«ã¨å®è£
ã®é¨åãå¦ãã§èªåã®ä¸ã«ãªãã®ã£ãããåã㦠IT ã ãã§ãªã CS ã«å¼·ããªãããã§ããã
æå¾ã«
æ®æ®µã¯éä¿¡å¶ã®å¤§å¦ã«éãã¤ã¤ï¼ï¼ï¼ããã¤ãã§ã¤ã³ãã©ã¨ã³ã¸ãã¢ã®ã¢ã·ã¹ã¿ã³ãããã¦ããã®ã§ããæ®æ®µã®æ¥åã§ã¯æ§ç¯ãªã©ãå¤ã
æ£ç´ããã°ã©ãã³ã°ã¯åãã¦ãªãããããªããï¼ã¨æããã¨ãå¤ã
ãã£ãã®ã§ãããå®éã«å®è£
ãã¦ããã¨ããã§ããªããªãã¨ãããã¨ã«æ°ã¥ãã¾ããã
ãã ãã¤ã³ã¿ã¼ã³ãããã«ã½ã³ã§è¡ã£ããã¨ã§ã¯ãªãã®ã§å®¢è¦³çãªè©ä¾¡ã¯å¾ãããªããããããã¯ã¡ãã£ã¨ãã¡ãªããã ãªã¨æãã¾ãã
å®è£
ä¸ã¯å¸¸ã«èªåãä½ãããããªãããä»ä½ãã§ãã¦ä½ããã¹ãããã解決ããããã« man ã RFC ãé»è»ã§ã®ç§»åä¸ãªã©ã«ã²ããã調ã¹ã¦ãã¾ããã
ç¸ããè¨ãããã¨ã§é£æ度ãä¸ããã¾ããããããããå®è·µãããã¨ã§ã¡ã¿ã¹ãã«çãªé¨åã磨ãããããããªãããªãã¨æãã¾ãã
ãã¨ãããã¯æãããã¤ã³ããªãã§ãã RFC ã§ã©ããã¦ãããããªãé¨åããã£ã¦ãããã«ã¤ãã¦èª¿ã¹ãããã«ã°ã°ã£ã¦ãã¾ã£ããã¨ã§ããã
è¦ã¦ãããããã°æ¹æ³ã«æ°ã¥ããã®ã§ãããæ¬å½ã«æããã£ãã§ãã ICMP ã§ã¯çµ¶å¯¾ã«è¦ãªãã...ã¨å¿ã«èªã£ãã
å®è£
ä¸èª°ã«ãé ¼ããããã¨æ±ºãã¦ããã®ã§ãæ£ç´è¾ãããããªãã ãããï¼ã¨æã£ããã§ããå
¨ãè¾ããªãã£ãã§ãããããéãããæ
å ±ã½ã¼ã¹ã®ä¸ããã©ããã«ãã³ãããªããã
ãã£ã¨è¯ãå®è£
ãããããããªãããã¨ãã£ããã¨ã常ã«èãã¦ããããã®ã§ç´ç²ã«æ¥½ããã£ãã§ãã
ãã¨ãä¸éããã£ããã¨ã§ãããã¯ã¼ã¯æè¡ã«èå³ã湧ããã®ã§ ARP ã®å®è£
ãçµãã£ããã¨ã« EuroBSDcon ã®è³æèªãã§ã¿ãããã¾ããã
次ã¯ã«ã¼ãã«ã«ææ¦ãã¦ä½ã¬ã¤ã¤ã¼ã«æãããã¨ããæ°æã¡ãåºã¾ãã¾ãããæä½éã®ãã¼ãã¦ã§ã¢ã®ä»æ§æ¸ãèªãã§ã³ã¼ããçæã§ããããã«ãªãããã§ããã
ã¾ã æã¿ããã¦ãªãã³ã³ãã¤ã©ã§ãã£ãããã¨ãã¥ã¬ã¼ã¿ãæ¸ãã¦ã¿ãã¨ããã¡ãã£ã¨ãã¤ææ¦ãã¦ãããããªã¨æãã¾ãã
ãã¨ã¯å°±æ´»ãçµããããã®ãç®æ¨ã§ãã......æ©ãçµãããã¦ä½ã¬ã¤ã¤ã¼ã¨ CS ã®åå¼·ã«éä¸ã§ããããã«ãªããã...