Basic Concepts

91
Basic Concepts EE 122, Fall 2013 Sylvia Ratnasamy http://inst.eecs.berkeley.edu/ ~ee122/

description

Basic Concepts. EE 122, Fall 2013 Sylvia Ratnasamy http://inst.eecs.berkeley.edu/~ee122/. Administrivia. Instructional account forms have been sent by email to registered students (not wait list) you should have them by now email apanda@eecs and sylvia@eecs if you don ’ t - PowerPoint PPT Presentation

Transcript of Basic Concepts

Page 1: Basic Concepts

Basic Concepts

EE 122, Fall 2013

Sylvia Ratnasamy

http://inst.eecs.berkeley.edu/~ee122/

Page 2: Basic Concepts

Administrivia

Instructional account forms have been sent by email to registered students (not wait list) you should have them by now email apanda@eecs and sylvia@eecs if you don’t

Size of discussion sections raised to 45

Reminder: sections start this Friday

Page 3: Basic Concepts

Today

Basic concepts links packet delays circuit switching packet (datagram) switching

Layering (if we have time)

Page 4: Basic Concepts

Nodes and Links

A B

Page 5: Basic Concepts

Properties of Links

Bandwidth (capacity): “width” of the link number of bits sent (or received) per unit time (bits/sec or bps)

Latency (delay): “length” of the link propagation time for data to travel along the link (seconds)

Bandwidth-Delay Product (BDP): “volume” of the link amount of data that can be “in flight” at any time propagation delay × bits/time = total bits in link

bandwidth

Latency

delay x bandwidth

Page 6: Basic Concepts

Examples of Bandwidth-Delay

Same city over a slow link: BW~100Mbps Latency~0.1msec BDP ~ 10,000bits ~ 1.25KBytes

Cross-country over fast link: BW~10Gbps Latency~10msec BDP ~ 108bits ~ 12.5GBytes

Page 7: Basic Concepts

time=0

Packet DelaySending a 100B packet from A to B?

A B

100Byte packet

Time

1Mbps, 1ms

Time to transmit one bit = 1/106s

Time to transmit 800 bits=800x1/106s

Time when that bit reaches B

= 1/106+1/103s

The last bit reaches B at

(800x1/106)+1/103s= 1.8msPacket Delay = Transmission Delay + Propagation Delay

Packet Delay = (Packet Size ÷ Link Bandwidth) + Link Latency

Page 8: Basic Concepts

Packet DelaySending a 100B packet from A to B?

A B

100Byte packet

Time

1Mbps, 1ms

1Gbps, 1ms?

The last bit reaches B at

(800x1/106)+1/103s= 1.8ms

1GB file in 100B packets

The last bit reaches B at

(800x1/109)+1/103s= 1.0008ms

The last bit in the file reaches B at

(107x800x1/109)+1/103s= 8001ms

107 x 100B packets

Page 9: Basic Concepts

Packet Delay: The “pipe” viewSending 100B packets from A to B?

A B

100Byte packet

Time

1Mbps, 10ms

100Byte packet

100Byte packet

time BW

pkt tx

time

Page 10: Basic Concepts

Packet Delay: The “pipe” viewSending 100B packets from A to B?

1Mbps, 10ms (BDP=10,000)

time

BW

10Mbps, 1ms (BDP=10,000)

time

BW

1Mbps, 5ms (BDP=5,000)

time

BW

Page 11: Basic Concepts

Packet Delay: The “pipe” viewSending 100B packets from A to B?

1Mbps, 10ms (BDP=10,000)

time

BW

200B?

1Mbps, 10ms (BDP=10,000)

time

BW

Page 12: Basic Concepts

Any questions?

Page 13: Basic Concepts

Nodes and Links

A B

Page 14: Basic Concepts

What if we have more nodes?

One link for every node?

Need a scalable way to interconnect nodes

Page 15: Basic Concepts

Solution: A switched network

Nodes share network link resources

How is this sharing implemented?

Page 16: Basic Concepts

Two forms of switched networks

Circuit switching (used in the telephone network) Packet switching (used in the Internet)

