1
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Tham khảo
Điềukhiểntruynhập đường truyền
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Các giao thức đatruynhập
–Giải quyếtcácvấn đề liên quan đếnmôi
trường dùng chung
–Mộtsố loại:
• Contention protocols: giảiquyếtvấn đề xung đột
sau khi nó xảyra.
• Collision-free protocols (ví dụ: bit-map protocol và
binary countdown) đảmbảoxungđột không bao
giờ xảyra
2
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Kỹ thuậtchiasẻ kênh
Channel Sharing
Techniques
Static
Channelization
Dynamic Medium
Access Control
Scheduling
Random Access
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Phân loại các giao thức đatruynhập
Multiple access protocols
Contention-based Conflict-free
Random access
Collision resolution
FDMA,
TDMA,
CDMA,
Token Bus,
DQDB, etc
ALOHA,
CSMA,
BTMA,
ISMA,
etc
TREE,
WINDOW,
etc
DQDB: Distributed Queue Dual Bus
BTMA: Busy Tone Multiple Access
ISMA: Internet Streaming Media Alliance
3
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Contention Protocols
• Pure ALOHA
– Phát triểnnăm 1970 bởi Hawaii University.
– Xác nhậnviệc truyền thành công qua nhận
đượcACK của phía nhận
• Slotted ALOHA
–Cảitiến: Thờigianđược chia thành nhiều
khevàkhungchỉđược truyềntạithời điểm
bắt đầucủamỗikhe
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
• CSMA (Carrier Sense Multiple Access)
–Cảitiến: Bắt đầutruyềnkhikhôngthấy node nào đang
truyền
• CSMA/CD (CSMA with Collision Detection)
–Cảitiến: Dừng việctruyềnnếuxungđộtxảyra
• CSMA/CA (CSMA with Collision Avoidance)
–Cảitiến: Đợikhoảng thờigianngẫu nhiên và thử lạikhi
đường truyền không bận (carrier is quiet). Nếuvẫnvậythì
truyềndữ liệu
• CSMA/CA with ACK
• CSMA/CA with RTS/CTS
Contention Protocols
4
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Pure ALOHA
Trong pure ALOHA, khung đượctruyềntạicácthời điểmtuỳ ý
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Khi khung sẵnsàngtruyền, máy phải đợi đếnthời điểmbắt
đầucủamộtslot
Slotted ALOHA
5
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
So sánh thông lượng
ALOHA
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA
• Thông lượng tối đacủa slotted ALOHA là
0.368.
• CSMA có nhiềucảitiếnso vớiALOHA
bằng cách lắng nghe đuờng truyềntrước
khi truyền
6
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Cơ chế xung đột trong CSMA
1 2 3
Time
Collision
4
Node 4 sense
Delay
5
Node 5 sense
Delay
Node 1 Packet
Node 2 Packet
Node 3 Packet
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Các loạiCSMA
CSMA
Nonpersistent CSMA
Persistent CSMA
Unslotted Nonpersistent CSMA
Unslotted persistent CSMA
Slotted Nonpersistent CSMA
Slotted persistent CSMA
1-persistent CSMA
p-persistent CSMA
7
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Nonpersistent/x-persistent CSMA
•Giaothức Nonpersistent CSMA:
Bước1: Nếu đường truyềnrỗi, truyền ngay lậptức
Bước2: Nếu đường truyềnbận, đợimộtkhoảng thờigian
ngẫu nhiên và lặplạibước1
–Gi
átrị backoff ngẫu nhiên làm giảmxácxuấtxungđột
–Nếu backoff quá lớpsẽ lãng phí thờigianrỗi
•Giaothức1-persistent CSMA:
Bước1: Nếu đường truyềnrỗi, truyền ngay lậptức
Bước2 : Nếu đường truyềnbận, tiếptụclắng nghe đếnkhi
đường truyềnrỗithìmớitruyền
–S
ẽ xảyrahiệntượng xung độtnếu 2 node muốntruyềnlại
(thường sẽ dừng việctruyềnsauvàilầnthử)
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
•Giaothức p-persistent CSMA :
Bước1: Nếu đường truyềnrỗi, truyềnvớixácsuấtp vàchờđể
truyềntrongkhethờigiantiếptheo(thờigiantrễđường truyền
lớnnhấtchomột gói tin) vớixácxuất (1-p)
Bước2: Nếu đường truyềnbận, tiếptụclắng nghe đếnkhiđường
truyềnrỗi thì quay lạibước1
-Một cách thoả hiệpgiữa nonpersistent and 1-persistent CSMA
Nonpersistent/x-persistent CSMA
8
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Lựachọngiátrị p như thế nào ?
•Giả sử N node muốngửitin vàđường
truyền đang bận
• Np đượcxemlàsố Node thử truyềnkhi
đường truyềnbắt đầurỗi
•Nếu Np > 1, xung độtcóthể xảyra
Vì vậyphải đảmbảo Np < 1 để tránh
xung đột, trong đóN làsố node hoạt động
lớnnhấttạimộtthời điểm
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Throughput
0 1 2 3 4 5 6 7 8 9
G
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
S
Aloha
Slotted Aloha
1-persistent CSMA
0.5-persistent CSMA
0.1-persistent CSMA
0.01-persistent CSMA
Nonpersistent CSMA
9
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CD (CSMA with Collision Detection)
• Trong CSMA, nếu 2 node bắt đầugửi khung tạicùng
thời điểm, mỗi node sẽ vẫntruyền toàn bộ khung mặc
dù có xung độtxảyra.
– >Lãng phí thờigianchoviệctruyềncả khung tin.
•CSMA/CD
Bước1: Nếu đường truyềnrỗi, truyền khung
tin
Bước2: Nếu đường truyềnbận, tiếptụclắng
nghe đếnkhiđường truyềnrỗi thì truyền
Bước3: Nếu xung đột được phát hiện trong
quá trình truyền, ngừng ngay việctruyền
Bước4: Đợimộtkhoảng thờigianngẫu nhiên
và thựchiệnlạithuật toán trên
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CD
A B
(α is the propagation time)
T
0
A begins transmission
A B
B begins transmission
Time
T
0
+α-ε
A B
B detects collision
T
0
+α
A B
A detects collision just
before end of transmission
T
0
+2α -ε
10
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA (CSMA with collision Avoidance)
•Tấtcả các node lắng nghe đường truyềngiống như trong
CSMA/CD.
• Node sẵnsàngtruyềnsẽ phát sóng cảm ứng.
•Nếu đường truyềnbận, đợi đếnkhikết thúc quá trình việctruyền
hiệntại
•Nósẽ tiếptục đợimộtkhoảng thờigianxácđịnh trướcDIFS
(Distributed inter frame Space).
•Nhậnlấymộtgiátrị ngẫu nhiên củakhethờigian(giátrị khởi đầu
củabộđếmbackoff) trongmột contention window để ch
ờ trướckhi
truyền 1 khung.
•Nếuhiện đang có một quá trình truyềntin bởimột node khác trong
chu kỳ thời gian này (backoff time), node sẽ giữ nguyên giá trị bộ
đếm.
•Tiếptục đếm lùi sau khi node khác kết thúc việctruyền + DIFS.
Node có thể bắt đầuviệctruyềnkhibộđếm đến0
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA
Time
Node A’s frame
Nodes B & C sense
the medium
Nodes B resenses the medium
and transmits its frame.
Node C freezes its counter.
Node B’s frame
Nodes C starts
transmitting.
Delay: B
Delay: C
Nodes C resenses the
medium and starts
decrementing its counter.
Node C’s frame
11
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA
DIFS
Next Frame
Medium Busy
DIFS
Contention window
Defer access
Backoff after defer
Slot
Time
DIFS – Distributed Inter Frame Spacing
Contention
window
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA with ACK
•Phíanhậnsẽ gửi ACK ngay sau khi nhận được
khung tin mà không cầnthămdòđường truyền
• Khung ACK đượctruyền sau khoảng thờigianSIFS
(Short Inter-Frame Space) (SIFS < DIFS)
•NếuACK bị mất, việctruyềnlạisẽđượctiến hành.
12
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA/ACK
DIFS
Next Frame
ACK
Data
Other
Source
Destination
DIFS
SIFS
Contention window
Defer access Backoff after defer
SIFS – Short Inter Frame Spacing
Time
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA with RTS/CTS
•Phíagửisẽ gửibản tin RTS (request to send) sau
khi đường truyềnrỗi sau khoảng thờigianlớnhơn
DIFS.
•Phíanhậntrả lờibằng bản tin CTS (clear to send)
sau khi đường truyềnrỗimộtkhoảng thờigianSIFS.
•Sauđódữ liệu đượctruyền.
• RTS/CTS đượcsử dụng cho việc đặtchỗđuờng
truyềnvìvậyxungđộtchỉ xảyravớicácbảntin điều
khiển.
13
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA with RTS/CTS
DIFS
Next Frame
CTS
RTS
Other
Source
Destination
DIFS
SIFS
Contention window
Defer access
Backoff after defer
SIFS
Data
SIFS
ACK
Time
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
RTS/CTS
R
T
S
C
T
S
D
a
t
a
A
C
K
Node A Node B
Trễ truyềnlan
14
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Wireless LAN Protocols
A wireless LAN. (a) A transmitting. (b) B transmitting.
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
The MACA protocol.
(a) A sending an RTS to B.
(b) B responding with a CTS to A.
Wireless LAN Protocols
15
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Ethernet
• Ethernet Cabling
• Manchester Encoding
•Lớp con MAC Ethernet
•Hiệusuấtcủamạng Ethernet
• Fast Ethernet
• Gigabit Ethernet
• IEEE 802.2: Logical Link Control
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Ethernet Cabling
Các loại cáp phổ biếnsử dụng trong công nghệ Ethernet
16
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
(a) 10Base5, (b) 10Base2, (c) 10Base-T.
Ethernet Cabling
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
(a) Binary encoding, (b) Manchester encoding,
(c) Differential Manchester encoding.
Ethernet Cabling
17
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Lớp con MAC
Định dạng khung (a) DIX Ethernet, (b) IEEE 802.3.
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Ethernet MAC Sublayer Protocol
Xung đột được phát hiện sau khoảng thờigian2 τ
Lớp con MAC
18
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Hiệusuấtmạng Ethernet
Hiệusuấtmạng Ethernet tốc độ 10 Mbps với512-bit
slot times.
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Fast Ethernet
Mộtsố loại cáp dùng trong mạng Fast Ethernet
19
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
multi-level transmit-3 levels
100BASE-TX (like 100BASE-FX) uses 4B/5B encoding which is then
scrambled and converted to multi-level transmit-3 levels or MLT-3.
Any Transition = binary 1.
No transition = binary 0.
Long strings of zeros
would give a ‘DC’
component but because of
the 4B/5B encoding this
can never happen.
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
100BASE-FX (like 100BASE-TX) uses 4B/5B encoding which is then
scrambled and converted to Non Return to Zero, Inverted.
Non Return to Zero, Inverted
Any Transition = binary 1.
No transition = binary 0.
Long strings of zeros
would give a ‘DC’
component but because of
the 4B/5B encoding this
can never happen.
Fiber cannot use the 3 level MLT3 because the
light source has only two levels, ON and OFF.
20
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Gigabit Ethernet
(a) A two-station Ethernet. (b) A multistation Ethernet.
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Mộtsố loại cáp dùng trong mạng Gigabit Ethernet
Gigabit Ethernet
21
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
IEEE 802.2: Logical Link Control
(a) Vị trí lớp con LLC. (b) Định dạng giao thức
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Wireless LANs
• Protocol Stack 802.11
•Lớpvậtlýcủa 802.11
•Lớpcon MAC
•Cấu trúc khung 802.11
22
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
802.11 Protocol Stack
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Lớp con MAC trong 802.11
(a) Hidden station problem.
(b) Exposed station problem.
23
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
B C DA BA C D
- A ®ang truyÒn d÷ liÖu sang B
- C n»m ngoµi tÇm sãng cña tr¹m A
- C còng muèn truyÒn d÷ liÖu sang B
-C ®−a ra kÕt luËn sai vÒ tr¹m B
-C vÉntruyÒnd÷liÖusang tr¹m B
- B ®ang truyÒn d÷ liÖu sang A
- C n»m trong tÇm sãng cña tr¹m B
- C muèn truyÒn d÷ liÖu sang D
-C ®−a ra kÕt luËn sai vÒ m«i tr−êng
truyÒn th«ng
-C kh«ngtruyÒnd÷liÖusang D
S¬ ®å 1 S¬ ®å 2
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
CSMA/CA.
The 802.11 MAC Sublayer Protocol
Lớp con MAC trong 802.11
24
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Mộtcụmmảnh
Lớp con MAC trong 802.11
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Khoảng cách liên frame trong 802.11
Lớp con MAC trong 802.11
25
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Cấu trúc khung 802.11
Hanoi University of Technology Faculty of Electronics and Telecommunications
07/08
Broadband Wireless
• So sánh 802.11 and 802.16
• 802.16 Protocol Stack
•Lớpvật lý trong 802.16
•Cấu trúc khung 802.16