Académique Documents
Professionnel Documents
Culture Documents
Sublayer
Chapter 4
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Assumptions for Dynamic Channel
Allocation
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ALOHA
Basic idea of ALOHA: let users transmit whenever they have
data to be sent.
Collisions are possible!
Sender might be able to listen for collisions while transmitting
If the frame was destroyed, the sender just waits a random
amount of time to retransmit it.
The waiting time must be random or the frames will collide again.
Contention systems: Systems in which multiple users share a
common channel in a way that can lead to conflicts.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ALOHA (1)
User
Collision
Collision Time
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ALOHA (3)
(Including retransmission)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Slotted Aloha
Divide time into discrete intervals called slots, each interval
corresponding to one frame.
Require the users to agree on slot boundaries
A station is not permit to send at any time. It is required to
wait for the beginning of the next slot
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
CSMA with Collision Detection
Direction of
transmission
Token ring
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Binary Countdown
Scaling problem: One bit per station for basic bit-map protocol
A station wanting to use the channel broadcasts its address
as a binary bit string with the high-order bit.
The bits in each address position from different stations are ORed
together when they are sent.
Higher-numbered stations
have a higher priority than
low-numbered stations
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Limited-Contention Protocols
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Adaptive Tree Walk Protocol
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Wireless LAN Protocols (1)
Hidden Terminal Problem:
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Ethernet
• Physical layer
• MAC sublayer protocol
• Ethernet performance
• Switched Ethernet
• Fast Ethernet
• Gigabit Ethernet
• 10 Gigabit Ethernet
• IEEE 802.2: Logical Link Control
• Retrospective on Ethernet
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
MAC Sublayer Protocol (1)
Ethernet preceded IEEE 802.3 by almost 10 years. Ethernet was
developed by RobertMelcalf at Xerox’s Palo Alto Research Center.
DIX stands for DEC, Intel, andXerox, the original collaborators
on the Ethernet standard.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
MAC Sublayer Protocol (1)
Type/Length: Depending on whether the frame is Ethernet or
802.3.
Multiple network-layer protocols may be use in the same time on the
same machine. Ethernet uses this field to tell the receiver what to do
with the frame (i.e., network protocol type, ex:IPv4).
Length: the length of frame.
Number less than or equal to 0x600(1536) can be interpreted as
Length, and the number greater than 0x600 can be interpreted as
Type.
Data: up to maximum 1500 bytes.
To make it easier to distinguish valid frames from garbage, Ethernet
requires that valid frames must be at least 64 bytes long, from
destination address to checksum, including both.
Another reason (and more important) reason fro having a minimum
length frame is to prevent a station from completing the transmission of
a short frame before the first bit has even reached the far end of the
cable, where it may collide with another frame.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
MAC Sublayer Protocol (2)
Checksum: CRC is an error detection code. The frame is
dropped if an error is detected.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Ethernet Performance
Twisted pairs
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Switch
Hub
Switch ports
Twisted pair
An Ethernet switch.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Switched Ethernet (2)
Hub:
Reduce the maximum cable run from the hub to 100 meters.
As more and more stations are added, each station gets a decreasing
share of the fixed capacity.
在資料的傳送上,採用廣播的方式。當它從一個Hub 的埠 (和 TCP 協定
的 port 不一樣﹐這裡 是指插網路線的接孔)接收信號進來之後﹐會將這
個信號原原本本的送到所有其它 port 上﹐不管哪些 port 是接到哪一台
機器。
All stations are in the same collision domain. Use the same CSMA/CD
algorithm to schedule their transmissions.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Switched Ethernet (2)
優點:
Since there are no collisions, the capacity is used more efficiently.
Multiple frames can be sent simultaneously.
Note that no two frames can be sent to the same output port
simultaneously.
Security: traffic is forward only to the ports where it is destined.
缺點:
The switch must have buffering for queuing in the case where two
frames are sent to the same output port simultaneously.
Promiscuous mode: all frames are given to each computer,
not just those addressed to it (ex: Hub).
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Fast Ethernet
Fast Ethernet (802.3u): keep old frame formats, interfaces,
and procedure rules, but reduce the bit time from 100 nsec
to 10 nsec.
The main disadvantage of a Category 3 twisted pair is its
inability to carry 100Mbps over 100 meters. In contrast,
Category 5 twisted pair wiring can handle 100m easily.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A two-station Ethernet
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Gigabit Ethernet (2)
Two modes: Full duplex (for switch) and Half duplex (for
hub) mode
A two-station Ethernet
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Wireless Lans
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
802.11 Architecture and Protocol Stack (1)
Each client is associated with an AP that is in turn connected
to the other network.
To Network
Access
Point
Client
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The 802.11 MAC Sublayer Protocol (1)
IEEE 802.11 中定義了兩種基本服務組合(Basic Service Set,
BSS)。
中控型基本服務組合(Infrastructure BSS),主要是由基地台
(Access Point, AP)負責中控型網路中所有的傳輸,包括同一服務
區域中所有行動節點之間的通訊。
獨立型基本服務組合(Independent BSS, IBSS),工作站能彼此為
直接通訊,無須透過基地台協助。
服務設定識別碼(SSID,Service Set Identifier):每一個基本服務組
合網路都配有一個 SSID.
SSID 是由 32 個字元長度的字母 、數字或符號所組成。為一群無線
區域網路裝置共用的網域名稱。同一個服務組的設備可以使用 SSID
來驗證另外一個網路設備是否為同一個群組。
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The 802.11 MAC Sublayer Protocol (1)
對於無線媒介的存取,IEEE 802.11 MAC 採用 CSMA/CA 機
制。802.11 規範了分散式協調功能(Distributed Coordination
Function, DCF)與中樞協調功能(Point Coordination
Function, PCF)兩種協調功能。
分散式協調功能(DCF)為標準 CSMA/CA 的存取機制,工作站在
傳送資料之前,會先檢查無線媒介的狀態。當無線媒介為淨空狀態
時,工作站會延遲一段時間(IFS),若在此段時間內,媒介仍為淨
空,工作站即可開始傳送資料。反之,若無線媒介為忙碌狀態時,
工作站除了延遲等待一段時間之外,還會再隨機選取一個延遲
(Backoff)時間。延遲時間唯有當媒介為淨空狀態時才會遞減,當
延後時間遞減為零時,即可開始傳送資料。
中樞協調功能(PCF)不同於分散式協調功能所提供的競爭服務,中
樞協調功能提供的是免競爭服務。在中樞協調功能的機制中,必須
有 AP 作為中樞協調者(Point coordinator),因此只有在中控型網
路中才會有中樞協調功能的服務。
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
當一工作站要傳送訊框前必須遵循CSMA/CA 原則來等待一段
時間,依據訊框的種類,IEEE 802.11 定義不一樣的訊框間隔
(Interframe Space, IFS),優先權高的訊框將被分配較短的
訊框間隔,而優先權低的則分配到較長的訊框間隔。訊框間隔
可以分為下列幾類:
短訊框間隔(Short IFS, SIFS):為最短的訊框間隔,用來處理需要立
即回應的訊框。例如: RTS, CTS, ACK 等,它們等候的時間都是
SIFS。
中樞協調功能訊框間隔(PCF IFS, PIFS):第二短的訊框間隔,在進
行 PCF 免競爭式傳輸時,有資料待傳的工作站須等待PIFS 時間後再進
行傳送。
分散式協調功能訊框間隔(DCF IFS, DIFS):第三短的訊框間隔,在
進行 DCF 競爭式傳輸時,有資料待傳的工作站須至少等到媒介閒置
後,再至少等待DIFS 時間後再進行傳送。
延長訊框間隔(Extended IFS, EIFS):為最長的訊框間隔,需要重送
的訊框,所需至少等待的時間。Backoff time=Random()*a slot time
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
SIFS、PIFS、DIFS 時間長度依照不同的實體傳輸媒介而有所
不同
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
所有競爭者皆等一段DIFS 時間,再進入競爭期間
開始偵測媒介
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
若同時有很多不同的電腦都想要傳送資料訊框,這些資料訊框
等待的時間都是 DIFS,還是會產生二次碰撞。
Backoff time: 若無線媒介為忙碌狀態時,工作站除了延遲等待
一段時間之外,還會再隨機選取一個延遲(Backoff)時間。
Backoff time=Random()*a slot time
Random(): 0~ CW, CW 代表 contention window, 介於 aCWmin 和 aCWmax 間
(aCWmin, aCWmax 由IEEE 802.11 定義)
Slot time 依據使用實體媒介而不同
• Example: CW = 前一次CW值+2n+2
競爭期間所有工作站開始倒數計時,一旦倒數時間為零,便可
立刻傳送資料。相反地,若自己的倒數時間未到,而別人已經
先結束倒數,則由他人先送訊框。
在偵測到無線媒介變為忙碌時,便暫停倒數計時,等傳輸媒介
再度變為空閒時,等待 DIFS 時間,再繼續先前未完的倒數計
時,直到倒數時間結束為止,才開始傳送資料。
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
CW
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
If the frame gets through, the destination sends a short
acknowledgement.
而接收端成功接收到訊框,會隔一段 SIFS 時間後,回傳正面回覆訊框
(ACK)。
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
Lack of an Ack is inferred to indicate an error, whether a
collision or otherwise. The sender doubles the backoff period
and tries again, continuing with the exponential backoff as in
Ethernet until the frame has been successfully transmitted or
the maximum number of retransmissions has been reached.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The 802.11 MAC Sublayer Protocol (2)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
為了避免隱藏節點問題所造成的碰撞,IEEE 802.11 設計了
一四段交握(4-way handshake)的流程。
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
在IEEE 802.11 中定義網路分配向量(Network Allocate
Vector, NAV)來記載工作站將會使用媒介多久,其他的工作
站會認為媒介在NAV 時間內都是忙碌的。
RTS/CTS 夾帶 NAV
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
分散式協調功能
工作站 C 會收到 B 工作站的 CTS,可以得知工作站 B 會在什
麼時間結束使用媒介。
RTS
CTS
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The 802.11 MAC Sublayer Protocol (5)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Broadband Wireless
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
802.16 Architecture and Protocol Stack
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
802.16 MAC Sublayer Protocol
Classes of service
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Bluetooth
• Architecture
• Applications
• Protocol stack
• Radio layer
• Link layers
• Frame structure
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Bluetooth Architecture
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Bluetooth Protocol Stack
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
RFID architecture.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
EPC Gen 2 Physical Layer
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
• Uses of bridges
• Learning bridges
• Spanning tree bridges
• Repeaters, hubs, bridges, switches,
routers, and gateways
• Virtual LANs
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Learning Bridges (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Learning Bridges (3)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Spanning Tree Bridges (2)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Poem by Radia Perlman (1985)
Algorithm for Spanning Tree (2)
...
First the Root must be selected
By ID it is elected.
Least cost paths from Root are traced
In the tree these paths are placed.
A mesh is made by folks like me
Then bridges find a spanning tree.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IEEE 802.1Q Standard (1)
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
End
Chapter 4
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011