Vous êtes sur la page 1sur 49

The Medium Access Control

Sublayer

Chapter 4

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Channel Allocation Problem

• Static channel allocation


 FDM/TDM
• Assumptions for dynamic channel
allocation

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Assumptions for Dynamic Channel
Allocation

1. Independent traffic: independent stations


2. Single channel: available for all communication. All
stations can transmit/receive on/from it. The stations
are equally capable.
3. Observable Collisions: All stations can detect a
collision.
4. Continuous or slotted time (for transmission)
5. Carrier sense or no carrier sense: With carrier sense,
stations can tell if the channel is in use before trying
to use it.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Multiple Access Protocols

• ALOHA: Early 1970s.


 Pure Aloha
 Slotted Aloha
• Carrier Sense Multiple Access
• Collision-free protocols
• Limited-contention protocols
• Wireless LAN protocols

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

In pure ALOHA, frames are transmitted


at completely arbitrary times
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ALOHA (2)

Vulnerable period for the shaded frame.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

ALOHA (3)

(Including retransmission)

Throughput versus offered traffic for ALOHA systems.

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

Carrier Sense Multiple Access Protocol


 When a station has data to send, it first listens to the channel
to see if anyone else is transmitting.
 If the channel is idle, the station sends data. Otherwise, it just
waits until it become idle.
 If a collision occurs, the station waits a random amount of
time and starts all over again.
 1-persistent: the station transmits with a probability of 1 when
it finds the channel idle.
 p-persistent: the station transmits with a probability of p when
it finds the channel idle.
 Non-persistent CSMA: If the channel is already in use, the
station does not continuously sense the channel for the
purpose of seizing it immediately upon detecting the end of
the previous transmission. Instead, it waits a random period
of time and then repeats the algorithm.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Persistent and Nonpersistent CSMA

Comparison of the channel utilization versus load for various


random access protocols.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

CSMA with Collision Detection


 The stations quickly detect the collision and abruptly stop
transmitting (rather than finishing them).
 Saves time and bandwidth.
 CSMA/CD (Collision Detection): basis of the classic Ethernet
 The station hardware must listen to the channel while it is
transmitting.
 A received signal must not be tiny compared to the
transmitted signal (for reading back transmitting data).
 Chose appropriate modulation method to allow collisions to
be detected.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
CSMA with Collision Detection

CSMA/CD can be in one of three states: contention,


transmission, or idle.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Collision-Free Protocols (1)


 Each contention period consists of exactly N slots. If station
0 has a frame to send, it transmits a 1 bit during slot 0. No
other station is allowed to transmit during this slot.
 Each station has complete knowledge of which stations wish
to transmit.
 After the last station has transmitted its frame, another N-bit
contention period is begun.
 Reservation protocol

The basic bit-map protocol


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Collision-Free Protocols (2)
 Token: A small message representing permission to send
 If a station has a frame queued for transmission when it
receives the token, it can send that frame before it passes
the token to the next station.
 The network topology defines the order in which stations
send.
 Token Bus: We do not need a physical ring to implement token
passing. Token
Station

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

The binary countdown protocol. A dash indicates silence.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Limited-Contention protocols
 The strategies are rated with two performance measures:
delay at low load and channel efficiency at high load.
 Light load: contention (pure/slotted ALOHA) is preferable due
to its low delay (collisions are rare).
 As the load increases, contention becomes increasingly less
attractive. The channel efficiency becomes an important
issue.
 Limited-Contention protocol: Use contention at low load and a
collision-free technique at high load

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Limited-Contention Protocols

Acquisition probability for a symmetric contention channel.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The Adaptive Tree Walk Protocol

The tree for eight stations

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The Adaptive Tree Walk Protocol


 For slot 0, all stations are permitted to try to acquire the
channel.
 If one of them does so, there is no problem.
 If there is a collision, then during slot 1 only those stations falling under
node 2 in the tree may compete.
 If one of them acquires the channel, the slot following the frame is reserved for
those stations under node 3.
 If, on the other hand, there is a collision in slot 1, in which case it is node 4’s turn
during slot 2.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Wireless LAN Protocols (1)
Hidden Terminal Problem:

A wireless LAN. (a) A and C are hidden terminals


when transmitting to B.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Wireless LAN Protocols (2)


Exposed Terminal Problem:

A wireless LAN. (b) B and C are exposed terminals when


transmitting to A and D.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Wireless LAN Protocols (3)
Multiple Access with Collision Avoidance (MACA)

The MACA protocol. (a) A sending an RTS to B. (b) B


