ECE 445: Homework #6 Instructor: Sergio Servetto; TAs: Xiaofei Wang, Xin Zhang. School of Electrical and Computer Engineering, Cornell University — Fall 2002. Problems (complete version). Due date: Mon 12/09, in 314 RH. Problem I (20 points) In this problem we will look at issues involved in the estimation of roundtrip times. samples, with each having a ( and are parameters). Write a matlab script to generate a vector , of length Gaussian distribution with variance 1 and mean ( is a simulation of measured RTTs). "! # $!%& (')+*,"! %- "!%& . ( Compute as and and are parameters). . ' is your sequence of predicted RTTs, Use these programs to generate plots for the following parameters: # /00 , ' # 21354 , . 6# ; # /000 , ' # 217254 , 8 # ; 2. # /00 , ' # 21354 , . 6# ; 3. # /00 , ' # 21354 , . 6# 5 ; 4. # 00 , ' # 217254 , 8 # ; 5. # /00 , ' # 2154 , . 6# ; 6. # 00 , ' # 214 , . <# ; 7. # 00 , ' # 214 , . <# ; 8. # /00 , ' # , 8 # ; 9. # /00 , ' # , 8 # ; 10. In each plot, show both and , using the plot and hold commands in matlab. Explain the effect of changing the values of , , and ' in the ability of this estimator to track the true 1. # , # , #:9 , #:9 , # ; , #:9 , # ; , #>= , # , # , RTTs. You can also play with other values of the parameters if you want. 1 Problem II (40 points) Write a matlab program that, given a vector of RTT measurements (like the vector in Problem I), computes the sequence of window sizes after receiving an acknowledgement with these RTTs. Then: Plot the evolution of the window size using 1. 2. 3. # , # /00 ; #:9 , # /00 ; # ; , # 00 ; above with parameters: A @ # B ? Suppose now that packets get lost with probability . We model this by letting (with probability ), and (with probability ). Plot the window evolution as above, for , and for . Explain the new window plot that you observe. # C%D? @ #FE # ? HGI5H0JKHGLH0JMHGN5JKHGIO ? You can also play with other values of the parameters if you want. Problem III (40 points) Write a matlab program to simulate the Aloha protocol, stabilized using Rivest’s algorithm, as discussed in class: You are given the number of nodes P Q in the system, and the total arrival rate . Your program has to maintain as state information: !R – An estimate of the current backlog size, . – A state vector ( ), indicating whether the -th node is backlogged or free. S/T U # 0GVGNGWP At each step of the simulation: U U XY .0JZ21\ [] 1. If node is backlogged, toss a coin with probability . If not, generate a new packet to send with probability . 2. Count of the number of packets to be set in the current step. 3. If the number of transmission attempts is 0, then update the backlog estimate as . 4. If the number of transmission attempts is 1, then there was no collision. Update , and set the state of the node that generated this packet to free. 5. If the number of transmission attempts is greater than 1, then a collision occurs at the current time step. Update , and set the state of all nodes that generated packets to backlogged. _^ !a R ` Xcb2de/!YR (Qf%&5JgQ !h R ` Xcb2de/!YR (Qf%&5JgQ !iR ` !R jQB k.l [ Using this simulation, you have to generate some plots: !R Put in the same plot both and the true size of the backlog, in the vertical axis, and simulation time in the horizontal axis. m Repeat the previous plot, but now retransmission probabilities are a constant , independent of . !R Q # HGn , P # 0 , and m # HGLH0JK3GnO . To generate these plots, use as parameters happens to the average throughput in both cases. 2 Explain what