Computer Networking Michaelmas/Lent Term M/W/F 11:00-12:00 LT1 in Gates Building Slide Set 1
Computer Networking Michaelmas/Lent Term M/W/F 11:00-12:00 LT1 in Gates Building Slide Set 1
Computer Networking Michaelmas/Lent Term M/W/F 11:00-12:00 LT1 in Gates Building Slide Set 1
Michaelmas/Lent Term
M/W/F 11:00-12:00
LT1 in Gates Building
Slide Set 1
Andrew W. Moore
[email protected]
2014-2015
1
Topic 1 Foundation
• Administrivia
• Networks
• Channels
• Multiplexing
• Performance: loss, delay, throughput
2
Course Administration
Commonly Available Texts
Computer Networking: A Top-Down Approach
Kurose and Ross, 6th edition 2013, Addison-Wesley
(5th edition is also commonly available)
Computer Networks: A Systems Approach
Peterson and Davie, 5th edition 2011, Morgan-Kaufman
3
Thanks
• Slides are a fusion of material from
Ian Leslie, Richard Black, Jim Kurose, Keith Ross, Larry Peterson, Bruce Davie,
Jen Rexford, Ion Stoica, Vern Paxson, Scott Shenker, Frank Kelly, Stefan
Savage, Jon Crowcroft , Mark Handley, Sylvia Ratnasamy, and Adam
Greenhalgh (and to those others I’ve forgotten, sorry.)
• Supervision material is drawn from
Stephen Kell, Andy Rice, and the fantastic TA teams of 144 and 168
• Practical material will become available through this year
But would be impossible without Georgina Kalogeridou,
Nick McKeown, Bob Lantz, Te-Yuan Huang and Vimal Jeyakumar
• Finally thanks to the Part 1b students past and Andrew Rice for all
the tremendous feedback.
4
What is a network?
• A system of “links” that interconnect “nodes”
in order to move “information” between nodes
• Internet
• Telephone network
• Transportation networks
• Cellular networks
• Supervisory control and data acquisition networks
• Optical networks
• Sensor networks
We will focus almost exclusively on the Internet
6
The Internet is
transforming everything
• The way we do business
– E-commerce, advertising, cloud-computing
• The way we have relationships
– Facebook friends, E-mail, IM, virtual worlds
• The way we learn
– Wikipedia, MOOCs, search engines
• The way we govern and view law
– E-voting, censorship, copyright, cyber-attacks
8
Internet research has impact
9
But why is the Internet interesting?
“What’s your formal model for the Internet?” -- theorists
11
A federated system
• The Internet ties together different networks
– >18,000 ISP networks
12
A federated system
The Internet ties together different networks
>18,000 ISP networks
13
Tremendous scale
• 3 Billion users (43% of world population)
• 1+ Trillion unique URLs
• 194 Billion emails sent per day
• 1.75 Billion smartphones
• 1.23 Billion Facebook users
• 50 Billion WhatsApp messages per day
• 2 Billion YouTube videos watched per day
• Routers that switch 92Terabits/second
• Links that carry 400Gigabits/second
14
Enormous diversity and
dynamic range
• Communication latency: microseconds to seconds (106)
• Bandwidth: 1Kbits/second to 100 Gigabits/second (107)
• Packet loss: 0 – 90%
Today
• 100+Gigabits/second backbone links
• 5B+ devices, all over the globe
• 20M Facebook apps installed per day
16
Asynchronous Operation
• Consider:
– How many cycles does your 3GHz CPU in Cambridge
execute before it can possibly get a response from a
message it sends to a server in Palo Alto?
• Cambridge to Palo Alto: 8,609 km
• Traveling at 300,000 km/s: 28.70 milliseconds
• Then back to Cambridge: 2 x 28.70 = 57.39 milliseconds
• 3,000,000,000 cycles/sec * 0.05739 = 172,179,999 cycles!
• Plus, recall
– scale lots of components
– asynchrony takes a long time to hear (bad) news
– federation (internet) hard to identify fault or assign blame
18
An Engineered System
• Constrained by what technology is practical
– Link bandwidths
– Switch port counts
– Bit error rates
– Cost
–…
19
Recap: The Internet is…
• A complex federation
• Of enormous scale
• Dynamic range
• Diversity
• Constantly evolving
• Asynchronous in operation
• Failure prone
• Constrained by what’s practical to engineer
• Too complex for theoretical models
• “Working code” doesn’t mean much
• Performance benchmarks are too narrow 20
Performance – not just bits per second
Second order effects
• Image/Audio quality
Other metrics…
• Network efficiency (good-put versus throughput)
• Others? 21
Channels Concept
(This channel definition is very abstract)
• Peer entities communicate over channels
• Peer entities provide higher-layer peers with
higher-layer channels
22
Channel Characteristics
Symbol type: bits, packets, waveform Reliability
Capacity: bandwidth, data-rate, Security: privacy, unforgability
packet-rate Order preserving: always, almost,
Delay: fixed or variable usually
Fidelity: signal-to-noise, bit error rate, Connectivity: point-to-point, to-many,
packet error rate many-to-many
Cost: per attachment, for use
23
Example Physical Channels
these example physical channels are also known as Physical Media
Twisted Pair (TP) Coaxial cable: Fiber optic cable:
• two insulated copper • two concentric copper • high-speed operation
wires conductors • point-to-point
– Category 3: traditional • bidirectional transmission
phone wires, 10 Mbps • baseband: • (10’s-100’s Gps)
Ethernet – single channel on cable • low error rate
– Category 6: – legacy Ethernet • immune to
1Gbps Ethernet • broadband: electromagnetic
• Shielded (STP) – multiple channels on noise
cable
• Unshielded (UTP) – HFC (Hybrid Fiber Coax)
24
More Physical media: Radio
• Bidirectional and multiple Radio link types:
terrestrial microwave
access
e.g. 45 Mbps channels
• propagation environment LAN (e.g., Wifi)
effects: 11Mbps, 54 Mbps, 200 Mbps
– reflection wide-area (e.g., cellular)
– obstruction by objects 4G cellular: ~ 4 Mbps
– interference satellite
Kbps to 45Mbps channel (or
multiple smaller channels)
270 msec end-end delay
geosynchronous versus low
altitude
25
Nodes and Links
A B
Channels = Links
Peer entities = Nodes
26
Properties of Links (Channels)
Latency
28
Packet Delay
Sending a 100B packet from A to B?
A B
1Mbps, 1ms
time=0
Time to transmit
Time when that
one bit = 1/106s
bit reaches B
Time to transmit 100Byte packet
= 1/106+1/103s
800 bits=800x1/106s
100Byte packet
The last bit in the file The last bit The last bit
reaches B at Time reaches B at reaches B at
(107x800x1/109)+1/103s (800x1/109)+1/103s (800x1/106)+1/103s
= 8001ms = 1.0008ms = 1.8ms
30
Packet Delay: The “pipe” view
Sending 100B packets from A to B?
A B
1Mbps, 10ms
Packet Transmission
Time
100Byte packet
Time
100Byte packet
31
Packet Delay: The “pipe” view
Sending 100B packets from A to B?
time
BW
time
time 32
Packet Delay: The “pipe” view
Sending 100B packets from A to B?
time
time
33
Recall Nodes and Links
A B
34
What if we have more nodes?
37
Circuit switching
Idea: source reserves network capacity along a path
10Mb/s?
A B
10Mb/s?
10Mb/s?
39
Circuit Switching: FDM and TDM
Example:
Frequency Division Multiplexing
4 users
Radio2 88.9 MHz
Radio3 91.1 MHz
frequency Radio4 93.3 MHz
RadioX 95.5 MHz
time
Time Division Multiplexing
Radio Schedule
…,News, Sports, Weather, Local, News, Sports,…
frequency
time
40
Time-Division Multiplexing/Demultiplexing
Frames
Slots = 0 1 2 3 4 5 0 1 2 3 4 5
Circuit
Establishment
Transfer
Information
time
Circuit
Tear-down
42
Circuit switching: pros and cons
• Pros
– guaranteed performance
– fast transfer (once circuit is established)
• Cons
43
Timing in Circuit Switching
Circuit
Establishment
Transfer
Information
time
Circuit
Tear-down
44
Circuit switching: pros and cons
• Pros
– guaranteed performance
– fast transfer (once circuit is established)
• Cons
– wastes bandwidth if traffic is “bursty”
45
Timing in Circuit Switching
Circuit
Establishment
Transfer
Information
time
Circuit
Tear-down
46
Timing in Circuit Switching
Circuit
Establishment
Transfer Information
Circuit
Tear-down
time
47
Circuit switching: pros and cons
• Pros
– guaranteed performance
– fast transfers (once circuit is established)
• Cons
– wastes bandwidth if traffic is “bursty”
– connection setup time is overhead
48
Circuit switching
• Cons
– wastes bandwidth if traffic is “bursty”
– connection setup time is overhead
– recovery from failure is slow
50
Numerical example
• How long does it take to send a file of 640,000
bits from host A to host B over a circuit-
switched network?
– All links are 1.536 Mbps
– Each link uses TDM with 24 slots/sec
– 500 msec to establish end-to-end circuit
1 / 24 * 1.536Mb/s = 64kb/s
640,000 / 64kb/s = 10s
Let’s work it out! 10s + 500ms = 10.5s
51
Two forms of switched networks
• Circuit switching (e.g., telephone network)
• Packet switching (e.g., Internet)
52
Packet Switching
• Data is sent as chunks of formatted bits (Packets)
• Packets consist of a “header” and “payload”*
1. Internet Address
2. Age (TTL)
3. Checksum to protect header
Data Header
payload
01000111100010101001110100011001 header
54
Packet Switching
• Data is sent as chunks of formatted bits (Packets)
• Packets consist of a “header” and “payload”
• Switches “forward” packets based on their
headers
55
Switches forward packets
GLASGOW
EDINBURGH
switch#4 switch#2
Forwarding Table
111010010 EDIN
Destination Next Hop
GLASGOW 4
OXFORD 5
EDIN 2
UCL 3
switch#5
OXFORD UCL
switch#3
56
Timing in Packet Switching
h
paylo
d
ad r
time What about the time to process the packet at the switch?
• We’ll assume it’s relatively negligible (mostly true)
57
Timing in Packet Switching
h
paylo
d
ad r
h
paylo
d
ad r
60
Packet Switching
• Data is sent as chunks of formatted bits (Packets)
• Packets consist of a “header” and “payload”
• Switches “forward” packets based on their
headers
• Each packet travels independently
– no notion of packets belonging to a “circuit”
61
Packet Switching
• Data is sent as chunks of formatted bits (Packets)
• Packets consist of a “header” and “payload”
• Switches “forward” packets based on their
headers
• Each packet travels independently
• No link resources are reserved in advance.
Instead packet switching leverages statistical
multiplexing (stat muxing)
62
Multiplexing
Time
Data Rate 2
Capacity
Time
Data Rate 3
Time 64
When Each Flow Gets 1/3rd of Capacity
Data Rate 1 Frequent Overloading
Time
Data Rate 2
Time
Data Rate 3
Time 65
When Flows Share Total Capacity
Time
No Overloading
Time
Time
Data Rate 2
Capacity
Time
Data Rate 3
Time 67
Three Flows with Bursty Traffic
Data Rate 1
Time
Data Rate 2
Capacity
Time
Data Rate 3
Time 68
Three Flows with Bursty Traffic
Time
Capacity
Time
pkt tx
time
BW
time
70
Statistical multiplexing: pipe view
71
Statistical multiplexing: pipe view
No Overload
72
Statistical multiplexing: pipe view
Queue overload
into Buffer
Transient Overload
Not such a rare event
73
Statistical multiplexing: pipe view
Queue overload
into Buffer
Transient Overload
Not such a rare event
74
Statistical multiplexing: pipe view
Queue overload
into Buffer
Transient Overload
Not such a rare event
75
Statistical multiplexing: pipe view
Queue overload
into Buffer
Transient Overload
Not such a rare event
76
Statistical multiplexing: pipe view
Queue overload
into Buffer
Transient Overload
Not such a rare event
77
Statistical multiplexing: pipe view
Queue overload
into Buffer
Transient Overload
Buffer absorbs transient
Not a rarebursts
event!
78
Statistical multiplexing: pipe view
Queue overload
into Buffer
80
(* plus per-hop processing delay that we define as negligible)
Queuing delay
• R=link bandwidth (bps)
• L=packet length (bits)
• a=average packet arrival
rate
81
Recall the Internet federation
• The Internet ties together different networks
– >18,000 ISP networks
82
“Real” Internet delays and routes
traceroute: rio.cl.cam.ac.uk to munnari.oz.au
(tracepath on pwf is similar)
Three delay measurements from
traceroute munnari.oz.au rio.cl.cam.ac.uk to gatwick.net.cl.cam.ac.uk
traceroute to munnari.oz.au (202.29.151.3), 30 hops max, 60 byte packets
1 gatwick.net.cl.cam.ac.uk (128.232.32.2) 0.416 ms 0.384 ms 0.427 ms
2 cl-sby.route-nwest.net.cam.ac.uk (193.60.89.9) 0.393 ms 0.440 ms 0.494 ms trans-continent
3 route-nwest.route-mill.net.cam.ac.uk (192.84.5.137) 0.407 ms 0.448 ms 0.501 ms link
4 route-mill.route-enet.net.cam.ac.uk (192.84.5.94) 1.006 ms 1.091 ms 1.163 ms
5 xe-11-3-0.camb-rbr1.eastern.ja.net (146.97.130.1) 0.300 ms 0.313 ms 0.350 ms
6 ae24.lowdss-sbr1.ja.net (146.97.37.185) 2.679 ms 2.664 ms 2.712 ms
7 ae28.londhx-sbr1.ja.net (146.97.33.17) 5.955 ms 5.953 ms 5.901 ms
8 janet.mx1.lon.uk.geant.net (62.40.124.197) 6.059 ms 6.066 ms 6.052 ms
9 ae0.mx1.par.fr.geant.net (62.40.98.77) 11.742 ms 11.779 ms 11.724 ms
10 ae1.mx1.mad.es.geant.net (62.40.98.64) 27.751 ms 27.734 ms 27.704 ms
11 mb-so-02-v4.bb.tein3.net (202.179.249.117) 138.296 ms 138.314 ms 138.282 ms
12 sg-so-04-v4.bb.tein3.net (202.179.249.53) 196.303 ms 196.293 ms 196.264 ms
13 th-pr-v4.bb.tein3.net (202.179.249.66) 225.153 ms 225.178 ms 225.196 ms
14 pyt-thairen-to-02-bdr-pyt.uni.net.th (202.29.12.10) 225.163 ms 223.343 ms 223.363 ms
15 202.28.227.126 (202.28.227.126) 241.038 ms 240.941 ms 240.834 ms
16 202.28.221.46 (202.28.221.46) 287.252 ms 287.306 ms 287.282 ms
17 * * *
18 * * * * means no response (probe lost, router not replying)
19 * * *
20 coe-gw.psu.ac.th (202.29.149.70) 241.681 ms 241.715 ms 241.680 ms
21 munnari.OZ.AU (202.29.151.3) 241.610 ms 241.636 ms 241.537 ms
83
Internet structure: network of networks
• a packet passes through many networks!
local
ISP Tier 3 local
local local
ISP ISP
ISP ISP
Tier-2 ISP Tier-2 ISP
Tier 1 ISP
local
ISP Tier 3 local
local local
ISP ISP
ISP ISP
Local and tier- 3 Tier-2 ISP Tier-2 ISP
ISPs are
customers of Tier 1 ISP
higher tier ISPs
connecting them
to rest of
Internet Tier 1 ISP
Tier 1 ISP Tier-2 ISP
local
Tier-2 ISP Tier-2 ISP
ISP
local local local
ISP ISP ISP 85
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
86
Internet structure: network of networks
• roughly hierarchical
• at center: “tier-1” ISPs (e.g., Verizon, Sprint, AT&T, Cable and
Wireless), national/international coverage
– treat each other as equals
87
Tier-1 ISP: e.g., Sprint
POP: point-of-presence
to/from backbone
peering
… …
.
…
…
to/from customers
88
Packet Switching
• Data is sent as chunks of formatted bits (Packets)
• Packets consist of a “header” and “payload”
• Switches “forward” packets based on their headers
• Each packet travels independently
• No link resources are reserved in advance. Instead
packet switching leverages statistical multiplexing
– allows efficient use of resources
– but introduces queues and queuing delays
89
Packet switching versus circuit switching
Packet switching may (does!) allow more users to use network
• 1 Mb/s link
• each user:
– 100 kb/s when “active”
– active 10% of time
N users
• circuit-switching: 1 Mbps link
– 10 users
• packet switching:
– with 35 users, probability Q: how did we get value 0.0004?
> 10 active at same time is
less than .0004
90
Packet switching versus circuit switching
Q: how did we get value 0.0004?
• 1 Mb/s link
• each user:
– 100 kb/s when “active”
– active 10% of time HINT: Binomial Distribution
• circuit-switching:
– 10 users
• packet switching:
– with 35 users, probability
> 10 active at same time is
less than .0004
91
Circuit switching: pros and cons
• Pros
– guaranteed performance
– fast transfers (once circuit is established)
• Cons
– wastes bandwidth if traffic is “bursty”
– connection setup adds delay
– recovery from failure is slow
92
Packet switching: pros and cons
• Cons
– no guaranteed performance
– header overhead per packet
– queues and queuing delays
• Pros
– efficient use of bandwidth (stat. muxing)
– no overhead due to connection setup
– resilient -- can `route around trouble’
93
Summary
• A sense of how the basic `plumbing’ works
– links and switches
– packet delays= transmission + propagation +
queuing + (negligible) per-switch processing
– statistical multiplexing and queues
– circuit vs. packet switching
94