week10
week10
Transport
IEEE802.2 Logic Link Control (LLC)
Network
LLC 802.3 802.11 802.15
Data Link MAC Ethernet WLAN WPAN
Physical PHY
357
Ethernet
“dominant” wired LAN technology:
cheap ~$20 for 1Gbps cards, ~$100 for 10Gbps cards
first widely used LAN technology
Kept up with speed race: 10 Mbps – 400Gbps
Metcalfe’s Ethernet
sketch
358
Bus vs. Star topology
Bus topology popular through mid 90s
hub or
switch
359
Hubs vs Switches
Both connect segments of LANs
Hubs are layer-1 devices that duplicate
the messages to other ports
Computers connected by hubs are in
the same contention domain
Switches are layer-2 devices that
forward the messages to the selected
port
Computers connected by switches
are in the same broadcast domain
Point-to-point link between a
computer and a switch
360
Ethernet Frame Structure
Sending adapter encapsulates IP datagram (or other network
layer protocol packet) in Ethernet frame
8 6 6 2 4
Preamble:
7 bytes with pattern 10101010 followed by 1 byte with pattern
10101011
used to synchronize receiver, sender clock rates
361
Ethernet Frame Structure (more)
8 6 6 2 4
362
Unreliable, connectionless service
Connectionless: No handshaking between sending and
receiving adapter.
Unreliable: receiving adapter doesn’t send acks or nacks to
sending adapter
stream of datagrams passed to network layer can have gaps
gaps will be filled if app is using TCP
otherwise, app will see the gaps
363
Medium Access Control in Ethernet
Shared medium with bus or star topology with hubs
Carrier Sensing Multiple Access with Collision Detection
(CSMA/CD)
Half-duplex: nodes take turns in transmissions
Point-to-point in star topology with switches
Full duplex: can send and receive at the same time
How to learn which port a device is connected?
364
CSMA (Carrier Sense Multiple Access)
CSMA: listen before transmit
If channel sensed idle: transmit entire frame
If channel sensed busy, defer transmission
365
Collision in CSMA
366
CSMA/CD
Packet?
No
Yes
Discard
Packet Jam channel
b=CalcBackoff();
attempts < 16
wait(b);
attempts++;
attempts == 16
367
Collision in CSMA/CD
368
Limits on CSMA/CD Network
latency d B
A
370
Forwarding switch
1
2 3
switch
switch switch
371
Self learning
A switch has a switch table
entry in switch table:
(MAC Address, Interface, TTL)
stale entries in table dropped (TTL can be 60 min)
switch learns which hosts can be reached through which
interfaces
when frame received, switch “learns” location of sender:
incoming LAN segment
records sender/location pair in switch table
372
Filtering/Forwarding
When switch receives a frame:
373
Switch example
Suppose C sends frame to D
switch address interface
1 A 1
2 3
B 1
E 2
hub hub hub G 3
A
I
D F
B C G H
E
switch
collision
domain
hub
hub hub
switch
IP subnet
switch
switch switch
379
Summary: Comparison of Hubs,
Switches & Routers
5 5
4 4
3 3 3
2 2 2 2
1 1 1 1 1
host hub switch router host
hubs routers switches
optimal no yes no
routing
cut yes no yes*
through 5-380
WLANs
Elements of a wireless network
wireless hosts
l laptop, smartphone, tablet
l run applications
l may be stationary (non-
mobile) or mobile
network
l wireless does not always
infrastructure
mean mobility
382
Elements of a wireless network
base station
l typically connected to
wired network
l relay - responsible for
sending packets
network between wired
infrastructure
network and wireless
host(s) in its “area”
l e.g., cell towers
802.11 access points
383
Elements of a wireless network
wireless link
l typically used to connect
mobile(s) to base station
l also used as backbone
link
network l multiple access protocol
infrastructure coordinates link access
l various data rates,
transmission distance
384
Elements of a wireless network
infrastructure mode
l base station connects
mobiles into wired
network
l handoff: mobile changes
base station providing
network connection into wired
infrastructure network
385
Elements of a wireless network
Ad hoc mode
l no base stations
l nodes can only transmit
to other nodes within link
coverage
l nodes organize
themselves into a
network: route among
themselves
386
802.11 LAN architecture
l wireless host communicates with base
station
Internet l base station = access point (AP)
l Basic Service Set (BSS) (aka “cell”)
l in infrastructure mode contains
router wireless hosts and access point
(AP): base station
AP hub, switch l ad hoc mode: hosts only (IBSS)
l Distribution system (DS)
BSS 1 l Connects multiple APs
AP l Extended service set (ESS)
l Two or more basic service sets
interconnected by DS
ESS
387 BSS 2
IEEE 802.11 Specs
388
From wikipedia
389
5GHz (802.11a/h/j/n/ac)
390
802.11 frame: addressing # in bytes
2 2 6 6 6 2 6 0 - 2304 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4
391
802.11 frame: addressing
Internet
H1 R1 router
802.3 frame
802.11 frame
392
802.11 frame: more
duration of reserved
frame seq #
transmission time (RTS/CTS)
(for reliable ARQ)
2 2 6 6 6 2 6 0 - 2304 4
frame address address address seq address
duration payload CRC
control 1 2 3 control 4
Mac Header in bytes
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
in bits
frame type
(RTS, CTS, ACK, data)
393
Frame Types
Management frame
Beacon
(De)association request/respond
Announcement traffic indication message
Authentication/Deauthentication
Control frame
Poll frame & poll response frame
RTS
CTS
ACK
Power save (PS-poll)
Data frame
Limitation on payload size
Can be extended to 7395 (with multiple fragments)
394
Association
host: must associate with an AP
scans channels, listening for beacon frames containing service
set identifier and AP’s MAC address
SSID is 32 octets long
One SSID per network (BSS or IBSS)
selects AP to associate with; initiates association protocol
may perform authentication
will typically then run DHCP to get IP address in AP’s subnet
395
BBS 1
802.11: Association
BBS 2
BBS 1 BBS 2 1
2 2 AP 2
AP 1
3
4
1 1 H1
AP 1 AP 2
2
3
active scanning:
H1 (1) Probe Request frame broadcast
from H1
passive scanning: (2) Probe Response frames sent
(1) beacon frames sent from APs from APs
(2) association Request frame sent: H1 to
(3) Association Request frame sent:
selected AP
H1 to selected AP
(3) association Response frame sent from
(4) Association Response frame sent
selected AP to H1 from selected AP to H1
396