” COMP 5416编程 写作、 辅导R编程设计COMP 5416 Assignment 2Due: 16 November 2020, 23:59. Sydney timeQuestion 1 (TCP, 20%). In the following network, node A transmits packets that pass through B and C, and arrive at thedestination D. The bit rate of all links is R = 1 Mbit/sec. The maximum packet size in the network is 500 Bytes. Ignore theheader size. The one-way propagation delay on each link is 4 msec.How long does it take to transmit 100 + s packets if TCP Reno is used, where s is the last two digits of your student number.At the beginning, ssthresh is 8 segment size (4000 bytes). B and C use Store-and-Forward. No packet is lost. There is nobit-error in transmission. The size of ACK packets is negligible. The size of TCP header is negligible.$ % 2Question 2 (Queueing Theorem: Simulation, Analysis, and Application, 20%). In this task, you need to simulate and analyzean M/M/m/n queue with arbitrary m and n. You can reuse the codes in Week 6 Lab to simulate an M/M/m/n queue. YouPython code must be submitted as supplementary material. You also need to theoretically compute the stationary distribution toverify your simulation. Finally, you will understand how queueing theorem will help design and install real-world telephone andcellular networks.Throughout this question, let the Arrival rate be . Let the service rate of each server be .(1) Let = 2 and = 3. What is the stationary distribution of an M/M/1/10 queue. Please figure out this result by bothsimulation and analysis.(2) Let = 5 and = 1. What is the stationary distribution of an M/M/5/10 queue. Please figure out this result by bothsimulation and analysis.(3) Use theoretical analysis only. What is the stationary distribution of an M/M/m/m queue (now n = m). What is theprobability that a new arrival is blocked (dropped) by the system? This probability is defined as pb.(4) Follow (3). Let = 1 and m = 10. If the blocking probability pb must be limited to 0.001, what is the maximum value of?(5) Follow (3). Let = 10 and = 1. If the blocking probability pb must be limited to 0.001, what is the minimum value ofm, i.e., the number of servers?(6) Telecom/cellular companies usually use methods in (4) and (5) to design their telephone/cellular networks. In (4), giventhe required blocking probability pb and the number of telephone lines m, they want to know the maximum possible trafficintensity they can accommodate. In (5), given the required blocking probability pb and the traffic intensity , they want toknow how many telephone lines they shall install. The method to compute pb is also well known as Erlang Formula. GoogleErlang Formula and answer the following questions.(a) What are Erlang-B and Erlang-C Formulas? When are they used? What is the difference between them?(b) In (4) and (5), do you use Erlang-B or Erlang-C Formula? Why?(7) Use the Erlang table provided, and find the solution to the following question. A base station in a cellular network has 50 +schannels, where s is the last digit of your student number. Each user uses one channel. On average, each user uses a channelfor 0.5 minutes. The blocking probability must be limited to 0.5%, what is the maximum user arrival rate (units/minute) thatcan be supported by the base station? Which row/column in the table do you use to find the result?3Question 3 (Multi-thread Server: Implementation, 20%). You are given the complete code for the client in Lab in Week 8. Yourtask is to write the TCP server. The client code is in client.py. You must not modify this code. (However, you are allowedto change ServerName and ServerPort). Only Python 3 is allowed.Different from the server in the lab, the new server must be able to serve multiple clients simultaneously. Please note that theserver code in Week 8 can only accept one client! In order to serve multiple clients simultaneously. The server should run multiplethreads. The server will establish a new connection socket to communicate with one new client, and each new connection socketwill be managed by a new thread. You should self-study the following function: _thread.start_new_thread().The following figure shows an Example of server when two clients are sending images at the same time. The two connectionsare closed in the end, demonstrating that there are two concurrent transmissions before the first Connection closed.You also need to capture the concurrent data transmission by Wireshark. In the example in the next page, we can see that thetwo clients are running at 192.168.0.3, with port numbers 60458 and 60462. The server is running at 192.168.0.4, with portnumber 12011. The throughputs of the two connections are both positive at around the 4th second.Tasks and submissions:(1) Build up a multi-thread server which can serve multiple clients at the same time. Submit your server-side Python code.Submit your server code as Lastname_Firstname_Server.py. We will use the client in Week 8 to test against your server.(2) Test your server with three clients sending images at the same time. Capture the packets by Wireshark at the server side.You are allowed to run the Server and clients in one computer using localhost. Submit your Wireshark capture. Your capturefile must be smaller than 10MB. Your capture will be ignored and will not be marked if it is greater than 10MB. Submit yourcapture as Lastname_Firstname_Capture.pcapng (or .pcap).(3) In the main submission file, based on your capture in (2), plot the throughput vs. time of the three connections (similar tothe figures in the next page). Show that they are operated in parallel. In the main file, you also need to give the three clientsIP addresses, clients port numbers, servers IP address, and servers port number.4You overall mark will be zero if you do not submit code in (1), no matter if you submit (2) or (3).You submission in (2) and (3) will be ignored and will not be marked if your submission in (1) does not work.You overall mark will be zero if your Wireshark capture in (2) does not match the throughput plots in (3).5Question 4 (BER vs SNR with different modulation schemes, 20%). We aim to plot BER vs SNR curves of two modulationschemes in this question.(1) BPSK. In wireless communication, we can transmit 0 and 1 through signals 1 and 1 respectively. Both 1 and 1 signalshave power of 1, so that the mean signal power is 1. This is called Binary Phase Shift Keying (BPSK). Due to the existence ofnoise, the received signal is 1+n or 1+n respectively, where n is the noise term. n follows Gaussian distribution n N(0, 2).2is the power of the noise, and thus 12 is SNR. If the received Signal is 0, it is decoded as 1; if the received signal is 0,it is decoded as 0. We assume that 0 and 1 are sent with equal probabilities. Compute average BER vs SNR of BPSK whenSNR = [0,5,10,15,20,25] dB. Hint: What is dB?(2) 4PAM. Now we consider Another modulation scheme, where each signal can represent two bits. We can transmit 00, 01, 11,10 through signals 3, 1, 1, and 3 respectively. The mean signal power of the signal is 32+12+12+324 = 5. This is called 4pulse-amplitude modulation (4PAM). Still, due to the existence of noise, the received signal is 3 + n, 1 + n, 1 + n, or 3 + nrespectively, where n is the noise term. Still, n follows Gaussian distribution n N(0, 2). 2is the power of the noise, andthus 52 is SNR. If the received signal is in (, 2], (2, 0], (0, 2], and (2, ), it is decoded as 00, 01, 11, and 10 respectively.We assume that 00, 01, 11, and 10 are sent with equal probabilities. Compute average BER vs SNR of 4PAM when SNR =[0,5,10,15,20,25] dB. Note that if 00 is decoded as 01, it is regarded as one bit error; if 00 is decoded as 11, it is regarded astwo bit errors.To compute Q function, you can use Python math.erfc() function. math.erfc() returns result of erfc function, and Q(x) =12erfc( x2).(3) Plot the BER vs SNR Curves of BPSK and 4PAM. You should derive a figure like Page 45 in the slides of Week 8. Discusswhy improved data rate can cause higher BER.6Question 5 (VoIP, 20%). A VoIP trace is included in A2Q5trace.xlsx. The trace includes VoIP data packets. Each line in thetrace shows the sending timestamp, sequence number, and receiving timestamp of a VoIP packet. At the beginning, the delayestimation diis 100ms, and the deviation of delay viis 10ms. Find the right place in the slides to review how di and vi valuesare updated. Let = 0.1 and = 0.1. The playout time is set as follows.playouttimei = ti + di + xvi, (1)where x = 2 + s/10, and s is the last digit of your student number. For example, if your student number is 490123456, x = 2.6in your case. Please answer the following questions.(1) What are the playout times of all packets? List all of them in a table.(2) How many packets Missed the playout time?7Question 6 (Bonus Question, optimization, additional 10%). In this question, we aim to solve the following optimization problem.minxkAx bk2,subject to Gx = h.x is an n-dimension vector, A is an m n matrix, G is a p n matrix. Give the KKT conditions, and derive expression andvalues for the optimal solution x. m n, p n.Please unzip A2Q6input.zip. The values of A, b, G, h are stored in the SIDX.txt, where X is the last digit of your SID. Inthe file, the first part is 10 8 matrix of A; the second part is 10-dimension b; the third part is 5 8 matrix of G; and thefourth part is 5-dimension h. k k indicates the L2-norm of a vector. Please note that you will get zero if you do not use yourown SID.8Submission Instructions: You should submit one main file and several supplementary files. You should include your answersto Q1Q6 and explanations of your answers in the main file. You should submit your main file at main file submission. Themain file is in the format of pdf. For Q2, you must submit your queue simulator at Q2 code submission. For Q3, you mustsubmit your Python code at Q3 code submission and Wireshark capture at Q3 capture submission. Your code and capturewill be examined against your answers in the main file. Penalty would be incurred if your code/capture does not match youranswer in the main file. For Q4, you may upload Python code to calculate Q-function in Q4 Q-function calculation. For Q5,you may use Python or Excel to process the raw data. You may upload Python code or excel file in Q5 data processing. Pleasenote that, files uploaded in Q4 and Q5 will be marked as intermediate steps. Wrong answers in Q4 and Q5 without file uploadswill incur heavier Penalties.File upload File format Must upload?main file submission pdf YesQ2 code submission Python 3 code YesQ3 code submission Python 3 code YesQ3 capture submission Wireshark capture YesQ4 Q-function calculation Python 3 code NoQ5 data processing Python 3 code or Excel file NoTABLE IFILE UPLOADAll your Submissions will be checked by plagiarism examination tools.This is one assignment with multiple pieces to submit. Your submission time is equal to the submission time of the last piece.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。