104
Link Layer 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

COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Page 1: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

COMP 3331/9331:� Computer Networks and

ApplicationsWeek 11

Data Link Layer + Wireless Networks

Reading Guide: Chapter 5, Sections 5.4, 5.7

Chapter 6, Sections 6.1 – 6.3

Page 2: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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

2

Page 3: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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)

3

Page 4: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

LAN addresses and ARP each adapter on LAN has unique LAN address

adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN (wired or wireless)

4

Page 5: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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 §  address depends on IP subnet to which node is

attached

5

Page 6: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

MAC Address vs. IP Addressv  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

Page 7: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Taking Stock: Naming

Layer Examples Structure Configuration Resolution Service

App. Layer

www.cse.unsw.edu.au organizational hierarchy

~ manual

Network Layer

129.94.242.51 topological hierarchy

DHCP

Link layer 45-CC-4E-12-F0-97 vendor (flat)

hard-coded

DNS

ARP

Link Layer 7

Page 8: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Sending Packets Over Link-Layer

v  Adapters only understand MAC addresses §  Translate the destination IP address to MAC address §  Encapsulate the IP packet inside a link-level frame

host host DNS...1.2.3.156

router

1.2.3.53

1.2.3.53

1.2.3.156

IP packet

Link Layer 8

Page 9: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

ARP: address resolution protocol

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)

Question: how to determine interface’s MAC address, knowing its IP address?

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137.196.7.23

137.196.7.78

137.196.7.14

137.196.7.88

9

Page 10: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

10

Page 11: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

Addressing: routing to another LAN

R

1A-23-F9-CD-06-9B 222.222.222.220

111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111 74-29-9C-E8-FF-55

A

222.222.222.222 49-BD-D2-C7-56-2A

222.222.222.221 88-B2-2F-54-1A-0F

B

11

Page 12: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

R

1A-23-F9-CD-06-9B 222.222.222.220

111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111 74-29-9C-E8-FF-55

A

222.222.222.222 49-BD-D2-C7-56-2A

222.222.222.221 88-B2-2F-54-1A-0F

B

Link Layer

Addressing: routing to another LAN

IP Eth Phy

IP src: 111.111.111.111 IP dest: 222.222.222.222

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

12

Page 13: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

R

1A-23-F9-CD-06-9B 222.222.222.220

111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111 74-29-9C-E8-FF-55

A

222.222.222.222 49-BD-D2-C7-56-2A

222.222.222.221 88-B2-2F-54-1A-0F

B

Link Layer

Addressing: routing to another LAN

IP Eth Phy

v  frame sent from A to R

IP

Eth Phy

v  frame received at R, datagram removed, passed up to IP

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 src: 111.111.111.111 IP dest: 222.222.222.222

13

Page 14: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

R

1A-23-F9-CD-06-9B 222.222.222.220

111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111 74-29-9C-E8-FF-55

A

222.222.222.222 49-BD-D2-C7-56-2A

222.222.222.221 88-B2-2F-54-1A-0F

B

Link Layer

Addressing: routing to another LAN

IP src: 111.111.111.111 IP dest: 222.222.222.222

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

Eth Phy

IP Eth Phy

14

Page 15: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

R

1A-23-F9-CD-06-9B 222.222.222.220

111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111 74-29-9C-E8-FF-55

A

222.222.222.222 49-BD-D2-C7-56-2A

222.222.222.221 88-B2-2F-54-1A-0F

B

Link Layer

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

IP src: 111.111.111.111 IP dest: 222.222.222.222

MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A

IP

Eth Phy

IP Eth Phy

15

Page 16: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

R

1A-23-F9-CD-06-9B 222.222.222.220

111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111 74-29-9C-E8-FF-55

A

222.222.222.222 49-BD-D2-C7-56-2A

222.222.222.221 88-B2-2F-54-1A-0F

B

Link Layer

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

IP src: 111.111.111.111 IP dest: 222.222.222.222

MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A

IP Eth Phy

16

Page 17: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Example ARP Table

Link Layer 17

Page 18: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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

Link Layer 18

Page 19: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

19

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

Page 20: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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.5 link virtualization: MPLS

5.6 data center networking

5.7 a day in the life of a web request

20

Page 21: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Ethernet

“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

Metcalfe’s Ethernet sketch

21

Bob Metcalfe, Xerox PARC, visits Hawaii and gets an idea!

Page 22: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Ethernet: physical topology v  bus: popular through mid 90s

§  all nodes in same collision domain (can collide with each other) §  CSMA/CD for media access control

