计算机网络作业

2019-01-05 11:33

Chapter 1

11. What are two reasons for using layered protocols?(M) 通过协议分层可以把设计问题划分成较小的易于处理的片段 分层意味着某一层的协议的改变不会影响高层或低层的协议

13. What is the principal difference between connectionless communication and connection-oriented communication?(E) 主要的区别有两条。

其一:面向连接通信分为三个阶段,第一是建立连接,在此阶段,发出一个建立连接的请求。第二阶段,只有在连接成功建立之后,保持连接状态,才能开始数据传输。第三阶段,当数据传输完毕,必须释放连接。而无连接通信没有这么多阶段,它直接进行数据传输。 其二:面向连接的通信具有数据的保序性,而无连接的通信不能保证接收数据的顺序与发送数据的顺序一致。

18.Which of the OSI layers handles each of the following? (a) Dividing the transmitted bit stream into frames. (b) Determining which route through the subnet to use. Answer: (a) Data link layer. (b) Network layer.

22. What is the main difference between TCP and UDP?(E) TCP 是面向连接的,而UDP 是一种数据报服务。

25. When a file is transferred between two computers, two acknowledgement strategies are possible. In the first one, the file is chopped up into packets, which areindividually acknowledged by the receiver, but the file transfer as a whole is

notacknowledged. In the second one, the packets are not acknowledgedindividually,but the entire file is acknowledged when it arrives. Discuss these two approaches.(E) 答:如果网络容易丢失分组,那么对每一个分组逐一进行确认较好,此时仅重传丢失的分组。 如果网络高度可靠,那么在不发差错的情况下,仅在整个文件传送的结尾发送一次确认,从而减少了确认的次数,节省了带宽;不过,即使有单个分组丢失,也需要重传整个文件。

(课堂练习)若待发送数据为:1010001101,现要计算CRC校验和。如果我们选G=110101, 1)请给出对应的生成多项式G(X)。

2)请给出实际发送出去的数据(比特流)。

补充题1:试在下列条件下比较电路交换和分组交换。要传送的报文共x (bit),从源站到目的站共经过k 段链路,每段链路的传播时延为d 秒,数据率为b (bit/s)。在电路交换时电路的建立时间为s 秒。在分组交换时分组长度为p (bit),且各结点的排队等待时间可忽略不计。问在怎样的条件下,分组交换的时延比电路交换要小? 电路交换时延:s+x/b+kd

分组交换时延:x/b+kd+(k-1)p/b x/b+kd+(k-1)p/b < s+x/b+kd

? s > (k-1)p/b

*但前提是:x>>p, 或分组数大于链路数.

补充题2:在上题的分组交换网中,设报文和分组长度分别为x 和(p+h)(bit),其中p 为分组的数据部分的长度,而h 为每个分组所带的控制信息固定长度,与p 的大小无关。通信的两端共经过k 段链路。链路的数据率为b(bit/s),但传播时延和结点的排队时延均可忽略不计。若打算使总的时延为最小,问分组的数据部分长度p 应该取多大?

(2010考研)在下图所示的采用“存储-转发”方式的分组交换网络中,所有链路的数据传输速率为100Mbps,分组大小为1000 B,其中分组头大小为20 B。若主机H1向主机H2发送一个大小为980 000 B的文件,则在不考虑分组拆装时间和传播延迟的情况下,从H1发送开始到H2接收完为止,至少需要多少时间?

b=100Mbps; x=980 000 B

p=(1000-20) B; h=20B; k=3

??1x(p?h)?D??x??h??(k?1)???pb??b

D=80.16 msec

分组长度L=1000B=980B+20B

分组数N=980000/980=1000

发送1个分组的时间Ttran=(1000x8)/(100x106) =8x10-5 sec Ttotal=N x Ttran+2 x Ttran= 80.16 msec

某局域网采用CSMA/CD协议实现介质访问控制,数据传输速率为10Mbps,主机甲和主机乙之间的距离为2km,信号传播速度是200 000km/s。请回答下列问题,要求说明理由或写

出计算过程。