Page 17: Basic Concepts

Circuit switching

(1) Node A sends a reservation request(2) Interior switches establish a connection -- i.e., “circuit”(3) A starts sending data(4) A sends a “teardown circuit” message

Idea: source reserves network capacity along a path

A B10Mb/s?

10Mb/s?

10Mb/s?

Page 18: Basic Concepts

Circuit Switching: Sharing a Link

Time-division Each circuit allocated

certain time slots

Frequency-division Each circuit allocated

certain frequencies

timefrequency

time

Page 19: Basic Concepts

Time-Division Multiplexing/Demultiplexing

Time divided into frames; frames into slots Relative slot position inside a frame determines to which

conversation data belongs e.g., slot 0 belongs to orange conversation

Slots are reserved (released) during circuit setup (teardown) If a conversation does not use its circuit capacity is lost!

Frames

0 1 2 3 4 5 0 1 2 3 4 5Slots =

Page 20: Basic Concepts

time

Timing in Circuit Switching

Page 21: Basic Concepts

time

Timing in Circuit Switching

Page 22: Basic Concepts

time

Timing in Circuit Switching

Page 23: Basic Concepts

time

Timing in Circuit Switching

Page 24: Basic Concepts

Circuit Establishment

time

Timing in Circuit Switching

Page 25: Basic Concepts

Information

Circuit Establishment

Transfer

time

Timing in Circuit Switching

Page 26: Basic Concepts

Information

Circuit Establishment

Transfer

Circuit Teardown

time

Timing in Circuit Switching

Page 27: Basic Concepts

Circuit switching: pros and cons

Pros guaranteed performance fast transfer (once circuit is established)

Cons

Page 28: Basic Concepts

Information

Circuit Establishment

Transfer

Circuit Teardown

time

Timing in Circuit Switching

Page 29: Basic Concepts

Circuit switching: pros and cons

Pros guaranteed performance fast transfer (once circuit is established)

Cons wastes bandwidth if traffic is “bursty”

Page 30: Basic Concepts

Information

Circuit Establishment

Transfer

Circuit Teardown

time

Timing in Circuit Switching

Page 31: Basic Concepts

Information

Circuit Establishment

Circuit Teardown

time

Data transfer

Timing in Circuit Switching

Page 32: Basic Concepts

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

Page 33: Basic Concepts

Circuit switching

A

B

Circuit switching doesn’t “route around trouble” Circuit switching doesn’t “route around trouble”

Page 34: Basic Concepts

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 recovery from failure is slow

Page 35: Basic Concepts

Two forms of switched networks

Circuit switching (e.g., telephone network) Packet switching (e.g., Internet)

Page 36: Basic Concepts

Packet Switching

Data is sent as chunks of formatted bits (Packets) Packets consist of a “header” and “payload”*

© Nick McKeown 2006

01000111100010101001110100011001

1. Internet Address2. Age3. Checksum to protect header

HeaderData

headerpayload

Page 37: Basic Concepts

Packet Switching

Data is sent as chunks of formatted bits (Packets) Packets consist of a “header” and “payload”*

payload is the data being carried header holds instructions to the network for how to

handle packet (think of the header as an interface!)

Page 38: Basic Concepts

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

Page 39: Basic Concepts

Switches forward packets

to MIT

to UW

UCB

to NYU

Destination Next Hop

UCB 4

UW 5

MIT 2

NYU 3

Forwarding Table111010010 MIT

switch#2

switch#5

switch#3

switch#4

Page 40: Basic Concepts

time

Timing in Packet Switching

payload

hdr

What about the time to process the packet at the switch?

• We’ll assume it’s relatively negligible (mostly true)

Page 41: Basic Concepts

time

Timing in Packet Switching

payload

hdr

Could the switch start transmitting as soon as it has processed the header?

• Yes! This would be called a “cut through” switch

Page 42: Basic Concepts

time

Timing in Packet Switching

payload

hdr

We will always assume a switch processes/forwards a packet after it has received it entirely.

This is called “store and forward” switching

Page 43: Basic Concepts

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

Page 44: Basic Concepts

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”

