0% found this document useful (0 votes)
63 views14 pages

TCP CUBIC & CUBIC-FIT in Vehicular Networks

This document outlines a project to implement and evaluate the TCP CUBIC and CUBIC-FIT congestion control algorithms in vehicular networks. The objectives are to simulate the algorithms, assess their performance in terms of metrics like throughput and delay, and determine how they can improve data communication reliability and efficiency in vehicular scenarios. TCP CUBIC is currently one of the most widely used algorithms and aims to provide high throughput and fairness. CUBIC-FIT extends CUBIC to enhance performance over wireless links by simulating multiple flows within a connection and adjusting flow numbers based on queuing delay. The report will analyze simulating these algorithms and their potential to enhance vehicular communication systems.

Uploaded by

Pratham Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views14 pages

TCP CUBIC & CUBIC-FIT in Vehicular Networks

This document outlines a project to implement and evaluate the TCP CUBIC and CUBIC-FIT congestion control algorithms in vehicular networks. The objectives are to simulate the algorithms, assess their performance in terms of metrics like throughput and delay, and determine how they can improve data communication reliability and efficiency in vehicular scenarios. TCP CUBIC is currently one of the most widely used algorithms and aims to provide high throughput and fairness. CUBIC-FIT extends CUBIC to enhance performance over wireless links by simulating multiple flows within a connection and adjusting flow numbers based on queuing delay. The report will analyze simulating these algorithms and their potential to enhance vehicular communication systems.

Uploaded by

Pratham Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Implementation of the TCP CUBIC and CUBIC-FIT Congestion

Control Algorithm (& how they can help vehicular networks)

1. Executive Summary:

This formal project report outlines the comprehensive implementation of the TCP CUBIC and
CUBIC-FIT congestion control algorithms and their potential contributions to improving
vehicular networks. The report provides an in-depth analysis of the simulating process,
performance evaluation, and implications for enhancing the efficiency and reliability of
vehicular communication systems.

1.2 Objectives

The primary objective of this project is to implement and evaluate the TCP CUBIC and
CUBIC-FIT congestion control algorithms in the context of vehicular networks. Specifically, we
aim to:

● Implement the TCP CUBIC and CUBIC-FIT congestion control algorithms in a vehicular
network simulation environment.
● Assess the performance of these algorithms in terms of throughput, delay, fairness, and
packet loss rate (PLR).
● Investigate how these algorithms can improve the efficiency and reliability of data
communication in vehicular networks.
● Provide recommendations for the practical deployment of these algorithms in
real-world vehicular network scenarios.

2. Introduction

2.1 Background

In the ever-evolving field of computer networking, the Network Simulator 3 (NS3) stands as a
vital tool for simulating various networking technologies. Among these, the TCP CUBIC
congestion control algorithm is a critical component due to its widespread use.

TCP is the primary transport protocol on the Internet, responsible for managing network
congestion to ensure data transfer reliability. TCP CUBIC, the default congestion control
algorithm in the Linux kernel, has become one of the most widely deployed variants. Alongside
BIC and the Microsoft Windows Compound algorithm, it dominates the TCP landscape.
Computer Networks Project Report 2

__________________________________________________________________

Simulation plays a crucial role in understanding and developing congestion control algorithms
CUBIC. NS3, a popular network simulator, is used worldwide for this purpose. However, NS3
lacks native support for TCP CUBIC, which is essential for accurately modeling real-world
network behavior.

This report addresses this gap by designing and implementing TCP CUBIC in NS3 & by aligning
it with the Linux kernel's version for real life testing. To ensure accuracy, we focus on the core
principles of the CUBIC algorithm while considering Linux-specific details when necessary and
later explore the effective operation of vehicular networks that rely heavily on efficient data
communication, which is vulnerable to network congestion.

2.1 Congestion Control in Vehicular Networks

A review of the existing literature reveals that congestion control in vehicular networks is a
challenging problem. Various approaches, including modifications to the traditional TCP and
the development of new congestion control algorithms, have been proposed. However, there is
a lack of comprehensive studies evaluating the suitability of these algorithms for vehicular
networks.

2.2 TCP CUBIC


TCP CUBIC is a congestion control algorithm that has gained popularity in wired and wireless
networks due to its ability to provide high throughput and fairness. It utilizes a cubic function to
adjust the congestion window size, allowing it to respond efficiently to network congestion.
However, its performance in vehicular networks remains largely unexplored.

