電腦協定

Download Report

Transcript 電腦協定

Speaker: Wei-Lin Chen
Date: 2010/07/14
Outline
 OSI Model & TCP/IP Model
 Internet Protocol
 TCP & UDP
 Wireshark
 Capture Filter
 References
2
OSI Model
3
OSI Model (cont.)
 Physical Layer (實體層)
 定義網路裝置之間的位元資料傳輸,也就是在電線或
其他物理線材上,傳遞0與1電子訊號,形成網路。
 RJ-45, 光纖纜線
 Data Link Layer (資料連接層)
 在網路之間建立邏輯連結,將實體層的數位訊號封裝
成一組符合邏輯傳輸資料,這組訊號稱為資料訊框
(Data Frame)
 MAC address
4
OSI Model (cont.)
 Network Layer (網路層)
 主要的通訊協定是網際網路協定(Internet Protocol),
資料在傳輸時,該協定將IP位址加入傳輸資料內,並把
資料組成封包(Packet)。
 IPv4, IPv6
 Transport Layer (傳輸層)
 主要負責電腦整體的資料傳輸及控制,可以將一個較
大的資料切割成多個適合傳輸的資料,提供流量管制
及錯誤控制。
 TCP, UDP
5
OSI Model (cont.)
 Session Layer (會議層)
 負責建立網路連線,等到資料傳輸結束時,再將連線
中斷。
 Presentation Layer (表現層)
 應用層收到的資料後,透過展示層可轉換表達方式。
 當資料透過網路傳輸時,需要將內容予以加密或解密。
 Application Layer (應用層)
 處理應用程式,進而提供使用者網路應用服務
 FTP, DHCP, HTTP, etc.
6
Comparing TCP/IP with OSI
7
TCP/IP Model
8
Internet Protocol (IP)
 IPv4
 Length : 32-bit,
 Header : 20 bytes
 IPv6
 Length : 128-bit
 Header : 40 bytes
 Network ID
位於IP位址的前段,可用來識別所屬網路。
 Host ID
位於IP位址的後段,可用來識別個別裝置。
9
Internet Protocol (cont.)
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Header
Version
Type of Service
Total Length
Length
Identification
Time to Live
Flags
Protocol
Fragment Offset
Header Checksum
Source IP Address
Destination IP Address
Options
Data
IPv4 Header
10
Internet Protocol (cont.)
IPv6 Header
11
Internet Protocol (cont.)
 Class A (Range 1.x.x.x to 126.x.x.x)
 Class B (Range 128.x.x.x to 191.x.x.x)
 Class C (Range 192.x.x.x to 223.x.x.x)
12
Internet Protocol (cont.)
 Private IP address
 Class A : 10.0.0.0 - 10.255.255.255
 Class B : 172.16.0.0 - 172.31.255.255
 Class C : 192.168.0.0 - 192.168.255.255
13
Internet Protocol (cont.)
 IP routing
 一個封包從發送端被傳送到接收端所經過的路徑。
14
TCP
 Connection-oriented
 Establishment
 Maintenance
 Termination
 Reliability
 Data confirm
 Error correction
 Flow control
 Sliding Windows
15
TCP (cont.)
 TCP Header
16
TCP (cont.)
 Three-Way Handshake
17
TCP (cont.)
 Flow control – Sliding Windows
18
UDP
 Connection-less
 No acks (Unconfirmed Service)
 High rate of transmission
 Unreliable
 No flow control
19
UDP (cont.)
20
Port
 TCP & UDP 都使用了port 號碼,將資訊傳遞給較上
面各層。
21
Wireshark
 Wireshark的前身叫做Ethereal(2006.06因為商標問題
改名),是一開放原始碼軟體,使用者可以免費從官
方網站(http://www.wireshark.org/)下載使用。
 Wireshark支援了多種作業系統,在Windows、UNIX
、MAC…etc下都有相對應的版本。藉由此軟體我們可
以抓取資料封包,進一步分析封包內的摘要及詳細資
訊。
22
23
24
25
26
Capture Filter
28
References
 Wireshark official website
 http://www.wireshark.org/
 網路教學-IP位址
 http://www.pcnet.idv.tw/pcnet/network/network_ip_addr.h
tm
 網路教學-TCP與UDP
 http://www.pcnet.idv.tw/pcnet/network/network_ip_tcp.ht
m
 Sliding Windows Demo
 http://www2.rad.com/networks/2004/sliding_window/inde
x.html
29