Download presentation
Presentation is loading. Please wait.
Published byDouglas Merritt Modified over 9 years ago
1
實驗三 Linux 網路協定程式追蹤 教師: 助教:
2
2 Outline Why Linux ? Linux 核心的內部 Linux 開機始末 實驗步驟
3
3 Why Linux ? Free !! Compatible with System V & BSD UNIX Compliant to POSIX 1.0 Fast update !! Internet Powerful !! Pure 32-bit OS Candidate OS for embedded system Source code open !! Suitable for academic use
4
4 Linux 核心內部
5
5 Linux 開機始末 Load the kernel Probe & setup the hardware Create system process System initialization getty login process
6
6 實驗步驟 安裝 Linux 追蹤開機始末 編譯核心 設定 Linux 網路組態 在 kernel 中追蹤 network driver
7
7 安裝 Linux Where to get it ? ftp://linux.cs.nctu.edu.tw Which distributions ? Fedora, Ubuntu, Debian Which versions? Fedora 5 How do I install it ? Existing documents ? /usr/doc
8
8 追蹤 Linux 開機始末 Capture bootup sequence dmesg Scroll Lock , Shift + [PgUp | PgDw] syslogd Traverse /etc/initab /etc/rc.d/ Tools grep Microsoft Visio Studio - Edit - Find in files
9
9 編譯核心 Obtain the kernel source make [config | menuconfig | xconfig] Modules support Choose your adapter driver Choose TCP/IP protocol stack make clean, make make modules_install cp arch/i386/boot/bzImage to /boot cp System.map to /boot move to /boot and mkinitrd rewrite grub/grub.conf
10
10 設定網路組態 Internet 參數 Network interface configuration ifconfig eth0 x.x.x.x netmask y.y.y.y broadcast z.z.z.z ( Set IP address, netmask, broadcast address) Routing table configuration route add -net default gw 140.113.88.254 dev eth0 ( Add new network route on device eth0 and route packets via a gateway ) route add -net 140.113.23.0 dev eth0 ( Add new network route on device eth0 )
11
11 追蹤 kernel 中的 network driver Trace by debugger (KDB) Trace by printing, record by logging klogd vs. syslogd Trigger network modules by “ ping ”
12
12 決定待測機器 ( H and M )=( R and M )=( N1 and M )=( N2 and M ) ≠ ( F and M ) 公式中的 and 代表作 bitwise 的 AND 運算。 ( H and M ) = ( R and M ) 代表 H 和 R 在同一個 network 狀態 IP address ( 32-bit ) 本機位址已連上 InternetH ( host ) 本機 Netmask - M ( mask ) router 或 gateway 位址已連上 InternetR ( router ) 選擇的遠端(跨 subnet )待測機器位址已連上 InternetF ( far ) 選擇的近端(同 subnet )待測機器位址已連上 InternetN1 ( near ) 選擇的近端(同 subnet )待測機器位址尚未連上 InternetN2 ( near )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.