Handling Packet Losses:


When a packet loss event is detected, TCP CUBIC employs a variant called 'wmax' to estimate
the network's capacity.
It then sets the congestion control window size 'wcubic' to recover from congestion. The
formula for 'wcubic' is (1 - b) * wmax, where 'b' is a window decrease factor.

No Packet Losses:
In the absence of packet losses, TCP CUBIC uses 'wmax' as a parameter.
It probes the network capacity using a cubic function, which is defined by Equation (1) in the
provided text.

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 3

__________________________________________________________________

Parameter Tuning:

TCP CUBIC relies on two main parameters, 'C' and 'b,' to control its behavior.
'C' is a scaling parameter, and 'b' is the window decrease factor.

The relationship between these parameters, packet loss rate ('P LR'), and
round-trip time ('RTT') is given by Equation (2) and Equation (3) for the standard TCP CUBIC
settings.

2.3 CUBIC-FIT

​ ertainly, here's the information presented with improved formatting for equations:
C

​CUBIC-FIT is an extension of the TCP CUBIC congestion control algorithm designed to
enhance throughput performance over wireless links. It achieves this by incorporating
delay-based TCP principles and simulating multiple CUBIC flows within a single TCP
connection while adjusting the simulated flow number based on end-to-end queuing delay.
Here's a breakdown of the key elements:

​TCP CUBIC Framework & CUBIC-FIT Improvement
​TCP CUBIC treats packet losses as indicators of network congestion. When a packet loss event
occurs, TCP CUBIC adjusts its congestion control window size to recover from congestion.
Without losses, it uses a cubic function to probe network capacity.

​Equation (1):

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 4

__________________________________________________________________


​CUBIC-FIT extends the CUBIC framework by simulating multiple CUBIC flows within a single
TCP connection to maximize network capacity utilization. It uses end-to-end queuing delay to
dynamically adjust the simulated CUBIC flow number.


​Throughput Calculation
​The throughput of CUBIC-FIT depends on the parameters C and b, which are part of the CUBIC
algorithm, as well as the average packet loss rate (PLR) and average round-trip time (RTT).

​Equation (2):




​Plain CUBIC Parameters
​In the standard CUBIC setting, C is typically set to 0.4, and b is set to 0.2. This results in the
following throughput function:

​Equation (3):




​CUBIC-FIT Throughput
​Since CUBIC-FIT simulates N plain CUBIC flows using a single window, its throughput function
is calculated as follows:

​Equation (4):



_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 5

__________________________________________________________________

​ arameter Tuning
P
​To ensure proper emulation of N plain CUBIC flows, CUBIC-FIT adjusts the parameters C and b
based on N. Specifically, it sets:


​Window Growth Function
​The window growth function for CUBIC-FIT, accounting for the adjusted C and b values, is given
by:

​Equation (5):




​Aggression Control (N Parameter)
​CUBIC-FIT employs the parameter N to control its aggression. Smaller N values may
underutilize network capacity, while larger values can lead to starvation in other TCP flows. N is
updated based on end-to-end RTT using the formula:

​Equation (6):




​The parameter α is discussed further in Section III.

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 6

__________________________________________________________________


​Throughput with Queuing Delay
​The throughput of CUBIC-FIT is adjusted based on network queuing delay (q):

​Equation (7):




​A low queuing delay (q) leads to an increase in N to enhance performance when the network is
underutilized. Conversely, CUBIC-FIT reduces N to maintain fairness with plain CUBIC flows
during congestion caused by long queuing delays.

2.4 Evaluation metrics

Throughput : Throughput is the average rate at which data is transferred over a TCP
connection. It is measured in bits per second (bps).

Delay :Delay is the time it takes for a packet to travel from the sender to the receiver. It is
measured in milliseconds (ms).

Fairness : Fairness is a measure of how fairly TCP connections share network bandwidth. A fair
TCP congestion control algorithm should ensure that all connections receive a fair share of
bandwidth, regardless of their size or priority.

We will be using Jain’s fairness Index for fairness calculation

Packet Loss Rate (PLR) : PLR is the percentage of packets that are lost during transmission.

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 7

__________________________________________________________________

3 Methodology

There are 2 major ways we simulated TCP CUBIC and CUBIC-FIT

● Network simulation: We used a network simulator such as ns-3 or OMNeT++ to


