20 - LANs Part II
20 - LANs Part II
application
transport
network
data link
physical
Link Layer
Local Area Networks (LANs) – Part II
Some slides are adapted from “Computer Networking – a Top-Down Approach”
© 1996-2012 by J.F Kurose and K.W. Ross, All Rights Reserved
Questions
• How does an Ethernet switch work?
• What are the differences between a switch
and a router?
• What/Why/How of VLANs?
• How do data center networks look like?
• How does a HTTP GET request message
reach its destination?
1
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
• transparent
– hosts are unaware of presence of switches
• plug-and-play, self-learning
– switches do not need to be configured
2
Switch Forwarding Table
Q: how does switch know A’ A
reachable via interface 4, B’ B
C’
reachable via interface 5?
❖ A: each switch has a switch 6 1 2
table, each entry:
5 4 3
▪ (MAC address of host, interface
to reach host, time stamp) B’ C
A A A’
• switch learns which hosts
can be reached through
C’ B
which interfaces
– when frame received, 6 1 2
switch “learns” location
of sender: incoming LAN 5 4 3
segment
– records sender/location B’ C
pair in switch table
A’
3
Switch: Frame filtering/forwarding
when frame received at switch:
A A A’
• frame destination, A’,
location unknown: flood C’ B
❖ destination A location 6 1 2
A’
4
Interconnecting Switches
❖ switches can be connected together
S4
S1
S3
A S2
F
D I
B C
G H
E
S4
S1
S3
A S2
F
D I
B C
G H
E
10
10
5
Institutional Network Example
mail server
to external
network
router web server
IP subnet
11
11
12
12
6
VLANs: Motivation
consider:
• 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
Computer
Computer destination MAC
Science Electrical
Engineering
Engineering address) must cross
entire LAN
– security/privacy,
efficiency issues
13
13
switch(es) supporting
VLAN capabilities can be … …
configured to define
Electrical Engineering Computer Science
multiple virtual LANS over (VLAN ports 1-8) (VLAN ports 9-16)
single physical LAN
… operates as multiple virtual switches
infrastructure.
1 7 9 15
2 8 10 16
… …
Electrical Engineering Computer Science
(VLAN ports 1-8) (VLAN ports 9-16)
14
14
7
Port-based VLAN
router
❖ traffic isolation: frames
to/from ports 1-8 can only
reach ports 1-8
▪ can also define VLAN based on
MAC addresses of endpoints, 15
1 7 9
rather than switch port 2 8 10 16
15
15
2 8 10 16 2 4 6 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
16
16
8
802.1Q VLAN Frame Format
type
type
dest. source
preamble
address address
data (payload) CRC 802.1Q frame
17
17
18
9
Data center networks – cont’d
load balancer: application-layer routing
▪ receives external client requests
▪ directs workload within data center
▪ returns results to external client (hiding data
Internet center internals from client)
Border router
Load Load
balancer Access router
balancer
Tier-1 switches
B
A C Tier-2 switches
TOR switches
Server racks
1 2 3 4 5 6 7 8
19
19
Tier-1 switches
Tier-2 switches
TOR switches
Server racks
1 2 3 4 5 6 7 8
20
20
10
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
21
21
school network
68.80.2.0/24
web page
22
22
11
A day in the life… connecting to the Internet
DHCP DHCP • connecting laptop needs to
DHCP UDP
IP
get its own IP address, addr
of first-hop router, addr of
DHCP
DHCP Eth
Phy DNS server: use DHCP
DHCP
23
24
24
12
A day in the life… ARP (before DNS, before HTTP)
DNS DNS • before sending HTTP request, need
DNS UDP IP address of www.google.com: DNS
DNS
ARP
IP
ARP query Eth
Phy ▪ DNS query created, encapsulated in
UDP, encapsulated in IP,
encapsulated in Eth. To send frame
ARP
to router, need MAC address of
ARP reply Eth
Phy router interface: ARP
▪ ARP query broadcast, received by
router
(runs DHCP) 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
25
25
router
▪ IP datagram forwarded from
(runs DHCP) campus network into Comcast
▪ IP datagram containing DNS network, routed (tables created
query forwarded via LAN by RIP, OSPF, IS-IS and/or BGP
switch from client to 1st hop routing protocols) to DNS server
router ▪ demuxed to DNS server
▪ DNS server replies to client
with IP address of
www.google.com
26
26
13
A day in the life…TCP connection carrying HTTP
HTTP
HTTP
SYNACK
SYN TCP
SYNACK
SYN IP
SYNACK
SYN Eth
Phy
27
27
28
14
Quote of The Day
29
29
15