What is the average queue size for example ex1.tcl




















Click again and again. See how the tokens are moved inthe net. Mini project: questions1. What token will Place A receive after thefirst transition? Explain why. How does the network guarantee thepackets are transmitted in order? Modify the model of simple protocol so thatthe sender can send two packets tokens before receiving a ACK, but the receiverresponds with a ACK for every packet.

If a deadlock occurs,please explain how. FTP10 Mbps,1ms delay kbps,20ms delay Simulation model for this project13 Term project: questions1. Short-link Link Embed. Share from cover. Share from page:. Tune the Page 14 and Term project: questions1. More magazines by this user. Close Flag as Inappropriate.

You have already flagged this document. Thank you, for helping us keep this platform clean. The editors will have a look at it as soon as possible. This allows one to reduce packet and event processing time. Then in the OTcl script provided by the user, we can define a particular network topology, the specific protocols and applications that we wish to simulate whose behavior is already defined in the compiled hierarchy and the form of the output that we wish to obtain from the simulator.

In Chapter 10 we explain how to create new classes on these hierarchies. NS-2 is a discrete event simulator, where the advance of time depends on the timestamp of events which are maintained by a scheduler. The scheduler keeps an ordered data structure there are four, but by default NS-2 uses a Calendar scheduler of the events to be executed and fires them one by one, invoking the handler of the event.

It is a language with a very simple syntax and it allows a very easy integration with other languages. Tcl was created by John Ousterhout. To have the correct result, we need to indicate that we do not work with integers, and should thus type puts "[expr 1.

This is done with the command: set file1 [open filename w]. The inequality is written with! The last part of the statement is for declaring the changing in the counter variable; in this case we increment i one by one, but we can also decrement it or use any mathematical expression for increment or decrement the counter instead. The procedures can return some value when they contain a "return" command.

In our case these are named par1, par2, etc. These parameters will be used within the procedures with these names.

The procedure is called by typing blue x y If par1 and par2 are changed within the procedure, this will not affect the values of x and y. In the above example these are var1 and var2. In the following, we will show how to use these commands through some simple examples of tcl.

In Listing 1. The pow expression give the power of variable d to j. Example 1. The prime numbers example shows how to use an if command, loops, and a procedure. The variable argc contains the number of parameters passed to the program. The variable argv is a vector that has the parameters passed to the program so, argc is the length of argv , and the command lindex allows us to take the case of the vector pointed by the second parameter. Usage : ns prime.

The reserved word Class followed by the name of the class is used to declare a new class in OTcl. The methods of the classes are declared using the word instproc preceded by the name of the class and followed by the name of the method and its parameters. The method init is the constructor of the class. To declare the instance variable, OTcl uses the word instvar. The word -superclass is used for declaring that a class inherits from another one, in the example the Integer class inherits from the Real class.

Some simple examples will be given that will enable us to make the first steps with the NS-2 simulator. You can call this variable whatever you wish, but, in general, people declare it as ns because it is an instance of the Simulator class, so an object.

The code [new Simulator] is indeed the instantiation of the class Simulator using the reserved word new. So, using this new variable ns we can use all the methods of the class Simulator that we will see below. Within the tcl script, these files are not called explicitly by their names out. The first and fourth lines in the example are only comments; they are not simulation commands. Note that these lines begin with a symbol. The third line uses a simulator method called trace-all that has as parameter the name of the file where the traces will be written.

With this simulator command we will trace all the events in a specific format that we will explain later in this chapter. The last line tells the simulator to record all simulation traces in NAM input format. Note: the commands trace-all and namtrace-all may result in the creation of huge files.

If we wish to save space, other trace commands should be used so as to trace only a subset of the simulated events which may be needed. Such commands are described in Section 2. The word global is used to specify that we are using variables declared outside the procedure. Note that we pass the real name of the file of traces to nam and not to the pointer namfile because it is an external command. The command exit will end the application and return the number 0 as status to the system.

Zero is the default for a clean exit. Other values can be used to say that it is an exit because something fails. Indeed, the at method of the simulator allows us to schedule events explicitly.