Page 45: Basic Concepts

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

Page 46: Basic Concepts

Statistical Multiplexing

Page 47: Basic Concepts

Data Rate 1

Data Rate 2

Data Rate 3

Three Flows with Bursty Traffic

Time

Time

TimeCapacity

Page 48: Basic Concepts

Data Rate 1

Data Rate 2

Data Rate 3

When Each Flow Gets 1/3rd of Capacity

Time

Time

Time

Frequent Overloading

Page 49: Basic Concepts

When Flows Share Total Capacity

Time

Time

Time

No Overloading

Statistical multiplexing relies on the assumption that not all flows burst at the same time.

Very similar to insurance, and has same failure case

Page 50: Basic Concepts

Data Rate 1

Data Rate 2

Data Rate 3

Three Flows with Bursty Traffic

Time

Time

TimeCapacity

Page 51: Basic Concepts

Data Rate 1

Data Rate 2

Data Rate 3

Three Flows with Bursty Traffic

Time

Time

TimeCapacity

Page 52: Basic Concepts

Data Rate 1+2+3 >> Capacity

Three Flows with Bursty Traffic

Time

TimeCapacity

What do we do under overload?

Page 53: Basic Concepts

Statistical multiplexing: pipe view

time

BW

pkt tx

time

Page 54: Basic Concepts

Statistical multiplexing: pipe view

Page 55: Basic Concepts

Statistical multiplexing: pipe view

No Overload!

Page 56: Basic Concepts

Statistical multiplexing: pipe view

Transient OverloadNot a rare event!

Queue

Page 57: Basic Concepts

Statistical multiplexing: pipe view

Transient OverloadNot a rare event!

Queue

Page 58: Basic Concepts

Statistical multiplexing: pipe view

Transient OverloadNot a rare event!

Queue

Page 59: Basic Concepts

Statistical multiplexing: pipe view

Transient OverloadNot a rare event!

Queue

Page 60: Basic Concepts

Statistical multiplexing: pipe view

Transient OverloadNot a rare event!

Queue

Page 61: Basic Concepts

Statistical multiplexing: pipe view

Queue

Transient OverloadNot a rare event!Queues absorb transient bursts!

Page 62: Basic Concepts

Statistical multiplexing: pipe view

What about persistent overload?Will eventually drop packets

Page 63: Basic Concepts

Queues introduce queuing delays

Recall, packet delay = tx delay + prop delay

With queues (stat. muxing) packet delay = tx delay + prop delay + queuing delay

Queuing delay caused by “packet interference”

Made worse at high load less “idle time” to absorb bursts think about traffic jams at rush hour

Page 64: Basic Concepts

Basic Queuing Theory Terminology

Arrival process: how packets arrive Average rate A Peak rate P

Service process: transmission times Average transmission time (function of packet size)

W: average time packets wait in the queue W for “waiting time”

L: average number of packets waiting in the queue L for “length of queue”

Two different quantities

Page 65: Basic Concepts

Little’s Law (1961)

L = A x W

Compute L: count packets in queue every second How often does a single packet get counted? W times

Why do you care? Easy to compute L, harder to compute W

Page 66: Basic Concepts

Statistical Multiplexing is a recurrent theme in computer science

Page 67: Basic Concepts

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

Page 68: Basic Concepts

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

Page 69: Basic Concepts

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’

Page 70: Basic Concepts

Recap: you should leave this lecture with…

