CS计算机代考程序代写 cache dns algorithm DHCP COMP 3331/9331:

COMP 3331/9331:
Computer Networks and
Applications
Week 11
Data Link Layer + Wireless Networks
Reading Guide: Chapter 5, Sections 5.4, 5.7 Chapter 6, Sections 6.1 – 6.3
Link Layer

Link layer, LANs: outline
5.1 introduction, services 5.2 error detection,
correction
5.3 multiple access protocols
5.4 LANs
§ addressing, ARP § Ethernet
§ switches
§ VLANS
5.7 a day in the life of a web request
Link Layer 2

MAC addresses and ARP
v 32-bit IP address:
§ network-layer address for interface
§ used for layer 3 (network layer) forwarding
v MAC (or LAN or physical or Ethernet) address:
§ function: used ‘locally” to get frame from one interface to another physically-connected interface (same network, in IP- addressing sense)
§ 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable
§ e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation (each “number” represents 4 bits)
Link Layer 3

LAN addresses and ARP
each adapter on LAN has unique LAN address 1A-2F-BB-76-09-AD
LAN (wired or wireless)
adapter
71-65-F7-2B-08-53
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
Link Layer 4

LAN addresses (more)
v MAC address allocation administered by IEEE
v manufacturer buys portion of MAC address space
(to assure uniqueness)
v analogy:
§ MAC address: like Social Security Number § IP address: like postal address
v MAC flat address ➜ portability
§ can move LAN card from one LAN to another
v IP hierarchical address not portable
§ addressdependsonIPsubnettowhichnodeis attached
Link Layer 5

MAC Address vs. IP Address
v MAC addresses (used in link-layer)
§ Hard-coded in read-only memory when adapter is built § Like a social security number
§ Flat name space of 48 bits (e.g., 00-0E-9B-6E-49-76)
§ Portable, and can stay the same as the host moves
§ Used to get packet between interfaces on same network
v IP addresses
§ Configured, or learned dynamically
§ Like a postal mailing address
§ Hierarchical name space of 32 bits (e.g., 12.178.66.9)
§ Not portable, and depends on where the host is attached § Used to get a packet to destination IP subnet
Link Layer 6

Taking Stock: Naming
Layer
App. Layer
Examples
www. cse. unsw. edu. au
Structure
organizational hierarchy
Configuration
~ manual
Resolution Service
Network Layer
129. 94. 242. 51
topological hierarchy
DHCP
DNS
Link layer
45-CC-4E-12-F0-97
vendor (flat)
hard-coded
ARP
Link Layer 7

Sending Packets Over Link-Layer
1.2.3.53 1.2.3.156
host … DNS
router
host
IP packet
1.2.3.53
1.2.3.156
v Adapters only understand MAC addresses
§ Translate the destination IP address to MAC address § Encapsulate the IP packet inside a link-level frame
Link Layer 8

ARP: address resolution protocol
Question: how to determine interface’s MAC address, knowing its IP address?
137.196.7.78 1A-2F-BB-76-09-AD
ARP table: each IP node (host, router) on LAN has table
§ IP/MAC address mappings for some LAN nodes:
< IP address; MAC address; TTL>
§ TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)
137.196.7.23
71-65-F7-2B-08-53
137.196.7.88
LAN
137.196.7.14
58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98
Link Layer 9

ARP protocol: same LAN
v A wants to send datagram to B
§ B’s MAC address not in A’s ARP table.
v A broadcasts ARP query packet, containing B’s IP address
§ dest MAC address = FF-FF- FF-FF-FF-FF
§ all nodes on LAN receive ARP query
v B receives ARP packet, replies to A with its (B’s) MAC address
§ frame sent to A’s MAC address (unicast)
v A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out)
§ soft state: information that times out (goes away) unless refreshed
v ARP is “plug-and-play”:
§ nodes create their ARP tables without intervention from net administrator
Link Layer 10

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
• How does A know B is not local (i.e. connected to the same LAN as A) ? – Subnet Mask (discovered via DHCP)
§ assume A knows IP address of first hop router, R (how?) – Default router (discovered via DHCP)
§ assume A knows R’s MAC address (how?) – ARP
A
111.111.111.111 74-29-9C-E8-FF-55
111.111.111.112 CC-49-DE-D0-AB-7D
R
222.222.222.220 1A-23-F9-CD-06-9B
111.111.111.110 E6-E9-00-17-BB-4B
B
222.222.222.222 49-BD-D2-C7-56-2A
222.222.222.221 88-B2-2F-54-1A-0F
Link Layer 11

Addressing: routing to another LAN
v A creates IP datagram with IP source A, destination B
v A creates link-layer frame with R’s MAC address as dest, 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
Phy
A
111.111.111.111 74-29-9C-E8-FF-55
111.111.111.112 CC-49-DE-D0-AB-7D
R
222.222.222.220 1A-23-F9-CD-06-9B
111.111.111.110 E6-E9-00-17-BB-4B
B
222.222.222.222 49-BD-D2-C7-56-2A
222.222.222.221 88-B2-2F-54-1A-0F
Link Layer 12

