performance metrics outline bandwidth latency bandwidth-delay product

34
Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Upload: prudence-little

Post on 20-Jan-2018

231 views

Category:

Documents


0 download

DESCRIPTION

CS 6403 Bandwidth versus Latency Relative importance –1-byte: 1ms vs 100ms dominates 1Mbps vs 100Mbps –25MB: 1Mbps vs 100Mbps dominates 1ms vs 100ms Infinite bandwidth –RTT dominates Throughput = TransferSize / TransferTime TransferTime = RTT + (1/Bandwidth) x TransferSize

TRANSCRIPT

Page 1: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Performance Metrics

OutlineBandwidthLatencyBandwidth-delay product

Page 2: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 2

Performance Metrics• Bandwidth (throughput)

– data transmitted per time unit– link versus end-to-end– notation

• KB = 1000 bytes• Mbps = 106 bits per second

• Latency (delay)– time to send message from point A to point B– one-way versus round-trip time (RTT)

• RTT: time for a packet to go from A to B and B to respond back to A (e.g., with an ACK or Acknowledgment)

– componentsLatency = Propagation + Transmit + QueuePropagation = Distance / cTransmit = Size / Bandwidth

Page 3: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 3

Bandwidth versus Latency• Relative importance

– 1-byte: 1ms vs 100ms dominates 1Mbps vs 100Mbps– 25MB: 1Mbps vs 100Mbps dominates 1ms vs 100ms

• Infinite bandwidth– RTT dominates

• Throughput = TransferSize / TransferTime• TransferTime = RTT + (1/Bandwidth) x TransferSize

Page 4: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 4

Delay x Bandwidth Product

• Amount of data “in flight” or “in the pipe”• Example: 100ms x 45Mbps = 560KB

Bandwidth

Delay

Page 5: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Physical Layer Issues and Methods

OutlinePhysical Layer OverviewEncodingFramingError Detection

Page 6: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Intro• Problem statement: getting packets across the physical

network• For now, we will focus on one segment of a network —

i.e., there are no switches• Key issues that arise here:

– links operate on signal — electromagnetic. We are dealing with digital info — encoding

– we are sending packets over the links — need other end to know when “packet” was received — framing

– there may be errors in transmission or reception — what to do? error detection

– there may be multiple senders contending — on a shared medium. How to get people to

– take turns and share fairly — multiple access

CS 640 6

Page 7: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 7

Physical Layer Data Transfer• Signals are placed on wire via transceivers• Problem is how to do transmit 0’s and 1’s (signal encoding) in a

robust fashion– Binary voltage encoding

• Map 1 to high voltage• Map 0 to low voltage

– How are consecutive 0’s or 1’s detected at node?• Clock synchronization problem

• Transmitted signals have a variety of problems– Attenuation– Noise – Dispersion

Page 8: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 8

Non-Return to Zero (NRZ)

• High voltage = 1 and low voltage = 0• Voltage does not return to 0 between bits• Receiver keeps average of signal seen to distinguish 0

from 1

Page 9: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 9

NRZ• Benefits

– Easy to engineer – most basic encoding– Efficient use of bandwidth – not many transitions

• Drawbacks– Long strings of 0’s can be confused with no signal– Long strings of 1’s can cause signal average to wander– Clock synchronization can be poor

Page 10: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 10

NRZ-Inverted (NRZI)

• NRZI addresses clock synchronization problem– Encodes 1 by transitioning from current signal– Encodes 0 by staying at current signal

• So we’re still out of luck on consecutive strings of 0’s

Page 11: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 11

Manchester Data Encoding

• Explicit merging of clock and bit stream– Each bit contains a transition

• High-low = 1• Low-high = 0

– Enables effective clock signal recovery at receiver• Clocks are still needed to differentiate between bit boundaries

• Poor bandwidth utilization– Effective sending rate is cut in half

• Used by 802.3 – 10Mbps Ethernet

Page 12: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 12

Manchester Encoding contd.+V

-VEncoding for 1

+V

-VEncoding for 0

0+V

-V

0 0 0 01 1 1 1

Bit Boundaries Signal Edges

Page 13: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 13

