intro to single / two rate three color marker (srtcm / trtcm)

19
Introduction to Single / Two Rate Three Color Marker (srTCM / trTCM) Kentaro Ebisawa / 海老澤 健太郎 Twitter: @ebiken

Upload: kentaro-ebisawa

Post on 22-Jul-2015

524 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Introduction toSingle / Two Rate Three Color Marker

(srTCM / trTCM)Kentaro Ebisawa /海老澤健太郎

Twitter: @ebiken

Page 2: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Preface

• The objective of this document is to provider entry point for people to understand srTCM and trTCM (single / two rate Tree Color Marker).

• This document will explain algorithm described in below RFCs, and compare two different algorithm used for trTCM.• RFC 2697 - A Single Rate Three Color Marker

• https://tools.ietf.org/html/rfc2697

• RFC 2698 - A Two Rate Three Color Marker - IETF Tools• https://tools.ietf.org/html/rfc2698

• RFC 4115 - A Differentiated Service Two-Rate, Three-Color Marker with Efficient Handling of in-Profile Traffic• https://tools.ietf.org/html/rfc4115

2Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken

Page 3: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

List of contents

• Intro to metering

• color-blind vs. color-aware modes

• 3 types of meter algorithm using Token Bucket• RFC 2697 - A Single Rate Three Color Marker

• RFC 2698 - A Two Rate Three Color Marker

• RFC 4115 - A Differentiated Service Two-Rate, Three-Color Marker with Efficient Handling of in-Profile Traffic

• Comparison between RFC2698 and RFC4115

• Notes

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 3

Page 4: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Metering … what is it and where would it be used?

• Meter will be applied to flow of packets assigned to each meter by classifier.

• Meter will measure rate of packet belonging to the meter, and mark packet for further processing.

• An implementation can use any method for accounting rate. However, token bucket is widely used due to difficulty of accounting rate by storing raw historical stats data of flow.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 4

RFC2475: https://tools.ietf.org/html/rfc2475Fig. 1 : Logical View of a Packet Classifier and Traffic Conditioner

Packets Classifier

Meter

MarkerShaper/Dropper

Page 5: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

color-blind vs. color-aware modes• Both RFC 2698 and RFC 4115 has 2 modes, color-blind and aware mode.

• The following slides only describes algorithm of color-blind mode to keep simplicity. • If you found needs to differentiate packet marking after reading description below, refer to the original RFCs for details.

• RFC 2698• color-blind mode

• Packet will be evaluated against remaining tokens and tokens are consumed.

• color-aware mode• If packet has been pre-colored in then it would be marked with the color without evaluating nor consuming remaining tokens.• If packet was not pre-colored, it will be treated same as in color-blind mode.

• RFC 4115• color-blind mode

• The meter assumes that all incoming packets are green. • The operation of the meter is similar to that in the color-aware operation for green packets.

• color-aware mode• red packets are always marked red.• yellow packets could be marked yellow or red as result of evaluation.• green packets could be marked any color as result of evaluation.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 5

Page 6: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

RFC 2697 - A Single Rate Three Color Marker (srTCM)

• Parameters• Committed Information Rate (CIR) … Bytes per second

• Committed Burst Size (CBS) … Bytes

• Excess Burst Size (EBS) … Bytes

• Descriptions• CIR defines how fast token will be refilled.

• CBS/EBS defines size of token buckets named Tc and Te whose max size is CBS/EBS.

• Tc(t) and Te(t) stands for amount of tokens in the buckets at time “t”.

• CBS and/or EBS must be greater than 0 and should be larger than MTU.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 6

Page 7: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

RFC 2697 - srTCM algorithm (diagrams in following slides)

• Bucket update algorithm• Initially both buckets are full.

• Tc(0) = CBS, Te(0) = EBS

• Tc and Te are updated CIR times per second as below.• If Tc is less than CBS, Tc is incremented by one, else• if Te is less then EBS, Te is incremented by one, else• neither Tc nor Te is incremented.