Addressing: routing to another LAN
v frame sent from A to R
v frame received at R, datagram removed, passed up to IP
MAC src: 74-29-9C-E8-FF-55
MAC dest: E6-EI9P-0s0rc-1: 711-B1.B1-141B.111.111
IP dest: 222.222.222.222 IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
Eth
Phy
IP
Eth
Phy
A
111.111.111.111 74-29-9C-E8-FF-55
111.111.111.112 CC-49-DE-D0-AB-7D
R
222.222.222.220 1A-23-F9-CD-06-9B
111.111.111.110 E6-E9-00-17-BB-4B
B
222.222.222.222 49-BD-D2-C7-56-2A
222.222.222.221 88-B2-2F-54-1A-0F
Link Layer 13

Addressing: routing to another LAN
v R forwards datagram with IP source A, destination B (forwarding table) v R creates link-layer frame with B’s MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
Eth
Phy
IP
Eth
Phy
A
111.111.111.111 74-29-9C-E8-FF-55
111.111.111.112 CC-49-DE-D0-AB-7D
R
222.222.222.220 1A-23-F9-CD-06-9B
111.111.111.110 E6-E9-00-17-BB-4B
B
222.222.222.222 49-BD-D2-C7-56-2A
222.222.222.221 88-B2-2F-54-1A-0F
Link Layer 14

Addressing: routing to another LAN
v R forwards datagram with IP source A, destination B
v R creates link-layer frame with B’s MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
Eth
Phy
IP
Eth
Phy
A
111.111.111.111 74-29-9C-E8-FF-55
111.111.111.112 CC-49-DE-D0-AB-7D
R
222.222.222.220 1A-23-F9-CD-06-9B
111.111.111.110 E6-E9-00-17-BB-4B
B
222.222.222.222 49-BD-D2-C7-56-2A
222.222.222.221 88-B2-2F-54-1A-0F
Link Layer 15

Addressing: routing to another LAN
v R forwards datagram with IP source A, destination B
v R creates link-layer frame with B’s MAC address as dest, frame
contains A-to-B IP datagram
MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A
IP src: 111.111.111.111
IP dest: 222.222.222.222
IP
Eth
Phy
A
111.111.111.111 74-29-9C-E8-FF-55
111.111.111.112 CC-49-DE-D0-AB-7D
R
222.222.222.220 1A-23-F9-CD-06-9B
111.111.111.110 E6-E9-00-17-BB-4B
B
222.222.222.222 49-BD-D2-C7-56-2A
222.222.222.221 88-B2-2F-54-1A-0F
Link Layer 16

Example ARP Table
Link Layer 17

Sample Problem
http://www-net.cs.umass.edu/kurose_ross/interactive/link_layer_addressing.php
Link Layer 18

Security Issues: ARP Cache Poisoning
v Denial of Service – Hacker replies back to an ARP query for a router NIC with a fake MAC address
v Man-in-the-middle attack – Hacker can insert his/her machine along the path between victim machine and gateway router
v Such attacks are generally hard to launch as hacker needs physical access to the network
Solutions –
• Use Switched Ethernet with port security enabled (i.e. one host MAC address per switch port)
• Adopt static ARP configuration for small size networks
• Use ARP monitoring tools such as ARPWatch
http://www.watchguard.com/infocenter/editorial/135324.asp
Link Layer 19

Link layer, LANs: outline
5.1 introduction, services 5.2 error detection,
correction
5.3 multiple access protocols
5.4 LANs
§ addressing, ARP § Ethernet
§ switches
§ VLANS
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer 20

Ethernet
Bob Metcalfe, Xerox PARC, visits Hawaii and gets an idea!
Metcalfe’s Ethernet sketch
“dominant” wired LAN technology:
v cheap $20 for NIC
v first widely used LAN technology
v simpler, cheaper than token LANs and ATM v kept up with speed race: 10 Mbps – 10 Gbps
Link Layer 21

v
v
Ethernet: physical topology
bus: popular through mid 90s
§ all nodes in same collision domain (can collide with each other) § CSMA/CD for media access control
star: prevails today
§ active switch in center
§ each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other)
§ No sharing, no CSMA/CD
bus: coaxial cable
switch
star
Link Layer 22

Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
type
preamble:
v 7 bytes with pattern 10101010 followed by one byte with pattern 10101011
v used to synchronize receiver, sender clock rates
Link Layer 23
preamble
dest. address
source address
data (payload)
CRC

Ethernet frame structure (more)
v 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
v type: indicates higher layer protocol (mostly IP but
others possible, e.g., Novell IPX, AppleTalk) v CRC: cyclic redundancy check at receiver
§ error detected: frame is dropped type
preamble
dest. address
source address
data (payload)
CRC
Link Layer 24

Ethernet: unreliable, connectionless
v connectionless: no handshaking between sending and receiving NICs
v unreliable: receiving NIC doesnt 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
v Ethernet’s MAC protocol: unslotted CSMA/CD with binary backoff
Link Layer 25

