Networking Primer - The Internet and the Link Layer ECE 256 Romit Roy Choudhury Dept.

Download Report

Transcript Networking Primer - The Internet and the Link Layer ECE 256 Romit Roy Choudhury Dept.

Networking Primer - The Internet
and the Link Layer
ECE 256
Romit Roy Choudhury
Dept. of ECE and CS
1
Slides are from ECE 156
Designed to help you recall undergrad material
Please be patient if you remember most of this …
2
On the Shoulders of Giants
 1961: Leonard Kleinrock published a work on packet
switching
 1962: J. Licklider described a worldwide network of
computers called Galactic Network
 1965: Larry Roberts designed the ARPANET that
communicated over long distance links
 1971: Ray Tomilson invents email at BBN
 1972: Bob Kahn and Vint Cerf invented TCP for reliable
packet transport
3
On the Shoulders of Giants …
 1973: David Clark, Bob Metcalfe implemented
TCP and designed ethernet at Xerox PARC
 1975: Paul Mockapetris developed DNS system
for host lookup
 1980: Radia Perlman invented spanning tree
algorithm for bridging separate networks
 Things snowballed from there on …
4
What we have today is beyond any of the
inventors’ imagination …
5
And YOU are here
6
And by “YOU” I mean …
7
“Cool” internet appliances
Web-enabled toaster +
weather forecaster
IP picture frame
http://www.ceiva.com/
World’s smallest web server
http://www-ccs.cs.umass.edu/~shri/iPic.html
Internet phones
8
And Of Course real people …
9
InterNetwork
 Millions of end points (you, me, and toasters)
connected across a mesh of links
 Many end points can be addressed by numbers
 Many others lie behind a virtual end point
 Many networks form a bigger network
 The overall strcture called the Internet
 With a capital I
 Defined as a network of networks
10
Internet structure: network of networks
 roughly hierarchical
 at center: “tier-1” ISPs (e.g., MCI, Sprint, AT&T, Cable and
Wireless), national/international coverage
 treat each other as equals
Tier-1
providers
interconnect
(peer)
privately
Tier 1 ISP
Tier 1 ISP
NAP
Tier-1 providers
also interconnect
at public network
access points
(NAPs)
Tier 1 ISP
11
Tier-1 ISP: e.g., Sprint
Sprint US backbone network
Seattle
Tacoma
DS3 (45 Mbps)
OC3 (155 Mbps)
OC12 (622 Mbps)
OC48 (2.4 Gbps)
POP: point-of-presence
to/from backbone
Stockton
…
…
Kansas City
.
…
Anaheim
peering
…
…
San Jose
Cheyenne
New York
Pennsauken
Relay
Wash. DC
Chicago
Roachdale
Atlanta
to/from customers
Fort Worth
Orlando
12
Internet structure: network of networks
 “Tier-2” ISPs: smaller (often regional) ISPs
 Connect to one or more tier-1 ISPs, possibly other tier-2 ISPs
 France telecome, Tiscali, etc. buys from Sprint
Tier-2 ISP pays
tier-1 ISP for
connectivity to
rest of Internet
Tier-2 ISP
Tier-2 ISP
Tier 1 ISP
Tier 1 ISP
Tier-2 ISP
NAP
Tier 1 ISP
Tier-2 ISPs
also peer
privately with
each other,
interconnect
at NAP
Tier-2 ISP
Tier-2 ISP
13
Internet structure: network of networks
 “Tier-3” ISPs and local ISPs (Time Warner, Earthlink, etc.)
 last hop (“access”) network (closest to end systems)
local
ISP
Local and tier3 ISPs are
customers of
higher tier
ISPs
connecting
them to rest
of Internet
Tier 3
ISP
Tier-2 ISP
local
ISP
local
ISP
local
ISP
Tier-2 ISP
Tier 1 ISP
Tier 1 ISP
Tier-2 ISP
local
local
ISP
ISP
NAP
Tier 1 ISP
Tier-2 ISP
local
ISP
Tier-2 ISP
local
ISP
14
Internet structure: network of networks
 a packet passes through many networks!
 Local ISP (taxi) -> T1 (bus) -> T2 (domestic) -> T3 (international)