Once we define several nodes, we can define the links that connect them. In NS-2, an output queue of a node is implemented as a part of each link whose input is that node.

The definition of the link then includes the way to handle overflow at that queue. In our case, if the buffer capacity of the output queue is exceeded then the last packet to arrive is dropped DropTail option.

Of course, we should also define the buffer capacity of the queue related to each link. A queue overflow is implemented by sending dropped packets to a Null Agent. A duplex link is constructed from two parallel simplex links. As an example of a simple network, consider the one depicted in Figure 2.

Example 2. When this time expires, then the packet is dropped. Listing 2. The queues corresponding to all other links have the default value of This default value can be found at ns-default.

By first checking the file ns-lib. To that end, we need to define routing in particular, sources and destinations , the agents protocols and applications that use them. We should first define in Listing 2. We then define in Listing 2. It uses acknowledgements created by the destination to know whether packets are well received, lost packets are interpreted as congestion signals; TCP thus requires bidirectional links for the acknowledgements in order to return information to the source.

We note that in TCP the destination node has an active role in the protocol of generating acknowledgements in order to guarantee that all packets arrive at the destination. TCP has many parameters with initial fixed default values that can be changed if mentioned explicitly.

For example, the default TCP packet size has a size of bytes. When we have several flows, we may wish to distinguish them so that we can identify them with different colors in the visualisation part.

This is done in the last three lines in Listing 2. The trace driven application is defined as follows. The Tcl script defines when events should occur. The initializing command set ns [new Simulator] creates an event scheduler, and events are then scheduled using the format: 20 2.

We are now ready to run the whole simulation. Note: in Listing 2. The procedure is a recursive one, after each 0. It passes as parameter the TCP source and the file to which we wish to write the output.

Gets as arguments the name of the tcp source node called " tcpSource " and of output file. The location of the nodes could have been chosen at random. In order to reproduce the initial location of the nodes as in Figure 2. We note that the nam display shows us with animation the CBR packets that flow from node 1 to 5 in red, and TCP packets flowing from node 0 to 4 in blue.

To obtain the colors, we had to define them in the beginning of our script ex1. This can be used to describe some event that is scheduled at that time.

The graphic interface of NAM is shown in figure 2. Figure 2. NOTE: It is worth to note that the example ex1. When we use tracing as mentioned in Section 2. EnqT registers information concerning a packet that arrives and is queued at the input queue of the link. If the packet overflows, then information concerning the dropped packet are handled by DrpT.

DeqT registers information at the instant the packet is dequed. Finally, RecvT gives us information about packets that have been received at the output of the link. NS-2 allows us to get more information than through the above tracing. One way is by using queue monitoring. This is described at the end of Section 4. The meanings of the fields are: 1. Comparison of reliable multicast protocols using the NS-2 simulator are available in [31]. An evaluation test suite for the initial evaluation of any proposed TCP modifications has been developed and made available [12].

This test suite is not intended to result in an exhaustive evaluation of a proposed TCP modification or new congestion control mechanism. Instead, the focus is on quickly and easily generating an initial evaluation report that allows the networking community to understand and discuss the behavioural aspects of a new proposal, in order to guide further experimentation that will be needed to fully investigate the specific aspects of a new proposal.

This suggests that NS-2 will remain for many years a useful tool, with an advantage of having huge amount of accessible open source software that had been developed during the last decade and not yet ported to NS The open source nature of NS-2 and the community-based development practices of NS-2 which were one of the main sources for its rapid development, are expected to continue with the NS-3 version.

NS-2, is the most popular simulator for academic research, is generally criticized for its complicated architecture. But, its large use by the community makes up for it since there are lots of people helping each other with their problems through the use of mailing lists and forums. OPNET Modeler is also a good, complete solution; but, it caters to industrial researchers, people who need an extensive set of built-in reliable models for constructing credible simulations in a quick way, rather than academic researchers.

A ns-2 2. However, the complete set of OPNET Modeler modules provides more features than Ns-2, and it therefore will be more attractive to network operators.