802.3 Ethernet standards: link & physical layers
v many different Ethernet standards
§ common MAC protocol and frame format
§ different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10Gbps, 40Gbps, 100Gbps,
§ different physical layer media: fiber, cable
application
MAC protocol and frame format
transport
network
link
physical
100BASE-TX
100BASE-T4
100BASE-T2
100BASE-SX
100BASE-FX
100BASE-BX
copper (twister pair) physical layer
fiber physical layer
Link Layer 26

Link layer, LANs: outline
5.1 introduction, services 5.2 error detection,
correction
5.3 multiple access protocols
5.4 LANs
§ addressing, ARP § Ethernet
§ switches
§ VLANS
5.5 link virtualization: MPLS
5.6 data center networking
5.7 a day in the life of a web request
Link Layer 27

Ethernet switch
v 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
v transparent
§ hosts are unaware of presence of switches
v plug-and-play, self-learning
§ switches do not need to be configured
Link Layer 28

Switch: multiple simultaneous transmissions
v hosts have dedicated, direct connection to switch
v switches buffer packets
v Ethernet protocol used on each
incoming link, but no collisions; full duplex
§ each link is its own collision domain
v switching: A-to-A’ and B-to-B’ can transmit simultaneously, without collisions
A
C’
1
B
2 543
6
B’ C A’
switch with six interfaces (1,2,3,4,5,6)
Link Layer 29

Switch forwarding table
Q: how does switch know A’ reachable via interface 4, B’ reachable via interface 5?
v A: each switch has a switch
table, each entry:
§ (MAC address of host, interface to
reach host, time stamp) § looks like a routing table!
Q: how are entries created, maintained in switch table?
§ something like a routing protocol?
C’
A
B
6 1 5
2
B’ C A’
switch with six interfaces (1,2,3,4,5,6)
4
3
Link Layer 30

Switch: self-learning
v 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
Source: A Dest: A’
A
B
AA’
C’
1
2 543
6
B’ C A’
Switch table (initially empty)
MAC addr
interface
TTL
A
1
60
Link Layer 31

Quiz: Self-learning?
Suppose the switch receives a packet from A to G. (Assume it knows what interface both A and G are on.) It should…
A. Flood the packet
B. Throw the packet away
C. Send the packet out on interface 1
D. Do something else
A
F G
EC D
B
1 543
6
2
Link Layer
32

Switch: frame filtering/forwarding
when frame received at switch:
1. record incoming link, MAC address of sending host
2. index switch table using MAC destination address
3. if entry found for destination then {
if destination on segment from which frame arrived then drop frame
else forward frame on interface indicated by entry }
else flood /* forward on all interfaces except arriving interface */
Link Layer 33

Self-learning, forwarding: example
Source: A Dest: A’
AA’
v frame destination, A’, locaton unknown: flood
v destination A location known: selectively send
on just one link
C’
1
A
B
2 543
6
A A’
B’ C
A’
switch table
(initially empty)
A’A
MAC addr
interface
TTL
A A’
1 4
60 60
Link Layer 34

Interconnecting switches
v switches can be connected together S4
S3 F
S1
S2
A
BC
I H
Q: sending from A to G – how does S1 know to forward frame destined to F via S4 and S3?
v A: self learning! (works exactly the same as in single-switch case!)
D
G
E
Link Layer 35

Self-learning multi-switch example
Suppose C sends frame to I, I responds to C
S1
S2
S4
S3
A
BC
D
E
F
G
I H
v
Q: show switch tables and packet forwarding in S1, S2, S3, S4
Link Layer 36

Institutional network
to external network
mail server
web server
IP subnet
router
Link Layer 37

Switches vs. routers both are store-and-forward:
§ routers: network-layer devices (examine network- layer headers)
§ switches: link-layer devices (examine link-layer headers)
both have forwarding tables:
§ routers: compute tables using routing algorithms, IP addresses
§ switches: learn forwarding table using flooding, learning, MAC addresses
switch
application
transport
datagram
network
frame
link
physical
network
link
physical
link
datagram
frame
frame
physical
application
transport
network
link
physical
Link Layer 38

Security Issues
v In a switched LAN once the switch table entries are established frames are not broadcast
§ Sniffing frames is harder than pure broadcast LANs
§ Note: attacker can still sniff broadcast frames and frames for
which there are no entries (as they are broadcast)
v Switch Poisoning: Attacker fills up switch table with bogus entries by sending large # of frames with bogus source MAC addresses
v Since switch table is full, genuine packets frequently need to be broadcast as previous entries have been wiped out
Link Layer 39

VLANs: motivation
Computer Science
Electrical Engineering
Computer Engineering
consider:
v CS user moves office to EE, but wants connect to CS switch?
v single broadcast domain:
§ all layer-2 broadcast traffic (ARP, DHCP, unknown location of destination MAC address) must cross entire LAN
§ security/privacy, efficiency issues
Link Layer 40
Self Study