responding with a CTS to A.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Wireless LAN Protocols (4)


 Any station hearing RTS is clearly close to A and must
remain silent long enough for the CTS to be transmitted back
to A without conflict.
 Any station hearing CTS is clearly close to B and must
remain silent during the upcoming data transmission, whose
length it can tell by examining the CTS frame.
 Collisions can still occur. For example, B and C could both
send RTS frames to A at the same time.
 In the event of a collision, an unsuccessful transmitter waits a
random amount of time and tries again later.

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

Classic Ethernet Physical Layer


 Two kinds of Ethernet: classic Ethernet (3~10Mbps),
Switched Ethernet (100,1000,10000Mbps)
 Repeater: a physical layer device that receives, amplifies
and retransmit signals in both directions.

Architecture of classic Ethernet

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.

Frame formats. (a) Ethernet (DIX). (b) IEEE 802.3.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

MAC Sublayer Protocol (1)


 Preamble: 8 bytes, each containing the bit pattern 10101010
(with the exception of the last byte, in which the last 2 bits are
set to 11).
 The last byte is called the Start of Frame delimiter for 802.3.
 Allow the receiver’s clock to synchronize with the sender’s
 The last two 1 bits tell the receiver that the rest of the frame is about to
start.
 Destination/Source MAC address: 6 bytes (48 bits).
 The first transmitted bit of the destination address is a 0 for ordinary
addresses and a 1 for group addresses (Multicasting).
 The special address consisting all 1 bits is reserved for broadcasting.
 The source addresses are globally unique, assigned by IEEE to
ensure that no two stations anywhere in the world have the same
address.
 The first 3 bytes of the source address field are used for an OUI
(Organizationally Unique Identifier), indicating a manufacturer。

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

MAC Sublayer Protocol (2)

Collision detection can take as long as 2.

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

Efficiency of Ethernet at 10 Mbps with 512-bit slot times.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Switched Ethernet (1)

Twisted pairs

(a) Hub. (b) Switch.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Switched Ethernet (2)

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

Switched Ethernet (2)


 Switch
 Only output frames to the ports for which those frames are destined.
 When a switch port receives an Ethernet frame from a station, the
switch checks the Ethernet addresses to see which port the frame is
destined for. This requires the switch to be able to work out which
ports correspond to which addresses.
 資料傳送採用點對點方式。當你在傳送資料時,會將封包直接轉送至目
的地電腦,而不會影響其他的電腦。因為它多了記錄MAC address的功
能(對應到哪一個switch 的埠)。當信號從一個 port 進來之後﹐會檢查這
個 frame 的 destination 是哪個 MAC﹐然 後按 table 找到這個 MAC 對
應的 port ﹐而僅將信號往這個 port 送﹐其它的 port 就不送了。
 Each port is its own independent collision domain. In the common
case, the cable is full duplex. Both the station and the port can send a
frame on the cable at the same time without worrying about other ports
and stations.

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

Switched Ethernet (2)


 Bridge (橋接器):
 使用 bridge 的時候﹐基本上將實體連線切為兩個 segment (或多個﹐視
bridge 界面而定)﹐然後﹐bridge 也會建立起自己的 table﹐分別將不同
的 MAC address 劃分到不同 的 segment 去。
 當 frame 抵達 bridge 的時候﹐bridge 會檢查其傳送端和接收端﹐如果
發現這兩個 MAC address 都在同一個 segment 之上﹐那就不處理這個
frame (發揮 filter 的功能)﹔但如果發現 source 和 destination 不在同一
個 segment 上呢﹐就起用轉送 (forwarding) 功能﹐將 frame 送到
destination 那個 segment 上﹐或是單純的向所有 ‘非來源端’的
segment(s) 遞送(視 bridge 的能力)。
 對 frame 的處理﹐和 switch 是不一樣的﹕bridge 以 segment 為依據﹐
而 switch 則以個別設備為單位。在執行效率上還是有分別的。
 如果將每一 port 所連接的設備看為單一 的 segment﹐然後將 switch 看
為具有學習能力的 bridge﹐那或許可以將它們看為極為近似的兩個設備

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.

The original fast Ethernet cabling.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Gigabit Ethernet (1)


 The gigabit Ethernet has to offer unacknowledged
datagram service with both unicast and broadcast.

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

Gigabit Ethernet (3)


 Supports both copper and Fiber cabling.
 Signaling at short wavelength can be achieved with cheaper
LEDs. It is used with multimode fiber and is used for
connections within a building.
 Signaling at the long wavelength requires more expensive
lasers. It is used between buildings, such as for a campus
backbone.

