2009年10月26日 星期一

Network basic concept

最近在設定 iptables , 要有一些基本知識,就翻了些網頁,順便做點筆記,以後忘掉時才有東西可查

Ref:鳥哥私房菜 - 網路基礎概念Network Sorcery - IPRFC791酷學園 - TCP 與 UDPNetwork Sorcery - TCPRFC793




A Class :
0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx ==> NetI_D 的開頭是 0
|-Net-ID|-----------Host-ID-------|
B Class :
10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx ==> NetI_D 的開頭是 10
|-----Net-ID-----|----Host-ID-----|
C Class :
110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx ==> NetI_D 的開頭是 110
|----------Net-ID---------|-Host-ID|

三種分級在十進位的表示:
A Class : 0.xx.xx.xx ~ 126.xx.xx.xx
B Class : 128.xx.xx.xx ~ 191.xx.xx.xx
C Class : 192.xx.xx.xx ~ 223.xx.xx.xx

Network : Host-ID all '0' , first IP in that that network
Broadcast : Host-ID all '1' , last IP in that that network
Netmask : Net-ID all '1' , Host-ID all '0'
Network / Netmask : Network / bits , bits = How many Net-ID bits

example.
a.
192.168.0.0 / 24
available ip -- 192.168.0.0 ~ 192.168.0.255
b.
192.168.0.128 / 25 is the same with 192.168.0.128/255.255.255.128
25 bits fo Net-ID , available ip -- 192.168.0.128 ~ 192.168.0.255

private IP
A Class:10.0.0.0 - 10.255.255.255
B Class:172.16.0.0 - 172.31.255.255
C Class:192.168.0.0 - 192.168.255.255

three-way handshake:
1.
Server is listening , Client sent TCP packet (SYN , seq = 1200)
# 1200 is the initial sequence number ,
# server expect the first data byte seq = 1200+1
# server also replies a sequence number to client
2.
Server replies packet ( SYN ,ACK, seq = 2340 ack = 1201 )
# Client will also expect server to sent data for seq = 2340+1
3.
Client replies packet (ACK , ack = 2341, seq = 1201 )

沒有留言: