E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
1
EE 586 Communication andSwitching Networks
Lecture 23
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-2
underline_base
Link layer, LANs: outline
5.1 introduction, services
5.2 error detection,correction
5.3 multiple accessprotocols
Taking Turn MAC
5.4 LANs
addressing, ARP
Ethernet
switches
VLANS
5.5 link virtualization:MPLS
5.6 data centernetworking
5.7 a day in the life of aweb request
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-3
underline_base
Taking turns MAC protocols
channel partitioning MAC protocols:
share channel efficiently and fairly at high load
inefficient at low load: delay in channel access, 1/Nbandwidth allocated even if only 1 active node!
random access MAC protocols
efficient at low load: single node can fully utilizechannel
high load: collision overhead
taking turns protocols
look for best of both worlds!
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-4
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
polling:
master node invitesslave nodes to transmitin turn
typically used withdumb slave devices
concerns:
polling overhead
latency
single point offailure (master)
IEEE 802.15 andbluetooth
master
slaves
poll
data
data
underline_base
Taking turns MAC protocols
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-5
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
token passing:
control token passedfrom one node to nextsequentially.
token message
concerns:
token overhead
latency
single point of failure(token)
FDDI and IEEE 802.5
 
T
data
(nothing
to send)
T
underline_base
Taking turns MAC protocols
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-6
Ethernet
dominant wired LAN technology:
cheap $20 for NIC
first widely used LAN technology
simpler, cheaper than token LANs and ATM
kept up with speed race: 10 Mbps – 10 Gbps
551 metcalfe-enet
Metcalfes Ethernet sketch (1972, Xerox Parc)
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-7
802.3 Ethernet standards: link & physical layers
many different Ethernet standards
common MAC protocol and frame format
different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps,10G bps
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
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-8
Ethernet: unreliable, connectionless
connectionless: no handshaking between sending andreceiving NICs
unreliable: receiving NIC doesnt send acks or nacksto sending NIC
data in dropped frames recovered only if initialsender uses higher layer rdt (e.g., TCP), otherwisedropped data lost
Ethernets MAC protocol: unslotted CSMA/CD wthbinary backoff
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-9
Ethernet frame structure
sending adapter encapsulates IP datagram (or othernetwork layer protocol packet) in Ethernet frame
preamble:
7 bytes with pattern 10101010 followed by onebyte with pattern 10101011
 used to synchronize receiver, sender clock rates
underline_base
dest.
address
source
address
data(payload)
CRC
preamble
type
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-10
Ethernet frame structure (more)
addresses: 6 byte source, destination MAC addresses
if adapter receives frame with matching destinationaddress, or with broadcast address (e.g. ARP packet), itpasses data in frame to network layer protocol
otherwise, adapter discards frame
type: indicates higher layer protocol (mostly IP butothers possible, e.g., Novell IPX, AppleTalk)
CRC: cyclic redundancy check at receiver
error detected: frame is dropped
underline_base
dest.
address
source
address
data(payload)
CRC
preamble
type
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
underline_base
5-11
Ethernet: physical topology
bus: popular through mid 90s
all nodes in same collision domain (can collide with eachother)
star: prevails today
active switch in center
each spoke runs a (separate) Ethernet protocol (nodesdo not collide with each other)
switch
bus: coaxial cable
star
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-12
Switch: multiple simultaneous transmissions
hosts have dedicated, directconnection to switch
switches buffer packets
Ethernet protocol used on eachincoming link, but no collisions;full duplex
each link is its own collisiondomain
switching: A-to-A and B-to-Bcan transmit simultaneously,without collisions
switch with six interfaces
(1,2,3,4,5,6)
A
A
B
B
C
C
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
1
2
3
4
5
6
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
A
A
B
B
C
C
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
1
2
3
4
5
6
5-13
Switch: self-learning
switch learns which hostscan be reached throughwhich interfaces
when frame received,switch learns  locationof sender: incomingLAN segment
records sender/locationpair in switch table
A  A
Source: A
Dest: A
MAC addr   interface    TTL
Switch table
(initially empty)
A
1
60
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
A
A
B
B
C
C
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
1
2
3
4
5
6
5-14
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
frame destination, A,locaton unknown:
flood
A A
destination A locationknown:
A
4
60
            selectively send