VL ANs
Virtual Local
port-based VLAN: switch ports grouped (by switch management software) so that single physical switch ……
1
7
9
15
2
8
10
16
Area Network
switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure.

Electrical Engineering (VLAN ports 1-8)

Computer Science (VLAN ports 9-15)
… operates as multiple virtual switches
1
7
2
8
9
15
10
16


Electrical Engineering Computer Science (VLAN ports 1-8) (VLAN ports 9-16)
Link Layer 41
Self Study

v
Port-based VLAN
traffic isolation: frames to/from ports 1-8 can only reach ports 1-8
§ can also define VLAN based on MAC addresses of endpoints, rather than switch port
dynamic membership: ports can be dynamically assigned among VLANs
router
1
7
9
15
2
8
10
16
v
v

Electrical Engineering (VLAN ports 1-8)

forwarding between VLANS: done via routing (just as with separate switches)
§ in practice vendors sell combined switches plus routers
Computer Science (VLAN ports 9-15)
Link Layer 42
Self Study

VLANS spanning multiple switches
1
7
9
15
2
8
10
16
1
3
4
5
6
7
2
8


Electrical Engineering Computer Science Ports 2,3,5 belong to EE VLAN (VLAN ports 1-8) (VLAN ports 9-15) Ports 4,6,7,8 belong to CS VLAN
v trunk port: carries frames between VLANS defined over multiple physical switches
§ frames forwarded within VLAN between switches can’t be vanilla 802.1 frames (must carry VLAN ID info)
§ 802.1q protocol adds/removed additional header fields for frames forwarded between trunk ports
Link Layer 43
Self Study

802.1Q VLAN frame format
type
preamble
dest. address
source address
data (payload)
CRC
type
802.1 frame
802.1Q frame
Recomputed CRC
preamble
dest. address
source address
data (payload)
CRC
2-byte Tag Protocol Identifier (value: 81-00)
Tag Control Information (12 bit VLAN ID field, 3 bit priority field like IP TOS)
Link Layer 44
Self Study

Link layer, LANs: outline
5.1 introduction, services 5.2 error detection,
correction
5.3 multiple access protocols
5.4 LANs
§ addressing, ARP § Ethernet
§ switches
§ VLANS
5.7 a day in the life of a web request
Link Layer 45

Synthesis: a day in the life of a web request v journey down protocol stack complete!
§ application, transport, network, link v putting-it-all-together: synthesis!
§ goal: identify, review, understand protocols (at all layers) involved in seemingly simple scenario: requesting www page
§ scenario: student attaches laptop to campus network, requests/receives www.google.com
Link Layer 46
Self Study

A day in the life: scenario
browser
DNS server
Comcast network 68.80.0.0/13
school network 68.80.2.0/24
web page
web server 64.233.169.105
Google’s network 64.233.160.0/19
Link Layer 47
Self Study

A day in the life… connecting to the Internet
DHCP
DHCP
v connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP
v DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.3 Ethernet
v Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server
v Ethernet demuxed to IP demuxed, UDP demuxed to DHCP
UDP
DHCP
IP
DHCP
Eth
DHCP
Phy
DHCP
DHCP
DHCP
UDP
DHCP
IP
DHCP
Eth
router
(runs DHCP)
DHCP
Phy
Link Layer 48
Self Study

A day in the life… connecting to the Internet
DHCP
DHCP
UDP
DHCP
IP
DHCP
Eth
DHCP
Phy
DHCP
DHCP
UDP
DHCP
IP
DHCP
Eth
router
(runs DHCP)
v DHCP server formulates DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server
v encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client
v DHCP client receives DHCP ACK reply
DHCP
Phy
DHCP
Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router
Link Layer 49
Self Study

A day in the life… ARP (before DNS, before HTTP)
DNS
DNS
v before sending HTTP request, need IP address of www.google.com: DNS
v DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. To send frame to router, need MAC address of router interface: ARP
v ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface
v client now knows MAC address of first hop router, so can now send frame containing DNS query
UDP
DNS
ARP IP Eth
DNS
ARP query
Phy
ARP reply
ARP Eth
Phy
router
(runs DHCP)
Link Layer 50
Self Study

A day in the life… using DNS
DNS
DNS server
DNS
UDP
UDP
DNS
IP
DNS
DNS
Eth
DNS
DNS
Phy
DNS
IP
DNS
Eth
DNS
Phy
DNS
Comcast network 68.80.0.0/13
v IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
v v
router
(runs DHCP)
v
IP datagram forwarded from campus network into comcast network, routed (tables created by RIP, OSPF, IS-IS and/or BGP routing protocols) to DNS server
demux’ed to DNS server
DNS server replies to client with IP address of
www. google. com
Link Layer 51
Self Study