Surprisingly, a few months later, some of the authors seem to change their mind. From the results obtained we can conclude that more comparisons between network simulators in general, and between NS-2 and OPNET Modeler in particular, could be done.

The paper does not address the reliability of the results obtained by different simulators. Helpful insight can be found in [11]. Figure 1. NS-2 has a rich library of network and protocol objects. This is useful, in particular, for the detailed definition and operation of protocols. This allows one to reduce packet and event processing time. Then in the OTcl script provided by the user, we can define a particular network topology, the specific protocols and applications that we wish to simulate whose behavior is already defined in the compiled hierarchy and the form of the output that we wish to obtain from the simulator.

In Chapter 10 we explain how to create new classes on these hierarchies. NS-2 is a discrete event simulator, where the advance of time depends on the timestamp of events which are maintained by a scheduler. The scheduler keeps an ordered data structure there are four, but by default NS-2 uses a Calendar scheduler of the events to be executed and fires them one by one, invoking the handler of the event.

It is a language with a very simple syntax and it allows a very easy integration with other languages. Tcl was created by John Ousterhout. To have the correct result, we need to indicate that we do not work with integers, and should thus type puts "[expr 1.

This is done with the command: set file1 [open filename w]. The inequality is written with! The last part of the statement is for declaring the changing in the counter variable; in this case we increment i one by one, but we can also decrement it or use any mathematical expression for increment or decrement the counter instead.

The procedures can return some value when they contain a "return" command. In our case these are named par1, par2, etc. These parameters will be used within the procedures with these names. The procedure is called by typing blue x y If par1 and par2 are changed within the procedure, this will not affect the values of x and y. In the above example these are var1 and var2. In the following, we will show how to use these commands through some simple examples of tcl.

Example 1. The pow expression give the power of variable d to j. Listing 1. The prime numbers example shows how to use an if command, loops, and a procedure. The variable argc contains the number of parameters passed to the program. The variable argv is a vector that has the parameters passed to the program so, argc is the length of argv , and the command lindex allows us to take the case of the vector pointed by the second parameter.

Usage : ns prime. Usage : ns fact. The methods of the classes are declared using the word instproc preceded by the name of the class and followed by the name of the method and its parameters. The method init is the constructor of the class. To declare the instance variable, OTcl uses the word instvar.

The word -superclass is used for declaring that a class inherits from another one, in the example the Integer class inherits from the Real class.

Some simple examples will be given that will enable us to make the first steps with the NS-2 simulator. You can call this variable whatever you wish, but, in general, people declare it as ns because it is an instance of the Simulator class, so an object.

The code [new Simulator] is indeed the instantiation of the class Simulator using the reserved word new. So, using this new variable ns we can use all the methods of the class Simulator that we will see below.

Within the tcl script, these files are not called explicitly by their names out. The first and fourth lines in the example are only comments; they are not simulation com- mands.

Note that these lines begin with a symbol. The third line uses a simulator method called trace-all that has as parameter the name of the file where the traces will be written.

With this simulator command we will trace all the events in a specific format that we will explain later in this chapter. The last line tells the simulator to record all simulation traces in NAM input format. Note: the commands trace-all and namtrace-all may result in the creation of huge files.

If we wish to save space, other trace commands should be used so as to trace only a subset of the simulated events which may be needed. Such commands are described in Section 2. The word global is used to specify that we are using variables declared outside the procedure. Note that we pass the real name of the file of traces to nam and not to the pointer namfile because it is an external command.

The command exit will end the application and return the number 0 as status to the system. Zero is the default for a clean exit. Other values can be used to say that it is an exit because something fails. Indeed, the at method of the simulator allows us to schedule events explicitly. Once we define several nodes, we can define the links that connect them. In NS-2, an output queue of a node is implemented as a part of each link whose input is that node.

The definition of the link then includes the way to handle overflow at that queue. In our case, if the buffer capacity of the output queue is exceeded then the last packet to arrive is dropped DropTail option. Of course, we should also define the buffer capacity of the queue related to each link. A queue overflow is implemented by sending dropped packets to a Null Agent.