simulate a network with TCP Cubic enabled. This can be useful for testing TCP Cubic in
a controlled environment and for comparing its performance to other congestion
control algorithms.

● Real-world testing: You also tested TCP Cubic in a real-world network by enabling it on
a Linux machine. To do this, we set the net.ipv4.tcp_congestion_control kernel
parameter to cubic , compiled it and tested TCP Cubic by transferring files between two
machines over our lab’s Ethernet network (wlps0).

3.1 Implementation in ns3 Simulator

TCP connection using the Cubic congestion control algorithm. The simulation collects and
analyzes various statistics, such as throughput and Jain fairness index, and visualizes the
results in a 2D plot.

3.1.1 Architecture

The code is structured as follows:

- MyApp Class: Represents the application generating TCP traffic.


- Member Variables: Store information related to the application and statistics.

- Member Functions:

- `StartApplication`: Initiates the application and starts sending packets.


- `StopApplication`: Stops the application and prints final statistics.
- `SendPacket`: Sends a packet and updates throughput statistics.
- `ScheduleTx`: Schedules the next packet transmission.
- `CalculateThroughput`: Calculates and prints throughput.
- `CalculateJainFairnessIndex`: Calculates and prints Jain fairness index.

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 8

__________________________________________________________________

- CwndChange Function: Callback function for congestion window change events to


document the results and collect data.
- main Function: Sets up the simulation environment, creates nodes and devices, installs the
TCP Cubic algorithm, and runs the simulation.

Data Structures:
- Vectors: Store statistics, including fairness indices, congestion windows, throughput values,
and times.

Plotting:
- Gnuplot Usage: The code utilizes the Gnuplot library for generating 2D plots.
- Plots: Generates a plot of throughput values against parameters.

3.1.2 Simulation Environment

Network Topology

The simulation involves two nodes connected by a point-to-point link. The TCP Cubic algorithm
is applied to the traffic generated by the `MyApp` class.

Network topology for testing

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 9

__________________________________________________________________

TCP Cubic Configuration

- Congestion Control: The TCP Cubic algorithm is utilized.


- TraceConnect: The code connects the congestion window change trace to the `CwndChange`
callback function.

Tcp state machine used in ns3 simulator

Error Model
- RateErrorModel: An error model is applied to the receiving end with a specified error rate.

Application Configuration
- Packet Generation: The `MyApp` class generates TCP traffic with specified packet size,
number of packets, and data rate.

Simulation Results

Throughput
- Calculation: Throughput is calculated and printed during the simulation.
- Visualization: The final throughput values are plotted against time using Gnuplot.

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 10

__________________________________________________________________

Figure1 : Throughput vs Time

Jain Fairness Index


- Calculation: Jain fairness index is calculated and printed during the simulation.
- Visualization: Fairness indices are collected and can be analyzed.

Figure2 : Jain Fairness Index against Time

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 11

__________________________________________________________________

Congestion Window
- Visualization: Congestion window values are traced and can be visualized vs Time

Figure3 : Congestion window vs Time

- Visualization: Congestion window values are traced and can be visualized vs Fairness Index
Values

Figure4 : Congestion window vs Fairness Index Values

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 12

__________________________________________________________________

3.2 Implementation in Real-life

Kernel Source Code:


We obtained the source code for Linux kernel version 2.6.2, by downloading it from the official
Linux kernel repository

Modify Congestion Control Algorithm:


The congestion control algorithms were located in the kernel source code, in the net directory,
specifically in files related to TCP congestion control. The default congestion control algorithm,
including TCP Cubic, was located in net/ipv4/tcp_cong.c.

We implemented or modified the TCP Cubic congestion control algorithm within the specified
files.

Compile and Install the Modified Kernel:


The modified kernel source code was compiled, involving configuring the kernel and
performing the compilation. The new kernel was then installed on our systems, following the
instructions provided in the Linux kernel documentation for building and installing a custom
kernel.

Configure Congestion Control Algorithm:


After installing the modified kernel, the TCP Cubic congestion control algorithm was configured
for the TCP stack. This configuration was typically done through sysctl settings or specific
configuration files, such as using the following command:

sysctl -w net.ipv4.tcp_congestion_control=cubic

The configuration set the TCP Cubic algorithm as the default congestion control algorithm.
Packet Transmission:

We utilized tools like iperf as this allowed us to observe and analyze the behavior of the TCP
Cubic congestion control algorithm in a controlled environment with commands like

