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