MATLAB Answers

TCP congestion control algorithm

33 views (last 30 days)
Hi,
Is there anyone who could help me to have some suggestion regarding TCP congestion control algorithm. There have different types of TCP like Reno, Westood, Vegas, bandwidth and RTT detection based, Jersey etc. I do have idea about the slow start, congestion avoidance, fast retransmit and fast recovery phases which are the algorithms used in TCP. I know how these algorithms work but as I do not have very good hand on coding so I do not know how to code these algorithm by MATLAB. As well as I am not understanding how to start or from where to start. TCP works like,
  1. Measures the Smoothed RTT,
  2. increases/decreases congestion window based on the phases,
  3. sets the slow start threshold
More specifically, if we take the link parameters like,
  1. Data Rate (10 Mbps)
  2. Propagation Delay (250 ms)
  3. Loss Rate (1%)
Then,
  1. How I can send a packet from source to destination dynamically?
  2. How to receive acknowledgement to the sender? and
  3. how to specify these packet sending and receiving time and record them accordingly?
Moreover, How can I specify a source node and destionation node based on who will do these packet transferring between them.
I got some idea about it but those are coded by 'C' as well as in 'NS-2' which is Linux based. It is quite tough for me to learn this linux based simulation now as it is my final year of graduation.
If anybody could assist me to start the coding, it would be a great help for me. Please help me out.
Thank you in advance.

  5 Comments

Show 2 older comments
Walter Roberson
Walter Roberson on 12 Feb 2020
MATLAB is a Turing-Equivalent programming language. Any deterministic computation can be programmed in MATLAB provided that it can be made to fit within 2^48 bytes of memory. The computation might take a long long time of course.
The question you should be asking is about the tools that MATLAB provides to make it easier to implement what you want to simulate. I have not encountered any raw-packet-level construction tools, or ethernet-layer simulation tools in MATLAB; the only place I would expect raw-packet-level tools would be USRP. It is tempting to think of the 5G toolbox in this connection, but I don't think it simulates at the right level for your purposes.
My expectation is that you would have to write the simulation software. Stateflow might make it easier to do so.
Walter Roberson
Walter Roberson on 13 Feb 2020
Question is effectively duplicated by https://www.mathworks.com/matlabcentral/answers/505199-tcp-congestion-control-algorithm
Mohmmad Abu Yousuf
Mohmmad Abu Yousuf on 15 Feb 2020
yes. that one is also mine. I am removing one.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Feb 2020
Is there anyone who could help me to have some suggestion regarding TCP congestion control algorithm.
A number of them are described at https://en.wikipedia.org/wiki/TCP_congestion_control
I know how these algorithms work but as I do not have very good hand on coding so I do not know how to code these algorithm by MATLAB.
If the question is whether MATLAB or its toolboxes provide any functions to make it easier to construct and send and receive raw packets, the answer is NO, with the exception that Simulink Real-Time ( not Simulink Real-Time Desktop) provides a way to construct raw packets.
If the question is whether MATLAB or its toolboxes provide any functions to make it easier to emulate TCP conversations and the effect of choosing one of those TCP Flow Control techniques, the answer is that
"SimEvents® provides a discrete-event simulation engine and component library for analyzing event-driven system models and optimizing performance characteristics such as latency, throughput, and packet loss. Queues, servers, switches, and other predefined blocks enable you to model routing, processing delays, and prioritization for scheduling and communication. "
Note that this is not part of the Communications Systems Toolbox, or the 5G Toolbox, or the USRP Support Package. An event/state simulator is, however, an appropriate tool for modeling how program state logic interacts.

  1 Comment

Mohmmad Abu Yousuf
Mohmmad Abu Yousuf on 16 Feb 2020
Thank you for guiding me Mr Walter Roberson. I will follow your instructions.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by