当前位置:天才代写 > Python代写,python代做代考-价格便宜,0时差服务 > Analysis代写 Assignment代写 Python code代写 stationary distribution代写

Analysis代写 Assignment代写 Python code代写 stationary distribution代写

2020-11-19 17:04 星期四 所属: Python代写,python代做代考-价格便宜,0时差服务 浏览:1877

Analysis代写

COMP 5416 Assignment 2

Analysis代写 Question 1 (Go-Back-N , 20%). This question will further extend our discussion in tutorial 6 and quiz.In the following network,

Due: 5 November 2019,  23:59.

Question 1 (Go-Back-N , 20%).Analysis代写

This question will further extend our discussion in tutorial 6 and quiz.

In the following network, node A transmits packets that pass through B and C, and arrive at the destination D. The bit rate           of all links is R = 1 Mbit/sec. The maximum packet size in the network is 500 Bytes. Ignore the header size. The one-way propagation delay on each link is 4 msec.

(1)How long does it take to transmit a file of size 80000 Bytes if A and D use the Go-Back-N ARQ and B and C are Store- and-Forward? Assume that there is no error in transmission in the network, and the size of ACK packets is negligible. N ranges from1 to  Sketch the overall time vs. N .

(2)Repeat(1) if the second packet is lost (all other packets are successfully received). The timeout duration is assumed to be 50 ms. We assume that the timer starts when A starts to send the first bit of the packet.

Analysis代写
Analysis代写

Question  2 Analysis代写

(Queueing Theorem: Simulation, Analysis, and Application, 20%).  In this task, you need to simulate and analyze  an M/M/m/n queue with arbitrary m and n. You can reuse the codes in Week 7 Lab to simulate an M/M/m/n queue. You Python code must be submitted as supplementary material. You also need to theoretically compute the stationary distribution to verify your simulation. Finally, you will understand how queueing theorem will help design and install real-world telephone and cellular networks.Analysis代写

Throughout this question, let the arrival rate be λ. Let the service rate of each server be µ.

(1)Let λ = 1 and µ = 2. What is the stationary distribution of an M/M/1/10 Please figure out this result by both simulation andanalysis.

(2)Let λ = 1 and µ = 1. What is the stationary distribution of an M/M/5/10 Please figure out this result by both simulation andanalysis.

(3)Use theoretical analysis What is the stationary distribution of an M/M/m/m queue (now n = m). What is the probabilitythat a new arrival is blocked (dropped) by the system? This probability is defined as pb.Analysis代写

(4)Follow (3).

Let µ = 1 and m = 10. If the blocking probability pbmust 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 of m, 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), given      the required blocking probability pband the number of telephone lines m, they want to know the maximum possible traffic intensity λ they can accommodate. In (5), given the required blocking probability pb and the traffic intensity λ, they want to   know how many telephone lines they shall install. The method to compute pb is also well known as Erlang Formula. Google Erlang Formula and answer the following  Analysis代写

(a)Whatare 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?

Question 3 Analysis代写

(Multi-thread Server: Implementation, 20%).  You  are given the complete code for the client in Lab in Week  11.  Your task is to write the TCP server. The client code is in client.py. You must not modify this code. (However, you are allowed to change ServerName and ServerPort). Only Python 3 is allowed.Analysis代写

Different from the server in the lab, the new server must be able to serve multiple clients simultaneously. Please note that the server code in Week 11 can only accept one client! In order to serve multiple clients simultaneously. The server should run multiple threads. The server will establish a new connection socket to communicate with one new client, and each new connection socket will 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 connections  are closed in the end, demonstrating that there are two concurrent transmissions before the first “Connection closed”.Analysis代写

You  also need to capture the concurrent data transmission by Wireshark. In the example in the next page, we can see that the   two clients are running at 192.168.0.3, with port numbers 60458 and 60462. The server is running at 192.168.0.4, with port number 12011. The throughputs of the two connections are both positive at around the 4th second.Analysis代写

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. Submityour server code as py. We will use the client in Week 11 to test against your server.

(2)Test your server with three clients (using the code in Week 11) 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 capture file must be smaller than 10MB. Your capture will be ignored and will not be marked if it is greaterthan  Submit your capture as Lastname_Firstname_Capture.pcapng (or .pcap).Analysis代写

(3)In the main submission file, based on your capture in (2), plot the throughput vs. time of the three connections (similar to     the figures in the next page). Show that they are operated in parallel. In the main file, you also need to give  the three clients’    IPaddresses, clients’ port numbers, server’s IP address, and server’s port number.

Analysis代写
Analysis代写

You 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).Analysis代写

Question 4  