A duplex link is constructed from two parallel simplex links. Example 2. When this time expires, then the packet is dropped. Listing 2. The queues corresponding to all other links have the default value of This default value can be found at ns-default.

By first checking the file ns-lib. To that end, we need to define routing in particular, sources and destinations , the agents protocols and applications that use them. We should first define in Listing 2.

We then define in Listing 2. It uses acknowledgements created by the destination to know whether packets are well received, lost packets are interpreted as congestion signals; TCP thus requires bidirectional links for the acknowledgements in order to return information to the source.

We note that in TCP the destination node has an active role in the protocol of generating acknowledgements in order to guarantee that all packets arrive at the destination.

TCP has many parameters with initial fixed default values that can be changed if mentioned explicitly. For example, the default TCP packet size has a size of bytes.

When we have several flows, we may wish to distinguish them so that we can identify them with different colors in the visualisation part. This is done in the last three lines in Listing 2. The trace driven application is defined as follows.

The Tcl script defines when events should occur. We are now ready to run the whole simulation. Note: in Listing 2. The procedure is a recursive one, after each 0. It passes as parameter the TCP source and the file to which we wish to write the output. Gets as arguments the name of the tcp source node called " tcpSource " and of output file.

The location of the nodes could have been chosen at random. In order to reproduce the initial location of the nodes as in Figure 2. We note that the nam display shows us with animation the CBR packets that flow from node 1 to 5 in red, and TCP packets flowing from node 0 to 4 in blue.

To obtain the colors, we had to define them in the beginning of our script ex1. This can be used to describe some event that is scheduled at that time. The graphic interface of NAM is shown in figure 2. Figure 2. NOTE: It is worth to note that the example ex1.

When we use tracing as mentioned in Section 2. EnqT registers information concerning a packet that arrives and is queued at the input queue of the link. If the packet overflows, then information concerning the dropped packet are handled by DrpT. DeqT registers information at the instant the packet is dequed. Finally, RecvT gives us information about packets that have been received at the output of the link. NS-2 allows us to get more information than through the above tracing. One way is by using queue monitoring.

This is described at the end of Section 4. The meanings of the fields are: 1. The first field is the event type. The second field gives the time at which the event occurs. The third field gives the input node of the link at which the event occurs.

The fourth field gives the output node of the link at which the event occurs. The type corresponds to the name that we gave to those applications. For example, the TCP application in Listing 2. The sixth field gives the packet size.

Some flags follow that we shall see later. This is the flow id fid of IPv6 that a user can set for each flow at the input OTcl script.

One can further use this field for analysis purposes; it is also used when specifying stream color for the NAM display. This is the destination address, given in the same form. The last field shows the unique id of the packet. As an example, consider the first lines of the trace produced by running the script ex1.

We now indicate ways to trace only a subset of these events. A similar command can be used for the nam trace, using namtrace-queue instead of trace-queue. The trace-queue line should appear of course after the definition of the links, i.

It is also possible to filter events using UNIX commands within the tcl script. This will be discussed in Section 3. Due to its important role in traffic modeling and in network simulation, we briefly recall the definitions and moments of main random variables in Appendix A.

For more background, one can consult, e. This would allow us to compare directly, for a single random set of events, how the simulated results depend on some physical parameters such as link delays or queue length. The generation of random variables uses a seed which is some number that we write in the tcl script. The seed value of 0 results in the generation of a new random variable each time we run the simulation, so if we wish to have the same generated random variables for different simulations, we would have to save the generated random variables.

In contrast, if we use other seeds then each time we run the simulation, the same sequence of random variables that are generated in a simulation will be generated. In ns-2, if we use different generators with the same seed and the same distribution, they will create the same values of random variables unless the seed is zero. We shall see this in an example below. Pareto Distribution. Uniform distribution. Exponential distribution. Hyperexponential distribution. It is given in Table 2.

For each substream corresponding to replica values 0, 1 and 2 , we create a sequence of three random variables. The sequences generated by each random generator are independent, and for each random generator, the sequences generated by a different substream i in the example are also independent. If we wish to analyze the data, we may need to extract relevant information from traces and to manipulate them.

