school of computing national university of singaporeunder m/m/1, power = throughput 𝑅𝑇𝑇 β‰ˆ...

64
Congestion Avoidance Richard T. B. Ma School of Computing National University of Singapore CS 5229: Advanced Compute Networks

Upload: others

Post on 24-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Congestion Avoidance

Richard T. B. Ma

School of Computing

National University of Singapore

CS 5229: Advanced Compute Networks

Page 2: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

References

K. K. Ramakrishnan, Raj Jain, β€œA Binary Feedback Scheme for Congestion Avoidance in Computer Networks with a Connectionless Network Layer”, ACM Computer Communication Review, Vol. 18, No. 4, August 1988, pp. 303-313.

Page 3: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Congestion Collapse

When: October 1986

Where: Lawrence Berkeley Laboratory (LBL) to UC Berkeley site, 400 yards and 3 hops away

What: Throughput dropped from 32 Kbps to 40bps

Page 4: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Congestion

Dest

Source

Source

Router

1.5-Mbps T1 link

Congestion in a packet-switched network

Page 5: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Flow Control

End-to-end flow control looks at β€œselfish” control function Make sure sufficient buffer at destination

Receiver sends π‘…π‘π‘£π‘Šπ‘–π‘›π‘‘π‘œπ‘€ (or π‘Ÿπ‘€π‘›π‘‘) =

π‘…π‘π‘£π΅π‘’π‘“π‘“π‘’π‘Ÿ – (πΏπ‘Žπ‘ π‘‘π΅π‘¦π‘‘π‘’π‘…π‘π‘£π‘‘ βˆ’ πΏπ‘Žπ‘ π‘‘π΅π‘¦π‘‘π‘’π‘…π‘’π‘Žπ‘‘)

Sender keeps πΏπ‘Žπ‘ π‘‘π΅π‘¦π‘‘π‘’π‘†π‘’π‘›π‘‘ βˆ’ πΏπ‘Žπ‘ π‘‘π΅π‘¦π‘‘π‘’π΄π‘π‘˜π‘’π‘‘ β‰€π‘Ÿπ‘€π‘›π‘‘

Page 6: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Flow Control VS Congestion Control

End-to-end flow control looks at β€œselfish” control function Make sure sufficient buffer at destination

Congestion control solves a β€œsocial” problem End-to-end flows of the network cooperate to

avoid/recover from congestion of the intermediate nodes/routers they share

Page 7: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Connectionless Flows

Dest1

Source

Source

Router

Multiple flows passing through a set of routers

Source

Dest2

Router

Router

Page 8: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Congestion Avoidance/Control

Congestion control: Detect and reduce load from the β€œCliff”

Congestion avoidance: Operate network at the β€œKnee”

Page 9: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

DECbit Scheme: 1-bit Feedback

Minimum feedback information One congestion avoidance bit

Set by the router if congested

Destination sends it back in ACK

When does the router set avoidance bit?

What does an end-host respond?

0 1

1

Congestion Avoidance Bit

Page 10: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Optimization Criteria (Metrics)

Efficiency Maximize β€œPower”

π‘ƒπ‘œπ‘€π‘’π‘Ÿ ≝ π‘‡β„Žπ‘Ÿπ‘œπ‘’π‘”β„Žπ‘π‘’π‘‘π›Ό

π‘…π‘’π‘ π‘π‘œπ‘›π‘ π‘’ π‘‡π‘–π‘šπ‘’, 0 < 𝛼 < 1.

Operate at β€œKnee” when maximizing for 𝛼 = 1

π‘…π‘’π‘ π‘œπ‘’π‘Ÿπ‘π‘’ 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 ≝ π‘…π‘’π‘ π‘œπ‘’π‘Ÿπ‘π‘’ π‘ƒπ‘œπ‘€π‘’π‘Ÿ

π‘…π‘’π‘ π‘œπ‘’π‘Ÿπ‘π‘’ π‘ƒπ‘œπ‘€π‘’π‘Ÿ π‘Žπ‘‘ 𝐾𝑛𝑒𝑒

Less than 100% efficiency can happen when β€’ Underutilize capacity (low throughput)

β€’ Overutilize capacity (high response time)

Page 11: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Optimization Criteria (Metrics)

Fairness Maximize Jain’s index

𝐽 π‘₯ = π‘₯𝑖𝑛𝑖=1

2

