cs/ee 143 communication networks steven low cms, ee, caltech fall 2012

43
cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Upload: brenton-leacock

Post on 02-Apr-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

cs/ee 143 Communication Networks

Steven LowCMS, EE, Caltech

Fall 2012

Page 2: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Warning

These notes are not self-contained, probably not understandable,

unless you also were in the lecture

They are supplement to not replacement for class attendance

Page 3: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Internet applications (2006)

Telephony Music TV & home theatre

Cloud computing

Finding your way

Mail

GamesLibrary at your finger tip

Social networking

Page 4: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Networking: 143, 144, 145

cs/ee 143 Communication Networks How to send information from A to B

cs/ee 144 Ideas Behind the Web How web technologies work

cs/ee 145 Projects in Networking Advanced project – propose your own topic

Understanding both theory and practice of networks

Page 5: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Networking: 143, 144, 145

143: transport layer and down

144: transport layer and up

145: project course

143/144/145 forms a project sequence for CS major

Another RSRG sequence: cs141abc

Page 6: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

143: Communication Networks

Page 7: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

144: Ideas behind the weba.k.a. What makes google tick?

Unique course that you can’tfind at any other school

The course will be a series of important topics from the web.

For each, we will learn- The theory behind the topic- Hands-on design, system building

Page 8: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Alumni Recommendation

The Caltech experience should give engineers skills in: Communication

Writing scientific papers, proposals, plans Speaking to science, government, business

audiences Working in teams

Project planning and management Division of labor; leadership Larger, global view of the world

Source: Mani Chandy

Page 9: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

RSRG courses and research

RSRG courses1. Learn by doing

1. Emphasis on creativity, problem-solving, research

2. Integrating courses, SURF, internships, theses, research opportunities in multiyear programs

3. Close interaction with faculty in and out of class

4. Interactive classes: “The lecture is dead.”

Source: Mani Chandy

Page 10: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Course website

http://courses.cms.caltech.edu/cs143/

Page 11: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

cs/ee 143 Communication Networks

Chapter 1 The Internet

Text: Walrand & Parakh, 2010

Steven LowCMS, EE, Caltech

Page 12: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

• Hosts, routers, links• IP addresses, domain name• Packet, header/trailer

Page 13: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Basic mechanisms

Packet switching No dedicated resources Packets may follow different paths Packets may be lost, error, out-of-order

Addressing Globally unique IP address Domain name Mapping from DN to IP may change

dynamically (DNS)

Page 14: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Basic mechanisms

Routing Destination based Routing decision may adapt to network

condition, e.g., failure

Error & loss recovery Retransmission of lost or erroneous pkt Typically done end-to-end

Flow & congestion control End-to-end Implicit feedback class project focus

Page 15: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Router

Page 16: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

CIDR notation

Example (IPv4)

18.128.33.0/24 = { 18.128.33.0 – 18.128.33.255 } = subnet mask 255.255.255.0

18.128.0.0/22 = { 18.128.0000 0000. 0000 0000 – 18.128.0000 0011. 1111 1111

} = { 18.128.0.0 – 18.128.3.255 }

subnet mask: prefix = first 24 bits

#addresses = 232-24 = 28

#addresses = 232-22 = 210

CIDR = classless inter-domain routing

Page 17: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

CIDR notation

0101

10

0 1

0 1

0 1 0 1

0 1

0 1

0

0 1

0 1

0 1 0 1

0 1

0 1

0

1

1

1010

Page 18: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

CIDR notation

0101

10

0 1

0 1

0 1 0 1

0 1

0 1

0

0 1

0 1

0 1 0 1

0 1

0 1

0

1

1

1010

0.0.0.0/1 1.0.0.0/1

Page 19: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

CIDR notation

0101

10

0 1

0 1

0 1 0 1

0 1

0 1

0

0 1

0 1

0 1 0 1

0 1

0 1

0

1

1

1010

0.0.0.0/2

1.0.0.0/1

0.1.0.0/2

1.1.0.0/3

Address blocks may be nested !e.g. 1.0.0.0/1 contains 1.1.0.0/3

Page 20: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Forwarding decision

Destination IP Output link

18.128.33.0/24 1

18.128.0.0/22 2

.... 3

.... 4

18.128.33.5Packet’s destination IP Output link ?

18.128.0010 0001. 0000 0000

18.128.0000 0000. 0000 0000

18.128.0010 0001. 0000 0101

entry 1:

entry 2:

destination:

Page 21: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Forwarding decision

0 1

18.128.0.0/18

18.128.0.0/22

18.128.33.0/24

18.128.0010 0001.0000 0000/24

18.128.0000 0000.0000 0000/22

output link 2 output link 1

Page 22: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Forwarding decision

0 1

18.128.0.0/18

18.128.0.0/22

18.128.33.0/24

Packet dest:18.128.33.5

output link 2 output link 1

Page 23: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Longest prefix matching

Destination IP Output link

18.128.33.0/24 1

18.128.0.0/22 2

.... 3

.... 4

18.128.33.5Packet’s destination IP Output link 1