A day in the life…TCP connection carrying HTTP
HTTP
SYSNYANCK
HTTP
TCP
IP
SYSNYANCK
Eth
SYSNYANCK
Phy
router
(runs DHCP)
v to send HTTP request, client first opens TCP socket to web server
v TCP SYN segment (step 1 in 3- way handshake) inter-domain routed to web server
v web server responds with TCP SYNACK (step 2 in 3-way handshake)
v TCP connection established!
Link Layer 52
TCP
IP
Eth
Phy
SYSNYANCK
SYSNYANCK
SYSNYANCK
web server 64.233.169.105
Self Study

A day in the life… HTTP request/reply
v web page finally (!!!) displayed
HTTP HTTP
HTTP
TCP
HTTP HTTP
IP
H H
T T
T T
P P
Eth
H
T
T
P
H
HT
TT
TP
P
Phy
HTTP
router
(runs DHCP)
v HTTP request sent into TCP socket
v IP datagram containing HTTP request routed to
www. google. com
v web server responds with HTTP reply (containing web page)
v IP datagram containing HTTP reply routed back to client
HTTP
TCP
HTTP
IP
HTTP
Eth
HTTP
Phy
web server 64.233.169.105
Link Layer 53
Self Study

Link Layer: Summary
v principles behind data link layer services: § error detection, correction
§ sharing a broadcast channel: multiple access § link layer addressing
v instantiation and implementation of various link layer technologies
§ Ethernet
§ switched LANS, VLANs
§ virtualized networks as a link layer: MPLS
v synthesis: a day in the life of a web request
Link Layer 54

Link Layer: let’s take a breath v journey down protocol stack complete (except
PHY)
v solid understanding of networking principles, practice
v ….. could stop here …. but lots of interesting topics!
§ wireless
§ multimedia
§ security
§ network management
Link Layer 55

Ch. 6: Wireless and Mobile Networks
Background:
v # wireless (mobile) phone subscribers now exceeds # wired phone subscribers (5-to-1)!
v # wireless Internet-connected devices equals # wireline Internet-connected devices
§ laptops, Internet-enabled phones promise anytime untethered Internet access
v two important (but different) challenges
§ wireless: communication over wireless link
§ mobility: handling the mobile user who changes point of attachment to network
Wireless Networks 56

Outline
6.1 Introduction
Wireless
6.2 Wireless links, characteristics
§ CDMA
6.3 IEEE 802.11 wireless
LANs (“Wi-Fi”)
6.4 Cellular Internet Access
(NOT COVERED) § architecture
§ standards (e.g., GSM)
Mobility
6.5 – 6.8 NOT COVERED 6.9 Summary
Wireless Networks 57

Wireless 101
Wireless Networks 58

Elements of a wireless network
network infrastructure
Wireless Networks 59

Elements of a wireless network
network infrastructure
wireless hosts
v laptop, smartphone v run applications
v may be stationary (non- mobile) or mobile
§ wirelessdoesnotalways mean mobility
Wireless Networks 60

Elements of a wireless network
network infrastructure
base station
v typically connected to wired network
v relay – responsible for sending packets between wired network and wireless host(s) in its “area”
§ e.g., cell towers, 802.11 access points
Wireless Networks 61

Elements of a wireless network
network infrastructure
wireless link
v typically used to connect mobile(s) to base station
v also used as backbone link v multiple access protocol
coordinates link access
v various data rates, transmission distance
Wireless Networks 62

Characteristics of selected wireless links
802.15
802.11n
802.11a,g
802.11a,g point-to-point
802.11b
4G: LTWE WIMAX
3G: UMTS/WCDMA-HSPDA, CDMA2000-1xEVDO
2.5G: UMTS/WCDMA, CDMA2000 2G: IS-95, CDMA, GSM
200
54 5-11 4
1
.384 .056
Indoor 10-30m
Outdoor 50-200m
Mid-range
outdoor 200m – 4 Km
Long-range
outdoor 5Km – 20 Km
Wireless Networks 63
Data rate (Mbps)

Wireless Networks 64

Elements of a wireless network
network infrastructure
infrastructure mode
v base station connects mobiles into wired network
v handoff: mobile changes base station providing connection into wired network
Wireless Networks 65

Elements of a wireless network
ad hoc mode
v no base stations
v nodes can only transmit to other nodes within link coverage
v nodes organize themselves into a network: route among themselves
Wireless Networks 66

Wireless network taxonomy
single hop
multiple hops
infrastructure (e.g., APs)
no infrastructure
host connects to base station (WiFi, WiMAX, cellular) which connects to larger Internet
no base station, no connection to larger Internet (Bluetooth, ad hoc nets)
host may have to relay through several wireless nodes to connect to larger Internet: mesh net
no base station, no connection to larger Internet. May have to relay to reach other a given wireless node MANET, VANET
Wireless Networks 67

Outline
6.1 Introduction Wireless
6.2 Wireless links, characteristics
§ CDMA
6.3 IEEE 802.11 wireless
LANs (“Wi-Fi”)
6.4 Cellular Internet Access § architecture
§ standards (e.g., GSM)
Wireless Networks 68