𝑛 π‘₯𝑖2𝑛

𝑖=1

π‘₯𝑖 denotes π‘–β€˜s resource share, absolute or %

𝐽 π‘₯ ∈ 0,1

Independent of scale

Continuous

𝐽 π‘₯ = π‘˜/𝑛 if only k users are allocated equally

Page 12: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Optimization Criteria (Metrics)

Distributedness Only depends on the congestion avoidance bit

End-hosts control independently

Convergence Responsiveness

Smoothness

Page 13: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Congestion Detection at Router

Assumption: single server FIFO type

Metrics: 1) utilization 𝜌, 2) # of packets 𝐿

Packet size distribution determine service time distribution

When packet size varies a lot, utilization 𝜌 is not a good measure of congestion

𝐿 is used instead to measure congestion

Page 14: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Hysteresis algorithm

Two thresholds 0 < 𝐿1 < 𝐿2 Set congestion signal when 𝐿 > 𝐿2

Unset congestion signal when 𝐿 < 𝐿1

Equivalently, the algorithm maintains a center 𝐢 and width 𝐾 such that 𝐿1 = 𝐢 βˆ’ 𝐾 and 𝐿2 = 𝐢 + 𝐾

Power is maximized (in experiment) with 𝐢 = 1 and 𝐾 = 0 (or 𝑇1 = 𝑇2 = 1)

Set congestion avoidance bit when 𝐿 β‰₯ 1

Page 15: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Hysteresis algorithm

Source

Source

Router Source

π‘³πŸ π‘³πŸ = πŸ‘

Dest

π‘ͺ 𝑲

Page 16: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Feedback Filter at Router

Do not use instantaneous value of 𝐿(𝑑)

Average over time interval 𝑇

Using last (busy + idle) cycle time plus the busy period of the current cycle

Page 17: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

What do end-hosts respond?

From a sender’s perspective πΏπ‘Žπ‘ π‘‘π΅π‘¦π‘‘π‘’π‘†π‘’π‘›π‘‘ βˆ’ πΏπ‘Žπ‘ π‘‘π΅π‘¦π‘‘π‘’π΄π‘π‘˜π‘’π‘‘ ≀ min 𝑐𝑀𝑛𝑑, π‘Ÿπ‘€π‘›π‘‘

How to control the congestion window 𝑐𝑀𝑛𝑑?

Four aspects: Decision Frequency

Use of the Received Information

Signal Filtering

Decision Function

Page 18: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

User Policy: Decision Frequency

Update after each acknowledgement Sliding window size

oscillates frequently

Update after receiving π‘Šπ‘ +π‘Šπ‘ ACKs

π‘Šπ‘ and π‘Šπ‘ are the sizes of the previous and current sliding windows

Page 19: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

User Policy: Signal Filtering

Use of Received Information Only the most recent π‘Šπ‘ packets are examined

Drop old information (π‘Šπ‘ packets) after update

Signal Filtering Reduce π‘Šπ‘ if more than 50% of the bits are set

Increase π‘Šπ‘ otherwise

Why do we use 50% as a cutting point? Depends on optimal system utilization πœŒβˆ—

Depends on the used threshold 𝐢

Page 20: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

User Policy: Signal Filtering

Under M/M/1,

Power =Throughput

π‘…π‘‡π‘‡β‰ˆ

πœ†

E π‘Š= πœ‡2 1 βˆ’ 𝜌 𝜌

Max power is attained at πœŒβˆ— = 0.5

At the optimum, πœ‹0βˆ— = 1 βˆ’ πœŒβˆ— = 0.5, πœ‹π‘–

βˆ— = πœŒβˆ—π‘–πœ‹0

Given a threshold 𝐢 to set congestion bit At the optimum operating point β‡’ Pβˆ— bit set = 1 βˆ’ πœ‹0

βˆ— βˆ’ πœ‹1βˆ— βˆ’β‹―βˆ’ πœ‹πΆβˆ’1

βˆ—

If more than Pβˆ— bit set Γ— π‘Šπ‘ packets are set, system is over-utilized.

Page 21: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

User Policy: Signal Filtering

Use of Received Information Only the most recent π‘Šπ‘ packets are examined

Drop old information (π‘Šπ‘ packets) after update

Signal Filtering Reduce π‘Šπ‘ if more than 50% of the bits are set

Increase π‘Šπ‘ otherwise

