Transcript Ethernet
IEEE 802.3 Carrier Sense Multiple Access with Collision Detection (CSMA/CD)
All rights reserved. No part of this publication and file may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written permission of Professor Nen-Fu Huang (E-mail: [email protected]).
Ethernet ‹#›/21
Typical CSMA/CD Network
B
收發器 終端器
A
收發器電纜
C
同軸電纜
D F E
終端器 Ethernet ‹#›/21
IEEE 802.3 Architecture
CSMA/CD OSI
參考模式 應用層 表達層 會議層 傳輸層 網路層 鏈結層 實體層 高層通訊協定 邏輯鏈結控制 媒介擷取控制 實體層訊號處理
LLC (IEEE 802.2) MAC PLS PMA AUI MAU MDI
傳輸媒介 Ethernet ‹#›/21
CSMA/CD Protocol
Carrier Sense before transmission
Carrier Sense while transmission
Collision: Two or more stations transmitting simultaneously
Backoff: Random delay after collision
Deference: Defers transmission if channel is sensed busy
Collision Window (Slot time): Round-trip propagation delay time plus some carrier sense time. In IEEE 802.3, this value is defined to be 51.2 us.
Ethernet ‹#›/21
CSMA/CD Collision Handling
Collision Signal is generated by Physical layer.
Jam signal (collision enforcement): To make sure that all stations involved in the collision will detect collision. A pattern of 32 bits.
Collision backoff and retransmission method (Truncated Binary Exponential Backoff Algorithm, BEBA):
n : number of collisions experienced (n <= 16)
k : Min (n,10) -- Truncation
r : Random delay time (unit: slot time) between 0 <= r < 2 k
Ethernet ‹#›/21
CSMA/CD Collision Handling
Slot time = 51.2 us.
Disadvantage of BEBA:
Last-in-First-out effect: Stations with no or few collisions will have a better chance to transmit before stations that have waited longer.
Ethernet ‹#›/21
IEEE 802.3 Frame Format
7 1 2, 6 2, 6 2 4
位元組
Preamble SFD DA SA LEN LLC PAD FCS
Preamble: (101010...1010) for Synchronization SFD: Start Frame Delimiter (10101011) DA: Destination Address SA: Source Address Length: Length of LLC-Frame I/G I/G U/L 15-
位元地址
46-
位元地址
LLC-Frame: Up to 1500 bytes PAD: Padding when LLC-Frame < 46 bytes FCS: Frame Check Sequence (CRC-32) MAC-frame size -- from DA to FCS
I/G = 0 Individual Address (個別地址) I/G = 1 Group Address (群體地址) U/L = 0 Globally Administered Address (整體性地址) U/L = 1 Locally Administered Address (區域性地址)
Min 64 bytes to distinguish from collision Max 1518 bytes to prevent dominating bandwidth
Ethernet ‹#›/21
Cyclic Redundancy Check (CRC32) Hardware Implementation
X 0 X 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 16 X 17 X 18 X 19 X 20 X 21 X 10 X 22 X 11 X 23 X 24 X 25 X 12 X 13 X 14 X 15 X 26 X 27 X 28 X 29 X 30 X 31 A .
C MUX O = A, C = 0 O = B, C = 1 B
控制訊號 輸入
MUX
輸出
.
= AND = XOR = NOT
Ethernet ‹#›/21
Flow Chart
傳送訊框 組成訊框
, i=1
接收訊框 開始接收
Y N
線上有 訊號
N
傳送訊框 接收完畢
Y N
訊框過短 (衝撞)
N Y
發生衝撞
Y
送出擾亂訊號
N
傳送完畢
Y Y i = i + 1 i > 16 N
計算延遲時間
Y N
位址辨識 成功
N
檢查碼 正確
Y
尚有多餘 位元
Y
長度欄位 內容正確
Y
刪除訊框頭尾
N
等待延遲時間 傳送成功 傳送失敗 訊框錯誤 對齊錯誤 接收成功 長度錯誤 Ethernet ‹#›/21
Collision Detection Window for Baseband CSMA/CD (=2a)
a = 0.5,
傳輸時間 =
1 t 0 A B
A 開始傳送訊框
t 0 +a-
e
A
B 開始傳送訊框
B
衝撞
t 0 +0.5
A t 0 +1-
e
A
A 偵測出衝撞 B 偵測出衝撞
B B
Ethernet ‹#›/21
Cable Signaling (Manchester Encoding)
Idle 0V -0.225V
-1.825V
Preamble Idle +0.7V
0V -0.7V
Preamble 100ns 50ns Data Data Idle Idle Coaxial Cable Transceiver Cable
Ethernet ‹#›/21
Network Configuration Example 1 (Single segment)
終端器
B
同軸電纜區段(最長
500
公尺)
C
同軸電纜
A 50
公尺)
100
個)
D E
終端器 Ethernet ‹#›/21
Network Configuration Example 2 (Two segments)
B
同軸電纜區段(最長
500
公尺)
C
第一段同軸電纜
A
收發器電纜(最長
50
公尺) 訊號增益器
E
第二段同軸電纜
D F G H
同軸電纜區段(最長
500
公尺)
I
Ethernet ‹#›/21
Network Configuration Example 3 (Five segments, maximum)
A 1
區段
1 B C
訊號增益器
2 G 3
區段
3 4 H D
區段
2 F J I
區段
4 K E
半訊號增益器間電纜 (最長
1000
半訊號增益器 公尺)
5
區段
5 N 6 L M
Ethernet ‹#›/21
Architecture, Functions, and Implementation
工作站界面 高層通訊協定 訊框包裝 網路控制卡 鏈結層 鏈結管理 實體層 編碼及解碼 收發器電纜 收發器 傳送及接收 銅軸電纜 Ethernet ‹#›/21
Calculation of Slot time (Example 3)
元件 元件 穩定延遲 編碼器 收發器電纜 收發器(傳送路徑) 收發器(接收路徑) 收發器(衝撞路徑) 同軸電纜 半訊號增益器間電纜 電纜驅動器 電纜接收器 訊號增益器(增益路徑) 訊號增益器(衝撞路徑) 載波感測 衝撞偵測 訊號上升時間 (至
70%
於
500
公尺處) 訊號上升時間(由
50%
至
94%
於
500
公尺處) 衝撞分割
0 0
元件 啟動延遲
0.1us
5.13ns/
公尺
0.05us
0.05us
0 4.33ns/
公尺
5.13ns/
公尺
0.1us
0.1us
0 0 0.2us
0.2us
0 0.1us
0 0.3us
0.6us
0 0 0.9us
0 0 0.4us
0.2us
0.2us
0.2us
0.1us
2.0us
0.2us
前進路徑 元件數 回程路徑 元件數
0 3 2 0 5 3 3 5 300
公尺
2 2 0 1500
公尺
1000
公尺
0 0
訊號來回傳遞最長延遲
5 0 0 2 0 3 0 5 300
公尺
2 2 3 1500
公尺
1000
公尺
3 1
整體延遲
6.00us
0.20us
46.38us
2.0us
3.08us
2.10us
1.95us
2.70us
12.99us
10.26us
0.40us
0.40us 1.20us
0.80us
1.00us
1.00us 0.30us
Ethernet ‹#›/21
10BaseT Ethernet Examples
10BASE5
界面
10BASE2
界面
10BASET
集線器
(HUB) A B C D F G H E
無遮蔽式雙絞線
(UTP)
最長
100
公尺
10BASE5
界面
10BASE2
界面
10BASET
集線器(HUB)
A B C D E F G H
串聯線 Ethernet ‹#›/21
Half-duplex MAC
Ethernets have always used a half-duplex MAC .
Efficient bidirectional communications is effected by rapidly changing the direction of communication on half-duplex channel.
For Ethernet, this is not a problem due to stations can quickly arbitrate for the ability to send their frames.
However, the extension of the Ethernet MAC algorithm to gigabit data rates does strain the ability to efficiently operate in this mode.
When the arbitration time (equal to the round-trip delay, in the worst-case) approaches or exceeds the time to transmit a typical frame , the efficiency of the algorithm suffers.
Ethernet ‹#›/21
Limitations of Half-duplex Operation
CSMA/CD implies an intimate relationship between the minimum length of a frame (L, measured in bit-times, not absolute time) and the maximum round-trip propagation delay (2a) of the network:
L > 2a
If we want to allow very long networks, we can make the minimum frame very long.
Padding needs if a station wishes to send less data than this minimum frame. Reduces the transmission efficiency.
If we want to avoid the overhead of padding, we must reduce the extent of the network so that collision can be detected in all cases.
Ethernet ‹#›/21
Limitations of Half-duplex Operation
For the original 10 Mbps Ethernet, a compromise was struck.
Minimum frame = 512 bits (64 bytes), Physical Layer overhead.
not including the preamble and Minimum data field = 46 bytes rarely imposes a significant padding overhead (IP header + TCP header = 40 bytes).
At 10 Mbps, 512 bit-times is on the order of from 2-3 Km .
51.2us
. Depends on the type of cable used and the network configuration, the extent of a 10 Mbps Ethernet can be 7 1 6 6 2 46 4 bytes Preamble SFD DA SA LEN Data FCS Minimum Frame Length (512 bits)
Ethernet ‹#›/21
Network Extent
For a given minimum-length frame, the extent of a network scales inversely with data rate.
10,000 m ~ 2800m 1,000 m ~ 205m 100 m ~ 20m 10m 10Mbps 100 Mbps 1000 Mbps
Ethernet ‹#›/21