on just one link
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-15
Switch: frame filtering/forwarding
when  frame received at switch:
1. record incoming link, MAC address of sending host
2. index switch table using MAC source address
3. if entry found for destinationthen {
     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 */
 
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-16
Interconnecting switches
switches can be connected together
Q: sending from A to G - how does S1 know toforward frame destined to F via S4 and S3?
A: self learning! (works exactly the same as insingle-switch case!)
A
B
S1
C
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
D
E
F
S2
S4
S3
H
I
G
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
desktop_computer_stylized_medium
underline_base
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
5-17
Switches vs. routers
both are store-and-forward:
routers: network-layerdevices (examine network-layer headers)
switcheslink-layer devices(examine link-layer headers)
both have forwarding tables:
routers: compute tables usingrouting algorithms, IPaddresses
switches: learn forwardingtable 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
desktop_computer_stylized_medium
desktop_computer_stylized_medium
underline_base
ROUTER
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
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 alllayers) involved in seemingly simple scenario:requesting www page
scenario: student attaches laptop to campus network,requests/receives www.google.com
underline_base
18
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
A day in the life: scenario
Comcast network
68.80.0.0/13
Googles network
64.233.160.0/19
64.233.169.105
web server
DNS server
school network
68.80.2.0/24
web page
browser
laptop_stylized_small
antenna_stylized
underline_base
19
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
router
(runs DHCP)
laptop_stylized_small
antenna_stylized
A day in the life… connecting to the Internet
connecting laptop needs toget its own IP address, addrof first-hop router, addr ofDNS server: use DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP request encapsulatedin UDP, encapsulated in IP,encapsulated in 802.3Ethernet
Ethernet frame broadcast(dest: FFFFFFFFFFFF) on LAN,received at router runningDHCP server
Ethernet demuxed to IPdemuxed, UDP demuxed toDHCP
underline_base
20
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
router
(runs DHCP)
laptop_stylized_small
antenna_stylized
DHCP server formulatesDHCP ACK containingclients IP address, IPaddress of first-hop routerfor client, name & IPaddress of DNS server
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCPserver, frame forwarded(switch learning) throughLAN, demultiplexing atclient
Client now has IP address, knows name & addr of DNS
server, IP address of its first-hop router
DHCP client receivesDHCP ACK reply
A day in the life… connecting to the Internet
underline_base
21
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
router
(runs DHCP)
laptop_stylized_small
antenna_stylized
A day in the life… ARP (before DNS, before HTTP)
before sending HTTP request, needIP address of www.google.com:DNS
DNS
UDP
IP
Eth
Phy
DNS
DNS
DNS
DNS query created, encapsulated inUDP, encapsulated in IP,encapsulated in Eth.  To send frameto router, need MAC address ofrouter interface: ARP
ARP query broadcast, received byrouter, which replies with ARPreply giving MAC address ofrouter interface
client now knows MAC addressof first hop router, so can nowsend frame containing DNSquery
ARP query
Eth
Phy
ARP
ARP
ARP reply
underline_base
22
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
router
(runs DHCP)
laptop_stylized_small
antenna_stylized
DNS
UDP
IP
Eth
Phy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNSquery forwarded via LANswitch from client to 1st hoprouter
IP datagram forwarded fromcampus network into comcastnetwork, routed (tables createdby RIP, OSPF, IS-IS and/or BGProuting protocols) to DNS server
demuxed to DNS server
DNS server replies to clientwith IP address ofwww.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
underline_base
23
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
router
(runs DHCP)
laptop_stylized_small
antenna_stylized
A day in the life…TCP connection carrying HTTP
HTTP
TCP
IP
Eth
Phy
HTTP
to send HTTP request,client first opens TCPsocket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domainrouted to web server
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
web server responds with TCPSYNACK (step 2 in 3-wayhandshake)
underline_base
24
E l e c t r i c a l    &   C o m p u t e r
Department of
Electrical & Computer Engineering
router
(runs DHCP)
laptop_stylized_small
antenna_stylized
A day in the life… HTTP request/reply
HTTP
TCP
IP
Eth
Phy
HTTP
HTTP request sent intoTCP socket
IP datagram containing HTTPrequest routed towww.google.com
IP datagram containing HTTPreply routed back to client
64.233.169.105
web server
HTTP
TCP
IP
Eth
Phy
web server responds withHTTP reply (containing webpage)
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally (!!!) displayed
underline_base
25