TEORÍA DE REDES DE TELECOMUNICACIONES Grao en Ingeniería Telemática Grao en Ingeniería en Sistemas e Telecomunicación Curso 2015-2016 Lab work #8. Congestion control (1 session) Author: Pablo Pavón Mariño
1 Objectives The goals of this lab work are: 1. Create Net2Plan algorithms that solve formulations of the congestion control problem using the Java Optimization Moeler (JOM) library. 2. Gain experience with the ifferent forms of writing optimization problems in JOM, making benefit of its vectorial representation capabilities. 2 Duration This lab work is esigne for one session of two hours. 3 Evaluation This lab work has been esigne to guie the stuents in their learning of Net2Plan. The annotations the stuents make in this ocument are for their use when stuying the course, an o not have to be elivere to the teacher for evaluation. 4 Documentation The resources neee for this lab work are: JOM library ocumentation (see http://www.net2plan.com/jom). Net2Plan tool an their ocumentation (see http://www.net2plan.com/). Instructions in this woring. 5 Previous work before coming to the lab Rea Section 3.8 an 6.2 of [1], an the lecture notes regaring congestion control. Refresh your reaing in the JOM ocumentation in http://www.net2plan.com/jom, in particular, how vector of variables an constraints are hanle. 6 Estimating the performance of TCP Reno sources Let G(N, E) be a network, where the set of noes N an the set of links E are given. Link capacities (u e, e E) are known. The offere traffic is compose of a set of unicast emans D. For each eman D, the sequence of traverse links p is known, but the amount of offere traffic h is unknown. We assume that each eman represents one uniirectional flow of a TCP elephant connection (that is always willing to transmit traffic), using a TCP-Reno version. As we have seen in the lectures, 1
the NUM moel (Network Utility Maxmimization) can be use to estimate the average (in macroscopic equilibrium) injecte traffic of each connection. In particular, the TCP connection average rates are given by the optimum solution of the following formulation: Input parameters (known constants): N : Set of network noes. E: Set of network links. u e, e E: Capacity of link e. D: Set of offere unicast emans (TCP connections, consiere uniirectional). p, D: Sequence of traverse links of the TCP connection. We enote as P e to the set of TCP connections that traverse a given link e. RT T, D: Roun-trip-time of the packets in connection. We assume here that a connection RTT consiers only the propagation time of the traverse links (multiplie by two, to account for the return path). Decision variables: h, D: Average traffic injecte by TCP connection. Formulation: max 3 2RT T 2h, subject to: (1a) h u e, e E (1b) P e h 0, D (1c) The objective function (1a) represents the NUM moel, that tries to maximize the sum of the utilities of each TCP connection. The utility function U (h ) of a TCP Reno connection, accoring to the moel seen in theory, is given by: 3 U (h ) = 2RT T 2h Constraints (1b) are the stanar link capacity constraints, an mean that for each link, the traffic carrie in the link is less or equal than its capacity (an thus, no link is oversubscribe). Finally, (1c) forbi injecting a negative amount of traffic. 7 Net2Plan algorithm The stuent shoul evelop a Net2Plan algorithm solving problem (1) following the next steps: 1. Copy the AlgorithmTemplate.java file in Aula Virtual an rename it as TCPReno.java. 2. Set the routing type of the input NetPlan object to source routing. 3. Eliminate any carrie traffic by removing all the routes in the network. 2
4. For each unicast eman, create a route for it carrying zero traffic, traversing the shortest path between the eman en noes measure in number of hops (e.g. using GraphUtils metho getshortestpath). 5. Create an object of the type OptimizationProblem (e.g. of name op). 6. A the problem ecision variables, with name h_: one variable per route. The i-th coorinate correspons to the Route object of inex i (which is associate to a specific eman). The minimum value of the variables is set to zero, the maximum to Double.MAX_VALUE. 7. Set the problem objective function. For this, you can use the metho of NetPlan class: netplan.getvectorroutepropagationdelayinmilisecons to obtain a DoubleMatrix1D vector with the propagation elay (measure in ms) of each route, which can be converte to a stanar ouble[] array using the metho toarray. Recall that the roun-trip time of a connection is twice its one-way propagation elay 1. The stuent is suggeste to create a vector with the coefficients: c = 3, a it as an input parameter to 2RT T 2 the problem, an make the objective function to maximize becomes: sum (z_./ h_). where./ is the element-by-element ivision of two arrays which must have the same size. 8. Use a for loop with as many iterations as links, to a the link capacity constraints (1)b. For aing the constraint of a link e: Set the JOM input parameters: P_e with the inexes of the routes traversing link e. For this, use the metho gettraversingroutes of the noe object to get the output links, an the metho NetPlan.getInexes to convert the collection of links to their inexes. u_e with the capacity of the link. Set the constraint using the function sum, over h_, but restricting the sum to the elements in P_e. 9. Call the solver to fin a numerical solution. Since the problem is not linear, the solver to use is ipopt. 10. Retrieve the primal solution obtaine. 11. Save it in the netplan object. For this, use a for loop iterating along the routes of the esign. For each route: (i) set the route carrie traffic an occupie link capacity accoring to the optimum solution, (ii) set the offere traffic of the associate eman to be equal to the carrie traffic. 7.1 Check the algorithm Loa the network example7noeswithtraffic.n2p. The algorithm shoul prouce a solution with a total of 600.36 units of total offere traffic, an all the links shoul have a utilization of 100%. 1 Note that multiplying the objective function by any positive constant oes not chage the optimum. Then, constant factors can be remove from the objective function. Also, the result woul not change is we measure the RTT in secons or any other unit. 3
8 Problem variations Quiz 1. Moify the problem in (1) so now the cost objective function becomes the well known α-fair funtions: h 1 α 1 α for α 0, α 1, an log h when α = 1. Implement a Net2Plan algorithm that has an input parameter of name alpha (efaults to 1), an solves the NUM formulation with α factor equal to the input parameter alpha. To check the solution, loa the network example7noeswithtraffic.n2p. The throughput for α = 2 is 514.64, an for α = 1 is 549.26. Quiz 2. Use the algorithm you have just evelope to fill in the following table, which shows how the network throughput varies when ifferent α fairness values are use by the congestion control. The table refers to NSFNET network in the file NSFNet_N14_E42.n2p, for link capacities u e = 500, an one eman per each noe pair 2. As a check, we inclue the results for α = 2. NSFNET topology α Jain fairness factor Throughput h 0 0.5 1 2 0.48 12311 5 Column Jain fairness factor shoul isplay the well-known Jain factor J (see e.g. Jain s fairness measure in http://en.wikipeia.org/wiki/fairness_measure). Factor J is a measure of fairness in the istribution of resources. In our case, J is given by: J = ( h ) 2 D h2 where D is the number of emans. Jain factor will be maximum (J = 1) when all the emans have exactle the same rate ( maximum fairness ), an will take the mininum possible value (J = 1/ D ) when one emans receives traffic an the rest receive nothing ( minimum fairness ). The stuent shoul inclue in the algorithm the coe that computes an prints in System.out the J inex for the obtaine solution. Are there emans with 0 rate assigne in the case α = 0? coul a network like Internet be useful if the congestion control was esigne to maximize the throughput? What is the tren in throughput an in fairness when we increase α? 2 Note: For high α values (e.g. α 4), solutions can iffer in ifferent executions because of numerical instabilities in the solver. 4
9 Matricial form of problem constraints (optional) 9.1 Link capacity constraints The link capacity constraints in (1b) take the form: :e h u e, e E where: All the E constraints can be represente by a single vectorial inequality as follows: A ep h u e (2) A ep is link-to-route assignment matrix. This is a E P matrix with one row per link, an one column per route (in this case, one per eman). Coorinate (e, p) is the number of times that path p traverses link e. The link-to-route assignment matrix can be obtaine as an sparse matrix in Net2Plan using the metho of NetPlan class: getmatrixlink2routeassignment h is a 1 D row vector, with the ecision variables (the traffic carrie by route associate to eman ). u e is a row vector 1 E with the capacity of each link. The link capacity vector can be obtaine in Net2Plan using the metho of NetPlan class: getvectorlinkcapacity Quiz 3. Rewrite the link capacity constraints using their matricial form. Recall that JOM operator * implements the stanar matrix multiplication. 10 Work at home after the lab work The stuent is encourage to complete all the Quizs that he/she coul not finish uring the lab session. 5
Bibliography [1] P. Pavón Mariño, Optimization of computer networks. Moeling an algorithms. A hans-on approach, Wiley 2016. 6