Wireless Link Characteristics (1)
important differences from wired link ….
§ decreased signal strength: radio signal attenuates as it
propagates through matter (path loss)
§ interference from other sources: standardized wireless network frequencies (e.g., 2.4 GHz) shared by other
devices (e.g., phone); devices (motors) interfere as well
§ multipath propagation: radio signal reflects off objects ground, arriving ad destination at slightly different times
…. make communication across (even a point to point) wireless link much more “difficult”
Wireless Networks 69

Path Loss/Path Attenuation
v Free Space Path Loss d: distance
: wavelength
f: frequency
c: speed of light
v Reflection, Diffraction, Absorption
v Terrain contours (urban, rural, vegetation) v Humidity
Wireless Networks 70

Multipath Effects
v Signals bounce off surface and interfere (constructive or destructive) with one another
v Self-interference
Wireless Networks 71

Ideal Radios
Wireless Networks 72

Real Radios
Wireless Networks 73

Wireless Link Characteristics (2)
v SNR: signal-to-noise ratio
§ larger SNR – easier to extract signal from noise (a “good thing”)
v SNR versus BER tradeoffs
§ given physical layer: increase power -> increase SNR- >decrease BER
§ given SNR: choose physical layer that meets BER requirement, giving highest thruput
• SNR may change with mobility: dynamically adapt physical layer (modulation technique, rate)
10-1 10-2 10-3
10-4 10-5
10-6
10
-7
10 20 30 40
SNR(dB)
QAM256 (8 Mbps) QAM16 (4 Mbps)
BPSK (1 Mbps)
Wireless Networks 74
BER

Wireless network characteristics
Multiple wireless senders and receivers create additional problems (beyond multiple access):
AB A’s signal
strength
space
Signal attenuation:
C
C’s signal strength
A
C
B
Hidden terminal problem
v B,Aheareachother
v B,Cheareachother
v A,Ccannotheareachother means A, C unaware of their interference at B
v Carrier sense will be ineffective
v B,Aheareachother
v B,Cheareachother
v A,Ccannotheareachother interfering at B
Wireless Networks 75

Wireless network characteristics
v Exposed Terminals
v Node B sends a packet to A; C hears this and decides not to send a packet to D (despite the fact that this will not cause interference) !!
v Carrier sense would prevent a successful transmission
Wireless Networks 76

Code Division Multiple Access (CDMA)
v unique “code” assigned to each user; i.e., code set partitioning
§ all users share same frequency, but each user has own “chipping” sequence (i.e., code) to encode data
§ allows multiple users to “coexist” and transmit simultaneously with minimal interference (if codes are “orthogonal”)
v encoded signal = (original data) X (chipping sequence)
v decoding: inner-product of encoded signal and chipping sequence
Wireless Networks 77

CDMA: Encoding and Decoding
v Assume original data are represented by 1 and -1
v Encoded signal = (original data) modulated by (chipping sequence)
§ assume cm = 1 1 1 -1 1 -1 -1 -1 § ifdatais 1,send 1 1 1-1 1-1 -1 -1
§ ifdatais -1send-1-1-1 1-1 1 1 1
v Decoding: inner-product (summation of bit-by-bit product) of
encoded signal and chipping sequence
§ if inner-product > threshold, the data is 1; else -1
Wireless Networks 78

CDMA encode/decode
sender
data bits
code
Zi,m= di.cm
slot 1 channel output
d1 = -1
1
1
1
d0 = 1
channel output Zi,m
slot 0 channel output
1
1
1
1
1
1
-1
-1
-1
-1
-1
-1
-1
-1
1
1
1
1
1
-1
slot 1
slot 0
-1
-1
-1
-1
-1
-1
-1
1
1
received input
code
receiver
m=1
M
M. Di = ΣZi,m cm
1
1
1
1
1
1
1
1
-1
-1
-1
-1
-1
1
1
-1
-1
-1
1
1
1
1
1
1
-1
slot 1
slot 0
slot 1 channel output
slot 0 channel output
-1
-1
-1
-1
-1
-1
-1
d1 = -1
d0 = 1
Wireless Networks 79

CDMA: two-sender interference
Sender 1
Sender 2
channel sums together transmissions by sender 1 and 2
using same code as sender 1, receiver recovers sender 1’s original data from summed channel data!
Wireless Networks 80

CDMA codes
v CDMA codes are orthogonal.
v E.g: (1,1,1,-1,1,-1,-1,-1) and (1,-1,1,1,1,-1,1,1) v Inner product of the codes should be zero
C1: 1 1 1 -1 1 -1 -1 -1
C2: 1 -1 1 1 1 -1 1 1 —————————————–
C1 .C2 = 1+(-1)+1+(-1) +1+ 1+(-1)+(-1)=0
v If there are multiple CDMA codes all of the codes have to be orthogonal to each other.
§ E.g:3codes:C1,C2andC3.ThenC1xC2=0, C2x C3 = 0 and C1 x C3 = 0
WirelessNetworks 81

