![Page 1: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/1.jpg)
WPI
TCP CUBIC in ns-3
CS577Brett Levasseur
12/10/2013
![Page 2: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/2.jpg)
WPI
2
Outline
• Introduction• CUBIC• CUBIC in Linux• ns-3 Implementation• Results• Conclusions
12/10/2013
![Page 3: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/3.jpg)
WPI
3
Introduction
• TCP grows cwnd too slowly for large bandwidth connections
• New TCP Variant needed
12/10/2013
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.60
20,000,000
40,000,000
60,000,000
80,000,000
100,000,000
120,000,000
10Gbps
cwnd
Hours
Bytes
1,250 byte packetsssthresh ~ 8000 bytes100ms RTT
Almost 1.4 hours to take up ½ possible cwnd
![Page 4: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/4.jpg)
WPI
4
CUBIC
• BIC was first attempt• CUBIC simplified and improved upon BIC• Grow cwnd slower around loss events
12/10/2013
![Page 5: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/5.jpg)
WPI
5
CUBIC Basics
• cwnd growth
• Packet loss
12/10/2013
C CUBIC parameter
t Elapsed time from the last window reduction
K Time period to increase W to Wmax
W Current cwnd
Wmax cwnd at last window reduction
β Window decrease constant
![Page 6: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/6.jpg)
WPI
6
0 2 4 6 8 10 12 140
50
100
150
200
250
300
CUBIC Basics
12/10/2013
Wmax
W(t=0)
• At loss event set Wmax, reduce cwnd by β and calculate K
![Page 7: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/7.jpg)
WPI
7
CUBIC Basics
12/10/2013
0 2 4 6 8 10 12 140
50
100
150
200
250
300
K
W(t=1)
W(t=2)
• cwnd grows back to K when t = K
W(t=K)
![Page 8: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/8.jpg)
WPI
8
CUBIC in Linux
• Not implemented as in the CUBIC paper• cwnd grows in increments of segment sizes• Custom method for calculating cube roots• Checks for error conditions• Unit scaling
12/10/2013
![Page 9: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/9.jpg)
WPI
9
Growing cwnd
• Linux only grows cwnd by full segments
• CUBIC can grow cwnd less than full segment
• Same impact by increasing amount of time between updates
12/10/2013
0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
1.2
0 0
1 0.25
2 0.5
3 0.75
4 1
0 0
4 1
![Page 10: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/10.jpg)
WPI
10
Scaling in CUBIC
• Most scaling is related to time• Variable ‘t’ measured with TCP timestamps– Timestamps use clock cycles to increment– Units are called jiffies in the Linux Kernel
• Number of milliseconds in a jiffy depends on the CPU’s clock
• Scaling required to get time units correct
12/10/2013
![Page 11: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/11.jpg)
WPI
11
ns-3 Implementation
• Object oriented design• Generic TCP defined• TCP variants are
extended from base• TCP headers and buffers
provided• Added TcpCubic object– tcp-cubic.cc– tcp-cubic.h
12/10/2013
![Page 12: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/12.jpg)
WPI
12
ns-3 Methods
• NewAck – called for every new ACK received– Normal cwnd updates in slow start– CUBIC updates otherwise
• DupAck – called for every duplicate ACK received– Normal operation when < 3 duplicates– For 3 duplicate ACKs reduce cwnd
12/10/2013
![Page 13: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/13.jpg)
WPI
13
CUBIC Methods
• CubicRoot – Find the cubic root of a number– Based on Linux Kernel implementation
• CubicUpdate – Calculate the cwnd target for CUBIC
• CubicTcpFriendliness – Change the cwnd target for TCP Friendliness
• CubicReset – Reset CUBIC parameters
12/10/2013
![Page 14: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/14.jpg)
WPI
14
CUBIC Flow
12/10/2013
NewAck CubicRootCubicUpdate CubicTcpFriendliness
If outside slow startSet K for loss event
Check TCPFriendliness
Recommended cwnd growth
![Page 15: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/15.jpg)
WPI
15
Issues
• ns-3 does not have TCP timestamps• Simulation clock used instead• Requires adjustments to calculating ‘t’ due to
different units• Could remove the use of jiffy code but much
of the Linux implementation relies on scaling factors based on the system clock
12/10/2013
![Page 16: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/16.jpg)
WPI
16
Results
• Compare to real world CUBIC example• Examine simulation results– Verify cwnd reduction– Verify cwnd growth in relation to Wmax
• Compare simulated CUBIC to simulated NewReno
12/10/2013
![Page 17: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/17.jpg)
WPI
17
Simulation Scenario
• Simple sender and sink topology
• Packet sizes 536 bytes• Transmission rate
1Mbps• Delay 40ms• Error rate – Causes lost
packets at the receiver
12/10/2013
![Page 18: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/18.jpg)
WPI
18
Measurements
12/10/2013
• Measurement and simulation have similar CUBIC curve
• Number of segments similar
![Page 19: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/19.jpg)
WPI
19
Packet Loss
• Before loss cwnd = 216• After loss cwnd = 172• β = 819• BICTCP_BETA_SCALE = 1024
12/10/2013
![Page 20: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/20.jpg)
WPI
20
CUBIC Growth
12/10/2013
• Before and after additional scaling of ‘t’• More work is needed for using simulator clock
with ‘t’
concave
concave &convex
convex
![Page 21: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/21.jpg)
WPI
21
NewReno Comparison
• Same simulation run with CUBIC and NewReno
• Both increment the same under slow start
• CUBIC grows cwnd faster
• CUBIC handles packet loss better than NewReno
12/10/2013
![Page 22: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/22.jpg)
WPI
22
Conclusions
• Created a CUBIC implementation in ns-3• Similar cwnd growth to actual CUBIC
measurements• Current version outperforms NewReno• Scaling adjustments required
12/10/2013
![Page 23: WPI TCP CUBIC in ns-3 CS577 Brett Levasseur 12/10/2013](https://reader035.vdocument.in/reader035/viewer/2022062309/56649f355503460f94c5326c/html5/thumbnails/23.jpg)
WPI
23
Questions
12/10/2013