4B/5B Encoding• Tries to address inefficiencies in Manchester• Every 4 bits of data are encoded in a 5 bit code

– Encodings selections• At most one leading 0• At most two trailing 0’s• Never more than three consecutive 0’s

• Uses NRZI to put bits on the wire • This is why code is focused on zeros• 80% efficiency• See text for details of codes

Page 14: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Framing• Need the other end of the link to know when a packet

transmission started and ended. – What makes this challenging? Packets can be of different length

and knowing start is hard — are you just hearing noise?• Approach: add delimiters

– Byte oriented — add special bytes at the beginning and end. If the special byte appears in payload then you would need to escape it.

• Another approach — have a starting special byte, and then include a byte counter.

– Bit oriented — add special bit sequences at beginning and end. You would need to escape individual bits in case they appear in the payload.

• Enough to understand this idea at this high level.

CS 640 14

Page 15: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Error Detection• Classic problem — a lot of this is math, so we will gloss over.• In networks there are many choices:

– don’t detect errors. Let higher layer deal with it end to end.– detect errors and retroactively correct it.– proactively correct errors.

• Generally latter two are used in many network technologies– End to end sanity checks almost always used. – For cost and efficiency reasons.

• Error detection is common. Some possible approaches:– Add parity bits.– Add parity bytes.– Compute some function over payload and add that to end of message

— receiver checks. Common ideas here:• check sum — IP layer uses this. Simple to implement but not robust.• cyclic redundancy check — Ethernet uses this. A little more complex, but more

robust to more different error patterns.

CS 640 15

Page 16: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Ethernet

OutlineMultiple Access and Ethernet IntroEthernet FramingCSMA/CD protocolExponential backoff

Page 17: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 17

Shared Access Networks

• Shared Access Networks assume multiple nodes on the same physical link– Bus, ring and wireless structures– Transmission sent by one node is received by all others– No intermediate switches

• Need methods for moderating access – Medium Access Control Protocols, or MAC protocols– Fairness– Performance– How can this be done?

Page 18: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 18

Multiple Access Methods• Fixed assignment

– Partition channel so each node gets a slice of the bandwidth– Essentially circuit switching – thus inefficient– Examples: TDMA, FDMA, CDMA (all used in wireless/cellular

environments)• Contention-based

– Nodes contends equally for bandwidth and recover from or avoid collisions

– Examples: Aloha, Ethernet, Wireless• Token-based or reservation-based

– Take turns using the channel– Examples: Token ring

Page 19: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

Ethernet• History

– Developed by Bob Metcalfe and others at Xerox PARC in mid-1970s– Standardized by Xerox, DEC, and Intel in 1978– LAN standards define MAC and physical layer connectivity

• IEEE 802.3 (CSMA/CD - Ethernet) standard – originally 2Mbps• IEEE 802.3u standard for 100Mbps Ethernet• IEEE 802.3z standard for 1,000Mbps Ethernet

• CSMA/CD: Ethernet’s Media Access Control (MAC) policy– CS = carrier sense

• Send only if medium is idle– MA = multiple access– CD = collision detection

• Stop sending immediately if collision is detected

Page 20: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 20

The Old Ethernet (“10Base2”)

Page 21: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 21

Ethernet Overview• Bandwidths: 10Mbps, 100Mbps, 1Gbps• Max bus length: 2500m

– Upto 3 repeaters Max 10KM

• Bus and Star topologies are used to connect hosts– Hosts attach to network via Ethernet transceiver or hub or switch

• Detects line state and sends/receives signals– All hosts on an Ethernet are competing for access to the medium

• Switches break this model

• Problem: Distributed algorithm that provides fair access

Page 22: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 22

Ethernet Overview (contd.)

• Ethernet by definition is a broadcast protocol– Any signal can be received by all hosts– Switching enables individual hosts to communicate

• Network layer packets are transmitted over an Ethernet by encapsulating

• Frame Format

Destaddr

64 48 32

CRCPreamble Srcaddr Type Body

1648

Page 23: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 23

Ethernet Frames• Preamble is a sequence of 8 bytes, each set to “10101010”

– Used to synchronize receiver before actual data is sent• Addresses

– unique, 48-bit unicast address assigned to each adapter• example: 08:00:e4:b1:02:a1• Each manufacturer gets their own address range