Outline
6.1 Introduction Wireless
6.2 Wireless links, characteristics
§ CDMA
6.3 IEEE 802.11 wireless
LANs (“Wi-Fi”)
6.4 Cellular Internet Access § architecture
§ standards (e.g., GSM)
Wireless Networks 82

IEEE 802.11 Wireless LAN
802. 11b
802. 11a
§ 5-6 GHz range § up to 54 Mbps
802. 11g
§ 2.4-5 GHz range
§ up to 54 Mbps 802.11n: multiple antennae
§ 2.4-5 GHz range § up to 200 Mbps
v 2.4-5 GHz unlicensed spectrum
v up to 11 Mbps
v direct sequence spread spectrum (DSSS) in physical layer
§ all hosts use same chipping code
v all use CSMA/CA for multiple access
v all have base-station and ad-hoc network versions
Wireless Networks 83

802.11 LAN architecture
BSS 1
Internet
hub, switch or router
BSS 2
v wireless host communicates with base station
§ base station = access point (AP)
v Basic Service Set (BSS) (aka
“cell”) in infrastructure mode
contains:
§ wireless hosts
§ access point (AP): base station § ad hoc mode: hosts only
Wireless Networks 84

802.11: Channels, association
v 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!
v 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
Wireless Networks 85

802.11b channels
Wireless Networks 86

802.11: passive/active scanning
BBS 1
BBS 2
BBS 1
BBS 2
AP 2
4
AP1
1112 AP2 AP1 2
233
passive scanning:
(1) beacon frames sent from APs (2) association Request frame sent: H1 to
selected AP
(3) association Response frame sent from
selected AP to H1
active scanning:
H1
H1
(1) Probe Request frame broadcast from H1
(2) Probe Response frames sent from APs
(3) Association Request frame sent: H1 to selected AP
(4) Association Response frame sent from selected AP to H1
Wireless Networks 87

IEEE 802.11: multiple access
v avoid collisions: 2+ nodes transmitting at same time v 802.11: CSMA – sense before transmitting
§ don’t collide with ongoing transmission by other node v 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
C
B
AB A’s signal
strength
C
C’s signal strength
space
Wireless Networks
88

Multiple access: Key Points
v No concept of a global collision
§ Different receivers hear different signals
§ Different senders reach different receivers
v Collisions are at receiver, not sender
§ Only care if receiver can hear the sender clearly
§ It does not matter if sender can hear someone else
§ As long as that signal does not interfere with receiver
v Goal of protocol
§ Detect if receiver can hear sender
§ Tell senders who might interfere with receiver to shut up
Wireless Networks
89

IEEE 802.11 MAC Protocol: CSMA/CA
802.11 sender
1 if sense channel idle for DIFS then transmit entire frame (no CD)
2 if sense channel busy then
start random backoff time
timer counts down while channel idle
transmit when timer expires
if no ACK, increase random backoff interval, repeat 2
802.11 receiver
– if frame received OK
return ACK after SIFS (ACK needed due to hidden terminal problem)
sender DIFS
receiver
data
ACK
SIFS
Wireless Networks 90

Avoiding collisions (more)
idea: allowsenderto“reserve”channelratherthanrandom access of data frames: avoid collisions of long data frames
v sender first transmits small request-to-send (RTS) packets to BS using CSMA
§ RTSs may still collide with each other (but they’re short)
v BS broadcasts clear-to-send CTS in response to RTS
v CTS heard by all nodes
§ sender transmits data frame
§ other stations defer transmissions
avoid data frame collisions completely using small reservation packets!
Wireless Networks 91

Collision Avoidance: RTS-CTS exchange
A AP B
reservation collision
time
DATA (A)
defer
Wireless Networks 92
RTS(B)
RTS(A) RTS(A)
CTS(A)
ACK(A)
CTS(A)
ACK(A)

802.11 frame: addressing
2 2 6 6 6 2 6 0-2312 4
frame control
duration
address 1
address 2
address 3
seq control
address 4
payload
CRC
Address 1: MAC address of wireless host or AP
to receive this frame
Address 2: MAC address of wireless host or AP transmitting this frame
Address 4: used only in ad hoc mode
Address 3: MAC address
of router interface to which AP is attached
Wireless Networks 93

802.11 frame: addressing
R1 router
Internet
H1
R1 MAC addr
H1 MAC addr
dest. address
address 3
802.11 frame
source address 802.3 frame
AP MAC addr
H1 MAC addr R1 MAC addr
address 1
address 2
Wireless Networks 94

802.11 frame: more
duration of reserved transmission time (RTS/CTS)
frame seq # (for RDT)
2 2 6 6 6 2 6 0-2312 4
frame control
duration
address 1
address 2
address 3
seq control
address 4
payload
CRC
2
2411111111
Protocol version
Type
Subtype
To AP
From AP
More frag
Retry
Power mgt
More data
WEP
Rsvd
frame type
(RTS, CTS, ACK, data)
Wireless Networks 95