A sense of how the basic `plumbing’ works links and switches packet delays (tx, propagation, queuing) statistical multiplexing and queues circuit vs. packet switching

Next: back to lofty principles protocols and layering

Page 71: Basic Concepts

Layering

Page 72: Basic Concepts

Three (networking) design steps

Break down the problem into tasks

Organize these tasks

Decide who does what

Page 73: Basic Concepts

Tasks in Networking

What does it take to send packets across country?

Simplistic decomposition: Task 1: send along a single wire

Task 2: stitch these together to go across country

This gives idea of what I mean by decomposition

Page 74: Basic Concepts

Tasks in Networking (bottom up)

Bits on wire Packets on wire Deliver packets within local network Deliver packets across global network Ensure that packets get to the destination Do something with the data

Page 75: Basic Concepts

Resulting Modules

Bits on wire (Physical) Packets on wire (Physical) Delivery packets within local network (Datalink) Deliver packets across global network (Network) Ensure that packets get to the dst. (Transport) Do something with the data (Application)

This is decomposition…

Now, how do we organize these tasks?

Page 76: Basic Concepts

Dear John,

Your days are numbered.

--Pat

Inspiration…

CEO A writes letter to CEO B Folds letter and hands it to administrative aide

Aide: Puts letter in envelope with CEO B’s full name Takes to FedEx

FedEx Office Puts letter in larger envelope Puts name and street address on FedEx envelope Puts package on FedEx delivery truck

FedEx delivers to other company78

Page 77: Basic Concepts

CEO

Aide

FedEx

CEO

Aide

FedExLocationFedex Envelope (FE)

The Path of the Letter

79

Letter

Envelope

Semantic Content

Identity

“Peers” on each side understand the same thingsNo one else needs to

Lowest level has most packaging

Page 78: Basic Concepts

The Path Through FedEx

80

Truck

SortingOffice

Airport

FE

SortingOffice

Airport

Truck

SortingOffice

Airport

Crate Crate

FE

NewCrate Crate

FE

Higher “Stack”at Ends

Partial “Stack”During Transit

Deepest Packaging (Envelope+FE+Crate)at the Lowest Level of Transport

Highest Level of “Transit Stack”

is Routing

Page 79: Basic Concepts

In the context of the Internet

Applications

…built on…

…built on…

…built on…

…built on…

Reliable (or unreliable) transport

Best-effort global packet delivery

Best-effort local packet delivery

Physical transfer of bits

Page 80: Basic Concepts

Three Observations

82

Page 81: Basic Concepts

Layering Crucial to Internet’s Success

Reuse

Hides underlying detail

Innovation at each level can proceed in parallel

Pursued by very different communities

83

Page 82: Basic Concepts

Distributing Layers Across Network

84

Page 83: Basic Concepts

What Gets Implemented on Host?

Bits arrive on wire, must make it up to application

Therefore, all layers must exist at host!

85

Page 84: Basic Concepts

What Gets Implemented on Router?

86

Page 85: Basic Concepts

What Gets Implemented on Switches?

Switches do what routers do, except they don’t participate in global delivery, just local delivery

They only need to support Physical and Datalink Don’t need to support Network layer

Won’t focus on the router/switch distinction When I say switch, I almost always mean router Almost all boxes support network layer these days

87

Page 86: Basic Concepts

88

Complicated Diagram

HTTP

TCP

IP

Ethernetinterface

HTTP

TCP

IP

Ethernetinterface

IP IP

Ethernetinterface

Ethernetinterface

SONETinterface

SONETinterface

host host

router router

HTTP message

TCP segment

IP packet IP packetIP packet

Page 87: Basic Concepts

89

Simple Diagram Lower three layers implemented everywhere Top two layers implemented only at hosts

Transport

Network

Datalink

Physical

Transport

Network

Datalink

Physical

Network

Datalink

Physical

Application Application

Host A Host BRouter

Page 88: Basic Concepts

90

Logical Communication

Layers interacts with peer’s corresponding layer

Transport

Network

Datalink

Physical

Transport

Network

Datalink

Physical

Network

Datalink

Physical

Application Application

Host A Host BRouter

Page 89: Basic Concepts

91

Physical Communication Communication goes down to physical network Then from network peer to peer Then up to relevant layer

Transport

Network

Datalink

Physical

Transport

Network

Datalink

Physical

Network

Datalink

Physical

Application Application

Host A Host BRouter

Page 90: Basic Concepts

92

Layer Encapsulation

Trans: Connection ID

Net: Source/Dest

Link: Src/Dest

Appl: Get index.html

User A User B

Common case: 20 bytes TCP header + 20 bytes IP header + 14 bytes Ethernet header = 54 bytes overhead

Page 91: Basic Concepts

Next time.

Recap layering Protocols Introduction to the network layer