– broadcast: all 1s– multicast: first bit is 1

• Type field is a demultiplexing key used to determine which higher level protocol the frame should be delivered to

• Body can contain up to 1500 bytes of data

Page 24: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 24

MAC Algorithm: Receiver Side• Receivers very simple: simply read frames with

acceptable address– Address to host– Address to broadcast– Address to multicast to which host belongs– All frames if host is in promiscuous mode

Page 25: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 25

Ethernet’s Sender Algorithm• CSMA/CD – listens to line before/during sending

Sender Behavior (where all the smarts are):• If line is idle (no carrier sensed)

– send packet immediately– upper bound message size of 1500 bytes– must wait 9.6us between back-to-back frames

• If line is busy (carrier sensed)– wait until idle and transmit packet immediately

• called 1-persistent sending• If collision detected

– Stop sending and jam signal– Try again later

Page 26: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 26

State Diagram for CSMA/CD

Packet?

Sense Carrier

Discard Packet

Send Detect Collision

Jam channel b=CalcBackoff();

wait(b);attempts++;

No

Yes

attempts < 16

attempts == 16

Page 27: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 27

Collisions

A B

A B

Collisions are caused when two adaptors transmit at the same time (adaptors sense collision based on voltage differences)

• Both found line to be idle• Both had been waiting to for a busy line to become idle

A starts attime 0

Message almost there at time T whenB starts – collision!

How can we be sure A knows about the collision?

Page 28: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 28

Collision Detection • Detected collision? Send jamming signal after collision is detected to insure

all hosts see collision– 32 bit signal– In our example, B sends this

• How can A know that a collision has taken place?– There must be a mechanism to insure retransmission on collision– A’s message reaches B at time T– B’s message (jamming signal) reaches A at time 2T– So, A must still be transmitting at 2T

• IEEE 802.3 specifies max value of 2T to be 51.2us– This relates to maximum distance of 10000m between hosts– At 10Mbps it takes 0.1us to transmit one bit so 512 bits (64B) take 51.2us to send– So, Ethernet frames must be at least 64B long

• 14B header, 46B data, 4B CRC• Padding is used if data is less than 46B

Page 29: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 29

Collision Detection contd.A B

A B

A B

time = 0

time = T

time = 2T

Page 30: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 30

Exponential Backoff• If a collision is detected, delay and try again• Delay time is selected using binary exponential backoff

– 1st time: choose K from {0,1} then delay = K * 51.2us– 2nd time: choose K from {0,1,2,3} then delay = K * 51.2us– nth time: delay = K x 51.2us, for K=0..2n – 1

• Note max value for k = 1023– give up after several tries (usually 16)

• Report transmit error to host

• If delay were not random, then there is a chance that sources would retransmit in lock step

• Why not just choose from small set for K– This works fine for a small number of hosts– Large number of nodes would result in more collisions

Page 31: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 31

Experiences with the Old Ethernet

• Ethernets work best under light loads– Utilization over 30% is considered heavy

• Network capacity is wasted by collisions

• Most networks are limited to about 200 hosts– Specification allows for up to 1024

• Most networks are much shorter– 5 to 10 microsecond RTT

• Transport level flow control helps reduce load (number of back to back packets)

• Ethernet is inexpensive, fast and easy to administer!

Page 32: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 32

Ethernet Problems

• Ethernet’s peak utilization is pretty low• Peak throughput worst with

– More hosts• More collisions needed to identify single sender

– Smaller packet sizes• More frequent arbitration

– Longer links• Collisions take longer to observe, more wasted bandwidth

– Efficiency is improved by avoiding these conditions

Page 33: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 33

Fast and Gigabit Ethernet• Gigabit Ethernet (1,000Mbps)

– Compatible with lower speeds– Uses standard framing and CSMA/CD algorithm– Distances are severely limited– Standard on NICs today

Page 34: Performance Metrics Outline Bandwidth Latency Bandwidth-delay product

CS 640 34

Why did Ethernet Win?

• There are LOTS of LAN protocols• Price• Performance• Availability• Ease of use• Scalability• Tomorrow we will talk about physical layer stuff…