• 沒有找到結果。

Link Layer & 一點點的 Physical Layer

N/A
N/A
Protected

Academic year: 2022

Share "Link Layer & 一點點的 Physical Layer"

Copied!
12
0
0

加載中.... (立即查看全文)

全文

(1)

Link Layer & 一點點的 Physical Layer

Prof. Michael Tsai 2015/03/16

(2)

Multiple Access Protocols (Link Layer)

Point-to-point link – link 的兩端各有一個傳輸 & 接收器

Broadcast link – 多個裝置共用一個”連結” / 媒體 (Medium)

共用 = 你講話大家都聽得到

Collision = 多個人一起講話 , 每個人都聽到同時兩個人以上講話  沒人聽得懂 剛剛的時間 ( 頻寬 ) 就浪費了

大家必須有某種 decentralized, 簡單 , 公平的協議來避免 coll ision!

Channel partition protocols & taking turns protocols

Random access protocols:

傳的時候全速傳

壞掉再重傳 (retransmission)

(3)

Ethernet’s Carrier Sensing / Collision Detection

上層 (network layer) 有東西要傳的時候,會將準備好 的封包放進 buffer 內。

1.

Carrier Sensing: 說前先聽, 如果有人在說話 ( 如果 你聽到了 ) ,先等他說完再說。

如果 96-bit duration 沒有偵測到傳輸,則開始傳輸。

2.

Collision Detection: 如果有人同時開始講話 ( 如果你 聽到了 ) ,立刻停下來。

停下來以後,傳輸 48-bit duration 的 jam signal 。

3.

Exponential Backof: 每次傳輸失敗後,這個裝置會 進入 exponential backoff 模式。

當傳輸這個封包碰到連續第 n 次 collision 後,則須等待 , 的時間,然後回到步驟 1 。

(4)

2 CSMA Nodes with Colliding Transmissions

Space Time

0

1

A B

Transmission Time

Propagation Delay �( �, �)

(5)

2 CSMA/CD Nodes with Colliding Transmissio ns

Space Time

0

1

A B

偵測到 collision, 停止傳輸

(6)

CSMA/CD 的效率

= 最大 propagation delay

= 最大 packet transmission time

(7)

Ethernet: 從 broadcast link 到 point-to- point link

HUB: Re-send received packets to all ports  A multi-port repeater!

(8)

Ethernet: 從 broadcast link 到 point-to- point link

Switch:

1. The internal address table will learn the MAC addresses on that port.

2. Packets to a specific address will be sent to only the port with that address.

3. Packets with new addresses will be sent to all ports.

4. Point-to-point links! No longer need a MAC!

(9)

常用使用網路線的 Ethernet 科技

10 Base2: 使用類似家裡第四台用的同軸電纜傳輸。速 度可達 10 MBps 。資訊館最早的網路使用此科技。

10 BaseT: 使用 Cat. 3 or Cat. 5 網路線中的四芯 ( 兩對 ) 。 所有裝置都直接接到 HUB 或 Switch( 星狀拓樸 ) 。

100 BaseTX: 使用 Cat. 5 網路線中的四芯 ( 兩對 ) 。

1000 BaseT: 使用 Cat. 5 等級或更好的網路線中的八芯 ( 四對 ) 。

10G BaseT: 使用 Cat. 6a 等級或更好的網路線。

(10)

10 BaseT 的訊號

可以經常切換 high & low voltages (-2.5 及 2.5 Volt)

Clock recovery: 需要知道每個 bit 開始及結束的時間。但是每個裝置 內部的時間不同 ! 因此需要從對方傳輸的訊號變換來估計每個 bit 的 時間有多長 !

接收端用 0 volt 來當作 threshold 判斷到底是 high or low 。

Noise: 電路中的雜訊會加在收到的訊號上。當訊號相對於雜訊太弱

的時候,就有可能會誤判 high or low 。

(11)

100 BaseTX 的訊號

4B5B + MLT-3 編碼

4B5B: 把 0 和 1 做更平均的分配

MLT-3: +1, 0, -1 Volt

Bit 1: 移動到下一個 state

Bit 0: 同樣一個 state

Name 4b 5b

0 0000 11110

1 0001 01001

2 0010 10100

3 0011 10101

4 0100 01010

5 0101 01011

6 0110 01110

7 0111 01111

8 1000 10010

9 1001 10011

A 1010 10110

B 1011 10111

C 1100 11010

D 1101 11011

E 1110 11100

F 1111 11101

(12)

Ethernet Frame Structure

Preamble: 10101010, 用來做 clock recovery 用途。

MAC source/destination: 紀錄來源及目的裝置網路卡號

MTU (Maximum Transmission Unit): 如果上層封包 > 1500 By tes, 則會被切小分段傳輸。

FCS (CRC): 可以檢查這個封包是否有錯誤。

Preamble Start of frame delimiter

MAC destinati

on

sourceMAC

Length (IEEE 802

.3)

802.1Q ta g

(optional) Payload

Frame check sequence

(32 bit C‑ RC) 7 octets 1 octet 6 octets 6 octets 2 octets (4 octets) 42–1500

octets 4 octets

Octets = Bytes

參考文獻

相關文件

(c) Pseudo Header 的功能主要是為了要檢查 UDP 封包是否送達正確的終點。UDP 的錯 誤檢查碼可視為雙重保險的機制。當封包在傳遞中發生錯誤, 而位於 UDP 下的各層協定 都沒有找出此錯誤時,

IP Layer Basics and Firewall & Networking tools (ifconfig, route, ip, iptables, nslookup, dig, arp) (作業:pfSense firewall).. Wireless physical layer, Wireless link layer

Physical & Link layers + CISCO switch link layer functions.. Wireless physical and link layers + Access

Physical Layer Link Layer Network Layer Transport Layer Application Layer.

本次的作業 (netstat -na 部分 ) 即在觀看所有機 器上的 transport layer 連線. 本次的作業 (netstat -na 部分 ) 即在觀看所有機 器上的 transport layer

Physical Layer Link Layer Network Layer Transport Layer Application Layer..

„ However, NTP SIPv6 UA cannot communicate with CISCO PSTN gateway, and CCL PCA (IPv6 SIP UA) cannot communicate with CISCO PSTN gateway and Pingtel hardware-based SIP phone. „

Responsible for providing reliable data transmission Data Link Layer from one node to another. Concerned with routing data from one network node Network Layer