Professional Documents
Culture Documents
Medium Access Control (Mac) Layer: Computer Networks
Medium Access Control (Mac) Layer: Computer Networks
Medium Access Control (Mac) Layer: Computer Networks
6-slot 6-slot
frame frame
1 3 4 1 3 4
FDM cable
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
= 1/(2e) = .18
assumptions: operation:
• all frames same size • when node obtains fresh
frame, transmits in next slot
• time divided into equal size – if no collision: node can send
slots (time to transmit 1 new frame in next slot
frame) – if collision: node retransmits
frame in each subsequent slot
• nodes start to transmit only with prob. p until success
slot beginning
• nodes are synchronized
• if 2 or more nodes transmit
in slot, all nodes detect
collision
node 2 2 2 2
node 3 3 3 3
C E C S E C E S S
Pros: Cons:
• single active node can • collisions, wasting slots
continuously transmit at • idle slots
full rate of channel • nodes may be able to
• highly decentralized: only detect collision in less
than time to transmit
slots in nodes need to be packet
in sync
• clock synchronization
• simple
Link Layer and LANs 6-14
Slotted ALOHA: efficiency
!
at best: channel
• prob that given node has used for useful
success in a slot = p(1-p)N-1 transmissions 37%
• prob that any node has a of time!
success = Np(1-p)N-1
Link Layer and LANs 6-15
CSMA (carrier sense multiple access)
1
efficiency
1 5t prop /ttrans
• efficiency goes to 1
– as tprop goes to 0
– as ttrans goes to infinity
• better performance than ALOHA: and simple, cheap,
decentralized!
(Modified by LTL)
CSMA/CA
(CSMA with Collision Avoidance)
• When medium idle for a period ≥ DIFS => can xmit immediately
– DIFS = Distributed InterFrame Space
• In 802.11b networks, DIFS = 50 μs
->
DIFS
polling:
• master node “invites”
slave nodes to transmit data
poll
in turn
• typically used with master
data
“dumb” slave devices
• concerns:
– polling overhead
– latency slaves
– single point of failure
(master)
data
Link Layer and LANs 6-26
Cable access network
Internet frames, TV channels, control transmitted
downstream at different frequencies
cable headend
CMTS
…
splitter cable
cable modem … modem
termination system
Downstream channel i
CMTS
Upstream channel j
1A-2F-BB-76-09-AD
LAN
(wired or adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
0C-C4-11-6F-E3-98
137.196.7.88
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP IP
Eth Eth
Phy Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
IP
Eth
Phy
A B
R
111.111.111.111
222.222.222.222
74-29-9C-E8-FF-55
49-BD-D2-C7-56-2A
222.222.222.220
1A-23-F9-CD-06-9B
switch
star
bus: coaxial cable
Link Layer and LANs 6-45
Ethernet frame structure
preamble:
• 7 bytes with pattern 10101010 followed by one byte with
pattern 10101011
• used to synchronize receiver, sender clock rates
type
dest. source
preamble address address data CRC
(payload)
MAC protocol
application and frame format
transport
network 100BASE-TX 100BASE-T2 100BASE-FX
link 100BASE-T4 100BASE-SX 100BASE-BX
physical
Switch
Hub
Switch ports
Twisted pair
An Ethernet switch.
Fast Ethernet
Client
• Uses of bridges
• Learning bridges
• Spanning tree bridges
• Repeaters, hubs, bridges, switches,
routers, and gateways
• Virtual LANs
Using bridges to connect LANs
backward learning
• hash tables are initially empty.
• Bridges use a flooding algorithm.
• Gradually By looking at the source addresses, they can tell which machines
are accessible on which ports.
• it makes an entry in its hash table for each station.
• the arrival time of the last frame is noted in the entry.
• It purges all entries more than a few minutes old.
Forwarding Rules
1. If the port for the destination address is the same as the source port, discard
the frame.
2. If the port for the destination address and the source port are different,
forward the frame on to the destination port.
3. If the destination port is unknown, use flooding and send the frame on all
ports except the source port.
Protocol processing at a bridge
Loop creation in case of using redundant
links between bridges
Spanning Tree Bridging
• B1 is elected to be the root because of its lowest ID.
Repeaters, Hubs, Bridges, Switches,
Routers, and Gateways
twisted pair
hub
1-84
Connecting to hub
Backbone hub connects LAN segments
Extend maximum distance among nodes
But the segment's collision areas become larger
Unable to connect 10BaseT and 100BaseT
hub
hub
hub hub
1-85
Switch
• The switch is the repeating device of the datalink layer
– Store and forward Ethernet frames
– Check the frame header and select frame for forwarding based on
the MAC target address
– When the frame is forwarded on the segment, it uses CSMA/CD to
access the segment
– Transparent: Hosts don’t know the existence of the switch
– plug-and-play: Switch does not require pre-configuration
1-86
Forwarding
1
switch
2 3
hub
hub hub
1-87
Ethernet switch
• link-layer device: takes an active role
– store, forward Ethernet frames
– examine incoming frame’s MAC address,
selectively forward frame to one-or-more
outgoing links when frame is to be forwarded on
segment, uses CSMA/CD to access segment
• transparent
– hosts are unaware of presence of switches
• plug-and-play, self-learning
– switches do not need to be configured
A A A’
• switch learns which hosts
can be reached through C’ B
which interfaces
– when frame received, switch 6 1 2
“learns” location of sender:
incoming LAN segment 5 4 3
– records sender/location pair B’ C
in switch table
A’
A A A’
• frame destination, A’,
locaton unknown: flood C’ B
1
destination A location 6 2
known:selectively send A A’
5 4 3
on just one link B’ C
A’ A
A’
S1
S3
A S2
F
D I
B C
G H
E
S4
S1
S3
A S2
F
D I
B C
G H
E
mail server
to external
network
router web server
IP subnet
switch(es) supporting
VLAN capabilities can … …
be configured to Electrical Engineering Computer Science
define multiple virtual (VLAN ports 1-8) (VLAN ports 9-15)
… …
2 8 10 16
2 8 10 16 2 4 6 8
… …
type
dest. source
preamble
address address
data (payload) CRC 802.1Q frame