2010年12月30日 星期四

TCP/IP


TCP state machine[1]

TCP states[1]
TCP segment format[1]


FLAGS(CODE BIT):
SYN 代表連線的過程中帶著同步的(序號)
ACK 表示回應欄的值是有效的
PSH 連線建立可以推送資料
RST 連線必須被重置
URG 警急的指標
FIN 結束連線


References:
[1] http://penguin.dcs.bbk.ac.uk/academic/networks/transport-layer/tcp/index.php
[2] http://140.115.236.4/mediawiki/index.php?title=TCP_header_%E7%9A%84Control_Flags

2010年12月14日 星期二

RJ45 (8P8C)

8P8C,也稱之為RJ45,是乙太網路使用雙絞線連線時常用的連結器插頭。8P8C的意義是8個位置(Position)也就是8個凹槽,8個觸點(Contact)也就是8個金屬接點。

出處:http://zh.wikipedia.org/zh-tw/8P8C# 

在快速乙太網路(Fast Ethernet)中(100Mbps),僅適用1、2、3、6四根線,差動訊號傳輸方式,減少電磁干擾,其中1、2為TX(發送)(擰在一起),3、6為RX(接收)擰在一起。因此直連線就是兩端同為EIA-568-A或者EIA-568-B,而乙太網路交叉線就是一端使用EIA-568-A,另一端使用EIA-568-B的連線方法。
在千兆以太網(1000BASEm 1Gbit/s)或者乙太網路供電(Power on Ethernet)中,全部的四對差動對都被使用。


連線顏色
分為兩種:T568A以及T568B
T568A:http://zh.wikipedia.org/zh-tw/T568A
T568B:http://zh.wikipedia.org/zh-tw/T568B


References:
[1]http://zh.wikipedia.org/zh-tw/8P8C#

2010年11月24日 星期三

C語言- incompatible types in assignment

如果使用陣列的方式宣告字串,則不可以直接使用=指定運算子另外指定字串
Ex.

char str[] = "hello";
str = "world";   // error, incompatible types in assignment

Reference:
http://caterpillar.onlyfun.net/Gossip/CGossip/PointerAndString.html

2010年11月16日 星期二

MSTP (Multiple Spanning Tree Protocol)

這篇很棒!  快速了解MSTP

Multiple Spanning Tree Protocol (IEEE 802.1s) is backwards compatible with STP/RSTP and addresses the limitations of existing spanning tree protocols (STP and RSTP) in networks to include the following features:
  • One Common and Internal Spanning Tree (CIST) that represents the entire network's connectivity.
  • Grouping of multiple bridges (or switching devices) into regions that appear as one single bridge on the network.
  • A VLAN can be mapped to a specific Multiple Spanning Tree Instance (MSTI). MSTI allows multiple VLANs to use the same spanning tree.
  • Load-balancing is possible as traffic from different VLANs can use distinct paths in a region. 

Purpose
  • To supplement VLAN insensitivity problem in STP/RSTP.

Edge Ports
  • Directly transition to forwarding, skipping learning states. 
  • Doesn’t generate topology changes when its link toggles. 
  • Become a normal spanning-tree port whenever receives a BPDU.


MST Instances
  • An MST bridge must be able to handle at least the following two instances 
    • One Common Internal Spanning Tree (CIST) 
    • One or more Multiple Spanning Tree Instance(s) (MSTIs) 
    • Cisco supports 16 instances: one CIST (instance 0) and 15 MSTIs


MST Instance
  • An MST Instance (MSTI) is a spanning tree instance. VLANs can be configured to run on a specific MSTI. Each created MSTI is identified by a unique number (known as an MST ID) known internally to a region. Thus an MSTI does not span across MST regions. 

Common and Internal Spanning Tree (CIST)
  • A CIST represents the connectivity of the entire network and it is equivalent to a spanning tree in an STP/RSTP. The CIST is the default MST instance (MSTID 0). Any VLANs that are not members of an MST instance are members of the CIST. In an MSTP-enabled network, there is only one CIST that runs between MST regions and single spanning tree devices. A network may contain multiple MST regions and other network segments running RSTP.