Decision Function How much to increase/decrease?

Page 22: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Decision Function Requirements

Achieve efficiency (high resource power)

Achieve fairness (high Jain’s index)

Minimize oscillations

Minimize convergence time

Page 23: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Linear Decision Choices

1. Additive increase additive decrease (AIAD) ↑: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– + 𝑏; ↓: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– βˆ’ 𝑑

2. Additive increase multiplicative decrease (AIMD) ↑: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– + 𝑏; ↓: π‘Šπ‘

𝑖 = π‘‘π‘Šπ‘π‘–

3. Multiplicative increase additive decrease (MIAD) ↑: π‘Šπ‘

𝑖 = π‘π‘Šπ‘π‘–; ↓: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– βˆ’ 𝑑

4. Multiplicative increase and decrease (MIMD) ↑: π‘Šπ‘

𝑖 = π‘π‘Šπ‘π‘–; ↓: π‘Šπ‘

𝑖 = π‘‘π‘Šπ‘π‘–

Page 24: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

References

Dah Ming Chiu and Raj Jain, β€œAnalysis of the Increase and Decrease Algorithms for Congestion Avoidance in Computer Networks”, Computer Networks and ISDN Systems, 1989, Vol. 17, pp. 1-14.

Page 25: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Synchronous Feedback Model

Feedback control loop is synchronous

Congestion state is determined by the number of packets in the system

Single bottleneck and binary feedback

𝑦 𝑑 =

0 𝑖𝑓 π‘₯𝑖 𝑑

𝑛

𝑖=1

≀ 𝐢

1 𝑖𝑓 π‘₯𝑖 𝑑

𝑛

𝑖=1

> 𝐢

Page 26: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Distributed Linear Control

Each user 𝑖 adjust the window size π‘₯𝑖 as a linear function based on feedback

π‘₯𝑖 𝑑 + 1 = π‘ŽπΌ + 𝑏𝐼π‘₯𝑖(𝑑) 𝑖𝑓 𝑦 𝑑 = 0

π‘Žπ· + 𝑏𝐷π‘₯𝑖(𝑑) 𝑖𝑓 𝑦 𝑑 = 1

Decision on the values of π‘ŽπΌ, π‘Žπ·, 𝑏𝐼 and 𝑏𝐷. AIAD: π‘ŽπΌ > 0 > π‘Žπ·; 𝑏𝐼 = 𝑏𝐷 = 1.

AIMD: π‘ŽπΌ > 0 = π‘Žπ·; 0 < 𝑏𝐷 < 𝑏𝐼 = 1.

MIAD: π‘Žπ· < 0 = π‘ŽπΌ; 𝑏𝐷 = 1 < 𝑏𝐼 .

MIMD: π‘ŽπΌ = π‘Žπ· = 0; 0 < 𝑏𝐷 < 1 < 𝑏𝐼 .

Page 27: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Pictorial Explanation/Intuition

Additive Movement

Multiplicative Movement

Page 28: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

AIMD Works

Page 29: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

AIAD Not Fair (so as MIMD)

Page 30: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

π‘₯ 𝑑 + 1 = π‘Ž + 𝑏π‘₯ 𝑑

π‘Ž ≀ 0; 𝑏 ≀ 1 needed

Efficiency Convergence

𝒂 ≀ 𝟎 𝒃 ≀ 𝟏

𝒂 β‰₯ 𝟎 𝒃 β‰₯ 𝟏

𝒂 ≀ 𝟎 𝒃 β‰₯ 𝟏

𝒂 β‰₯ 𝟎 𝒃 ≀ 𝟏

Page 31: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Fairness Convergence

Conclusion: Decrease must be multiplicative in order to achieve fairness and efficiency.

Page 32: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Increase Fairness & Efficiency

Conclusion: Optimal increase is additive in order to achieve fairness and efficiency.

Page 33: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Decision Function Choices

1. Additive increase additive decrease (AIAD) ↑: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– + 𝑏; ↓: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– βˆ’ 𝑑

2. Additive increase multiplicative decrease (AIMD) ↑: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– + 𝑏; ↓: π‘Šπ‘

𝑖 = π‘‘π‘Šπ‘π‘–

3. Multiplicative increase additive decrease (MIAD) ↑: π‘Šπ‘

𝑖 = π‘π‘Šπ‘π‘–; ↓: π‘Šπ‘