One can of course write programs in any programming language that can handle data files. Yet several tools that seem particularly well adapted for these purposes already exist and are freely available under various operating systems linux, windows, etc. All they require is to write short scripts that are interpreted and executed without need for compilation.

In the following two examples we show how to take the average value of a given column in a file, and then to compute the standard deviation. If not then one should replace it by " ". This example shows how to pass parameters to an awk script. Note that if we do not divide at the end of the first awk script Table 3. The next example takes as input a file with 15 columns 0 to It then creates as output 5 columns, where the first contains column no.

The use of this script could be as follows: awk -f suma. We can create a new file which consists of only those lines from the original file that contain a given character sequence. For example, output traces in ns may contain all types of packets that go through all links, and we may be interested only in the data concerning tcp packets that went from node 0 to node 2.

If we wish to obtain a file containing all lines of tr1. This language was created by Larry Wall with the main idea of simplifying the task of system administration. Perl has evolved considerably and nowadays is a general purpose language and one of the most widely used tools for web and Internet data managing.

Perl is an interpreted language which has many uses, but is mainly addressed to search, extraction and report. We present in this Section some useful Perl scripts. The first example given in Listing 3. As input it takes three arguments: the name of a trace file e. Gnuplot has a help command that can be used to learn details of its operation. Some other features of gnuplot: consider, for example, the following commands: set size 0.

In both lines, other numbers can be used. In particular, it gives for each plotted object the line type or point type that is used. Note that the default name of each object that appears in the key is simply its corresponding file name. Sometimes it needs separate compiling using. Also, sometimes this does not work with the xgraph that arrives with the whole NS-2 single package, and it can then be downloaded and installed separately.

It can be invoked within the tcl command which thus results in an immediate display at the end of the simulation. For example, xgraph f1 f2 will print on the same figure the files f1 and f2. For example, another way to limit the tracing files or in general, to process them online while they are being written is to use linux commands related to file processing within the tcl command that opens the required file.

Although TCP is already largely deployed, it continues to evolve. In the first section we describe the operation of TCP. Then in subsequent sections we present several NS-2 scripts that illustrate the analysis of TCP through simulations. In order to control the transmission rate, the number of packets that have not yet been received or more precisely, for which the source has not obtained the information of good reception is bounded by a parameter called a congestion window.

We denote it by W , but it is called cwnd in the TCP code. In order to acknowledge packets and thus to be able to retransmit lost packets, each transmitted packet has a sequence number. How do we know that a packet is lost? What information does the ACK carry along? The ACK tells the source what is the sequence number of the packet it expects. This is illustrated by the following example. Suppose packets 1,2, When packet 6 arrives, the destination sends an ACK to say it expects packet number 7.

If packet 7 arrives, the destination requests number 8. Suppose packet 8 is lost and packet 9 arrives well. It is robust under losses of ACKs. Indeed, assume that the ACK saying that the destination waits for packet 5 is lost.

When the next ACK arrives, saying it awaits packet 6, the source knows that the destination has received packet 5, so the information sent by the lost ACK is deduced from the next ACK.

How to choose T0? The source has an estimation of the average round trip time RT T , which is the time necessary for a packet to reach the destination plus the time for its ACK to reach the source. It also has an estimation of the variability of RT T.

The standard value of d is 2. Therefore, if the first packet of an expected group of d 1 One does not consider a single repeated ACK as a loss indication since duplicated ACKS could be due to resequencing of packets at the Internet. Networks at that time were unstable, there were many losses, large and severe congestion periods, during which the throughputs decreased substantially, there were many packet retransmissions and large delays.

In order to solve this problem, Van Jacobson [37] proposed to use a dynamic congestion window: its size can vary according to the network state. The basic idea is as follows: When the window is small, it can grow rapidly, and when it reaches large values it can only grow slowly. When congestion is detected, the window size decreases drastically. The window starts at a value of one.

It thus transmits a single packet. When its ACK returns, we can transmit two packets. For each ACK of these two packets, the window increases by one, so that when the ACKs of these two packets return we transmit four packets. We see that there is an exponential growth of the window.