It matches more with the first address block

18.128.0010 0001. 0000 0000

18.128.0000 0000. 0000 0000

18.128.0010 0001. 0000 0101

entry 1:

entry 2:

destination:

Page 24: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Longest prefix matching

Destination IP Output link

18.128.33.0/24 1

18.128.0.0/22 2

.... 3

.... 4

18.128.4.5Packet’s destination IP Output link 2

It matches more with the second address block

18.128.0010 0001. 0000 0000

18.128.0000 0000. 0000 0000

18.128.0000 0000. 0000 0101

entry 1:

entry 2:

destination:

Page 25: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Longest prefix matching

Destination IP Output link

192.168.52.0/22 1

192.168.50.0/23 2

192.168.48.0/22 3

.... 4

192.168.51.15Packet’s destination IP Output link 2

192.168.0011 0100. 0000 0000 entry 1:

entry 2:

entry 3:

192.168.0011 0010. 0000 0000

192.168.0011 0000. 0000 0000

destination: 192.168.0011 0011. 0010 0101

Even though it matchesboth entries 2 and 3, entry 2 has a longer prefix

entry 3 “contains” entry 2

Page 26: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Longest prefix matching

0 1

192.168.48.0/21

192.168.48.0/22

1

192.168.50.0/23

192.168.52.0/22

Subnets in routing tables may not be disjoint!Route to most specific address block

Page 27: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

How to construct routing table

Destination IP Output link

18.128.33.0/24 1

18.128.0.0/22 2

.... 3

.... 4

How do we make routing decisions?(Dijkstra, Bellman-Ford, BGP, ... Ch 5 Routing)

Page 28: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

cs/ee 143 Communication Networks

Chapter 2 Principles

Text: Walrand & Parakh, 2010

Steven LowCMS, EE, Caltech

Page 29: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Principles

SharingMetrics ScalabilityLayering

Application & technology independence

Application topology

Page 30: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Sharing

Packet switching, statistical multiplexing Queueing analysis

cf circuit switching in traditional telephone network

Page 31: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Sharing

Packet switching Circuit switching

Internet Traditional telephone nk

No dedicated resources Dedicated resources

No circuit setup/tear down Circuit setup/tear down

Queueing delay No queueing delay

Loose performance guarantee

Stricter performance guarantee

More efficient for bursty (data) traffic

Better for fixed rate traffic

Page 32: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Metrics

Link rate (bps) DSL e.g. 768kbps down, 256kbps up

Link bandwidth (Hz) Size of frequency band FM radio, wireless spectra, ... If link can transmit over [300Hz, 1MHz],

its bandwidth is ~1MHz

Link capacity (bps) Maximum link rate possible

SNRWC 1log2

Page 33: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Metrics Link capacity example

SNR = 220

W = 1MHz C = 106 log2(1+ 220) bit/s = 20 Mbps

link “rate” is often called link “bandwidth” in networking literature

Page 34: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Metrics

Throughput (bps) Bit rate actually achieved Example

MP3 file of 3MB transferred in 2 mins Throughput = 3MB / 2mins = 200 kbps

Generally less than link rate because of transmission and protocol overheads

throughput <= link rate <= link capacity

information theory

communication, coding theories

networking,protocol design

Page 35: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Window Flow Control

~ W packets per RTT Lost packet detected by missing ACK

RTT

time

time

Source

Destination

1 2 W

1 2 W

1 2 W

data ACKs

1 2 W

Page 36: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Metrics Delay and delay jitter (s)

Some applications care more about throughput, some about delay, some about delay jitter

M/M/1 queue

Little’s law

1

delay total T

TL

Page 37: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Queueing system

random arrival process with rate

pkts/s

random service time

with average s/pkt 1

Little’s law

Verifies directly for M/M/1, but holds much more generally

Extremely useful because of its generality

TL

Page 38: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Queueing system

random arrival process with rate

pkts/s

random service time

with average s/pkt 1

T

qTqL

LTL

qq TL

1

TTq

Page 39: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

M/M/1 queue

L systemin pkts# avg

Poisson arrival process with rate

pkts/s

Exponential service time

with average s/pkt 1

1delay totalavg T

/1 time waitingavg q TT

Page 40: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Scalability

Location-based addressing Example: IP is location based Ethernet is not Advantages

Reduce routing table size Simpler routing operation

Disadvantages Makes mobility hard Makes security hard

Page 41: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Scalability

Hierarchical Two level Autonomous system

Same administrative and/or economic domain Shortest path routing: OSPF, IS-IS

Inter-domain BGP

Both simplify routing

Page 42: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Scalability

Best effort service Simple TCP/IP layer

End-to-end principle Simple network, intelligent hosts Stateless routers

Packet carries its own state

Both simplify router fast big inexpensive routers

Latest (~decade) idea: software defined networking (SDN)

Page 43: Cs/ee 143 Communication Networks Steven Low CMS, EE, Caltech Fall 2012

Scalability

Hierarchical naming Easier on human DNS translation

Layering Application & technology independence

Application topology Client/server CDN P2P Cloud computing Social networking