v  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

switch

bus: coaxial cable star

22

Page 23: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Ethernet frame structure

sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

preamble: v  7 bytes with pattern 10101010 followed by one

byte with pattern 10101011 v  used to synchronize receiver, sender clock rates

dest. address

source address

data (payload) CRC preamble

type

23

Page 24: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

dest. address

source address

data (payload) CRC preamble

type

24

Page 25: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

25

Page 26: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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 transport network

link physical

MAC protocol and frame format

100BASE-TX

100BASE-T4

100BASE-FX 100BASE-T2

100BASE-SX 100BASE-BX

fiber physical layer copper (twister pair) physical layer

26

Page 27: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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.5 link virtualization: MPLS

5.6 data center networking

5.7 a day in the life of a web request

27

Page 28: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

28

Page 29: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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 switch with six interfaces

(1,2,3,4,5,6)

A

A’

B

B’ C

C’

1 2

3 4 5

6

29

Page 30: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Switch forwarding table

Q: how does switch know A’ reachable via interface 4, B’ reachable via interface 5?

switch with six interfaces (1,2,3,4,5,6)

A

A’

B

B’ C

C’

1 2

3 4 5

6 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?

30

Page 31: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

A

A’

B

B’ C

C’

1 2

3 4 5

6

Link Layer

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

A A’

Source: A Dest: A’

MAC addr interface TTL Switch table

(initially empty) A 1 60

31

Page 32: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

32

Quiz: Self-learning?

Link Layer

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

D

B

E C

F

1 2

3 4 5

6

G

Page 33: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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 */

33

Page 34: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

A

A’

B

B’ C

C’

1 2

3 4 5

6

Link Layer

Self-learning, forwarding: example A A’

Source: A Dest: A’

MAC addr interface TTL switch table

(initially empty) A 1 60

A A’ A A’ A A’ A A’ A A’

v  frame destination, A’, locaton unknown: flood

A’ A

v  destination A location known:

A’ 4 60

selectively send on just one link

34

Page 35: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Interconnecting switches

v  switches can be connected together

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!)

A

B

S1

C D

E

F S2

S4

S3

H I

G

35

Page 36: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Self-learning multi-switch example Suppose C sends frame to I, I responds to C

v  Q: show switch tables and packet forwarding in S1, S2, S3, S4

A

B

S1

C D

E

F S2

S4

S3

H I

G

36

Page 37: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Institutional network

to external network

router

IP subnet

mail server

web server

37

Page 38: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

application transport network

link physical

network link

physical

link physical

switch

datagram

application transport network

link physical

frame

frame

frame datagram

38

Page 39: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer 39

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

Page 40: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

VLANs: motivation 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

Computer Science Electrical

Engineering Computer Engineering

40

Self Study

Page 41: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

VLANs port-based VLAN: switch ports

grouped (by switch management software) so that single physical switch ……

switch(es) supporting VLAN capabilities can be configured to define multiple virtual LANS over single physical LAN infrastructure.

Virtual Local Area Network 1

8

9

16 10 2

7

Electrical Engineering (VLAN ports 1-8)

Computer Science (VLAN ports 9-15)

15

Electrical Engineering (VLAN ports 1-8)

1

8 2

7 9

16 10

15

Computer Science (VLAN ports 9-16)

… operates as multiple virtual switches

41

Self Study

Page 42: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

Port-based VLAN

1

8

9

16 10 2

7

Electrical Engineering (VLAN ports 1-8)

Computer Science (VLAN ports 9-15)

15

v  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

v  dynamic membership: ports can be dynamically assigned among VLANs

router

v  forwarding between VLANS: done via routing (just as with separate switches) §  in practice vendors sell combined

switches plus routers

42

Self Study

Page 43: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

VLANS spanning multiple switches

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

1

8

9

10 2

7

Electrical Engineering (VLAN ports 1-8)

Computer Science (VLAN ports 9-15)

15

2

7 3

Ports 2,3,5 belong to EE VLAN Ports 4,6,7,8 belong to CS VLAN

5

4 6 8 16

1

43

Self Study

Page 44: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

type

2-byte Tag Protocol Identifier (value: 81-00)

Tag Control Information (12 bit VLAN ID field, 3 bit priority field like IP TOS)

Recomputed CRC

802.1Q VLAN frame format

802.1 frame

802.1Q frame

dest. address

source address data (payload) CRC preamble

dest. address

source address preamble data (payload) CRC

type

44

Self Study

Page 45: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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

45