• Marking and Bucket update when Packet arrives.• Packet size B arrives.• If Tc(t)-B >= 0, the packet is green and Tc is decremented by B• if Te(t)-B >= 0, the packets is yellow and Te is decremented by B• the packet is red and neither Tc nor Te is decremented.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 7

Page 8: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 8

Tc Te1. Tc += CIR*Δt

Tc(t) < CBS(not full)

2. Te += CIR*Δt

Te(t) < CBS(not full)

LoopEvery Δt

do nothing(both buckets

are full)1. Fill Token to Tc(if Tc is not full)

2. Fill Token to Te(if Tc was full & Te is not full)

EBSCBS

How Tokens are added(single rate TCM)

• CBS: Committed Burst Size (Bytes)• EBS: Excess Burst Size (Bytes)• CIR: Committed Information Rate

(Bytes per sec)

• Updates happens every Δt time (different from RFC)

srTCM

YES

NO

YES

NO

Page 9: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 9

Tc TeTc(t) - B >= 0

Te(t) - B >=0

Packet Arrives(Size B Bytes)

c. Mark RED

a. Mark GREENTc(t) -= B

b. Mark YELLOWTe(t) -= B

EBSCBS

How Packets are Colored & Tokens are Consumed(single rate TCM)

• CBS: Committed Burst Size (Bytes)• EBS: Excess Burst Size (Bytes)• CIR: Committed Information Rate

(Bytes per sec)

• Updates happens every Δt time (different from RFC)

srTCM

a. If Tc has enough tokenConsume from Tc

Mark GREEN

b. If Te has enough tokenConsume from Te

Mark YELLOWc. Mark RED(if no token)

Packet arrives(B bytes)

YES

NO

YES

NO

Page 10: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

RFC 2698 - A Two Rate Three Color Marker (trTCM)

• Parameters• PIR: Peak Information Rate … Bytes per second

• PBS: Peak Burst Size … Bytes (Burst size of PIR)

• CIR: Committed Information Rate … Bytes per second

• CBS: Committed Burst Size … Bytes (Burst size of CIR)

• Descriptions• PIR/CIR defines how fast token will be refilled.

• PIR must be equal to or greater than the CIR.

• PBS/CBS defines max size of token buckets named Tp and Tc.

• Tp(t) and Tc(t) stands for amount of tokens in the buckets at time “t”.

• PBS and/or CBS must be greater than 0 and should be larger than MTU.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 11

Page 11: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 12

Tc Tp

2. Fill Token to Tc(if Tc is not full)

1. Fill Token to Tp(if Tp is not full)

PBSCBS1. Tp += PIR*Δt

if Tp(t) < PBS (not full)

LoopEvery Δt

trTCMRFC2698

2. Tc += CIR*Δtif Tc(t) < CBS (not full)

How Tokens are added : RFC 2698 (trTCM)

Page 12: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 13

Tc TpTp(t) - B < 0

Tc(t) - B < 0

Packet Arrives(Size B Bytes)

c. Mark GREENTp(t) -= BTc(t) -= B

a. Mark RED

b. Mark YELLOWTp(t) -= B

PBS

b. If Tc does NOT has enough token.Mark YELLOW

Consume from Tp.

a. If Tp does NOT have enough token.

Mark RED

CBS

c. Mark GREENConsume from Tp, Tc Packet arrives (B bytes)

trTCMRFC2698

YES

NO

YES

NO

How Packets are Colored & Tokens are Consumed : RFC 2698 (trTCM)

Page 13: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 14

Tc TpTp(t) - B < 0

Tc(t) - B < 0

Packet Arrives(Size B Bytes)

c. Mark GREENTp(t) -= BTc(t) -= B

a. Mark RED

b. Mark YELLOWTp(t) -= B

2. Fill Token to Tc(if Tc is not full)

1. Fill Token to Tp(if Tp is not full)

PBS

b. If Tc does NOT has enough token.Mark YELLOW

Consume from Tp.

a. If Tp does NOT have enough token.

Mark RED

CBS

c. Mark GREENConsume from Tp, Tc Packet arrives (B bytes)

trTCMRFC2698

1. Tp += PIR*Δtif Tp(t) < PBS (not full)