Gigabit Ethernet cabling.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
10 Gigabit Ethernet
 All versions of 10G Ethernet support only full-duplex operation.
 CSMA/CD is no longer part of the design.
 At the end of 2007, IEEE created a group to standardize
Ethernet operating at 40G and 100Gbps (IEEE 802.3ba).

Gigabit Ethernet cabling


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Wireless Lans

• 802.11 architecture and protocol stack


• 802.11 physical layer
• 802.11 MAC sublayer protocol
• 802.11 frame structure
• Services

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

802.11 architecture – infrastructure mode


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

802.11 Architecture and Protocol Stack (2)


 A collection of computers that are associated so that they can
directly send frames to each other. There is no access point.

802.11 architecture – ad-hoc mode


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
802.11 Architecture and Protocol Stack (3)

Part of the 802.11 protocol stack.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

802.11 Architecture and Protocol Stack (3)


 The data link layer is split into two or more sublayers.
 MAC (Medium Access Control) sublayer determines how the
channel is allocated.
 LLC (Logical Link Control) sublayer hides the different 802
variants and make indistinguishable as far as the network
layer is concedned.

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

The 802.11 MAC Sublayer Protocol (1)

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 時間長度依照不同的實體傳輸媒介而有所
不同

 DIFS = 2 * a Slot Time+ a SIFS Time

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

The 802.11 MAC Sublayer Protocol (1)

Sending a frame with CSMA/CA.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The 802.11 MAC Sublayer Protocol (2)

The hidden terminal problem.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The 802.11 MAC Sublayer Protocol (3)

The exposed terminal problem.

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

 虛擬載波偵測 (Virtual Carrier Sense): 使用 RTS/CTS 判斷媒


介忙碌與否的方法

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The 802.11 MAC Sublayer Protocol (4)

The use of virtual channel sensing using CSMA/CA.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The 802.11 MAC Sublayer Protocol (5)

Interframe spacing in 802.11

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

802.11 Frame Structure

Format of the 802.11 data frame

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Broadband Wireless

• Comparison of 802.16 with 802.11, 3G


• 802.16 architecture and protocol stack
• 802.16 physical layer
• 802.16 frame structure

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Comparison of 802.16 with 802.11 and 3G

The 802.16 architecture

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
802.16 Architecture and Protocol Stack

The 802.16 protocol stack

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

802.16 Physical Layer

Frames structure for OFDMA with time division duplexing.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
802.16 MAC Sublayer Protocol

Classes of service

1. Constant bit rate service.


2. Real-time variable bit rate service.
3. Non-real-time variable bit rate service.
4. Best-effort service.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

802.16 Frame Structure

(a) A generic frame. (b) A bandwidth request frame.

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

Two piconets can be connected to form a scatternet

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Bluetooth Protocol Stack

The Bluetooth protocol architecture.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Bluetooth Frame Structure

Typical Bluetooth data frame at (a) basic, and


(b) enhanced, data rates.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
RFID

• EPC Gen 2 architecture


• EPC Gen 2 physical layer
• EPC Gen 2 tag identification layer
• Tag identification message formats

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

EPC Gen 2 Architecture

RFID architecture.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
EPC Gen 2 Physical Layer

Reader and tag backscatter signals.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

EPC Gen 2 Tag Identification Layer

Example message exchange to identify a tag.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Tag Identification Message Formats

Format of the Query message.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Data Link Layer Switching

• 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)

Bridge connecting two multidrop LANs

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Learning Bridges (2)

Bridges (and a hub) connecting seven point-to-point stations.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Learning Bridges (3)

Protocol processing at a bridge.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Spanning Tree Bridges (1)

Bridges with two parallel links

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Spanning Tree Bridges (2)

A spanning tree connecting five bridges. The dotted lines are


links that are not part of the spanning tree.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Poem by Radia Perlman (1985)


Algorithm for Spanning Tree (1)

I think that I shall never see


A graph more lovely than a tree.
A tree whose crucial property
Is loop-free connectivity.
A tree which must be sure to span.
So packets can reach every LAN.
...

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

Repeaters, Hubs, Bridges, Switches,


Routers, and Gateways

(a) Which device is in which layer.


(b) Frames, packets, and headers.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Virtual LANs (1)

A building with centralized wiring using hubs and a switch.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

Virtual LANs (2)

Two VLANs, gray and white, on a bridged LAN.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
The IEEE 802.1Q Standard (1)

Bridged LAN that is only partly VLAN-aware. The shaded


symbols are VLAN aware. The empty ones are not.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

The IEEE 802.1Q Standard (2)

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

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

Vous aimerez peut-être aussi