𝑖 = π‘Šπ‘π‘– βˆ’ 𝑑

4. Multiplicative increase and decrease (MIMD) ↑: π‘Šπ‘

𝑖 = π‘π‘Šπ‘π‘–; ↓: π‘Šπ‘

𝑖 = π‘‘π‘Šπ‘π‘–

Page 34: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Optimal Convergence To

Efficiency 𝑑𝑒 : time to convergence

Responsiveness improved with large increase/decreases parameters

𝑠𝑒 : oscillation size

Smoothness improved with small increase/decreases parameters

Fairness AIMD is the optimal mechanism

that convergences to fairness

Page 35: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Buffer Management

Buffer over-flow under congestion When to drop packets?

Which packets to drop?

Dest

Source

Source

Router

1.5-Mbps T1 link

Page 36: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-36

Chapter 4 Network Layer

A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers).

They’re in PowerPoint form so you can add, modify, and delete slides

(including this one) and slide content to suit your needs. They obviously

represent a lot of work on our part. In return for use, we only ask the

following:

If you use these slides (e.g., in a class) in substantially unaltered form, that

you mention their source (after all, we’d like people to use our book!)

If you post any slides in substantially unaltered form on a www site, that

you note that they are adapted from (or perhaps identical to) our slides, and

note our copyright of this material.

Thanks and enjoy! JFK/KWR

All material copyright 1996-2010

J.F Kurose and K.W. Ross, All Rights Reserved

Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

Page 37: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-37

Chapter 4: Network Layer

4. 1 Introduction

4.2 Virtual circuit and datagram networks

4.3 What’s inside a router?

4.4 IP: Internet Protocol Datagram format

IPv4 addressing

ICMP

IPv6

4.5 Routing algorithms Link state

Distance Vector

Hierarchical routing

4.6 Routing in the Internet RIP

OSPF

BGP

4.7 Broadcast and multicast routing

Page 38: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-38

Router Architecture Overview

two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP)

forwarding datagrams from incoming to outgoing link

switching fabric

routing processor

router input ports router output ports

Page 39: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-39

line termination

link layer

protocol (receive)

lookup, forwarding

queueing

Input Port Functions

Decentralized switching: given datagram dest., lookup output port

using forwarding table in input port memory

goal: complete input port processing at β€˜line speed’

queuing: if datagrams arrive faster than forwarding rate into switch fabric

Physical layer: bit-level reception

Data link layer: e.g., Ethernet see chapter 5

switch fabric

Page 40: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-40

Switching fabrics

transfer packet from input buffer to appropriate output buffer

switching rate: rate at which packets can be transfer from inputs to outputs often measured as multiple of input/output line rate

N inputs: switching rate N times line rate desirable

three types of switching fabrics

memory

memory

bus crossbar

Page 41: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-41

Switching Via Memory

First generation routers:

traditional computers with switching under direct control of CPU

packet copied to system’s memory

speed limited by memory bandwidth (2 bus crossings per datagram)

input port (e.g.,

Ethernet)

memory

output port (e.g.,

Ethernet)

system bus

Page 42: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-42

Switching Via a Bus

datagram from input port memory

to output port memory via a shared bus

bus contention: switching speed limited by bus bandwidth

32 Gbps bus, Cisco 5600: sufficient speed for access and enterprise routers

bus

Page 43: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-43

Switching Via An Interconnection Network

overcome bus bandwidth limitations

Banyan networks, crossbar, other interconnection nets initially developed to connect processors in multiprocessor

advanced design: fragmenting datagram into fixed length cells, switch cells through the fabric.

Cisco 12000: switches 60 Gbps through the interconnection network

crossbar

Page 44: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-44

Output Ports

buffering required when datagrams arrive from fabric faster than the transmission rate

scheduling discipline chooses among queued datagrams for transmission

line termination

link layer

protocol (send)

switch fabric

datagram buffer

queueing

Page 45: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-45

Output port queueing

buffering when arrival rate via switch exceeds output line speed

queueing (delay) and loss due to output port buffer overflow!

at t, packets more from input to output

one packet time later

switch fabric

switch fabric

Page 46: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-46

How much buffering?

RFC 3439 rule of thumb: average buffering equal to β€œtypical” RTT (say 250 msec) times link capacity C e.g., C = 10 Gpbs link: 2.5 Gbit buffer

recent recommendation: with N flows, buffering equal to RTT C .

