Figure 4.12: Internet congestion control

From FBSwiki
Revision as of 17:48, 28 May 2023 by Murray (talk | contribs)
Jump to navigation Jump to search
Chapter Examples
Figure number 4.12
Figure title Internet congestion control
GitHub URL
Requires python-control

Figure-4.12-congctrl eqplot.png

Figure 4.12: Internet congestion control. (a) Source computers send information to routers, which forward the information to other routers that eventually connect to the receiving computer. When a packet is received, an acknowledgment packet is sent back through the routers (not shown). The routers buffer information received from the sources and send the data across the outgoing link. (b) The equilibrium buffer size be for a set of N identical computers sending packets through a single router with drop probability ρb.

<nowiki>
  1. congctrl_eqplot.py - congestion control equilibrium point plot
  2. RMM, 29 Jun 2007 (converted from MATLAB)
  3. The equilibrium buffer size be for a set of N identical computers sending
  4. packets through a single router with drop probability ρb.

import matplotlib.pyplot as plt import numpy as np import scipy.optimize

  1. Range of values to plot (\alpha = 1/(2\rho^2 N^2)

alpha_vals = np.logspace(-2, 4)

  1. Solve for the equilibrium value of \rho b_e

bratio_vals = [] for alpha in alpha_vals:

   # Define a function for the equilibrium point (equation (4.22))
   def equilibrium(bratio):
       return alpha * bratio**3 + bratio - 1
   bratio = scipy.optimize.fsolve(equilibrium, 0)
   bratio_vals.append(bratio)
  1. Plot the equilibrium buffer length

plt.semilogx(alpha_vals, bratio_vals) plt.xlabel(r"$1/(2 \rho^2 N^2)$ (log scale)") plt.ylabel(r"$\rho b_{e}$") plt.title("Operating point") <nowiki>