DLL Kent
DLL Kent
Layer
Our goals:
understand principles behind data link layer
services:
error detection, correction
sharing a broadcast channel: multiple access
link layer addressing
reliable data transfer, flow control: done!
instantiation and implementation of various
link layer technologies
0 0
Sender: Receiver:
compute checksum of
treat segment contents
received segment
as sequence of 16-bit check if computed checksum
integers equals checksum field value:
checksum: addition (1’s NO - error detected
complement sum) of YES - no error detected.
segment contents But maybe errors
sender puts checksum nonetheless? More later ….
value into the checksum
field
D.2r
R = remainder[ ]
G
802.11)
5: DataLink Layer 5-12
Multiple Access protocols
single shared broadcast channel
two or more simultaneous transmissions by nodes:
interference
collision if node receives two or more signals at the same
time
multiple access protocol
distributed algorithm that determines how nodes
share channel, i.e., determine when node can
transmit
communication about channel sharing must use
channel itself!
no out-of-band channel for coordination
“Taking turns”
Nodes take turns, but nodes with more to send can
take longer turns
time
frequency bands
TDM (Time Division Multiplexing): channel divided into N time slots, one
per user; inefficient with low duty cycle users and at light load.
FDM (Frequency Division Multiplexing): frequency subdivided.
Pros Cons
single active node can collisions, wasting
continuously transmit slots
idle slots
at full rate of channel
highly decentralized: nodes may be able to
detect collision in less
only slots in nodes
than time to transmit
need to be in sync packet
simple clock synchronization
5: DataLink Layer 5-20
Slotted Aloha efficiency
Efficiency is the long-run For max efficiency
fraction of successful slots with N nodes, find p*
when there are many nodes, that maximizes
each with many frames to Np(1-p)N-1
send For many nodes, take
Suppose N nodes with many
limit of Np*(1-p*)N-1
frames to send, each
transmits in slot with as N goes to infinity,
probability p gives 1/e = .37
prob that node 1 has success
in a slot = p(1-p)N-1
prob that any node has a At best: channel
success = Np(1-p)N-1 used for useful
transmissions 37%
of time!
LAN
(wired or = adapter
wireless)
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
A
Two ARP tables in router R, one for each IP network (LAN)
R
B
In routing table at source Host, find router 111.111.111.110
In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc
R
B
Metcalfe’s Ethernet
sketch
hub or
switch
Preamble:
7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
used to synchronize receiver, sender clock
rates
1
efficiency
1 5t prop / ttrans
twisted pair
hub
twisted pair
hub
hub
hub
hu hub
b
hub
hu hub
b
D F
B C G H
E
address interface
switch
1 A 1
2 3
B 1
E 2
hu hub hub G 3
A
b I C 1
D F
B C G H
E
address interface
switch
1 A 1
2 3
B 1
E 2
hu hub hub G 3
A
b I C 1
D 2
D F
B C G H
E
switch
collision
domain
hub
hub hub
mail server
to external
network
router web server
switch
IP subnet
hub
hu hub
b
optimal no yes no
routing
Virtual Local 2 8 10 16
Area Network
… …
Switch(es)
supporting VLAN Electrical Engineering Computer Science
(VLAN ports 1-8) (VLAN ports 9-15)
capabilities can be
configured to define … operates as multiple virtual switches
multiple virtual
LANS over single 1 7 9 15
physical LAN 2 8 10 16
infrastructure.
… …
2 8 10 16
dynamic membership:
… …
ports can be
dynamically assigned Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-15)
among VLANs
forwarding between VLANS:
done via routing (just as with
separate switches)
in practice vendors sell combined
switches plus routers
2 8 10 16 2 4 6 8
… …
802.1 frame
802.1Q frame
wireless hosts
laptop, PDA, IP phone
run applications
may be stationary
(non-mobile) or
network mobile
infrastructure wireless does not
always mean
mobility
200 802.11n
no base station, no
no
connection to larger
no base station, no
infrastructure Internet. May have to
connection to larger
relay to reach other
Internet (Bluetooth,
a given wireless node
ad hoc nets)
MANET, VANET
BER
10-4
given physical layer:
10-5
increase power -> increase
SNR->decrease BER 10-6
given SNR: choose physical
layer that meets BER 10-7
10 20 30 40
requirement, giving highest SNR(dB)
thruput
• SNR may change with QAM256 (8 Mbps)
mobility: dynamically QAM16 (4 Mbps)
adapt physical layer
(modulation technique, BPSK (1 Mbps)
rate) 5: DataLink Layer 5-79
Wireless network characteristics
Multiple wireless senders and receivers create
additional problems (beyond multiple access):
A B C
C
space
Hidden terminal problem
B, A hear each other Signal attenuation:
B, A hear each other
B, C hear each other B, C hear each other
A, C can not hear each A, C can not hear each other
other interfering at B
spectrum up to 54 Mbps
up to 11 Mbps 802.11g
direct sequence spread 2.4-5 GHz range
spectrum (DSSS) in physical up to 54 Mbps
layer
802.11n: multiple
• all hosts use same
antennae
chipping code
2.4-5 GHz range
up to 200 Mbps
AP 1 AP 2 AP 1 1 AP 2
1 1 2 2
2 3
3 4
H1 H1
RTS(A) RTS(B)
reservation collision
RTS(A)
CTS(A) CTS(A)
DATA (A)
defer
time
ACK(A) ACK(A)
2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4
Internet
H1 R1 router
AP
802.3 frame
802.11 frame
5: DataLink Layer 5-90
802.11 frame: more
frame seq #
duration of reserved
(for RDT)
transmission time (RTS/CTS)
2 2 6 6 6 2 6 0 - 2312 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4
2 2 4 1 1 1 1 1 1 1 1
Protocol To From More Power More
Type Subtype Retry WEP Rsvd
version AP AP frag mgt data
frame type
(RTS, CTS, ACK, data)
switch: which AP is
BBS 1
associated with H1?
self-learning
AP 1
(Ch. 5):
switch will see frame AP 2
from H1 and
“remember” which H1 BBS 2
switch port can be
used to reach H1
10-3
dynamically change
BER
10-4
transmission rate 10-5
modulation 10-7
10 20 30 40
technique) as mobile SNR(dB)