Page 46: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

46

Self Study

Page 47: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

A day in the life: scenario

Comcast network 68.80.0.0/13

Google’s network 64.233.160.0/19 64.233.169.105

web server

DNS server

school network 68.80.2.0/24

web page

browser

47

Self Study

Page 48: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

router (runs DHCP)

Link Layer

A day in the life… connecting to the Internet

v  connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP 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

48

Self Study

Page 49: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

router (runs DHCP)

Link Layer

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

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP UDP

IP Eth Phy

DHCP

DHCP

DHCP

DHCP

DHCP

v  encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client

Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router

v  DHCP client receives DHCP ACK reply

A day in the life… connecting to the Internet

49

Self Study

Page 50: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

router (runs DHCP)

Link Layer

A day in the life… ARP (before DNS, before HTTP)

v  before sending HTTP request, need IP address of www.google.com: DNS

DNS UDP

IP Eth Phy

DNS

DNS

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

ARP query

Eth Phy

ARP

ARP

ARP reply

50

Self Study

Page 51: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

router (runs DHCP)

Link Layer

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

DNS

v  IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router

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

v  demux’ed to DNS server v  DNS server replies to client

with IP address of www.google.com

Comcast network 68.80.0.0/13

DNS server

DNS UDP

IP Eth Phy

DNS

DNS

DNS

DNS

A day in the life… using DNS

51

Self Study

Page 52: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

router (runs DHCP)

Link Layer

A day in the life…TCP connection carrying HTTP

HTTP TCP IP Eth Phy

HTTP

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  TCP connection established! 64.233.169.105 web server

SYN

SYN

SYN

SYN

TCP

IP Eth Phy

SYN

SYN

SYN

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

SYNACK

v  web server responds with TCP SYNACK (step 2 in 3-way handshake)

52

Self Study

Page 53: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

router (runs DHCP)

Link Layer

A day in the life… HTTP request/reply HTTP TCP IP Eth Phy

HTTP

v  HTTP request sent into TCP socket

v  IP datagram containing HTTP request routed to www.google.com

v  IP datagram containing HTTP reply routed back to client

64.233.169.105 web server

HTTP TCP IP Eth Phy

v  web server responds with HTTP reply (containing web page)

HTTP

HTTP

HTTP HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

v  web page finally (!!!) displayed

53

Self Study

Page 54: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

54

Page 55: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Link Layer

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

55

Page 56: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks 56

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

Page 57: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

57

Page 58: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless 101

Wireless Networks 58

Page 59: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Elements of a wireless network

network infrastructure

59

Page 60: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

wireless hosts v  laptop, smartphone v  run applications v  may be stationary (non-

mobile) or mobile §  wireless does not always

mean mobility

Elements of a wireless network

network infrastructure

60

Page 61: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

Elements of a wireless network

network infrastructure

61

Page 62: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

Elements of a wireless network

network infrastructure

62

Page 63: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Characteristics of selected wireless links

Indoor 10-30m

Outdoor 50-200m

Mid-range outdoor

200m – 4 Km

Long-range outdoor

5Km – 20 Km

.056

.384

1

4

5-11

54

2G: IS-95, CDMA, GSM

2.5G: UMTS/WCDMA, CDMA2000

802.15

802.11b

802.11a,g

3G: UMTS/WCDMA-HSPDA, CDMA2000-1xEVDO

4G: LTWE WIMAX

802.11a,g point-to-point

200 802.11n

Dat

a ra

te (M

bps)

63

Page 64: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks 64

Page 65: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

infrastructure mode v  base station connects

mobiles into wired network v  handoff: mobile changes

base station providing connection into wired network

Elements of a wireless network

network infrastructure

65

Page 66: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

Elements of a wireless network

66

Page 67: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

67

Page 68: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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)

68

Page 69: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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” 69

Page 70: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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

Page 71: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Multipath Effects

v  Signals bounce off surface and interfere (constructive or destructive) with one another

v  Self-interference

Wireless Networks 71

Page 72: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Ideal Radios

Wireless Networks 72

Page 73: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Real Radios

Wireless Networks 73

Page 74: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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 20 30 40

QAM256 (8 Mbps)

QAM16 (4 Mbps)

BPSK (1 Mbps)

SNR(dB)

BER

10-1

10-2

10-3

10-5

10-6

10-7

10-4

74

Page 75: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Wireless network characteristics Multiple wireless senders and receivers create additional

problems (beyond multiple access):

A B

C

Hidden terminal problem v  B, A hear each other v  B, C hear each other v  A, C can not hear each other

