Upload
ahmad-shdifat
View
220
Download
0
Embed Size (px)
Citation preview
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
1/13
1
LECTURE 5MULTIPLE ACCESS AND LOCAL AREA NETWORKS
To ics
Multi le access: CSMA/CD, CSMA/CA, token assin ,
2
channelization
LAN: characteristics, basic principles
Protocol architecture
Topologies
Extending LANs: repeater, bridge, router
Virtual LANs
Link La er Services
framing, link access:
3
encapsulate datagram into frame, adding header, trailer
channel access if shared medium
,
different from IP address!
reliable delivery between adjacent nodes
we learned how to do this already !
seldom used on low bit-error link (fiber, some twisted pair)
:
Q: why both link-level and end-end reliability?
Link La er Services more
4
pacing between adjacent sending and receiving nodes
error detection:
errors caused by signal attenuation, noise.
receiver detects presence of errors:
signa s sen er or retransmission or rops rame
error correction:
rece ver en es an correc s error s w ou resor ng oretransmission
half-duplex and full-duplex
with half duplex, nodes at both ends of link can transmit, but not at sametime
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
2/13
Where is the link la er im lemented?
in each and every host5
link layer implemented inadaptor (aka network host schematic
a lication
Ethernet card, PCMCI card,802.11 card
cpu memorytransportnetwork
link
mp ements n , p ysca ayer
attaches into hosts system
buses
controller
physical
bus(e.g., PCI)
linkphysical
combination of hardware,
software, firmware network adaptercard
Communication on LANs
6
Characteristics
small area, limited number of users, all nodes can
commun ca e rec y
short and long sessions
The use of shared medium and broadcast transmission
simple network elements, simple network management Property of LANs
propagation time
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
3/13
Ideal Multi le Access Protocol
Broadcast channel of rate R bps
9
1. when one node wants to transmit, it can send at rate R.
2. when M nodes want to transmit, each can send at average rateR/M
3. fully decentralized:
no speca no e to coor nate transmss ons
no synchronization of clocks, slots
4. simple
MAC Protocols: a taxonom
Three broad classes:
10
divide channel into smaller pieces (time slots, frequency, code)
allocate piece to node for exclusive use
Random Access
channel not divided, allow collisions
recover rom co s ons
Taking turns
nodes take turns, but nodes with more to send can take lon er turns
Channel Partitionin MAC rotocols: TDMA
TDMA: time division multiple access11
access to channel in "rounds"
each station gets fixed length slot (length = pkt trans time)n eac roun
unused slots go idle
- , , , , , ,
6-slot
1 3 4 1 3 4
frame
Channel Partitionin MAC rotocols: FDMA
FDMA: frequency division multiple access12
channel spectrum divided into frequency bands
each station assigned fixed frequency band unused transmission time in frequency bands go idle
example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6
bands
ue
ncy
freca e
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
4/13
Random Access Protocols
When node has packet to send
13
transmit at full channel data rate R. no a priori coordination among nodes
two or more transmitting nodes collision,
random access MAC protocol specifies:
how to recover from collisions (e.g., via delayed retransmissions)
Examples of random access MAC protocols:
slotted ALOHA
ALOHA
, ,
MAMultiple Access
Aloha
Packet radio protocol
Random-access method based on acknowledgementsand backoffs
Slotted ALOHA
Assumptions: Operation:
15
all frames same size
time divided into equal size
when node obtains fresh frame,
transmits in next slots o s me o ransm
frame)
nodes start to transmit only
no co s on: no e cansend new frame in nextslot
slot beginning
nodes are synchronized
if collision: noderetransmits frame in each
win slot, all nodes detect
collision
.p until success
Slotted ALOHA
16
Pros
Cons
s ng e ac ve no e can
continuously transmit at fullrate of channel
,
idle slots
nodes may be able to
highly decentralized: only
slots in nodes need to be in
detect collision in less than
time to transmit packet clock s nchronization
simple
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
5/13
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
6/13
Carrier Sense Multiple Access (CSMA)
21
Listen (sense) before sending
Do not send unless the medium is idle
Reduces the possibility of collisions
Does not eliminate collisions
Propagation delay
Takes time before all other stations can sense a
transmission
Persistence Strate22
Sense carrierSense carrier
Busy?Yes Busy?
Yesa
Send frame
No
Send frame
1-persistent Send as soon as
channel is idle
Non-persistent
Wait a random period of
again
p-Persistent
Sense carrier en c anne s e
Send with probability p
Wait and then sense again Busy?Yeswith probability (1-p)
No
r = random(0, 1)
Wait
r < p ?No
Send frame
Yes
CSMA with Collision Detection
Exponential back-off Wait 2N max ro a at ion t ime after col li sion where N is number of transmission_ _ ,
attempts
Send jam so other stations detect collision as well
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
7/13
Ethernet: Unreliable connectionless
connectionless: No handshaking between sending and receiving
25
NICs unreliable: receiving NIC doesnt send acks or nacks to sending
stream of datagrams passed to network layer can have gaps (missingdatagrams)
gaps will be filled if app is using TCP
otherwise, app will see gaps
:
Ethernet CSMA/CD algorithm
26
. rece ves a agram rom
network layer, creates frame
2. If NIC senses channel idle starts
. e ec s ano er
transmission while transmitting,aborts and sends jam signal
frame transmission If NIC senseschannel busy, waits until channel
5. After aborting, NIC enters
exponential backoff: after mth
,
3. If NIC transmits entire frame
without detecting another
,random from
{0,1,2,,2m-1}. NIC waits K512
transmission, NIC is done withframe !
bit times, returns to Step 2
Ethernets CSMA/CD (more)
Jam Si nal: make sure all other Ex onential Backoff:
27
transmitters are aware ofcollision; 48 bits
Bit time: .1 microsec for 10 Mb s
Goal: adapt retransmissionattempts to estimated current load
Ethernet ;for K=1023, wait time is about50 msec
be longer
first collision: choose K from {0,1};
times
after second collision: choose Krom , , ,
after ten collisions, choose K from
{0,1,2,3,4,,1023}
See/interact with Java
applet on AWL Web site:
highly recommended !
CSMA CD
MAC header contains a MAC destination address which
28
ensure only the specified destination actually forwards
the received frame (Others discard the frames).
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
8/13
CSMA CD
When a collision occurs i.e. excess current above what it is eneratin
29
> 24 mA for coaxial Ethernet), it stops transmission immediately.
Transmits a 32-bit jam sequence such that receivers discard the framedue to a CRC error.
To ensure collision detection, Ethernet defines a minimum frame size.
The minimum frame size is related to distance, media, and number ofnodes (Ethernet Slot Time).
Collision Detection
30
,
A.
A short time later, B also transmits. (In this case, the
medium, as observed by the NIC at B happens to be
idle too).
After Tr , the NIC at B detects the other
transmission from A, and is aware of a collision,
but NIC A has not yet observed that NIC B was also
transmitting. B continues to transmit, sending the
Ethernet Jam sequence (32 bits).
After one complete round trip propagation time
(twice Tr ), both NICs are aware of the collision. A
transmits a complete Jam Sequence. Finally the
cable becomes idle.
Collision Detection
Requires that stations still transmit when the colliding packet arrives
31
Collisions detected by all stations
Minimum packet size and maximum bus length
(Thick Ethernet)
TT prtr 2P: packet size [bit]
v
L
B
P
2
L: bus length [m]v: signal propagation speed [m/s]
Packet Size Versus Bus Length
S: frame size [bit]
v
L
C
STT prtr
22 >>
C: link capacity [bit/s]
L: bus length [m]
v: signal propagation speed
Collisions must be detected byTtr
TprTpr
[m/s]
all stations
Minimum packet size and
maximum bus len th
72 bytes (64 bytes at data
link layer) and 500 meters
Station 1 Station 2
Ethernet)
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
9/13
Wireless LAN CSMA CA
Problem with CSMA/CD in combination with radio33
Collision detection is not reliable
E.g., asymmetry: computer 3 might not receive the signals from computer1 to com uter 2
Hidden station problem, signal fading Requires ability to send data and detect collisions at the same timeMore costly hardware, higher bandwidth
CSMA CD Collision Detection
CSMA/CD: carrier sensing, deferral as in CSMA34
collisions detectedwithin short time colliding transmissions aborted, reducing channel
wastage
collision detection:
easy in wired LANs: measure signal strengths, comparetransmitted, received signals
cu n w re ess s: rece ve s gna s rengoverwhelmed by local transmission strength
Wireless NetworksHidden
erm na35
Stations may not detect each others signals
CSMA CA contd
36
Carrier Sense Multiple Access with Collision
Avoidance
Control signals before transmission
Carrier sense:
do not transmit immediately when medium getsidle (p-persistence)
ait ran om time
lower collision probability
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
10/13
Figure 12.16 Timing in CSMA/CA
37
Note
n , e can a so e use odefine the priority of a station or a frame.
38
Note
n , t e stat on n s t e c annebusy, it does not restart the timer of the
con en on w n ow;it stops the timer and restarts it when the
c anne ecomes e.
39
CSMA/CA Wait Procedure
When medium is busy =
Wait a random amount of
time
,
Sense carrier But only decrement timer
when medium is idle
IEEE 802.11 Wireless LANBusy?
Yes
NoDecrement t
t = 0 ?No
Yes
Send frame
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
11/13
Figure 12.17 Flow diagram for CSMA/CA
41
CSMA/CA With RTS/CTS
Request-to-send/clear-to-send (RTS/CTS) handshake
RTS/CTS frames contain Duration field
Period of time the medium is reserved for transfer
Other stations remain quite during this period Need not be used for all frames
Overhead too high for small frames
CONTROLLED ACCESSCONTROLLED ACCESS
nn con ro econ ro e accessaccess,, ee s a onss a ons consuconsu oneone ano erano er oo
findfind whichwhich stationstation hashas thethe rightright toto sendsend.. AA stationstation cannotcannot
..
discussdiscuss threethree popularpopular controlledcontrolled--accessaccess methodsmethods..
Controlled
TokenPassing
43
Token Passing
Token (a control frame) circulates among the nodes
e no e a o s e o en as e r g o ransm
Current station, predecessor, and successor
Used in Token Ring LAN
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
12/13
Token Passin Procedure45
Takin Turns MAC rotocols
Token passing:46
r contro to en passe rom
one node to next
sequentially.
r token message
r concerns:(nothing
to sendm token overhead
m latency
m single point of failure
(token)
data
Logical ring and physical topology in
token- assin access method Reservation48
7/31/2019 L5CN :MULTIPLE ACCESS AND LOCAL AREA NETWORKS
13/13
Pollin49
Select Poll
Takin Turns MAC rotocols
Polling:
50
master node invitesslave nodes to transmitpoll
data
typically used withdumb slave devices
masterdata
concerns:
polling overhead
atency
single point of failure(master)
s aves
Channelization51
A station is allocated a frequency band on an FDM link
TDMA Entire bandwidth is one channel
A station is allocated time slots on a TDM link
Entire bandwidth is one channel
Data from all inputs are transmitted at the same time
Based on coding theory, and uses sequences of numbers calledchips generated using Walsh Tables.
Summar of DLL52