Professional Documents
Culture Documents
CN 5
CN 5
▪ combination of hardware,
n
datagra datagra
m m
controll controll
er er
sending receiving
host datagra host
m
fram
e
6-slot 6-slot
fram fram
e e
1 3 4 1 3 4
Channel partitioning MAC protocols: FDMA
FDMA: frequency division multiple access
▪ 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 packet to send, frequency
bands 2,5,6 idle
tim
frequency e
bands
FDM
cable
Random access protocols
▪ when node has packet to send
• 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 detect collisions
• how to recover from collisions (e.g., via delayed
retransmissions)
▪ examples of random access MAC protocols:
• slotted ALOHA
• ALOHA
• CSMA, CSMA/CD, CSMA/CA
Slotted ALOHA
assumptions: operation:
▪ all frames same size ▪ when node obtains fresh
▪ time divided into equal size frame, transmits in next slot
slots (time to transmit 1 • if no collision: node can
frame) send new frame in next
▪ nodes start to transmit slot
only slot beginning • if collision: node
▪ nodes are synchronized retransmits frame in each
▪ if 2 or more nodes subsequent slot with prob.
transmit in slot, all nodes p until success
detect collision
Slotted ALOHA
node 1 1 1 1
1
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
slots in nodes need to be than time to transmit
in sync
packet
▪ simple
▪ clock synchronization
Slotted ALOHA: efficiency
!
▪ prob that given node has at best: channel
success in a slot = p(1- used for useful
p)N-1 transmissions 37%
▪ prob that any node has a of time!
success = Np(1-p) N-1
Pure (unslotted) ALOHA
▪ unslotted Aloha: simpler, no synchronization
▪ when frame first arrives
• transmit immediately
▪ collision probability increases:
• frame sent at t0 collides with other frames sent in
[t0-1,t 0+1]
Pure ALOHA efficiency
P(success by given node) = P(node transmits) .
P(no other node transmits in [t 0-1,t 0] .
P(no other node transmits in [t 0-1,t 0]
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
= 1/(2e) = .18
▪ efficiency goes to 1
• as tprop goes to 0
• as ttrans goes to infinity
▪ better performance than ALOHA: and simple, cheap,
decentralized!
“Taking turns” MAC protocols
channel partitioning MAC protocols:
▪ share channel efficiently and fairly at high load
▪ inefficient at low load: delay in channel access, 1/N
bandwidth allocated even if only 1 active node!
random access MAC protocols
▪ efficient at low load: single node can fully utilize
channel
▪ high load: collision overhead
“taking turns” protocols
look for best of both worlds!
“Taking turns” MAC protocols
polling:
▪ master node “invites”
slave nodes to transmit dat
in turn a pol
l
▪ typically used with
“dumb” slave devices maste
dat r
▪ concerns: a
• polling overhead
• latency
• single point of slave
failure (master) s
“Taking turns” MAC protocols
token passing:
T
▪ control token passed
from one node to next
sequentially.
▪ token message (nothin
▪ concerns: g
▪ token overhead to T
send)
▪ latency
▪ single point of failure
(token)
data
Cable access network
Internet frames, TV channels, control transmitted
downstream at different frequencies
cable headend
CMTS
…
splitte cable
cable modem … r mode
m
termination system
1A-2F-BB-76-09-
AD
LAN
(wired or adapte
wireless r
71-65- )
F7-2B-08-53 58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
LAN addresses (more)
▪ MAC address allocation administered by IEEE
▪ manufacturer buys portion of MAC address
space (to assure uniqueness)
▪ analogy:
• MAC address: like Social Security Number
• IP address: like postal address
▪ MAC flat address ➜ portability
• can move LAN card from one LAN to another
▪ IP hierarchical address not portable
• address depends on IP subnet to which node is
attached
ARP: address resolution protocol
Question: how to determine
interface’s MAC address,
knowing its IP address? ARP table: each IP node (host,
router) on LAN has table
137.196.7.7
• IP/MAC address
8 mappings for some
1A-2F-BB-76-09-
AD LAN nodes:
137.196.7.2
3 137.196.7.1 < IP address; MAC address; TTL>
4 • TTL (Time To Live):
time after which
71-65- LAN address mapping will be
F7-2B-08-53 58-23-D7-FA-20-B0
forgotten (typically 20
min)
0C-C4-11-6F-E3-98
137.196.7.8
8
ARP protocol: same LAN
▪ A wants to send datagram
to B
• B’s MAC address not in A’s ▪ A caches (saves) IP-to-
ARP table. MAC address pair in its
▪ A broadcasts ARP query ARP table until
packet, containing B's IP information becomes old
address (times out)
• destination MAC address = • soft state: information that
FF-FF-FF-FF-FF-FF times out (goes away)
• all nodes on LAN receive unless refreshed
ARP query ▪ ARP is “plug-and-play”:
▪ B receives ARP packet, • nodes create their ARP
replies to A with its (B's) tables without intervention
MAC address from net administrator
• frame sent to A’s MAC
address (unicast)
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R
▪ focus on addressing – at IP (datagram) and MAC layer (frame)
▪ assume A knows B’s IP address
▪ assume A knows IP address of first hop router, R (how?)
▪ assume A knows R’s MAC address (how?)
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ A creates IP datagram with IP source A, destination B
▪ A creates link-layer frame with R's MAC address as destination
address, frame contains A-to-B IP datagram
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-E9-00-17-BB-4B
IP src: 111.111.111.111
IP dest:
222.222.222.222
IP
Eth
Ph
y
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
Addressing: routing to another LAN
▪ frame sent from A to R
▪ frame received at R, datagram removed, passed up to IP
A B
R
111.111.111.111
222.222.222.22
74-29-9C-E8-
29-BD-D2-
4
FF-55
222.222.222.22 C7-56-2A
1A-23-F9-
0
CD-06-9B
111.111.111.112 111.111.111.110 222.222.222.22
CC-49-DE-D0- E6-E9-00-17- 88-
1
AB-7D BB-4B B2-2F-54-1A-0F
* Check out the online interactive exercises for more
examples: h ttp://gaia.cs.umass.edu/kurose_ross/interactive/
Ethernet
“dominant” wired LAN technology:
▪ single chip, multiple speeds (e.g., Broadcom BCM5761)
▪ first widely used LAN technology
▪ simpler, cheap
▪ kept up with speed race: 10 Mbps – 10 Gbps
switc
starh
bus: coaxial cable
Ethernet frame structure
sending adapter encapsulates IP datagram (or other
network layer protocol packet) in Ethernet frame
type
dest. source
preamble address address data CRC
(payload)
preamble:
▪ 7 bytes with pattern 10101010 followed by one
byte with pattern 10101011
▪ used to synchronize receiver, sender clock rates
Ethernet frame structure (more)
▪ addresses: 6 byte source, destination MAC addresses
• if adapter receives frame with matching destination
address, or with broadcast address (e.g. ARP packet), it
passes data in frame to network layer protocol
• otherwise, adapter discards frame
▪ type: indicates higher layer protocol (mostly IP but
others possible, e.g., Novell IPX, AppleTalk)
▪ CRC: cyclic redundancy check at receiver
• error detected: frame is dropped
type
dest. source
preamble address address data CRC
(payload)
Ethernet: unreliable, connectionless
▪ connectionless: no handshaking between sending and
receiving NICs
▪ unreliable: receiving NIC doesn't send acks or nacks
to sending NIC
• data in dropped frames recovered only if initial
sender uses higher layer rdt (e.g., TCP),
otherwise dropped data lost
▪ Ethernet’s MAC protocol: unslotted CSMA/CD with
binary backoff
802.3 Ethernet standards: link & physical layers
MAC protocol
applicatio and frame
n format
transport 100BASE-TX 100BASE-T2 100BASE-FX
network 100BASE-T4 100BASE-SX 100BASE-BX
link
physical
copper (twister fiber physical layer
pair) physical layer
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
Switch: multiple simultaneous transmissions
▪ hosts have dedicated, direct A
connection to switch
B
▪ switches buffer packets C’
A A
▪ switch learns which hosts A’
can be reached through B
C’
which interfaces
• when frame received, 6 1 2
switch “learns”
location of sender: 5 4 3
incoming LAN segment
• records sender/location B C
’
pair in switch table
A
’
MAC addr interface TTL
A 1 60 Switch table
(initially empty)
Switch: frame filtering/forwarding
when frame received at switch:
A A
▪ frame destination, A’, A’
d
▪ destination A location 6 1 2
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
IP subnet
Switches vs. routers
application
transport
both are store-and-forward: network
datagram
▪ routers: network-layer frame link
devices (examine network- physical link frame
layer headers) physical
▪ switches: link-layer devices
(examine link-layer headers) switch
network
infrastructure
Elements of a wireless network
wireless hosts
❖ laptop, smartphone
❖ run applications
❖ may be stationary (non-
mobile) or mobile
network
▪ wireless does not always
infrastructure
mean mobility
Elements of a wireless network
base station
❖ typically connected to
wired network
❖ relay - responsible for
sending packets
between wired network
network
and wireless host(s) in
infrastructure
its “area”
▪ e.g., cell towers,
802.11 access points
Elements of a wireless network
wireless link
❖ typically used to
connect mobile(s) to
base station
❖ also used as backbone
link
network
infrastructure ❖ multiple access protocol
coordinates link access
❖ various data rates,
transmission distance
Characteristics of selected wireless links
20 802.11n
0
5 802.11a, 802.11a,g point-to-
g
4 point
5-11 802.11b 4G: LTWE WIMAX
1
(Mbps)
802.1
5
no base station, no
connection to larger
no no base station, no
Internet. May have to
infrastructure connection to larger
relay to reach other
Internet (Bluetooth,
a given wireless node
ad hoc nets)
MANET, VANET
Wireless Link Characteristics (1)
important differences from wired link ….
BE
• given physical layer: increase
R
power -> increase SNR- 10-5
>decrease BER
10-6
• given SNR: choose physical
layer that meets BER 10-7
requirement, giving highest 1 2 3 4
thruput 0 0
SNR(dB 0 0
)
• SNR may change with QAM256 (8
mobility: dynamically adapt Mbps)
QAM16 (4
physical layer (modulation Mbps)
technique, rate) BPSK (1
Mbps)
Wireless network characteristics
Multiple wireless senders and receivers create additional
problems (beyond multiple access):
A B C
C
M
Di = Σ Zi,m cm
.
m=
1
M
receive 1 1 1 1 1 1 1 1
d0 = 1
d -1 -1 -1 -1 -1 -1 -1 -1 d1 = -1
input 1 1 1 1 1 1 1 slot 1 slot 0
1
cod channe channe
-1 -1 -1 -1 -1 -1 -1 -1
e l l
receiver slot 1 slot 0
output output
CDMA: two-sender interference
channel sums together
transmissions by sender
1 and 2
Sender 1
Sender 2
hub, switch
❖ Basic Service Set (BSS)
or router (aka “cell”) in
infrastructure mode
contains:
BSS 1 ▪ wireless hosts
▪ access point (AP): base
station
▪ ad hoc mode: hosts only
BSS 2
802.11: Channels, association
▪ 802.11b: 2.4GHz-2.485GHz spectrum divided into 11
channels at different frequencies
• AP admin chooses frequency for AP
• interference possible: channel can be same as that
chosen by neighboring AP!
▪ host: must associate with an AP
• scans channels, listening for beacon frames containing
AP’s name (SSID) and MAC address
• selects AP to associate with
• may perform authentication [Chapter 8]
• will typically run DHCP to get IP address in AP’s
subnet
802.11: passive/active scanning
BBS 1 BBS 2 BBS 1 BBS 2
1
1 1 2 2 AP
AP AP AP
2 3 2
1 3 2 1 4
H H
1 1
passive scanning: active scanning:
(1) beacon frames sent from APs (1) Probe Request frame broadcast
(2) association Request frame sent: H1 from H1
to selected AP (2) Probe Response frames sent
(3) association Response frame sent from APs
from selected AP to H1 (3) Association Request frame sent:
H1 to selected AP
(4) Association Response frame
sent from selected AP to H1
IEEE 802.11: multiple access
▪ avoid collisions: 2+ nodes transmitting at same time
▪ 802.11: CSMA - sense before transmitting
• don’t collide with ongoing transmission by other node
▪ 802.11: no collision detection!
• difficult to receive (sense collisions) when transmitting due to weak
received signals (fading)
• can’t sense all collisions in any case: hidden terminal, fading
• goal: avoid collisions: CSMA/C(ollision)A(voidance)
A B C
C
A’s C’s
B signal
A signal
strengt strengt
h h
space
IEEE 802.11 MAC Protocol: CSMA/CA
802.11 sender
1 if sense channel idle for DIFS then
transmit entire frame (no CD) sender receiver
2 if sense channel busy then
start random backoff time DIFS
reservation collision
RTS(A)
CTS(A) CTS(A)
DATA (A)
defer
tim
e ACK(A ACK(A
) )
802.11 frame: addressing
2 2 6 6 6 2 6 0- 4
addres addres addres addres
frame duratio seq 2312
s s s s payload CRC
control n contro
1 2 3 4
l
Internet
H1 R1 router
2 2 6 6 6 2 6 0- 4
addres addres addres addres
frame duratio seq 2312
s s s s payload CRC
control n contro
1 2 3 4
l
2 2 4 1 1 1 1 1 1 1 1
More Pow
Protocol To From More
Type Subtype Retry er WEP Rsvd
version AP AP data
frag mgt
frame type
(RTS, CTS, ACK, data)
802.11: mobility within same subnet
▪ H1 remains in same
IP subnet: IP address
can remain same
▪ switch: which AP is
associated with H1?
• self-learning (Ch. 5):
switch will see frame
from H1 and
H BBS 2
“remember” which BBS 1
1
switch port can be
used to reach H1
802.11: advanced capabilities
Rate adaptation 10-1
transmission rate
BE
10-4
R
(physical layer 10-5
Permanent address:
128.119.40.186
Care-of address:
79.129.13.2
dest: 128.119.40.186
packet sent by
correspondent
Mobile IP: agent discovery
❖ agent advertisement: foreign/home agents advertise
service by broadcasting ICMP messages (typefield = 9)
R bit: registration
required
Mobile IP: registration example
visited network:
home agent foreign agent79.129.13/24
HA: COA:
128.119.40.7 79.129.13.2 mobile agent
MA:
ICMP agent adv. 128.119.40.186
COA:
79.129.13.2
….
registration req.
registration req.
COA: 79.129.13.2
COA: 79.129.13.2 HA: 128.119.40.7
HA: 128.119.40.7 MA: 128.119.40.186
MA: 128.119.40.186 Lifetime: 9999
Lifetime: 9999 identification:714
identification: 714 ….
encapsulation format
….
registration reply
HA: 128.119.40.7 registration reply
MA: 128.119.40.186 HA: 128.119.40.7
Lifetime: 4999 MA: 128.119.40.186
Identification: 714 Lifetime: 4999
encapsulation format Identification: 714
…. ….
time
Components of cellular network architecture
recall: corresponden
wired public t
telephone
network
MSC MSC
MSC
MSC
MSC
(a) before
handoff
GSM: handoff between MSCs
❖ anchor MSC: first MSC
visited during call
home network
Home
corresponden ▪ call remains routed
t
MSC through anchor MSC
anchor MSC
❖ new MSCs add on to end of
MSC
PSTN
MSC chain as mobile moves
MSC
to new MSC
MSC
❖ optional path minimization
step to shorten multi-MSC
chain
(b) after
handoff
Mobility: GSM versus Mobile IP
GSM element Comment on GSM element Mobile IP element
Home system Network to which mobile user’s permanent Home
phone number belongs network
Gateway Mobile Home MSC: point of contact to obtain Home agent
Switching Center, or routable address of mobile user. HLR:
“home MSC”. Home database in home system containing
Location Register permanent phone number, profile information,
(HLR) current location of mobile user, subscription
information
Visited System Network other than home system where Visited
mobile user is currently residing network
Visited Mobile Visited MSC: responsible for setting up calls Foreign agent
services Switching to/from mobile nodes in cells associated with
Center. MSC. VLR: temporary database entry in
Visitor Location visited system, containing subscription
Record (VLR) information for each visiting mobile user
Mobile Station Routable address for telephone call segment Care-of-
Roaming Number between home MSC and visited MSC, visible address
(MSRN), or to neither the mobile nor the correspondent.
“roaming number”