N

Page 47: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Network Layer 4-47

Input Port Queuing

fabric slower than input ports combined -> queueing may occur at input queues queueing delay and loss due to input buffer overflow!

Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward

output port contention: only one red datagram can be

transferred. lower red packet is blocked

one packet time later: green packet experiences HOL

blocking

switch fabric

switch fabric

Page 48: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

References

Sally Floyd and Van Jacobson, β€œRandom Early Detection Gateway for Congestion Avoidance”, IEEE/ACM Transactions on Networking, Vol. 1 No. 4, August 1993.

Page 49: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Congestion Avoidance

β€œDefault” mechanism: FIFO, droptail Congestion can be detected after packet drop

Induce long queues and queueing delays

Main goal and desirable objectives Provide congestion avoidance by controlling the

average queue length

High throughput and low delay

Routers can detect congestion better Distinguish propagation and queueing delay

Page 50: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Random Early Detection (RED)

Does not assume cooperative end hosts, and provide probabilistic fairness to flows

General buffer management scheme that can be used with other congestion control mechanisms, e.g. TCP, and scheduling mechanisms, e.g. FIFO, priority queueing.

Does not require all routers in the Internet to implement in order for RED to work (incremental deployment is possible)

Avoid global synchronization

Page 51: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Versus DECbit

Computing average queue size DECbit: last (busy+idle) cycle + current busy

cycle for averaging queue size

RED: time-based exponential decay

Notifying congestion DECbit: no separation of detection and marking,

biased against bursty traffic

RED: randomized marking, avoid global synchronization

Page 52: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Algorithm (high-level)

For each packet arrival

calculate the average queue size π‘Žπ‘£π‘”

𝑖𝑓 π‘‘π‘šπ‘–π‘›β‰€ π‘Žπ‘£π‘” < π‘‘π‘šπ‘Žπ‘₯

calculate probability π‘π‘Ž

mark the arriving packet with probability π‘π‘Ž

𝑒𝑙𝑠𝑒 𝑖𝑓 π‘‘π‘šπ‘Žπ‘₯ ≀ π‘Žπ‘£π‘”

mark the arriving packet

Page 53: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Active Queue Management

𝑝 π‘₯ =

0, 0 ≀ π‘₯ < π‘‘π‘šπ‘–π‘›

π‘₯ βˆ’ π‘‘π‘šπ‘–π‘›

π‘‘π‘šπ‘Žπ‘₯ βˆ’ π‘‘π‘šπ‘–π‘›π‘π‘šπ‘Žπ‘₯ , π‘‘π‘šπ‘–π‘› ≀ π‘₯ ≀ π‘‘π‘šπ‘Žπ‘₯

1, π‘‘π‘šπ‘Žπ‘₯ < π‘₯

π’•π’Žπ’Šπ’ π’•π’Žπ’‚π’™

π’‘π’Žπ’‚π’™

1

0

Page 54: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Algorithm (part 1)

Initialization: a𝑣𝑔 = 0; π‘π‘œπ‘’π‘›π‘‘ = βˆ’1;

for each packet arrival

calculate the average queue size π‘Žπ‘£π‘”:

𝑖𝑓 π‘žπ‘’π‘’π‘’π‘’ 𝑖𝑠 π‘›π‘œπ‘›π‘’π‘šπ‘π‘‘π‘¦: π‘Žπ‘£π‘” = 1 βˆ’ π‘€π‘ž π‘Žπ‘£π‘” + π‘€π‘žπ‘ž

𝑒𝑙𝑠𝑒: π‘š = 𝑓 π‘‘π‘–π‘šπ‘’ βˆ’ π‘ž_π‘‘π‘–π‘šπ‘’ ;

π‘Žπ‘£π‘” = 1 βˆ’ π‘€π‘žπ‘šπ‘Žπ‘£π‘”

Page 55: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Algorithm Variables

π‘€π‘ž: the discount weight for historical avg.

If π‘€π‘ž is too big, the router cannot filter transient congestions

An upper bound of is derived in the paper

π‘ž_π‘‘π‘–π‘šπ‘’: starting time of the most recent idle period

π‘š = 𝑓 π‘‘π‘–π‘šπ‘’ βˆ’ π‘ž_π‘‘π‘–π‘šπ‘’ : # of packets that could have been transmitted during the idle period

Page 56: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Algorithm (part 2)

