BEST代写-线上编程学术专家

Best代写-最专业靠谱代写IT | CS | 留学生作业 | 编程代写Java | Python |C/C++ | PHP | Matlab | Assignment Project Homework代写

计算机网络代写|Computer Networks Homework 1

计算机网络代写|Computer Networks Homework 1

这是一个英国的计算机网络作业代写作业案例分享

Problem 1 (20 points) – A student wants to measure as accurately as possible the time it takes to
send 1GB, in 10KB chunks, to a remote computer using a SOCK_STREAM socket. To do so, he
writes a sender program which contains the following code fragment:

/* some standard code to create a socket
* and to establish a connection
*/
… code omitted …
fcntl(send_socket, F_SETFL, O_NONBLOCK);
gettimeofday(&start, NULL);
for (i=0; i<100000; i++) {
chunk = malloc(10000);
send(send_socket, chunk, 10000, 0);
free(chunk);
}
gettimeofday(&end, NULL);
/* compare start and end to obtain
* the elapsed time
*/

There are two fundamental design flaws in this code fragment. One causes the program to
sometimes send fewer than 1GB. Another one causes the program to be very inaccurate. Identify
these flaws and provide a revised code fragment that removes these flaws. You may find the man
pages on CLEAR for the various system calls useful.

Problem 2 (10 points) The weakness of the NRZI bit representation scheme is that a long
sequence of 0’s in the input bit stream will cause the electrical signal to contain no
voltage transition for a long period of time, thus making it difficult for the receiver to detect
clock drifts. One solution to this problem is to translate the input bit stream into an
encoded bit stream that eliminates long sequences of 0’s.

Design a way to translate every 3-bit sequence in the input bit stream to a 4-bit encoded
sequence such that the resulting encoded bit stream is guaranteed to contain no more
than 2 consecutive 0’s. Write down your answer in the space below.

Problem 3 (29 points) — Suppose you are designing a multi-access (i.e. broadcast) wired network
using CSMA/CD (Carrier Sense Multiple Access/Collision Detect) mechanisms similar to the
Ethernet for media access control. Assume that in your design, the network’s link speed is
15Mbps, frame sizes may range from 200 bytes to 2000 bytes. Also assume that data signal
propagates on the network link at a speed of 2*108 meters per second.

(a)To guarantee that a collision is detected, what is the maximum allowable link length (in meters)
between any pair of hosts connected to the same link? Show your work. (15 points)

(a)State the reasons why broadcast Ethernet, where all hosts on the network share one single
channel (i.e. wire) and CSMA/CD (carrier sense multiple access/collision detect) is used to
arbitrate media access among the hosts, cannot (1) support a large number of hosts and still
maintain high throughput, or (2) support hosts spread across a large geographic area. (14 points)

bestdaixie

评论已关闭。