Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 網路實體連結 Instructor: Teaching Assistant:. 2 Outline Structure of a Typical LAN Simplex vs. Duplex Wiring and Making connectors Experiment Steps.

Similar presentations


Presentation on theme: "1 網路實體連結 Instructor: Teaching Assistant:. 2 Outline Structure of a Typical LAN Simplex vs. Duplex Wiring and Making connectors Experiment Steps."— Presentation transcript:

1 1 網路實體連結 Instructor: Teaching Assistant:

2 2 Outline Structure of a Typical LAN Simplex vs. Duplex Wiring and Making connectors Experiment Steps

3 3 Structure of a Typical LAN

4 4 Simplex vs. Duplex Baseband vs.Broadband Duplex: 2 NICs using Twisted Pair Duplex: 2 NICs over one Hub

5 5 Connector and Wire Connector : RJ-45 Wiring : Category 5 –NIC to Hub/Switch –NIC to NIC –Hub/Switch to Hub/Switch Before Making A Cable –NIC –Hub/Switch –Wiring and Connectors

6 6 Connector : RJ-45 8P ? Colors vs. Twisted Pairs –W-O & O –W-G & G –W-BL & BL –W-BR & BR 8 wires for 8 functions ? –Nope !

7 7 Wiring : 5 Categories The 6th Category ? –Gears up for Gigabit Ethernet !!

8 8 3 Configurations NIC to Hub NIC to NIC Hub to Hub

9 9 Before Making A Cable NIC-driver configuration Hub/Switch Wiring Caution –Auto-Sense don’t always sense automatically

10 10 Experiment Steps (1/2) 製作五條網路線 –RJ-45 接頭安裝說明 使用剝線器撥掉外皮 將各絞線依序導入接頭中的小溝 放入壓線器 8P 的壓線孔中,接著用力夾緊,接頭即告完 成

11 11 Experiment Steps (2/2) 測試線材與接頭 – 利用 Hub ( 10/100Mbps )的燈號來測試每 一條線是否正常 若網路線在測試步驟中都沒有使燈亮過,很 有可能是您的製程有問題

12 12 網路協定觀察與分析 Instructor: Teaching Assistant:

13 13 大綱 Introduction to sniffer Ethereal Operation Guide HTTP Protocol Overview Protocol Analysis Example (HTTP) Experiment Requirements

14 14 Introduction to Sniffer

15 15 Ethereal User Interface 針對已擷 取之封包 分析的一 些工具 擷取封包 前的部份 設定

16 16 設定欲擷取封包之網卡 開始擷 取封包 觀察此張 網路卡的 細節

17 17 設定欲擷取之封包類型 勾選表示 允許擷取 此類型的 封包

18 18 已擷取之封包資料圖 所有擷取 的封包 單一封包 內容 內容細節 : 十 六進位表示法

19 19 封包流量分析圖 選擇是否 顯示出來 選定所欲 進行分析 的類型 線條種類 的選擇 UDP 封包 時間分布 TCP 封包 時間分布

20 20 協定分佈圖 TCP 封包 的佔有率 及其數量 UDP 封包 的佔有率 及其數量

21 21 封包流向表 封包種類 針對 140.113.179.36 這台節點所有傳接送的 封包總數和流量大小

22 22 主機流量統計 網路卡型 號 擷取封包 的時間 封包數量 總流量

23 23 HTTP Overview (1/2) Application-level, distributed, collaborative, hypermedia information system. HTTP/0.9 (1990) : raw data transfer HTTP/1.0 (RFC1945) : MIME-like message HTTP/1.1 (RFC2068) : persistent connection, caching, hierarchical proxies, new methods….

24 24 HTTP Overview (2/2) WWW Client A Web Server Proxy WWW Client B Port 80 TCP connection

25 25 Multipurpose Internet Mail Extension -- MIME Non-textual data --> RFC 822 (7 bit) MIME-type 1. Textual message bodies other than US-ASCII 2. Textual header information other than US-ASCII 3. Non-textual message part 4. Multi-part message bodies

26 26 Protocol Parameters HTTP version URI (Uniform Resource Identifiers) Date/Time Character sets Content coding Transfer coding Media types

27 27 Persistent Connections Separate TCP connections (HTTP/1.0) : increasing HTTP server load and traffic load Default behavior of HTTP/1.1 Either client or server close connection by : Connection : close Pipelined requests/responses within a connection

28 28 HTTP Messages -- Methods OPTION : request for information about the communication options available on the request/response chain GET : retrieve information HEAD : retrieve information (test hypertext links for validity, accessibility, and recent modification) POST : subordinate to a directory, newsgroup, database... PUT : store entity DELETE : delete entity TRACE : see what is being received at the other end of the request chain

29 29 HTTP Messages -- Status Codes 1XX : Informational 2XX : Success 3XX : Redirection (further actions needed) 4XX : Client error 5XX : Server error Examples. 100 : Continue 201 : Created 302 : Multiple choices 403 : Forbidden 504 : Gateway time-out

30 30 Caching Reduces the number of network round-trips and bandwidth requirement Semantic transparency Expiration model –age, expiration(lifetime) calculation Validation model –cache validator (Last-Modified header) Response cachability : 200, 203, 206, 300, 301, 410 Cache control mechanism