𝑖𝑓 π‘‘π‘šπ‘–π‘›β‰€ π‘Žπ‘£π‘” < π‘‘π‘šπ‘Žπ‘₯

π‘π‘œπ‘’π‘›π‘‘ = π‘π‘œπ‘’π‘›π‘‘ + 1;

calculate probability π‘π‘Ž:

𝑝𝑏 = π‘π‘šπ‘Žπ‘₯(π‘Žπ‘£π‘” βˆ’ π‘‘π‘šπ‘–π‘›)/(π‘‘π‘šπ‘Žπ‘₯ βˆ’ π‘‘π‘šπ‘–π‘›);

π‘π‘Ž = 𝑝𝑏/(1 βˆ’ π‘π‘œπ‘’π‘›π‘‘ Γ— 𝑝𝑏);

with probability π‘π‘Ž:

mark the arriving packet; π‘π‘œπ‘’π‘›π‘‘ = 0;

𝑒𝑙𝑠𝑒 𝑖𝑓 π‘‘π‘šπ‘Žπ‘₯ ≀ π‘Žπ‘£π‘”

mark the arriving packet; π‘π‘œπ‘’π‘›π‘‘ = 0;

𝑒𝑙𝑠𝑒 π‘π‘œπ‘’π‘›π‘‘ = βˆ’1;

When queue becomes empty: π‘ž_π‘‘π‘–π‘šπ‘’ = π‘‘π‘–π‘šπ‘’

Page 57: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

RED Algorithm Variables

π‘π‘œπ‘’π‘›π‘‘: # of unmarked packets under congestion No congestion: π‘π‘œπ‘’π‘›π‘‘ = βˆ’1

Just marked a packet, reset: π‘π‘œπ‘’π‘›π‘‘ = 0

The most recent 𝑛 packets are not marked under congestion: π‘π‘œπ‘’π‘›π‘‘ = 𝑛

Page 58: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Relationship between π‘π‘Ž and 𝑝𝑏

π‘π‘Ž = 𝑝𝑏/(1 βˆ’ π‘π‘œπ‘’π‘›π‘‘ Γ— 𝑝𝑏)

π‘π‘Ž increases with π‘π‘œπ‘’π‘›π‘‘

Ensure that the router does not wait too long before marking a packet

Make inter-dropping time uniform

Page 59: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Relationship between π‘π‘Ž and 𝑝𝑏

Use 𝑝𝑏 as the final dropping probability Inter-dropping time 𝑇𝑏 is a geometric r.v.

Prob 𝑇𝑏 = 𝑛 = 1 βˆ’ π‘π‘π‘›βˆ’1𝑝𝑏; E 𝑇𝑏 = 1/𝑝𝑏

More desirable to have uniform distribution

Use π‘π‘Ž as the final dropping probability

Prob π‘‡π‘Ž = 𝑛

=

𝑝𝑏1 βˆ’ 𝑛 βˆ’ 1 𝑝𝑏

1βˆ’π‘π‘

1 βˆ’ 𝑖𝑝𝑏

π‘›βˆ’2

𝑖=0= 𝑝𝑏 1 ≀ 𝑛 ≀ 1/𝑝𝑏

0 𝑛 > 1/𝑝𝑏

E π‘‡π‘Ž =1

2𝑝𝑏+1

2

Page 60: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Simulation Results

Topology 4 FTP flows and 1 RED router

Parameters π‘šπ‘–π‘›π‘‘β„Ž = 5; π‘šπ‘Žπ‘₯π‘‘β„Ž = 15; π‘€π‘ž = 0.002

Page 61: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Simulation Results

π‘π‘Ž

Page 62: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

Simulation Results

Page 63: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

How About TCP?

How to control congestion window sizes?

How to infer congestion?

Why and how to estimate and smooth RTT?

What is Slow Start? Why do we need it?

Retransmit timer back-off policy

Acknowledgement sending policy

Page 64: School of Computing National University of SingaporeUnder M/M/1, Power = Throughput 𝑅𝑇𝑇 β‰ˆ πœ† Eπ‘Š =πœ‡21βˆ’ Max power is attained at βˆ—=0.5 At the optimum, 0 βˆ—=1βˆ’

References

Van Jacobson, β€œCongestion Avoidance and Control”, ACM Computer Communication Review Vol. 18, No. 4, August 1988, pp. 314-329.