802.11: mobility within same subnet
v H1 remains in same IP subnet: IP address can remain same
v switch: which AP is associated with H1?
§ self-learning (Ch. 5): switch will see frame from H1 and “remember” which switch port can be used to reach H1
BBS 2
BBS 1
H1
Wireless Networks 96

802.11: advanced capabilities
Rate adaptation
v base station, mobile dynamically change transmission rate (physical layer modulation technique) as mobile moves, SNR varies
QAM256 (8 Mbps) QAM16 (4 Mbps)
BPSK (1 Mbps)
operating point
10-1 10-2 10-3 10-4 10-5 10-6 10-7
10 20 30 40 SNR(dB)
1. SNR decreases, BER increase as node moves away from base station
2. When BER becomes too high, switch to lower transmission rate but with lower BER
Wireless Networks 97
BER

802.11: advanced capabilities
power management
v node-to-AP: “I am going to sleep until next beacon frame”
§ AP knows not to transmit frames to this node § node wakes up before next beacon frame
v beacon frame: contains list of mobiles with AP-to- mobile frames waiting to be sent
§ node will stay awake if AP-to-mobile frames to be sent; otherwise sleep again until next beacon frame
Wireless Networks 98

802.15: personal area network
v less than 10 m diameter
v replacement for cables (mouse,
keyboard, headphones)
v ad hoc: no infrastructure
v master/slaves:
§ slaves request permission to send
(to master)
§ master grants requests
v 802. 15: evolved from Bluetooth specification
§ 2.4-2.5 GHz radio band § up to 721 kbps
S
P
M
P
P
radius of coverage
S
M
S
P
S
P
Master device
Slave device
Parked device (inactive)
Wireless Networks 99

Wireless Networks 100

Internet of Things
Wireless Networks 101

IoT Research Challenges
v Naming and Addressing: Advertising, Searching and Discovery
v Power/Energy/Efficient resource management
v Miniaturization
v Big data Analytics: 35Zb of data, 2B$ in value by 2020 v Semantic technologies
v Virtualization
v Privacy/Security
v Heterogeneity/Dynamics/Scale
Wireless Networks 102

uniquely ivden tify
p
)
Exciting Research: Device Free RF Sensing
†CSIRO Digital Productivity Flagship, Australia
actions/humans based on unique signatures which can be
WiFi-ID: Human Identification using WiFi signal
v We are enveloped in wireless transmissions
v Actions/humans create perturbations in the RF field ⇤School of Computer Science and Engineering, The University of New South Wales, Australia
Abstract—Prior research has shown the potential of device- State Information)
Effective Region Central Area
.
g
.
W
i
F
i
I
Ji
⇤† ‡ ⇤† ⇤
n Zh
D
(
@
C
a
ng
,
Bo
W
,
S
e
i,
W
E
en
H
u
S
Email: {jin.zhang1,wen.hu,salil.kanhere}@unsw.edu.au
v Recent research has shown that it is possible to identify
ali
lS
‡Department of Computer Science, University of Oxford, UK Email: {bo.wei}@cs.ox.ac.uk
measured from fine-grained information in the RF (Channel
.K
a
n
h
ere
free WiFi sensing for human activity recognition. In this paper, we show for the first time WiFi signals can also be used to
E

e
op
le.
Ther
e
is
s
tr
o
ng ev
id
ence th
at
sug
ge
sts
that all humans have a unique gait. An individual’s gait will thus
v Can identify
system called WiFi-ID that analyses the channel state information
create unique perturbations in the WiFi spectrum. We propose a
to extract unique features that are representative of the walking
§ Gestures
style of that individual and thus allow us to uniquely identify
that person. We implement WiFi-ID on commercial off-the-shelf
devices. We condu§ct exBtenrseiveatexhpeirnimgents to demonstrate that
our system can uniquely identify people with average accuracy
§ Emotions (hearbeat) envisage that this technology can find many applications in small
of 93% to 77% from a group of 2 to 6 people, respectively. We
10 0
CSI Amplitude CSI Amplitude
office or smart home settings.
Person 1:
Person 2:
§ ….
I. INTRODUCTION
Wireless devices are everywhere – our homes, offices, shops, restaurants and virtually all of our urban spaces. They invisibly fill the air with a spectrum of Radio Frequency (RF) signals. When a person walks through these spaces, they create a perturbation in this RF field. By closely examining these perturbations using the Channel State Information (CSI), it is possible to identify basic human activities such as standing, sitting, walking and running [25] and even hand gestures [19] and keystrokes typed on a keyboard [3].
-10
-200 1 2 3 4
10 Time (s) 0
-10
-200 1 2 3 4
Time (s)
Fig. 1. Operational Scenario for WiFi-ID Wireless Networks 103
of this approach makes it an attractive alternative to tradi- tional authentication methods that use cameras, microphones. biometrics or physical objects (swipe cards, wearable tags,

Summary
Wireless
v wireless links:
§ capacity, distance
§ channel impairments § CDMA
v IEEE 802.11 (“Wi-Fi”)
§ CSMA/CA reflects wireless channel characteristics
Wireless Networks 104