(1)若主机甲和主机乙发送数据时发生冲突,则从开始发送数据时刻起,到两台主机均检测到冲突时刻止,最短需经过多长时间?最长需以过多长时间?(假设主机甲和主机乙发送数据过程中,其他主机不发送数据)

(2)若网络不存在任何冲突与差错主同甲总是以标准的最长以太网数据帧(1518字节)向主同乙发数据主机乙成功收到一个数据帧后立即发送下一个数据帧。此时主机甲的有效数据传输速率是多少?(不考虑以太网帧的前导码)

(1)当甲乙同时向对方发送数据时,两台主机均检测到冲突所需时间最短: 1km/200000km/s×2=1×10^(-5)s

当一方发送的数据马上要到达另一方时,另一方开始发送数据,两台主机均检测到冲突所需时间最长:

2km/200000km/s×2=2×10^(-5)s

(2)发送一帧所需时间:1518B/10Mbps=1.2144ms

数据传播时间:2km/200 000km/s=1×10^(-5)s=0.01ms 有效的数据传输速率=10Mbps×1.2144ms/1.2244ms=9.92Mbps

Chapter 3

5. A bit string, 0111101111101111110, needs to be transmitted at the data link layer.What is the string actually transmitted after bit stuffing?(E) 输出:011110111110011111010.

6. When bit stuffing is used, is it possible for the loss, insertion, or modification of a single bit to cause an error not detected by the checksum? If not, why not? If so, how? Does the checksum length play a role here?(M)

可能。假定原来的正文包含位序列01111110 作为数据。位填充之后,这个序列将变成011111010。如果由于传输错误第二个0 丢失了,收到的位串又变成01111110,被接收方看成是帧尾。然后接收方在该串的前面寻找检验和,并对它进行验证。如果检验和是16 位,那么被错误的看成是检验和的16 位的内容碰巧经验证后仍然正确的概率是1/216。如果这种概率的条件成立了,就会导致不正确的帧被接收。显然,检验和段越长,传输错误不被发现的概率会越低,但该概率永远不等于零。

15.A bit stream 10011101 is transmitted using the standard CRC method described in the text. The generator polynomial is x3 + 1. Show the actual bit string transmitted. Suppose the third bit from the left is inverted during transmission. Show that this error is detected at the receiver's end.

A: The frame is 10011101. The generator is 1001. The message after appending three zeros is 10011101000. The remainder on dividing 10011101000 by 1001 is 100. So, the actual bit string transmitted is 10011101100. The received bit stream with an error in the third bit from the left is 10111101100. Dividing this by 1001 produces a remainder 100, which is different from zero. Thus, the receiver detects the error and can ask for a retransmission.

16. Data link protocols almost always put the CRC in a trailer rather than in aheader. Why?(E)

CRC是在发送期间进行计算的。一旦把最后一位数据送上外出线路,就立即把CRC编码附加在输出流的后面发出。如果把CRC 放在帧的头部,那么就要在发送之前把整个帧先检查一遍来计算CRC。这样每个字节都要处理两遍,第一遍是为了计算检验码,第二遍是为了发送。把CRC放在尾部就可以把处理时间减半。

17. A channel has a bit rate of 4 kbps and a propagation delay of 20 msec. Forwhat range of frame sizes does stop-and-wait give an efficiency of at least 50 percent?(E)

当发送一帧的时间等于信道的传播延迟的2倍时,信道的利用率为50%。或者说,当发送一帧的时间等于来回路程的传播延迟时,效率将是50%。而在帧长满足发送时间大于延迟的两倍时,效率将会高于50%。现在发送速率为4Mb/s,发送一位需要0.25微秒。

只有在帧长不小于160kb 时,停等协议的效率才会至少达到50%。

18. A 3000-km-long T1 trunk is used to transmit 64-byte frames using protocol 5.If the propagation speed is 6 μsec/km, how many bits should the sequence numbersbe?(M) 为了有效运行,序列空间(实际上就是发送窗口大小)必须足够的大,以允许发送方在收到第一个确认应答之前可以不断发送。信号在线路上的传播时间为

31. Consider an error-free 64-kbps satellite channel used to send 512-byte data frames in one direction, with very short acknowledgements coming back the other way. What is the maximum throughput for window sizes of 1, 7, 15, and 127? The