local
ISP
Tier 3
ISP
Tier-2 ISP
local
ISP
local
ISP
local
ISP
Tier-2 ISP
Tier 1 ISP
Tier 1 ISP
Tier-2 ISP
local
local
ISP
ISP
NAP
Tier 1 ISP
Tier-2 ISP
local
ISP
Tier-2 ISP
local
ISP
15
Organizing the giant structure
Networks are complex!
 many “pieces”:
 hosts
 routers
 links of various
media
 applications
 protocols
 hardware, software
Question:
Is there any hope of
organizing structure of
network?
16
Turn to analogies in air travel
ticket (purchase)
ticket (complain)
baggage (check)
baggage (claim)
gates (load)
gates (unload)
runway takeoff
runway landing
airplane routing
airplane routing
airplane routing
 a series of steps
17
Layering of airline functionality
ticket (purchase)
ticket (complain)
ticket
baggage (check)
baggage (claim
baggage
gates (load)
gates (unload)
gate
runway (takeoff)
runway (land)
takeoff/landing
airplane routing
airplane routing
airplane routing
departure
airport
airplane routing
airplane routing
intermediate air-traffic
control centers
arrival
airport
Layers: each layer implements a service
 layers communicate with peer layers
 rely on services provided by layer below
18
Why layering?
 explicit structure allows identification, relationship of
complex system’s pieces
 modularization eases maintenance, updating of
system
 change of implementation of layer’s service
transparent to rest of system
 e.g., change in aircraft runway does not affect
boarding gate
 layering considered harmful?
19
Protocol “Layers”
 Service of each layer encapsulated
 Universally agreed services called
PROTOCOLS
A large part of this course will focus on
designing protocols for
networking systems
20
Internet protocol stack
 application: supporting network applications
 FTP, SMTP, HTTP
 transport: host-host data transfer
 TCP, UDP
 network: routing of datagrams from source to
destination
 IP, routing protocols
 link: data transfer between neighboring
network elements
 PPP, Ethernet, WiFi, Bluetooth
application
transport
network
link
physical
 physical: bits “on the wire”
21
source
message
segment Ht
datagram Hn Ht
frame
Hl Hn Ht
M
M
M
M
Encapsulation
application
transport
network
link
physical
Hl Hn Ht
M
link
physical
Hl Hn Ht
M
switch
destination
M
Ht
M
Hn Ht
Hl Hn Ht
M
M
application
transport
network
link
physical
Hn Ht
Hl Hn Ht
M
M
network
link
physical
Hn Ht
Hl Hn Ht
M
M
router
22
PHY and Link Layer
23
PHY and Link Layer
 The Layers that make the connections




Sends signals on physical media
Schedules who gets to transmit
Detects transmission errors and collisions
Etc.
24
Physical Link / Media
 Guided media
 Twisted pair
 Coaxial cable
 Fiber optics
 Unguided media




terrestrial microwave up to 45 Mbps
WiFi LAN 11Mbps, 54 Mbps
Cellular Wide-area 3G: hundreds of kbps
Satellite Kbps to 45Mbps
25
Laying out Access networks
Q: How to connect end
systems to edge router?
 Mobile users
 Residential access nets
 Institutions, schools
 Backbones
26
Residential access: point to point access
 Dialup via modem
 up to 56Kbps direct access to
router (often less)
 Can’t surf and phone at same
time: can’t be “always on”
 ADSL: asymmetric digital subscriber line
 up to 1 Mbps upstream (today typically < 256 kbps)
 up to 8 Mbps downstream (today typically < 1 Mbps)
 FDM: 50 kHz - 1 MHz for downstream
4 kHz - 50 kHz for upstream
0 kHz - 4 kHz for ordinary telephone
27
Residential access: Networked
 Cable modems
 HFC: hybrid fiber coax
 asymmetric: up to 30Mbps downstream, 2 Mbps
upstream
 Network of cable/fiber attach homes to ISP router
• Homes share access to router
 Deployment: available via cable TV companies
28
Residential access: cable modems
Diagram: http://www.cabledatacomnews.com/cmic/diagram.html
29
Cable Network Architecture: Overview
Typically 500 to 5,000 homes
cable headend
cable distribution
network (simplified)
home
30
Cable Network Architecture: Overview
server(s)
cable headend
cable distribution
network
home
31
Cable Network Architecture: Overview
cable headend
cable distribution
network (simplified)
home
32
Cable Network Architecture: Overview
FDM:
V
I
D
E
O
V
I
D
E
O
V
I
D
E
O
V
I
D
E
O
V
I
D
E
O
V
I
D
E
O
D
A
T
A
D
A
T
A
C
O
N
T
R
O
L
1
2
3
4
5
6
7
8
9
Channels
cable headend
cable distribution
network
home
33
ADSL
 DSL is point to point
 Thus data rate does not
reduce when neighbor
uses DSL
 But, DSL uses twisted
pair
 Transmission technology
cannot support more
than ~10Mbps
Vs
Cable
 Cable modems share
pipe to the cable headend
 Data rate reduces when
neighbor surfing
 However, fiber optic lines
offer significantly higher
data rate (fat pipe)
 Even with neighbors, your
data rate can be higher
34
Wireless Access Networks
 shared wireless access network
connects end system to router
 via base station aka “access point”
 wireless LANs:
 802.11b/g (WiFi): 11 or 54 Mbps
router
base
station
 wider-area wireless access
 provided by telco operator
 4G, WiMax, LTE
• Will it happen??
mobile
hosts
35
Communication on Links
(Delay, Queuing, and Packet Loss)
36
How do loss and delay occur?
packets queue in router buffers
 packet arrival rate to link exceeds output link capacity
 packets queue, wait for turn
packet being transmitted (delay)
A
B
packets queueing (delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
37
Four sources of packet delay
 1. nodal processing:
 2. queueing
 check bit errors
 determine output link
 time waiting at output link
for transmission
 depends on congestion
level of router
transmission
A
propagation
B
nodal
processing
queueing
38
Delay in packet-switched networks
3. Transmission delay:
 R=link bandwidth (bps)
 L=packet length (bits)
 time to send bits into
link = L/R
transmission
A
4. Propagation delay:
 d = length of physical link
 s = propagation speed in
medium (~2x108 m/sec)
 propagation delay = d/s
Note: s and R are very
different quantities!
propagation
B
nodal
processing
queueing
39
Nodal delay
dnodal  dproc  dqueue  dtrans  dprop
 dproc = processing delay
 typically a few microsecs or less
 dqueue = queuing delay
 depends on congestion
 dtrans = transmission delay
 = L/R, significant for low-speed links
 dprop = propagation delay
 a few microsecs to hundreds of msecs
40
Queueing delay (revisited)
 R=link bandwidth (bps)
 L=packet length (bits)
 a=average packet arrival
rate
traffic intensity = La/R
 La/R ~ 0: average queueing delay small
 La/R -> 1: delays become large
 La/R > 1: more “work” arriving than can be
serviced, average delay infinite!
41
“Real” Internet delays and routes
 What do “real” Internet delay & loss look like?
 Traceroute program: provides delay measurement from source to
router along end-end Internet path towards destination. For all i:
 sends three packets that will reach router i on path towards destination
 router i will return packets to sender
 sender times interval between transmission and reply.
3 probes
3 probes
3 probes
42
“Real” Internet delays and routes
traceroute: gaia.cs.umass.edu to www.eurecom.fr
Three delay measurements from
gaia.cs.umass.edu to cs-gw.cs.umass.edu
1 cs-gw (128.119.240.254) 1 ms 1 ms 2 ms
2 border1-rt-fa5-1-0.gw.umass.edu (128.119.3.145) 1 ms 1 ms 2 ms
3 cht-vbns.gw.umass.edu (128.119.3.130) 6 ms 5 ms 5 ms
4 jn1-at1-0-0-19.wor.vbns.net (204.147.132.129) 16 ms 11 ms 13 ms
5 jn1-so7-0-0-0.wae.vbns.net (204.147.136.136) 21 ms 18 ms 18 ms
6 abilene-vbns.abilene.ucaid.edu (198.32.11.9) 22 ms 18 ms 22 ms
7 nycm-wash.abilene.ucaid.edu (198.32.8.46) 22 ms 22 ms 22 ms trans-oceanic
8 62.40.103.253 (62.40.103.253) 104 ms 109 ms 106 ms
link
9 de2-1.de1.de.geant.net (62.40.96.129) 109 ms 102 ms 104 ms
10 de.fr1.fr.geant.net (62.40.96.50) 113 ms 121 ms 114 ms
11 renater-gw.fr1.fr.geant.net (62.40.103.54) 112 ms 114 ms 112 ms
12 nio-n2.cssi.renater.fr (193.51.206.13) 111 ms 114 ms 116 ms
13 nice.cssi.renater.fr (195.220.98.102) 123 ms 125 ms 124 ms
14 r3t2-nice.cssi.renater.fr (195.220.98.110) 126 ms 126 ms 124 ms
15 eurecom-valbonne.r3t2.ft.net (193.48.50.54) 135 ms 128 ms 133 ms
16 194.214.211.25 (194.214.211.25) 126 ms 128 ms 126 ms
17 * * *
* means no response (probe lost, router not replying)
18 * * *
19 fantasia.eurecom.fr (193.55.113.142) 132 ms 128 ms 136 ms
43
Medium Access Control
In
Computer Networks
44
Random Access Protocols
 Trivial Solution: When node has packet to send
 transmit at full channel data rate R.
 no a priori coordination
 Two or more transmitting nodes ➜ “collision”
 Collision detected by comparing signal with channel content
 Random access MAC protocol specifies:
 how to schedule communications
 how to recover from collisions
 Examples of random access MAC protocols:
 slotted ALOHA
 ALOHA
 CSMA, CSMA/CD, CSMA/CA
45
Pure (unslotted) ALOHA
 unslotted Aloha: simple, no synchronization
 when frame first arrives
 transmit immediately
 collision probability increases:
 frame sent at t0 collides with other frames sent in [t0-1,t0+1]
46
Pure Aloha efficiency
P(success by given node) = P(node transmits) .
P(no other node transmits in [p0-1,p0] .
P(no other node transmits in [p0-1,p0]
= p . (1-p)N-1 . (1-p)N-1
= p . (1-p)2(N-1)
… choosing optimum p and then letting n -> infty ...
= 1/(2e) = .18
Very Poor !
47
Slotted ALOHA
Assumptions
 all frames same size
 time is divided into equal
size slots
 nodes start to transmit
frames only at beginning
of slots
 nodes are synchronized
Operation
 when node obtains fresh
frame, it transmits in next
slot
 no collision, node can send
new frame in next slot
 if collision, node retransmits
frame in each subsequent
slot with prob. p until
success
48
Slotted ALOHA
Pros
 single active node can
continuously transmit at full
rate of channel
 highly decentralized: only
slots in nodes need to be in
sync
 simple
Cons
 collisions, wasting slots
 idle slots
 nodes must be able to
detect collision in less
than time to transmit
packet
 clock synchronization
Why?
49
Slotted Aloha efficiency
 Suppose N nodes with many
frames to send, each
transmits in slot with
probability p
 prob that node 1 has
success in a slot
= p(1p)N-1
 prob that any node has a
success = Np(1-p)N-1
 For max efficiency with
N nodes, find p* that
maximizes
Np(1-p)N-1
 For many nodes, take
limit of Np*(1-p*)N-1 as N
goes to infinity, gives
1/e = .37
At best: channel
used for useful
transmissions 37%
of time!
50
CSMA (Carrier Sense Multiple Access)
CSMA: listen before transmit:
If channel sensed idle: transmit entire frame
 If channel sensed busy, defer transmission
 Human analogy: don’t interrupt others!
51
Don’t
transmit
Carrier Sensing
A
B
C
 Listen before you talk
 Carrier sense multiple access (CSMA)
 Defer transmission when signal on channel
Can collisions still occur?
52
Deterministic MAC protocols
Polling:
 master node “invites”
slave nodes to
transmit in turn
 concerns:
 polling overhead
 latency
 single point of failure
(master)
Token passing:
 control token passed from
one node to next sequentially.
 token message
 concerns:
 token overhead
 latency
 single point of failure (token)
53
Summary of MAC protocols
 What do you do with a shared media?
 Channel Partitioning, by time, frequency or code
• Time Division, Frequency Division
 Random partitioning (dynamic),
• ALOHA, S-ALOHA, CSMA, CSMA/CD
• carrier sensing: easy in some technologies (wire), hard in
others (wireless)
CSMA/CD used in Ethernet
CSMA/CA used in 802.11
•
•
 Taking Turns
• polling from a central site, token passing
54
Questions ?
55
Backup Slides
56
Wired Vs Wireless Media Access
Both are on shared media.
Then, what’s really the problem ?
57
Wired
A
B
C
 Collision Detection
 Tx can transmit and listen at the same time
• If (Transmitted_Signal != Sensed_Signal)
 Collision
 Channel Condition ~ identical at Tx and Rx
58
Wireless
 Collision Avoidance
 H/W can either transmit or receive
 While transmitting, cannot detect a collision
 Detection is based on SINR
• Thus must take educated decision when to transmit
 Channel Condition
 Tx unaware of signal quality at receiver
 Channel dispersion large – high uncertainty
59
Thoughts
 Please attend seminars
 Equivalent to reading 3 papers in 1 hour
 Priceless
 Check out the Comp. Eng Seminar series
• Lot of great speakers are scheduled over the semester
 People have begun selecting slots
 Please start looking
60
CSMA collisions
spatial layout of nodes
collisions can still occur:
propagation delay means
two nodes may not hear
each other’s transmission
collision:
entire packet transmission
time wasted
note:
role of distance & propagation
delay in determining collision
probability
61
CSMA/CD (Collision Detection)
CSMA/CD: carrier sensing, deferral as in CSMA
 collisions detected within short time
 colliding transmissions aborted, reducing channel
wastage
 collision detection:
 easy in wired LANs: measure signal strengths,
compare transmitted, received signals
 difficult in wireless LANs: receiver shut off while
transmitting
 human analogy: the polite conversationalist
62
CSMA/CD collision detection
63
Physical Media
 Bit: propagates between
transmitter/rcvr pairs
 physical link: what lies
between transmitter &
receiver
 guided media:
 signals propagate in solid
media: copper, fiber, coax
Twisted Pair (TP)
 two insulated copper
wires
 Category 3: traditional
phone wires, 10 Mbps
Ethernet
 Category 5:
100Mbps Ethernet
 unguided media:
 signals propagate freely, e.g.,
radio
64
Physical Media: coax, fiber
Coaxial cable:
 two concentric copper
conductors
 bidirectional
 baseband:
 single channel on cable
 legacy Ethernet
 broadband:
 multiple channels on
cable
 HFC
Fiber optic cable:
 glass fiber carrying light
pulses, each pulse a bit
 high-speed operation:
 high-speed point-to-point
transmission (e.g., 10’s-100’s
Gps)
 low error rate: repeaters
spaced far apart ; immune
to electromagnetic noise
65
Physical media: radio
 signal carried in
electromagnetic
spectrum
 no physical “wire”
 bidirectional
 propagation environment
effects:
 reflection
 obstruction by objects
 interference
Radio link types:
 terrestrial microwave
 e.g. up to 45 Mbps channels
 LAN (e.g., Wifi)
 11Mbps, 54 Mbps
 wide-area (e.g., cellular)
 e.g. 3G: hundreds of kbps
 satellite
 Kbps to 45Mbps channel (or
multiple smaller channels)
 270 msec end-end delay
 geosynchronous versus low
altitude
66
Applying the concepts later
 Several protocol designs will require solid
understanding of delay





Bandwidth estimation
TCP congestion control
TCP flow control
TCP loss discrimination
MAC protocols for wireless networks
67
Link Layer
 5.1 Introduction and
services
 5.2 Error detection and
correction
 5.3Multiple access
protocols
 5.4 Link-Layer
Addressing
 5.5 Ethernet
 5.6 Hubs and switches
 5.7 PPP
 5.8 Link Virtualization:
ATM and MPLS
68