After transmitting W packets, W increases by 1. We see that the window growth is linear. It is fixed in TCP to half the value of W when there has been a packet loss. There are several variants of TCP. This is a drastic decrease of the window size and thus of the transmission rate.

In the other mostly used variants, called Reno or New-Reno, the window drops to 1 only if the loss is detected through a time-out. When a loss is detected through repeated ACKs then the congestion window drops by half. Note that: if either of these packets is lost then after a time-out expires usually 3 or 6 secs it is retransmitted.

When a retransmitted packet is lost, the time-out duration doubles and the packet is sent again. We have to type: perl throughput. This output file can be displayed using gnuplot by typing: gnuplot set size 0.

Figure 4. In order to understand better the behavior of the system, we also plot the window size Fig- ure 4. We see that from time 20 onwards a steady-state cyclic regime of TCP is attained: TCP is always in congestion avoidance, and its window size increases almost linearly until congestion occurs.

Before time 20, we see a transient behavior in which TCP is in the slow-start phase. At time 4. The window halves, whereas the throughput becomes close to zero. How can we explain that? The reason is that at time 4. At time 11 there are again losses during a slow-start phase. In practice, losses may also be caused by noisy links. This is especially true in the case of radio links, e. A link may become, in fact, completely disconnected for some period. We shall see this aspect later, in Section 5.

Or it may suffer from occasional interference due to shadowing, fading, etc. In this section we shall show how to introduce the simplest error model: we assume that packets are dropped on the forward link with some fixed constant probability.

This link error model, which will be introduced to the link connecting nodes n3 and n2 in the example in Figure 4. It uses a generator of a uniformly distributed random variable, which is declared in the next line. The last line determines which link will be affected. As an example of a TCP connection that shares a noisy bottleneck link with a UDP connection, we consider the network depicted in Figure 4. Queue monitoring An important object of NS-2 is the monitor-queue.

It allows to collect much useful information on queue length, on the arrivals, departures and losses. In our case, the queue at the input of node n2-n3 is monitored every 0. An alternative way to work directly with these attributes is described in Section 4.

Listing 4. A zoomed version is given in Figure 4. In several cases we can observe long timeouts, in particular at time To see the huge impact of the random loss on TCP performance, we run the simulation again but with no losses.

The result is depicted in Figure 4. An important performance measure is the average throughput of TCP. A very simple way to compute it is to search in the trace file out. In our simulation this is found at time Note: if we look at the first lines of the out. Their serial number is zero. We do not count them because they correspond to signalling packets that are involved in the opening of the TCP connection. Furthermore, it becomes of interest to choose connection parameters such as time of be- ginning or end of activity, link delays, etc.

We treat both issues in this Section, and then provide an example. Note that we have already considered other aspects of randomness in Section 4. Example 4. Consider the network at Figure 4. The tcl script is given in Listing Figure 4. We create 5 FTP connections that start at random: the starting time is uniformly distributed between 0 and 7 sec.

The whole simulation duration is 10 seconds. We create links with delay that is chosen at random, uniformly distributed between 1ms and 5ms. This is done in the procedure plotWindow.

The procedure is called recursively for each of the 5 connections. The average transferred file is around 10Kbytes. This implies that most of the file transfers end in slow start phase. Surprisingly, however, most traffic in the Internet is transmitted by very long files. A typical distribution that describes the file size is the Pareto [20], with shape parameter of between 1 and 2 [20] and average of 10KB. Note that a Pareto distribution with mean 10Kbytes and a median size of 2. The distribution of interarrival times of new connections is frequently taken to be exponential.

In this Section we shall present ways to simulate short sessions, and to measure the distribution of the transmission duration, of the number of ongoing connections and the throughput. We shall consider a network with the same topology as the one in Figure 4. TCP sources are parameterized now by two parameters: the source node and the session number from that node. New TCP connections arrive according to a Poisson process. We shall therefore generate the beginning of a new TCP connection using exponentially distributed random variables.