31 31 Caching Cache control –Cache control header 1. What is cachable 2. Expiration mechanism modify 3. Cache revalidation & reload control 4. Entity transform

32 32 Related RFC list RFC822 : Standard for the Format of ARPA Internet Text Message RFC1630 : Universal Resource Identifier in WWW RFC1700 : Assigned Numbers RFC1738 : Universal Resource Locators RFC1808 : Relative Uniform Resource Locators RFC1945 : Hypertext Transfer Protocol -- HTTP/1.0 RFC2045 : MIME part one RFC2047 : MIME part three RFC2069 : Digest Access Authentication

33 33 存取 Yahoo 首頁所產生的 HTTP 協定封包 使用 filter 來篩選所有 HTTP 協定 的封包

34 34 第一個 HTTP 封包內容 由 Accept 、 Accept-Language 以及 Accept-Encoding 指明主機 端可接受的文件樣式。 由 User-Agent 指明本機端採用 MSIE 作為 HTTP 協定處理器。 由 Connection 指明 TCP 層繼續保持連線。 GET / HTTP/1.1 要求傳送根目錄下的首頁

35 35 第二個 HTTP 封包內容 HTTP/1.1 200 OK 傳回根目錄下的首頁 由 Server 指明網頁端採用 Apache/1.2.4 作為 HTTP 協定處理器。 由 Last-Modified 指明最後修改時間為 13 Mar 2007 10:19:26 。 由 Content-type 指明內容為 text/html 的文件樣式。 Data 部分包含 /news 目錄下的首頁 。

36 36 網路協定列表: HTTP 必須列入 實驗觀察 選擇另一個協定作 為觀察與分析的對 象,所有 RFC 可由 IETF 首頁或 NCTUCCCA 取得 協定 OSI layer 功能 SNMPApplication 網路設備與資料流量的監督與管理。 ARPNetwork 由 IP 位址查詢 MAC 位址。 RARPNetwork 由 MAC 位址查詢 IP 位址。 DNSApplication 由 domain name 查詢 IP 位址。 SMTPApplication 寄送電子郵件至指定的電子郵件帳號。 POP3Application 接收並保存電子郵件。 RPCSession 呼叫並執行遠端主機上的程序。 RIPNetwork Unicast routing protocol 。 DVMRPNetwork Multicast routing protocol 。 NFSApplication 分散式檔案管理與存取系統。 NetBIOSPresentation 在一群指定的主機間提供溝通機制,共享資源。 HTTPApplication 超媒體文件傳送、接收與管理。 RTP/RTSPApplication 支援在單和多目標廣播網路服務中傳輸即時資料。 SIPApplication 提供整合語音與其它多媒體的通訊服務。

37 實驗三 Linux 網路協定程式追蹤 教師: 助教:

38 38 Outline Why Linux ? Linux 核心的內部 Linux 開機始末 實驗步驟

39 39 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

40 40 Linux 核心內部

41 41 Linux 開機始末 Load the kernel Probe & setup the hardware Create system process System initialization getty login process

42 42 實驗步驟 安裝 Linux 追蹤開機始末 編譯核心 設定 Linux 網路組態 在 kernel 中追蹤 network driver

43 43 安裝 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

44 44 追蹤 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

45 45 編譯核心 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

46 46 設定網路組態 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 )

47 47 追蹤 kernel 中的 network driver Trace by debugger (KDB) Trace by printing, record by logging –klogd vs. syslogd Trigger network modules by “ping”

48 48 決定待測機器 ( 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 )

49 實驗四 Linux 子網域分割之設 定與觀察 教師: 助教:

50 50 Outline Traditional IP Allocation Netmask: the Concept Subnetting Realization –Proxy-ARP Transparent Router –Different Lengths of Netmask How Kernel Works –Broadcasting –Routing Table Lookup –Routing Table Cache Experiment

51 51 Traditional IP Allocation

52 52 Netmask: the Concept Used to determine whether two hosts are under the same network Unicast : A → B A → Router → C Broadcast : A → Everyone Router : Longest Prefix Match

53 53 Subnetting Realization - Proxy-ARP Transparent Router Get the mapping between MAC address and IP address of a host by ARP requests Sharing information with each subnet

54 54 Subnetting Realization - Different Lengths of Netmask

55 55 How Kernel Works Three possible scenarios when a packet arrives –Routing Table Lookup, Routing Cache, Broadcasting Routing Table Lookup

56 56 How kernel works Routing Cache Broadcasting –Set destination Ethernet address to ff:ff:ff:ff:ff:ff

57 57 Experiment Proxy-ARP –B or C ping A –B ping C –Open ARP on A –B or C ping A again –B ping C again Longest Prefix Matching and Routing Cache –Modify kernel source code and recompiled –Load new kernel –C ping B to check /var/log/messages Broadcasting


Download ppt "1 網路實體連結 Instructor: Teaching Assistant:. 2 Outline Structure of a Typical LAN Simplex vs. Duplex Wiring and Making connectors Experiment Steps."

Similar presentations


Ads by Google