(BER vs SNR, 20%).  Following the tutorial in Week  12 (CDMA with Noise), we now study how the noise level  will influence the bit error rate (BER), i.e., the probability that 1 is decoded as 1. The physical meaning of δ2 is the power of noise and 1 is the power of signal. So the SNR is 12.

Redo the question when δ2 = 10i, where i = 0,  0.5,  1,  1.5,  2,  2.5,  3. When computing the Q function, do not use the  table in the tutorial since it does not cover enough range. You can use the following website at https://www.wolframalpha.com/widgets/view.jsp?id=95784c6b00784691c55ea0a420fd7ee0 Analysis代写

Plot the BER vs SNR curve based on your result. The x-axis should be in dB, and the y-axis should be in powers of 10. See   week 10’s slide (wireless and mobile network 1) page 15.

Note: A similar question will be discussed in Week 12.

Analysis代写
Analysis代写
Question 5

(Token bucket, 20%, Final exam 2018). The following figure shows a token bucket scheduler. It consists of a bucket which can accommodate 3 tokens and a queue which can accommodate infinite packets. The arrival of packets follows Poisson process with rate λ > 0. The arrival of tokens follows Poisson process with rate µ > 0, which is independent of the arrival of packets. As discussed in the class, each packet consumes exactly one token and the packets are served by the first-in-first-out principle. If there is no token in the bucket, packets will wait at the queue. Otherwise, each packet consumes one token and  leaves the system immediately. If the bucket is full, new token arrivals will be dropped.Analysis代写

The system reaches the steady state  after a sufficiently long time.

(1)Let 1, 2, 3, 4, . . . denote the states where there are 1, 2, 3, 4, . . . packets in the Let  1,  2,  3 denote the states where there are 1, 2, 3 tokens in the bucket. Let 0 denote the state where there are 0 packet and 0 token. Draw the state transition  diagram of thesystem.

(2)Let λ = 1 unit/s and µ = 2 units/s. Compute the stationary distribution of each state, i.e., state  3,  2,  1, 0, 1, 2, 3, . . ..  Compute the stationary probability that there are at least one packet in the Compute the stationary probability that there  areat least 1 token in the bucket.Analysis代写

(3)Following(2), what is the average queue length (average number of packets in the buffer)?

(4)Whatis Little’s Theorem? Following (3), compute the average waiting time of a packet in the system.

(5)If λ = µ, what willhappen?

Analysis代写
Analysis代写

Question 6 (Power allocation by convex optimization, additional mark, 30%).  N  users are sharing a wireless channel in a TDMA mode. Each user will get  1  of timeslots. The N  users experience different noise n = (n1, n2, . . . , nN ). The base station will allocate power to different users, and the total power is limited to 1. If the power allocated to user i is xi, according to Shannon Theorem, user i will experience a data rate of 1 ln(1 + xi ). We want to study how to allocate the power to different N nusers in order to realize the max sum data rates.Analysis代写

Therefore, we can formulate the optimization problem as follows

(1)Solvethe above  Hint: You need to use KKT condition and find the optimal solution accordingly.

(2)LetN = 9 and user i’s noise is (1 + αi) 4 , where αi is the ith digit of your student  For example, if your studentnumber is 460123456, then n = (1.4953, 1.6266, 1.0000, 1.1892, 1.3161, 1.4142, 1.4953, 1.5651, 1.6266). Use your own student number and calculate the numerical optimal solution. You need to get the optimal xi, i = 1, 2, . . . , 9, and the optimal value of the objective function.

You will get zero if you use another student’s number. Penalty will be incurred if your answer to (2) does not match your answer to (1).Analysis代写

Submission  Instructions:

You  should submit one main file and several supplementary files. You  should include your answers  to Q1–Q6 and explanations of your answers in the main file. You should submit your main file at “main file submission”. The main file is in the format of pdf. For Q2, you need to submit your queue simulator at “Q2 code submission”. For Q3, you should submit your Python code at “Q3 code submission” and Wireshark capture at “Q3 capture submission”. Your code and capture  will be examined against your answers in the main file. Penalty would be incurred if your code/capture does not match your answer in the main file. All your submissions will be checked by plagiarism examination tools.Analysis代写

This is one assignment with multiple pieces to submit. Your submission time is equal to the submission time of the last  piece.  For example, suppose you submit the main file, Q2 code, and Q3 code on time, but your Q3 capture is late for 26 hours. The whole assignment is regarded as a 26-hour late submission.

Analysis代写
Analysis代写

更多其他:C++代写 考试助攻 C语言代写 finance代写 lab代写 计算机代写 report代写 project代写 物理代写 经济代写  java代写 python代写 程序代写

合作平台:天才代写 幽灵代写 写手招聘 Essay代写

 

天才代写-代写联系方式