# Example iperf command for a TCP test with 100 Mbps bandwidth and 200 ms delay (100 on
each side)

iperf -c <receiver_ip > -t <test_duration > -i <report_interva l> -b 100M

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 13

__________________________________________________________________

Performance Evaluation:
The performance of the TCP Cubic congestion control algorithm was measured and evaluated.
Factors such as throughput, delay, were monitored to assess the algorithm's effectiveness
under specific network conditions while packet loss rate was adjusted by giving jitter
parameter as zero for our testing purposes

Debugging and Iteration:


Any issues encountered during testing were debugged, and the implementation was iterated
upon based on observed behavior and performance. Adjustments were made to improve the
algorithm's functionality and address any identified issues.

5 Conclusion

The NS-3 implementation successfully simulated a TCP connection using the Cubic congestion
control algorithm. Throughput, Jain fairness index, and congestion window statistics are
collected and visualized

● In Figure 3: Congestion window vs Jain’s Fairness Index the graph of congestion


window vs. time shows that the congestion window is initially increasing rapidly, then
slows down and becomes linear, likely due to slow start and congestion avoidance. The
congestion window eventually reaches a plateau, suggesting the network's maximum
allowable throughput.

Upon further examining the graph we can see phases 0-0.2 seconds: Slow start, 0.2-0.4
seconds: Congestion avoidance, 0.4-0.6 seconds: Congestion, 0.6-0.8 seconds: Fast recovery,
0.8-1 second: Congestion avoidance. The graph indicates a positive correlation between
processing time and the fairness index, reflecting improved fairness in data processing. The
system's upward trend suggests equitable resource distribution over time, emphasizing the
importance of balancing speed and fairness.

● Figure 4: Congestion Window vs Fairness shows the fairness index increasing over
time, indicating improved fairness. The congestion window decreases with fairness,
implying enhanced network capacity. Despite congestion window spikes, the fairness
index remains stable, ensuring fair bandwidth distribution during congestion.

Overall, The implementation provides a comprehensive understanding of network behavior,


concluding that TCP CUBIC and CUBIC-FIT are well-suited for vehicular networks.

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar
Computer Networks Project Report 14

__________________________________________________________________

6 Recommendations for Future Work

The following are some recommendations for future work:

● Making more comprehensive testing scenarios/ conditions in real life testing scenarios
and analyzing them with better tools like wireshark to better visualize the behavior of
TCP Cubic under different conditions.

● Make more complex V2X scenarios for evaluation of Congestion Control Algorithm
using Omnet++ , Sumo , Netlink like

1. Scenarios with a mix of different types of vehicles: Scenarios with different traffic
conditions: For example, a scenario with heavy traffic congestion and a scenario with
light traffic congestion.
2. Scenarios with different network conditions: For example, a scenario with a
high-bandwidth network and a scenario with a low-bandwidth network.
3. Scenarios with different types of V2X applications: For example, a scenario with
cooperative adaptive cruise control (CACC) and a scenario with vehicle-to-infrastructure
(V2I) communication.
● Conduct a more comprehensive evaluation of TCP CUBIC and CUBIC-FIT in a real-world
vehicular network.

7 References
1 J. Wang, J. Wen, Y. Han, J. Zhang, C. Li and Z. Xiong, "CUBIC-FIT: A High Performance and TCP CUBIC
Friendly Congestion Control Algorithm," in IEEE Communications Letters, vol. 17, no. 8, pp. 1664-1667,
August 2013, doi: 10.1109/LCOMM.2013.060513.130664.

2 TCP Performance - CUBIC, Vegas y Reno Ing. Luis Marrone [email protected] Lic. Andres
Barbieri ´ [email protected] Mg. Mat´ıas Robles [email protected] LINTI - Facultad de
Informatica ´ Universidad Nacional de La Plata La Plata, Buenos Aires, Argentina

3 Wang, Jingyuan & Wen, Jiangtao & Han, Yuxing & Zhang, Jun & Li, Chao & Xiong, Zhang. (2013).
CUBIC-FIT: A high performance and tcp CUBIC friendly congestion control algorithm. Communications
Letters, IEEE. 17. 1664-1667. 10.1109/LCOMM.2013.060513.130664.

4 ns-3 tutorial: 7.3 A Real Example

_______________________________________________________________________________________________________

Submitted to: Dr.Suresh Chavhan Submitted by : Pratham Jain


Rushikesh Muneshwar

You might also like