means A, C unaware of their interference at B

v  Carrier sense will be ineffective

A B C

A’s signal strength

space

C’s signal strength

Signal attenuation: v  B, A hear each other v  B, C hear each other v  A, C can not hear each other

interfering at B

75

Page 76: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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

Wireless network characteristics

Page 77: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

77

Page 78: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

78

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

§  if data is 1, send 1 1 1 -1 1 -1 -1 -1

§  if data is -1 send -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

Page 79: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

CDMA encode/decode

slot 1 slot 0

d1 = -1

1 1 1 1

1 - 1 - 1 - 1 -

Zi,m= di.cm

d0 = 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 0 channel output

slot 1 channel output

channel output Zi,m

sender code

data bits

slot 1 slot 0

d1 = -1 d0 = 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 -

1 1 1 1

1 - 1 - 1 - 1 -

slot 0 channel output

slot 1 channel output receiver

code

received input

Di = Σ Zi,m.cm m=1

M

M

79

Page 80: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

CDMA: two-sender interference

using same code as sender 1, receiver recovers sender 1’s original data from summed channel data!

Sender 1

Sender 2

channel sums together transmissions by sender 1 and 2

80

Page 81: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

81

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

v  If there are multiple CDMA codes all of the codes have to be orthogonal to each other. §  E.g: 3 codes: C1, C2 and C3. Then C1 x C2 = 0, C2 x

C3 = 0 and C1 x C3 = 0

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

Wireless Networks

Page 82: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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)

82

Page 83: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

IEEE 802.11 Wireless LAN 802.11b 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

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  all use CSMA/CA for multiple access v  all have base-station and ad-hoc network versions

83

Page 84: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

802.11 LAN architecture 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 BSS 1

BSS 2

Internet

hub, switch or router

84

Page 85: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

85

Page 86: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

86

802.11b channels

Wireless Networks

Page 87: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

802.11: passive/active scanning

AP 2 AP 1

H1

BBS 2 BBS 1

1 2 3

1

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

AP 2 AP 1

H1

BBS 2 BBS 1

1 2 2

3 4

active scanning: (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

87

Page 88: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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)

space

A B

C A B C

A’s signal strength

C’s signal strength

88

Page 89: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

89

Page 90: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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 receiver

DIFS

data

SIFS

ACK

90

Page 91: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Avoiding collisions (more) idea: allow sender to “reserve” channel rather than random

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!

91

Page 92: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Collision Avoidance: RTS-CTS exchange

AP A B

time

RTS(A) RTS(B)

RTS(A)

CTS(A) CTS(A)

DATA (A)

ACK(A) ACK(A)

reservation collision

defer

92

Page 93: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

frame control duration address

1 address

2 address

4 address

3 payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seq control

802.11 frame: addressing

Address 2: MAC address of wireless host or AP transmitting this frame

Address 1: MAC address of wireless host or AP to receive this frame

Address 3: MAC address of router interface to which AP is attached

Address 4: used only in ad hoc mode

93

Page 94: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Internet router H1 R1

AP MAC addr H1 MAC addr R1 MAC addr address 1 address 2 address 3

802.11 frame

R1 MAC addr H1 MAC addr dest. address source address

802.3 frame

802.11 frame: addressing

94

Page 95: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

frame control duration address

1 address

2 address

4 address

3 payload CRC

2 2 6 6 6 2 6 0 - 2312 4

seq control

Type From AP Subtype To

AP More frag WEP More

data Power

mgt Retry Rsvd Protocol version

2 2 4 1 1 1 1 1 1 1 1

duration of reserved transmission time (RTS/CTS)

frame seq # (for RDT)

frame type (RTS, CTS, ACK, data)

802.11 frame: more

95

Page 96: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

H1 BBS 2 BBS 1

96

Page 97: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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)

10 20 30 40

SNR(dB)

BE

R

10-1

10-2

10-3

10-5

10-6

10-7

10-4

operating point

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

97

Page 98: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

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

802.11: advanced capabilities

98

Page 99: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

M radius of coverage

S

SS

P

P

P

P

M

S

Master device

Slave device

Parked device (inactive) P

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

99

Page 100: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks 100

Page 101: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Internet of Things

Wireless Networks 101

Page 102: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

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

Page 103: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Exciting Research: Device Free RF Sensing v  We are enveloped in wireless transmissions v  Actions/humans create perturbations in the RF field v  Recent research has shown that it is possible to identify

actions/humans based on unique signatures which can be measured from fine-grained information in the RF (Channel State Information)

v  E.g. WiFi-ID (@ CSE) v  Can identify

§  Gestures §  Breathing §  Emotions (hearbeat) §  ….

Wireless Networks 103

WiFi-ID: Human Identification using WiFi signalJin Zhang⇤†, Bo Wei‡, Wen Hu⇤†, Salil S. Kanhere⇤

⇤School of Computer Science and Engineering, The University of New South Wales, AustraliaEmail: {jin.zhang1,wen.hu,salil.kanhere}@unsw.edu.au

†CSIRO Digital Productivity Flagship, Australia‡Department of Computer Science, University of Oxford, UK Email: {bo.wei}@cs.ox.ac.uk

Abstract—Prior research has shown the potential of device-free WiFi sensing for human activity recognition. In this paper,we show for the first time WiFi signals can also be used touniquely identify people. There is strong evidence that suggeststhat all humans have a unique gait. An individual’s gait will thuscreate unique perturbations in the WiFi spectrum. We propose asystem called WiFi-ID that analyses the channel state informationto extract unique features that are representative of the walkingstyle of that individual and thus allow us to uniquely identifythat person. We implement WiFi-ID on commercial off-the-shelfdevices. We conduct extensive experiments to demonstrate thatour system can uniquely identify people with average accuracyof 93% to 77% from a group of 2 to 6 people, respectively. Weenvisage that this technology can find many applications in smalloffice or smart home settings.

I. INTRODUCTION

Wireless devices are everywhere - our homes, offices, shops,restaurants and virtually all of our urban spaces. They invisiblyfill the air with a spectrum of Radio Frequency (RF) signals.When a person walks through these spaces, they create aperturbation in this RF field. By closely examining theseperturbations using the Channel State Information (CSI), itis 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].

In this paper, we show for the first time that WiFi signals canalso be used to uniquely identify people. Everyone’s naturalwalking style (i.e. gait) is unique which is characterized bythe differences in the limb (hand and feet) movement patternsand velocity [15]. These patterns are also highly repetitive.Our hypothesis is that an individuals gait will thus create aunique perturbation in the WiFi spectrum. Fig. 1 shows thespectrogram of the CSI data for two people walking throughthe same corridor (scenario depicted at the top of Fig. 1).One can readily observe the differences manifested by eachpersons’ unique gait; particularly in the segment of the datawhere the subjects cross the Line of Sight (LoS) path betweenthe two wireless devices. Prior research has demonstrated thatunique gait signatures can be extracted from video sequencesthat capture people walking [22] and from an array of a largenumber of pressure-sensitive sensors deployed underneath afloor for measuring foot pressure patterns [6] [17].

Our work is different, since we rely on passive reception ofWiFi signals from infrastructure which is already ubiquitousin our surroundings. The device-free and non-intrusive nature

Time (s)0 1 2 3 4

CSI

Am

plitu

de

-20

-10

0

10

CentralArea

Person1:

Person2:

EffectiveRegion

Time (s)0 1 2 3 4

CSI

Am

plitu

de

-20

-10

0

10

Fig. 1. Operational Scenario for WiFi-ID

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,etc). Camera systems [23] require line of sight and sufficientambient light. Audio and visual approaches also give rise tosignificant privacy concerns. Wearable sensors [12] [11] relyon the unique signatures generated by embedded Inertial Mea-surement Unit (IMU) sensors but often are required to be wornin a specific manner to ensure accurate operations. Biometricsensors such as fingerprints are susceptible to hacking. Incontrast, our radio based approach is less intrusive and usesexisting WiFi infrastructure, and thus has broad applicationsfor authenticating individuals in smart homes, offices andassisted living facilities.

The general problem of uniquely identifying an individualfrom a large user population in any physical setting is arguablyvery challenging. To make the problem more tractable, weconsider a setting where the goal is to uniquely a personfrom a group of N people. This is representative of a smarthome or small office setting. Consider for example a smarthome where children may be prohibited access by themselvesinto the garage or home office. Or a smart office where onlyselected staff have access to certain offices (e.g., server room

Page 104: COMP 3331/9331: Computer Networks and Applications · MAC Address vs. IP Address v MAC addresses (used in link-layer) § Hard-coded in read-only memory when adapter is built § Like

Wireless Networks

Summary

Wireless v  wireless links:

§  capacity, distance §  channel impairments §  CDMA

v  IEEE 802.11 (“Wi-Fi”) §  CSMA/CA reflects wireless

channel characteristics

104