LoopEvery Δt

2. Tc += CIR*Δtif Tc(t) < CBS (not full)

YES

NO

YES

NO

Summary of RFC 2698 (trTCM)

Page 14: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

RFC 4115 - trTCM with Efficient Handling of in-Profile Traffic

• Parameters• EIR: Excess Information Rate … bits per second

• EBS: Excess Burst Size … Bytes (Burst size of EIR)

• CIR: Committed Information Rate … bits per second

• CBS: Committed Burst Size … Bytes (Burst size of CIR)

• Descriptions• EIR/CIR defines how fast token will be refilled. (generated)

• EBS/CBS defines max size of token buckets named Te and Tc.

• Te(t) and Tc(t) stands for amount of tokens in the buckets at time “t”.

• EBS and CBS must be larger than MTU. (max expected length of incoming PDU)

• EIR and CIR can be set independently of each other, or, could be linked together by defining a burst duration parameter, T, where T=EBS/EIR=CBS/CIR.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 15

Page 15: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 16

Tc Te

1. Fill Token to Tc(if Tc is not full)

2. Fill Token to Te(if Te is not full)

EBSCBS

trTCMRFC4115

1. Tc += CIR*Δtif Tc(t) < CBS (not full)

LoopEvery Δt

2. Te += EIR*Δtif Te(t) < EBS (not full)

How Tokens are added : RFC 4115 (trTCM)

Page 16: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 17

Tc TeB <= Tc(t)

B <= Te(t)

Packet Arrives(Size B Bytes)

c. Mark RED

a. Mark GREENTc(t) -= B

b. Mark YELLOWTe(t) -= B

EBS

a. If Tc has enough token.Mark GREEN

Consume from Tc.

b. If Te has enough token.Mark YELLOW

Consume from Te

CBS

Packet arrives (B bytes) c. Mark RED

trTCMRFC4115

YES

NO

YES

NO

How Packets are Colored & Tokens are Consumed : RFC 4115 (trTCM)

Page 17: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 18

Tc TeB <= Tc(t)

B <= Te(t)

Packet Arrives(Size B Bytes)

c. Mark RED

a. Mark GREENTc(t) -= B

b. Mark YELLOWTe(t) -= B

1. Fill Token to Tc(if Tc is not full)

2. Fill Token to Te(if Te is not full)

EBS

a. If Tc has enough token.Mark GREEN

Consume from Tc.

b. If Te has enough token.Mark YELLOW

Consume from Te

CBS

Packet arrives (B bytes) c. Mark RED

trTCMRFC4115

1. Tc += CIR*Δtif Tc(t) < CBS (not full)

LoopEvery Δt

2. Te += EIR*Δtif Te(t) < EBS (not full)

YES

NO

YES

NO

Summary of RFC 4115 (trTCM)

Page 18: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Comparison between RFC2698 and RFC4115

• Order of evaluating Buckets• RFC2698 Tp (Peak) => Tc (Commit)

• RFC4115 Tc (Commit) => Te (Excess)

• GREEN packet will be evaluated only once using RFC4115.

• This will be much efficient if most of traffic fall into GREEN.

• RFC2698 will require GREEN packet to pass two conformance tests.

• This could make yellow traffic starve incoming in-profile green packets.

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 19

Page 19: Intro to Single / Two Rate Three Color Marker (srTCM / trTCM)

Notes

• Which part of packet should be considered when calculating rate?• RFC2697/2698 (srTCM/trTCM) mentions only size of IP packets will be

measured when calculating CIR. (i.e. Link layer headers are ignored.)• The CIR is measured in bytes of IP packets per second, i.e., it includes the IP header,

but not link specific headers.

• However, some implementation will calculate rate including size of MPLS/VLAN/Ethernet header.

• RFC4115 implies size of PDU (not necessary IP packet) to be used.• Page 2: “The CBS and EBS are measured in bytes and must configure to be greater

than the expected maximum length of the incoming PDU.”

Intro to Single Rate / Two Rate Three Color Marker (srTCM/trTCM) | 2015/02/06 | @ebiken 20