earth-satellite propagation time is 270 msec.(M)

使用卫星信道端到端的传输延迟为270ms,以64kb/s 发送,周期等于604ms。发送一帧的时间为64ms,我们需要604/64=9 个帧才能保持通道不空。

对于窗口值1,每604ms 发送4096 位,吞吐率为4096/0.604=6.8kb/s。 对于窗口值7,每604ms 发送4096*7 位,吞吐率为4096*7/0.604=47.5kb/s。 对于窗口值超过9(包括15、127),吞吐率达到最大值,即64kb/s。

32. A 100-km-long cable runs at the T1 data rate. The propagation speed in the

cable is 2/3 the speed of light in vacuum. How many bits fit in the cable?(E) 在该电缆中的传播速度是每秒钟200 000km,即每毫秒200km,因此100km 的电缆将会在0.5ms 内填满。T1 速率125 微秒传送一个193 位的帧,0.5ms 可以传送4 个T1 帧,即193*4=772bit。

Chapter 4

3. Consider the delay of pure ALOHA versus slotted ALOHA at low load. Which

one is less? Explain your answer.(E)

对于纯的ALOHA,发送可以立即开始。对于分隙的ALOHA,它必须等待下一个时隙。这样,平均会引入半个时隙的延迟。因此,纯ALOHA 的延迟比较小。

16. What is the baud rate of the standard 10-Mbps Ethernet?(E) 以太网使用曼彻斯特编码,这就意味着发送的每一位都有两个信号周期。标准以太网的数据率为10Mb/s,因此波特率是数据率的两倍,即20MBaud。

19. A 1-km-long, 10-Mbps CSMA/CD LAN (not 802.3) has a propagation speed of 200 m/μsec. Repeaters are not allowed in this system. Data frames are 256 bits long, including 32 bits of header, checksum, and other overhead. The first bit slot after a successful transmission is reserved for the receiver to capture the channel in order to send a 32-bit acknowledgement frame. What is the effective data rate, excluding

overhead, assuming that there are no collisions?(M)

依题知一公里的在铜缆中单程传播时间为1/200000=5×10-6 s=5 usec,往返传播时间为2t =10 usec,一次完整的传输分为6步: 发送者侦听铜缆时间为10usec,若线路可用

发送数据帧传输时间为256 bits / 10Mbps = 25.6 usec 数据帧最后一位到达时的传播延迟时间为5.0usec 接收者侦听铜缆时间为10 usec,若线路可用

接收者发送确认帧用时3.2 usec

确认帧最后一位到达时的传播延迟时间为5.0 usec

总共58.8sec,在这期间发送了224 bits 的数据,所以数据传输率为3.8 Mbps.

21. Consider building a CSMA/CD network running at 1 Gbps over a 1-km cablewith no repeaters. The signal speed in the cable is 200,000 km/sec. What is theminimum frame size?(E)

对于1km 电缆,单程传播时间为1/200000=5×10-6 s=5微秒,往返传播时间为2t=10 微秒。为了能够按照CSMA/CD 工作,最小帧的发射时间不能小于10 微秒。以1Gb/s速率工作,10 可以发送的比特数等于:(10*10-6)/(1*10-9)=10000因此,最小帧是10000 bit = 1250字节长。

22. An IP packet to be transmitted by Ethernet is 60 bytes long, including all itsheaders. If LLC is not in use, is padding needed in the Ethernet frame, and if so,how many bytes?(E) 最小的以太网帧是64 bytes,包含了以太网地址帧头,类型/长度域,以及校验和。由于帧头域占用18 bytes,并且分组是60 bytes,总帧长是78 bytes,这已经超过了64-byte 的最小限制。因此,不必再填充z了。

23. Ethernet frames must be at least 64 bytes long to ensure that the transmitter is still going in the event of a collision at the far end of the cable. Fast Ethernet has the same 64-byte minimum frame size but can get the bits out ten times faster. How is it possible to maintain the same minimum frame size?(E) 将快速以太网的电缆长度至为以太网的1/10即可。


计算机网络作业.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:避服药具培训试卷

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: