CSC358 Week 11ylzhang/csc358/files/lec10.pdf · 2019. 5. 9. · • Material science: fluoride...
Transcript of CSC358 Week 11ylzhang/csc358/files/lec10.pdf · 2019. 5. 9. · • Material science: fluoride...
CSC358 Week 11
Adapted from slides by J.F. Kurose and K. W. Ross.All material copyright 1996-2016 J.F Kurose and K.W. Ross, All Rights Reserved
Logistics§ Next week’s lecture:
• finishing up topics• exam review
§ There is tutorial next week
Network Layer 4-2
We are here
4-3
Link layer, LANs: outline
6.1 introduction, services6.2 error detection,
correction 6.3 multiple access
protocols6.4 LANs• addressing, ARP• Ethernet• switches• VLANS
6.5 link virtualization: MPLS
6.6 data center networking
6-4Link Layer and LANs
Ethernet switch§ link-layer device: takes an active role
• store, forward Ethernet frames• examine incoming frame�s MAC address, selectively
forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment
• compared to traditional hubs that simply transmit the bits at the physical layer.
§ transparent• hosts are unaware of presence of switches
§ plug-and-play, self-learning• switches do not need to be configured
6-5Link Layer and LANs
4-6
switch
hub
splitter
Switch: multiple simultaneous transmissions
§ hosts have dedicated, direct connection to switch
§ switches buffer packets§ Ethernet protocol used on each
incoming link, but no collisions; full duplex• each link is its own collision
domain§ 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
345
6
6-7Link Layer and LANs
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
345
6§ 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?
6-8Link Layer and LANs
A
A�
B
B� C
C�
1 2
345
6
Switch: self-learning§ 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: ADest: A�
MAC addr interface TTLSwitch table
(initially empty)A 1 60
6-9Link Layer and LANs
Switch: frame filtering/forwarding
when frame received at switch:1. record incoming link, MAC address of sending host2. index switch table using MAC destination address3. if entry found for destination
then {if destination on segment from which frame arrivedthen drop frameelse forward frame on interface indicated by entry
}else
flood /* forward on all interfaces except arrivinginterface */
6-10Link Layer and LANs
A
A�
B
B� C
C�
1 2
345
6
Self-learning, forwarding: exampleA A�
Source: ADest: A�
MAC addr interface TTLswitch table
(initially empty)A 1 60
A A�A A�A A�A A�A A�
§ frame destination, A’, location unknown: flood
A� A
§ destination A location known:
A� 4 60
selectively send on just one link
6-11Link Layer and LANs
Interconnecting switches
self-learning switches can be connected together:
Q: sending from A to G - how does S1 know to forward frame destined to G via S4 and S3?§ A: self learning! (works exactly the same as in
single-switch case!)
A
B
S1
C D
E
FS2
S4
S3
HI
G
6-12Link Layer and LANs
Institutional network
to externalnetwork
router
IP subnet
mail server
web server
6-13Link Layer and LANs
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
applicationtransportnetworklink
physical
networklink
physical
linkphysical
switch
datagram
applicationtransportnetworklink
physical
frame
frame
framedatagram
6-14Link Layer and LANs
VLAN
4-15
VLANs: motivationconsider:§ CS user moves office to EE,
but wants connect to CS switch?
§ 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
ComputerEngineering
6-16Link Layer and LANs
VLANsport-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 virtualLANS over single
physical LAN
infrastructure.
Virtual Local Area Network 1
8
9
16102
7
…
Electrical Engineering
(VLAN ports 1-8)
Computer Science
(VLAN ports 9-15)
15
…
Electrical Engineering
(VLAN ports 1-8)
…
1
82
7 9
1610
15
…
Computer Science
(VLAN ports 9-16)
… operates as multiple virtual switches
6-17Link Layer and LANs
Port-based VLAN
1
8
9
16102
7
…
Electrical Engineering(VLAN ports 1-8)
Computer Science(VLAN ports 9-15)
15
…
§ 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
§ forwarding between VLANS: done via routing (just as with separate switches)• in practice vendors sell combined
switches plus routers
6-18Link Layer and LANs
Link layer, LANs: outline
6.1 introduction, services6.2 error detection,
correction 6.3 multiple access
protocols6.4 LANs• addressing, ARP• Ethernet• switches• VLANS
6.5 link virtualization: MPLS
6.6 data center networking
6-19Link Layer and LANs
Multiprotocol label switching (MPLS)
§ initial goal: high-speed IP forwarding using fixed length label (instead of IP address)
• fast lookup using fixed length identifier (rather than prefix matching)
• but IP datagram still keeps IP address!
PPP or Ethernet header IP header remainder of link-layer frameMPLS header
labelTCtraffic class
Sstack
TTL
20 3 1 8
6-20Link Layer and LANs
MPLS capable routers§ a.k.a. label-switched router§ forward packets to outgoing interface based only on
label value (don�t inspect IP address)• MPLS forwarding table distinct from IP forwarding tables
§ flexibility: MPLS forwarding decisions can differ from those of IP• use destination and source addresses to route flows to
same destination differently (traffic engineering)• re-route flows quickly if link fails: pre-computed backup
paths (useful for VoIP)
6-21Link Layer and LANs
R2
DR3
R5
A
R6
MPLS versus IP paths
IP router§ IP routing: path to destination determined
by destination address alone
R4
6-22Link Layer and LANs
R2
DR3R4
R5
A
R6
MPLS versus IP paths
IP-onlyrouter
§ IP routing: path to destination determined by destination address alone
MPLS and IP router
§ MPLS routing: path to destination can be based on source and destination address
• fast reroute: precompute backup routes in case of link failure
entry router (R4) can use different MPLS routes to A based, e.g., on source address
6-23Link Layer and LANs
Link layer, LANs: outline
6.1 introduction, services6.2 error detection,
correction 6.3 multiple access
protocols6.4 LANs• addressing, ARP• Ethernet• switches• VLANS
6.5 link virtualization: MPLS
6.6 data center networking
6-24Link Layer and LANs
Data center networks
§ 10’s to 100’s of thousands of hosts, often closely coupled, in close proximity:• e-business (e.g. Amazon)• content-servers (e.g., YouTube, Akamai, Apple, Microsoft)• search engines, data mining (e.g., Google)
§ challenges:§ multiple applications, each
serving massive numbers of clients
§ managing/balancing load, avoiding processing, networking, data bottlenecks
Inside a 40-ft Microsoft container, Chicago data center
6-25Link Layer and LANs
Server racks
Top-Of-Rack switches
Tier-1 switches
Tier-2 switches
Load balancer
Load balancer
B
1 2 3 4 5 6 7 8
A C
Border router
Access router
Data center networks load balancer: application-layer routing§ receives external client requests§ directs workload within data center§ returns results to external client (hiding data
center internals from client)
6-26Link Layer and LANs
Internet
Server racks
TOR switches
Tier-1 switches
Tier-2 switches
1 2 3 4 5 6 7 8
Data center networks § rich interconnection among switches, racks:• increased throughput between racks (multiple routing paths
possible)• increased reliability via redundancy
6-27Link Layer and LANs
Link Layer Summary§ principles behind data link layer services:• error detection, correction• sharing a broadcast channel: multiple access• link layer addressing
§ instantiation and implementation of various link layer technologies• Ethernet• switched LANS, VLANs• virtualized networks as a link layer: MPLS
6-28Link Layer and LANs
Going deeper: Physical Layer!!
4-29
Physical Layer Outline1. Network Interface Card
• Circuit Theory2. Twisted pair
• Electromagnetism• The Maxwell equations
• Signal processing• Fourier transform; Laplace
transform; Z-transform3. Optic Fibre
• Optoelectronics• Optic waveguide• Material science: fluoride glass,
phosphate glass, chalcogenide glass4. USB
• connectors• cabling• power
6-30Link Layer and LANs
4. Wireless• Radio theory• Antenna• Modulation• Resonance
5. Bluetooth• Link manager• Host Controller• Radio frequency communication
6. Cellular• Cell signal encoding, Directional antennas,
movement cell to cell• GSM, GPRS, 3G, LTE, 5G
7. Information Theory• Shannon’s theorem• Entropy
8. Quantum communication• Quantum mechanics• Quantum information theory• Quantum teleportation
Too many things going on at the physical layer, so we’ll skip most of these.
Synthesis:A Day in the Life of a
Web Request
4-31
4-32
Synthesis: a day in the life of a web request
§ journey down protocol stack complete!• application, transport, network, link
§ 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
6-33Link Layer and LANs
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
6-34Link Layer and LANs
router(runs DHCP)
A day in the life… connecting to the Internet
§ connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP
DHCPUDPIPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDPIPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
§ DHCP request encapsulatedin UDP, encapsulated in IP, encapsulated in 802.3Ethernet
§ Ethernet frame broadcast(dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server
§ Ethernet demuxed to IP demuxed, UDP demuxed to DHCP
6-35Link Layer and LANs
router(runs DHCP)
§ DHCP server formulates DHCP ACK containing client�s IP address, IP address of first-hop router for client, name & IP address of DNS server
DHCPUDPIPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDPIPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
§ 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
§ DHCP client receives DHCP ACK reply
A day in the life… connecting to the Internet
6-36Link Layer and LANs
router(runs DHCP)
A day in the life… ARP (before DNS, before HTTP)
§ before sending HTTP request, need IP address of www.google.com: DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
§ DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. To send frame to router, need MAC address of router interface: ARP
§ ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface
§ client now knows MAC address of first hop router, so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
6-37Link Layer and LANs
router(runs DHCP)
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
§ IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
§ IP datagram forwarded from campus network into Comcast network, routed (tables created by RIP, OSPF, IS-IS and/or BGProuting protocols) to DNS server
§ demuxed to DNS server§ DNS server replies to client
with IP address of www.google.com
Comcast network 68.80.0.0/13
DNS serverDNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the life… using DNS
6-38Link Layer and LANs
router(runs DHCP)
A day in the life…TCP connection carrying HTTP
HTTPTCPIPEthPhy
HTTP
§ to send HTTP request, client first opens TCP socket to web server
§ TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
§ TCP connection established!64.233.169.105web server
SYN
SYN
SYN
SYN
TCPIPEthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
§ web server responds with TCP SYNACK (step 2 in 3-way handshake)
6-39Link Layer and LANs
router(runs DHCP)
A day in the life… HTTP request/reply HTTPTCPIPEthPhy
HTTP
§ HTTP request sent into TCP socket
§ IP datagram containing HTTP request routed to www.google.com
§ IP datagram containing HTTP reply routed back to client64.233.169.105
web server
HTTPTCPIPEthPhy
§ web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
§ web page finally (!!!) displayed
6-40Link Layer and LANs
Next Topic
One more thing:
Wireless and Mobile Network
6-41Link Layer and LANs
Wireless and Mobile NetworksBackground:§ # wireless (mobile) phone subscribers now exceeds #
wired phone subscribers (5-to-1)!§ # wireless Internet-connected devices equals #
wireline Internet-connected devices• laptops, Internet-enabled phones promise anytime untethered
Internet access
§ two important (but different) challenges• wireless: communication over wireless link• mobility: handling the mobile user who changes point of
attachment to network
7-42Wireless and Mobile Networks
Outline
7.1 Introduction
Wireless7.2 Wireless links,
characteristics• CDMA
6.73 IEEE 802.11 wireless LANs (�Wi-Fi�)
67.4 Cellular Internet Access• architecture• standards (e.g., 3G, LTE)
Mobility7.5 Principles: addressing and
routing to mobile users7.6 Mobile IP7.7 Handling mobility in
cellular networks7.8 Mobility and higher-layer
protocols
7-43Wireless and Mobile Networks
Elements of a wireless network
network infrastructure
7-44Wireless and Mobile Networks
wireless hosts§ laptop, smartphone§ run applications§ may be stationary (non-
mobile) or mobile• wireless does not always
mean mobility
Elements of a wireless network
network infrastructure
7-45Wireless and Mobile Networks
base station§ typically connected to
wired network§ 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
7-46Wireless and Mobile Networks
wireless link§ typically used to connect
mobile(s) to base station§ also used as backbone link § multiple access protocol
coordinates link access § various data rates,
transmission distance
Elements of a wireless network
network infrastructure
7-47Wireless and Mobile Networks
Characteristics of selected wireless links
Indoor10-30m
Outdoor50-200m
Mid-rangeoutdoor
200m – 4 Km
Long-rangeoutdoor
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
450 802.11n
Dat
a ra
te (M
bps)
7-48Wireless and Mobile Networks
1300 802.11 ac
infrastructure mode§ base station connects
mobiles into wired network
§ handoff: mobile changes base station providing connection into wired network
Elements of a wireless network
network infrastructure
7-49Wireless and Mobile Networks
ad hoc mode§ no base stations§ nodes can only
transmit to other nodes within link coverage
§ nodes organize themselves into a network: route among themselves
Elements of a wireless network
7-50Wireless and Mobile Networks
Wireless network taxonomy
single hop multiple hops
infrastructure(e.g., APs)
noinfrastructure
host connects to base station (WiFi,WiMAX, cellular) which connects to
larger Internet
no base station, noconnection to larger Internet (Bluetooth,
ad hoc nets)
host may have torelay through severalwireless nodes to connect to larger Internet: mesh net
no base station, noconnection to larger Internet. May have torelay to reach other a given wireless node
MANET, VANET
7-51Wireless and Mobile Networks
Outline
7.1 Introduction
Wireless7.2 Wireless links,
characteristics• CDMA
7.3 IEEE 802.11 wireless LANs (�Wi-Fi�)
7.4 Cellular Internet Access• architecture• standards (e.g., 3G, LTE)
Mobility7.5 Principles: addressing and
routing to mobile users7.6 Mobile IP7.7 Handling mobility in
cellular networks
7-52Wireless and Mobile Networks
Wireless Link Characteristicsimportant 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�
7-53Wireless and Mobile Networks
Code Division Multiple Access (CDMA)
§ 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�)
7-54Wireless and Mobile Networks
Outline
7.1 Introduction
Wireless7.2 Wireless links,
characteristics• CDMA
7.3 IEEE 802.11 wireless LANs (�Wi-Fi�)
7.4 Cellular Internet Access• architecture• standards (e.g., 3G, LTE)
Mobility7.5 Principles: addressing and
routing to mobile users7.6 Mobile IP7.7 Handling mobility in
cellular networks
7-55Wireless and Mobile Networks
IEEE 802.11 Wireless LAN802.11b§ 2.4-5 GHz unlicensed spectrum§ up to 11 Mbps802.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 600 Mbps
802.11ac: multiple antennae§ 2.4-5 GHz range§ up to 1300 Mbps
§ all use CSMA/CA for multiple access§ all have base-station and ad-hoc network versions
7-56Wireless and Mobile Networks
802.11 LAN architecture
§ wireless host communicates with base station• base station = access
point (AP)
§ Basic Service Set (BSS) (aka �cell�) in infrastructure mode contains:• wireless hosts• access point (AP): base
stationBSS 1
BSS 2
Internet
hub, switchor router
7-57Wireless and Mobile Networks
802.11: Channels, association§ 802.11b: 2.4GHz-2.485GHz spectrum divided into 11
channels at different frequencies• AP admin chooses frequency for AP• interference possible: channel can be same as that
chosen by neighboring AP!
§ host: must associate with an AP• scans channels, listening for beacon frames containing
AP�s name (SSID) and MAC address• selects AP to associate with• may perform authentication• will typically run DHCP to get IP address in AP�s
subnet7-58Wireless and Mobile Networks
802.11: passive/active scanning
AP 2AP 1
H1
BBS 2BBS 1
12 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 2AP 1
H1
BBS 2BBS 1
1223 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
7-59Wireless and Mobile Networks
IEEE 802.11: multiple access§ avoid collisions: 2+ nodes transmitting at same time§ 802.11: CSMA - sense before transmitting
• don�t collide with ongoing transmission by other node
§ 802.11: no collision detection!• can�t sense all collisions: hidden terminal, fading• goal: avoid collisions: CSMA/CA (Collision Avoidance)
space
AB
CA B C
A�s signalstrength
C�s signalstrength
7-60Wireless and Mobile Networks
Avoiding collisionsidea: allow sender to �reserve� channel rather than random
access of data frames: avoid collisions of long data frames§ sender first transmits small request-to-send (RTS) packets
to BS using CSMA• RTSs may still collide with each other (but they�re short)
§ BS broadcasts clear-to-send CTS in response to RTS§ CTS (with sender’s ID) heard by all nodes
• sender transmits data frame• other stations defer transmissions
avoid data frame collisions completely using small reservation packets!
7-61Wireless and Mobile Networks
Collision Avoidance: RTS-CTS exchange
APA B
time
RTS(A)RTS(B)
RTS(A)
CTS(A) CTS(A)
DATA (A)
ACK(A) ACK(A)
reservation collision
defer
7-62Wireless and Mobile Networks
Outline
7.1 Introduction
Wireless7.2 Wireless links,
characteristics• CDMA
7.3 IEEE 802.11 wireless LANs (�Wi-Fi�)
7.4 Cellular Internet access• architecture• standards (e.g., 3G,
LTE)
Mobility7.5 Principles: addressing and
routing to mobile users7.6 Mobile IP7.7 Handling mobility in
cellular networks
7-63Wireless and Mobile Networks