The bottleneck link is assumed to be of 2Mbps, to have a delay of 1ms and to have a queue of size All other input links that join this link have a bandwidth of Mbps and a delay of 1ms. We use the New Reno version with a maximum window size of The average time between the arrivals of new TCP sessions at each node is in our example 45 msec. This means that on the average, We generate sessions of random size with a mean of 10Kbytes, with Pareto distribution with shape 1.

The global rate of generation of bits is thus We see that the rate of generation of bits is larger than the bottleneck capacity, so we shall expect a congestion phenomenon to appear. However, TCP has the capacity to avoid congestion in the network at the bottleneck queue. Congestion will therefore appear in other forms as we shall see. Monitoring the number of sessions In the context of short TCP sessions we are interested not only in packet statistics but also in session statistics.

The procedure calls itself each 0. In the script that follows, the output file will be Out. These parameters are used when calling the procedure at the beginning or end of a connection.

The procedure also calls itself periodically every 0. Monitoring the queue In the next tcl program, we present an alternative way to do queue moni- toring, more sophisticated than the method we saw in Section 4. For example, we print the used bandwidth of the queue in Kbytes per second into a file by dividing the number of departures in a time epoch by the epoch duration.

Their number is given by the parameter NodeNb S 1 D NodeNb. S NodeNb set Out [ open Out. Each 0. This is done by calling the procedure with the " sign " parameter equal 3 in which case the " ind " parameter does not play a role. The procedure is also called by the Test procedure whenever a connection from source i ends by assigning the " sign " parameter 0 , or when it begins , by assigning it 1 i is passed through the " ind " variable. When running the script we obtain the queue size in Kbytes and in packets as depicted in Figure 4.

We also ran later the simulation with a reduced number of sessions per node, and the queue size in Kbytes and in packets as depicted in Figure 4. Here are some observations: 1. In both figures, the number of packets at the queue is larger than the number of Kbytes queued.

This may seem strange since a TCP packet has a size of 1Kbyte! The reason is that a very large number of sessions are very small 3 packets or less. Therefore the number of overhead packets of size 40 bytes that are sent at the beginning of each TCP connection is considerable around one out of three! Taking into account these short packets as well, there are more packets than Kbytes. Observe that in Figure 4. From this moment on there will be losses at the queue.

Whereas the number of packets is always larger than the number of Kbytes queued in Fig- ure 4. At this point all packets at the queue are TCP data packets and there are no packets of 40 bytes corresponding to beginning of sessions. This is due to the fact that we limited the number of sessions per node to If we subtract the output rate of the bottleneck link from the generation rate of data, we obtain much more than the amount of data queued at the bottleneck queue.

Next we observe the evolution of the number of ongoing connections at the system, as given in Figure 4. This probing approach is quite costly. We mention two alternative monitoring approaches: 1. The id of the connection that has ended as well as other properties of the connection such as its start time can be used by the procedure if defined as states of the connection. The approach is presented in the tcl script shortTcp2.

One can use a per-flow monitor. It can give statistics on each flow with information such as the amount of transferred packets, transferred bytes, losses, etc. We delay the discussion on this approach until Section 6. The procedure is also called by the " done " procedure whenever a connection from source i ends by assigning the " sign " parameter 0 , or when it begins , by assigning it 1 i is passed through the " ind " variable.

Explain why the window size oscillates much more than the throughput in Figures 4. What is the average throughput and loss rate of the TCP connection for Example ex1. What is the average queue size for Example ex1. Study the effect of the packet loss probability in the noisy model of rdrop.

Modify the script rdrop. Plot the throughput as a function of the loss probabilities for loss rates ranging between 0 and 40 percent. Is TCP more sensitive to forward random losses of packets than to backward random losses of Acknowledgements?

Simulate two symmetric competing TCP connections sharing a common bottleneck link. Which fraction of the bandwidth does each one occupy if i only one connection uses the delayed ACK option and both connections are NewReno and ii both connections have the simple ACK option, the first connection uses the Tahoe version and the second the NewReno version.

In the procedure plotWindow at the end of the script ex3. What would happen if we passed it as a global variable i. Analyze the loss processes obtained in ex3. What should the queue size at link n2-n3 be so as to avoid losses?



0コメント

  • 1000 / 1000