计算机网络 Top down 部分课后题答案
- 格式:doc
- 大小:1.21 MB
- 文档页数:23
计算机网络课后题答案1. 简答题1.什么是计算机网络?计算机网络是指将地理位置不同的计算机和其他设备通过通信链路互相连接起来,以共享资源、传输数据和信息,实现数据交换和通信的技术系统。
2.简述计算机网络的基本组成部分。
计算机网络的基本组成部分包括:终端设备、通信链路、交换设备和协议。
•终端设备:指连接到网络中的计算机、手机或其他网络设备,例如个人计算机、路由器、交换机等。
•通信链路:指物理媒介或无线信道,用于连接终端设备。
通信链路可以是有线的,如双绞线、光纤等;也可以是无线的,如无线局域网、蓝牙等。
•交换设备:指用于在网络中转发信息的设备,如交换机、路由器等。
交换设备主要负责将信息从一个端点传输到另一个端点。
•协议:指网络通信中规定了双方之间通信行为的标准,包括物理层、数据链路层、网络层、传输层和应用层等。
3.简述OSI参考模型。
OSI参考模型是一个由国际标准化组织(ISO)制定的网络通信协议参考模型,它将计算机网络通信划分为七个不同的层次,每层负责不同的功能:1.物理层:负责物理设备之间的原始比特流传输,如电缆和接口。
2.数据链路层:负责传输数据帧,错误检测和纠错等。
3.网络层:负责数据分组的路由和转发,实现不同网络之间的通信。
4.传输层:负责端到端的可靠数据传输,提供流控制和差错恢复。
5.会话层:负责建立、管理和终止会话。
6.表示层:负责数据的格式化、加密和压缩。
7.应用层:提供与用户交互的网络服务和应用程序。
OSI参考模型的分层设计使得不同的网络功能可以独立地开发和升级,提高了网络的可扩展性和互操作性。
2. 计算题1.假设一台主机A的IP地址为192.168.1.10,子网掩码为255.255.255.0,那么主机A所在的网络号是多少?主机A的IP地址为192.168.1.10,子网掩码为255.255.255.0。
根据子网掩码的规则,将IP地址和子网掩码进行AND运算,可得主机A所在的网络地址为192.168.1.0。
Computer Networking: A Top-Down Approach, 7th Edition计算机网络自顶向下第七版Solutions to Review Questions and ProblemsChapter 6 Review Questions1.The transportation mode, e.g., car, bus, train, car.2.Although each link guarantees that an IP datagram sent over the link will bereceived at the other end of the link without errors, it is not guaranteed that IP datagrams will arrive at the ultimate destination in the proper order. With IP,datagrams in the same TCP connection can take different routes in the network, and therefore arrive out of order. TCP is still needed to provide the receiving end of the application the byte stream in the correct order. Also, IP can lose packets due to routing loops or equipment failures.3.Framing: there is also framing in IP and TCP; link access; reliable delivery: thereis also reliable delivery in TCP; flow control: there is also flow control in TCP;error detection: there is also error detection in IP and TCP; error correction; full duplex: TCP is also full duplex.4.There will be a collision in the sense that while a node is transmitting it will startto receive a packet from the other node.5.Slotted Aloha: 1, 2 and 4 (slotted ALOHA is only partially decentralized, since itrequires the clocks in all nodes to be synchronized). Token ring: 1, 2, 3, 4.6.After the 5th collision, the adapter chooses from {0, 1, 2,…, 31}. The probabilitythat it chooses 4 is 1/32. It waits 204.8 microseconds.7.In polling, a discussion leader allows only one participant to talk at a time, witheach participant getting a chance to talk in a round-robin fashion. For token ring, there isn’t a discussion leader, but there is wine glass that the participants take turns holding. A participant is only allowed to talk if the participant is holding the wine glass.8.When a node transmits a frame, the node has to wait for the frame to propagatearound the entire ring before the node can release the token. Thus, if L/R is small as compared to t prop, then the protocol will be inefficient.9.248 MAC addresses; 232 IPv4 addresses; 2128 IPv6 addresses.10.C’s adapter will process the frames, but the adapter will not pass the datagrams upthe protocol stack. If the LAN broadcast address is used, then C’s adapter will both process the frames and pass the datagrams up the protocol stack.11.An ARP query is sent in a broadcast frame because the querying host does notwhich adapter address corresponds to the IP address in question. For the response, the sending node knows the adapter address to which the response should be sent, so there is no need to send a broadcast frame (which would have to be processed by all the other nodes on the LAN).12.No it is not possible. Each LAN has its own distinct set of adapters attached to it,with each adapter having a unique LAN address.13.The three Ethernet technologies have identical frame structures.14.2 (the internal subnet and the external internet)15.In 802.1Q there is a 12- bit VLAN identifier. Thus 212 = 4,096 VLANs can besupported.16.We can string the N switches together. The first and last switch would use oneport for trunking; the middle N-2 switches would use two ports. So the totalnumber of ports is 2+ 2(N-2) = 2N-2 ports.Chapter 6 ProblemsProblem 11 1 1 0 10 1 1 0 01 0 0 1 01 1 0 1 11 1 0 0 0Problem 2Suppose we begin with the initial two-dimensional parity matrix:0 0 0 01 1 1 10 1 0 11 0 1 0With a bit error in row 2, column 3, the parity of row 2 and column 3 is now wrong in the matrix below:0 0 0 01 1 0 10 1 0 11 0 1 0Now suppose there is a bit error in row 2, column 2 and column 3. The parity of row 2 is now correct! The parity of columns 2 and 3 is wrong, but we can't detect in which rows the error occurred!0 0 0 01 0 0 10 1 0 11 0 1 0The above example shows that a double bit error can be detected (if not corrected).Problem 301001100 01101001+ 01101110 01101011------------------------------10111010 11010100+ 00100000 01001100------------------------------11011011 00100000+ 01100001 01111001-----------------------------00111100 10011010 (overflow, then wrap around)+ 01100101 01110010------------------------------10100010 00001100The one's complement of the sum is 01011101 11110011Problem 4a)To compute the Internet checksum, we add up the values at 16-bit quantities:00000001 0000001000000011 0000010000000101 0000011000000111 0000100000001001 00001010-------------------------00011001 00011110The one's complement of the sum is 11100110 11100001.b)To compute the Internet checksum, we add up the values at 16-bit quantities: 01000010 0100001101000100 0100010101000110 0100011101001000 0100100101001010 01001011-------------------------10011111 10100100The one's complement of the sum is 01100000 01011011c)To compute the Internet checksum, we add up the values at 16-bit quantities: 01100010 0110001101100100 0110010101100110 0110011101101000 0110100101101010 01101011-------------------------00000000 00000101The one's complement of the sum is 11111111 11111010.Problem 5If we divide 10011 into 1010101010 0000, we get 1011011100, with a remainder of R=0100. Note that, G=10011 is CRC-4-ITU standard.Problem 6a) we get 1000110000, with a remainder of R=0000.b) we get 010*******, with a remainder of R=1111.c) we get 1011010111, with a remainder of R=1001.Problem 7a) Without loss of generality, suppose ith bit is flipped, where 0<= i <= d+r-1 and assume that the least significant bit is 0th bit.A single bit error means that the received data is K=D*2r XOR R + 2i. It is clear that if we divide K by G, then the reminder is not zero. In general, if G contains at least two 1’s, then a single bit error can always be detected.b) The key insight here is that G can be divided by 11 (binary number), but any number of odd-number of 1’s cannot be divided by 11. Thus, a sequence (not necessarily contiguous) of odd-number bit errors cannot be divided by 11, thus it cannot be divided by G.Problem 8a)1)1()(--=N p Np p E21)1)(1()1()('------=N N p N Np p N p E))1()1(()1(2----=-N p p p N NN p p E 1*0)('=⇒=b)N N N N N N p E N N N 11)11()11()11(1*)(11--=-=-=-- 1)11(lim =-∞→N N e N N N 1)11(lim =-∞→ Thuse p E N 1*)(lim =∞→Problem 9)1(2)1()(--=N p Np p E)3(2)2(2)1)(1(2)1()('------=N N p N Np p N p E))1(2)1(()1()3(2----=-N p p p N N121*0)('-=⇒=N p p E)1(2)1211(12*)(----=N N N N p E e e p E N 21121*)(lim =⋅=∞→Problem 10a) A’s average throughput is given by pA(1-pB).Total efficiency is pA(1-pB) + pB(1-pA).b) A’s throughput is pA(1-pB)=2pB(1-pB)= 2pB- 2(pB)2.B’s throughput is pB(1-pA)=pB(1-2pB)= pB- 2(pB)2.Clearly, A’s throughput is not twice as large as B’s.In order to make pA(1-pB)= 2 pB(1-pA), we need that pA= 2 – (pA / pB).c)A’s throughput is 2p(1-p)N-1, and any other node has throughput p(1-p)N-2(1-2p).Problem 11a)(1 – p(A))4 p(A)where, p(A) = probability that A succeeds in a slotp(A) = p(A transmits and B does not and C does not and D does not)= p(A transmits) p(B does not transmit) p(C does not transmit) p(D does not transmit)= p(1 – p) (1 – p)(1-p) = p(1 – p)3Hence, p(A succeeds for first time in slot 5)= (1 – p(A))4 p(A) = (1 – p(1 – p)3)4 p(1 – p)3b)p(A succeeds in slot 4) = p(1-p)3p(B succeeds in slot 4) = p(1-p)3p(C succeeds in slot 4) = p(1-p)3p(D succeeds in slot 4) = p(1-p)3p(either A or B or C or D succeeds in slot 4) = 4 p(1-p)3(because these events are mutually exclusive)c)p(some node succeeds in a slot) = 4 p(1-p)3p(no node succeeds in a slot) = 1 - 4 p(1-p)3Hence, p(first success occurs in slot 3) = p(no node succeeds in first 2 slots) p(some node succeeds in 3rd slot) = (1 - 4 p(1-p)3)2 4 p(1-p)3d)efficiency = p(success in a slot) =4 p(1-p)3Problem 12Problem 13The length of a polling round is)/(poll d R Q N +.The number of bits transmitted in a polling round is NQ . The maximum throughput therefore isQR d R d R Q N NQ poll poll +=+1)/( Problem 14a), b) See figure below.c)1. Forwarding table in E determines that the datagram should be routed to interface 192.168.3.002.2. The adapter in E creates and Ethernet packet with Ethernet destination address 88-88-88-88-88-88.3. Router 2 receives the packet and extracts the datagram. The forwarding table in this router indicates that the datagram is to be routed to 198.162.2.002.4.Router 2 then sends the Ethernet packet with the destination address of 33-33-33-33-33-33 and source address of 55-55-55-55-55-55 via its interface with IP address of 198.162.2.003.5.The process continues until the packet has reached Host B.a)ARP in E must now determine the MAC address of 198.162.3.002. Host E sendsout an ARP query packet within a broadcast Ethernet frame. Router 2 receives the query packet and sends to Host E an ARP response packet. This ARP response packet is carried by an Ethernet frame with Ethernet destination address 77-77-77-77-77-77.Problem 15a)No. E can check the subnet prefix of Host F’s IP address, and then learn that F ison the same LAN. Thus, E will not send the packet to the default router R1. Ethernet frame from E to F:Source IP = E’s IP addressDestination IP = F’s IP addressSource MAC = E’s MAC addressDestination MAC = F’s MAC addressb)No, because they are not on the same LAN. E can find this out by checking B’s IPaddress.Ethernet frame from E to R1:Source IP = E’s IP addressDestination IP = B’s IP addressSource MAC = E’s MAC addressDestination MAC = The MAC address of R1’s interface connecting to Subnet 3.c)Switch S1 will broadcast the Ethernet frame via both its interfaces as the receivedARP frame’s destination address is a broadcast address. And it learns that Aresides on Subnet 1 which is connected to S1 at the interface connecting to Subnet1. And, S1 will update its forwarding table to include an entry for Host A.Yes, router R1 also receives this ARP request message, but R1 won’t forward the message to Subnet 3.B won’t send ARP query message asking for A’s MAC address, as this address can be obtained from A’s query message.Once switch S1 receives B’s response message, it will add an entry for host B in its forwarding table, and then drop the received frame as destination host A is on the same interface as host B (i.e., A and B are on the same LAN segment).Lets call the switch between subnets 2 and 3 S2. That is, router R1 between subnets 2 and 3 is now replaced with switch S2.a) No. E can check the subnet prefix of Host F’s IP address, and then learn that F is on the same LAN segment. Thus, E will not send the packet to S2. Ethernet frame from E to F: Source IP = E’s IP address Destination IP = F’s IP address Source MAC = E’s MAC addressDestination MAC = F’s MAC addressb) Yes, because E would like to find B’s MAC address. In this case, E will send an ARP query packet with destination MAC address being the broadcast address. This query packet will be re-broadcast by switch 1, and eventually received by Host B. Ethernet frame from E to S2: Source IP = E’s IP address Destination IP = B’s IP address Source MAC = E’s MAC addressDestination MAC = broadcast MAC address: FF-FF-FF-FF-FF-FF.c) Switch S1 will broadcast the Ethernet frame via both its interfaces as the received ARP frame’s destination address is a broadcast address. And it learns that Aresides on Subnet 1 which is connected to S1 at the interface connecting to Subnet 1. And, S1 will update its forwarding table to include an entry for Host A.Yes, router S2 also receives this ARP request message, and S2 will broadcast this query packet to all its interfaces.B won’t send ARP query message asking for A’s MAC address, as this address can be obtained from A’s query message.Once switc h S1 receives B’s response message, it will add an entry for host B in its forwarding table, and then drop the received frame as destination host A is on the same interface as host B (i.e., A and B are on the same LAN segment).Problem 17Wait for 51,200 bit times. For 10 Mbps, this wait is12.51010102.5163=⨯⨯bps bitsmsecFor 100 Mbps, the wait is 512 μsec.At 0=t A transmits. At 576=t , A would finish transmitting. In the worst case, B begins transmitting at time t=324, which is the time right before the first bit of A’s frame arrives at B. At time t=324+325=649 B 's first bit arrives at A . Because 649> 576, A finishes transmitting before it detects that B has transmitted. So A incorrectly thinks that its frame was successfully transmitted without a collision.Problem 19Because A 's retransmission reaches B before B 's scheduled retransmission time (805+96), B refrains from transmitting while A retransmits. Thus A and B do not collide. Thus the factor 512 appearing in the exponential backoff algorithm is sufficiently large.Problem 20a) Let Y be a random variable denoting the number of slots until a success:1)1()(--==m m Y P ββ,where β is the probability of a success.This is a geometric distribution, which has mean β/1. The number of consecutive wasted slots is 1-=Y X thatββ-=-==11][][Y E X E x1)1(--=N p Np β11)1()1(1-----=N N p Np p Np xefficiency11)1()1(1-----+=+=N N p Np p Np k kxk kb)Maximizing efficiency is equivalent to minimizing x , which is equivalent tomaximizing β. We know from the text that β is maximized at Np 1=.c)efficiency 11)11()11(1-----+=N N NN k k∞→N lim efficiency 1/1/11-+=-+=e k kee k kd) Clearly, 1-+e k kapproaches 1 as ∞→k .Problem 21i) from A to left router: Source MAC address: 00-00-00-00-00-00Destination MAC address: 22-22-22-22-22-22Source IP: 111.111.111.001Destination IP: 133.333.333.003ii) from the left router to the right router: Source MAC address: 33-33-33-33-33-33Destination MAC address: 55-55-55-55-55-55Source IP: 111.111.111.001Destination IP: 133.333.333.003iii) from the right router to F: Source MAC address: 88-88-88-88-88-88Destination MAC address: 99-99-99-99-99-99Source IP: 111.111.111.001Destination IP: 133.333.333.003Problem 22i) from A to switch: Source MAC address: 00-00-00-00-00-00Destination MAC address: 55-55-55-55-55-55Source IP: 111.111.111.001Destination IP: 133.333.333.003ii) from switch to right router: Source MAC address: 00-00-00-00-00-00Destination MAC address: 55-55-55-55-55-55Source IP: 111.111.111.001Destination IP: 133.333.333.003iii) from right router to F: Source MAC address: 88-88-88-88-88-88Destination MAC address: 99-99-99-99-99-99Source IP: 111.111.111.001Destination IP: 133.333.333.003111.111.111.00311-11-11-11-11-11122.222.222.00466-66-66-66-66Problem 23If all the 11=9+2 nodes send out data at the maximum possible rate of 100 Mbps, a total aggregate throughput of 11*100 = 1100 Mbps is possible.Problem 24Each departmental hub is a single collision domain that can have a maximum throughput of 100 Mbps. The links connecting the web server and the mail server has a maximum throughput of 100 Mbps. Hence, if the three collision domains and the web server and mail server send out data at their maximum possible rates of 100 Mbps each, a maximum total aggregate throughput of 500 Mbps can be achieved among the 11 end systems.Problem 25All of the 11 end systems will lie in the same collision domain. In this case, the maximum total aggregate throughput of 100 Mbps is possible among the 11 end sytems. Problem 26Problem 27a) The time required to fill 8⋅L bits is.sec 16sec 1012883m LL =⨯⋅b) For ,500,1=L the packetization delay is.sec 75.93sec 161500m m =For ,50=L the packetization delay is.sec 125.3sec 1650m m =c) Store-and-forward delay RL 408+⋅=For 500,1=L , the delay issec 4.19sec 1062240815006μ≈⨯+⋅For ,50=L store-and-forward delay sec 1μ<.d) Store-and-forward delay is small for both cases for typical link speeds. However, packetization delay for 1500=L is too large for real-time voice applications.Problem 28The IP addresses for those three computers (from left to right) in EE department are: 111.111.1.1, 111.111.1.2, 111.111.1.3. The subnet mask is 111.111.1/24.The IP addresses for those three computers (from left to right) in CS department are: 111.111.2.1, 111.111.2.2, 111.111.2.3. The subnet mask is 111.111.2/24.The router’s interface card that connects to port 1 can be configured to contain two sub-interface IP addresses: 111.111.1.0 and 111.111.2.0. The first one is for the subnet of EE department, and the second one is for the subnet of CS department. Each IP address is associated with a VLAN ID. Suppose 111.111.1.0 is associated with VLAN 11, and 111.111.2.0 is associated with VLAN 12. This means that each frame that comes from subnet 111.111.1/24 will be added an 802.1q tag with VLAN ID 11, and each frame that comes from 111.111.2/24 will be added an 802.1q tag with VLAN ID 12. Suppose that host A in EE department with IP address 111.111.1.1 would like to send an IP datagram to host B (111.111.2.1) in CS department. Host A first encapsulates the IP datagram (destined to 111.111.2.1) into a frame with a destination MAC address equal to the MAC address of the router’s interface card that connects to port 1 of the switch. Once the router receives the frame, then it passes it up to IP layer, which decides that the IP datagram should be forwarded to subnet 111.111.2/24 via sub-interface 111.111.2.0. Then the router encapsulates the IP datagram into a frame and sends it to port 1. Note that this frame has an 802.1q tag VLAN ID 12. Once the switch receives the frame port 1, it knows that this frame is destined to VLAN with ID 12, so the switch will send the frame to Host B which is in CS department. Once Host B receives this frame, it will remove the 802.1q tag.Problem 30(The following description is short, but contains all major key steps and key protocols involved.)Your computer first uses DHCP to obtain an IP address. You computer first creates a special IP datagram destined to 255.255.255.255 in the DHCP server discovery step, and puts it in a Ethernet frame and broadcast it in the Ethernet. Then following the steps in the DHCP protocol, you computer is able to get an IP address with a given lease time.A DHCP server on the Ethernet also gives your computer a list of IP addresses of first-hop routers, the subnet mask of the subnet where your computer resides, and the addresses of local DNS servers (if they exist).Since your computer’s ARP cache is initially empty, your computer will use ARP protocol to get the MAC addresses of the first-hop router and the local DNS server.Your computer first will get the IP address of the Web page you would like to download. If the local DNS server does not have the IP address, then your computer will use DNS protocol to find the IP address of the Web page.Once your computer has the IP address of the Web page, then it will send out the HTTP request via the first-hop router if the Web page does not reside in a local Web server. The HTTP request message will be segmented and encapsulated into TCP packets, and then further encapsulated into IP packets, and finally encapsulated into Ethernet frames. Your computer sends the Ethernet frames destined to the first-hop router. Once the router receives the frames, it passes them up into IP layer, checks its routing table, and then sends the packets to the right interface out of all of its interfaces.Then your IP packets will be routed through the Internet until they reach the Web server. The server hosting the Web page will send back the Web page to your computer via HTTP response messages. Those messages will be encapsulated into TCP packets and then further into IP packets. Those IP packets follow IP routes and finally reach yourfirst-hop router, and then the router will forward those IP packets to your computer by encapsulating them into Ethernet frames.Problem 32a) Each flow evenly shares a link’s capacity with other flows traversing that link, then the 80 flows crossing the B to access-router 10 Gbps links (as well as the access router to border router links) will each only receive 10 Gbps / 80 = 125 Mbpsb) In Topology of Figure 5.31, there are four distinct paths between the first and third tier-2 switches, together providing 40 Gbps for the traffic from racks 1-4 to racks 9-12. Similarly, there are four links between second and fourth tier-2 switches, together providing 40 Gbps for the traffic from racks 5-8 to 13-16. Thus the total aggregate bandwidth is 80 Gbps, and the value per flow rate is 1 Gbps.c) Now 20 flows will need to share each 1 Gbps bandwidth between pairs of TOR switches. So the host-to-host bit rate will be 0.5 Gbps.Problem 33a)Both email and video application uses the fourth rack for 0.1 percent of the time.b)Probability that both applications need fourth rack is 0.001*0.001 = 10-6.c)Suppose the first three racks are for video, the next rack is a shared rack for bothvideo and email, and the next three racks are for email. Let's assume that thefourth rack has all the data and software needed for both the email and video applications. With the topology of Figure 5.31, both applications will have enough intra-bandwidth as long as both are not simultaneously using the fourth rack.From part b, both are using the fourth rack for no more than .00001 % of time, which is within the .0001% requirement.。
计算机⽹络⾃顶向下⽅法,第7版——习题解答⽬录前⾔本⽂包含了Computer Networking A Top-Down Approach, 7th Edition中部分回顾性习题的问题与解答,主要参考了英⽂第7版和中⽂第7版的正⽂内容,欢迎各位的交流与指正!CHAPTER 1SECTION 1.1R1. What is the difference between a host and an end system? List several different types of end systems. Is a Web server anend system?在计算机⽹络中,⼆者的含义是相同的。
端系统列举:⼿机、平板电脑、环境传感器等⽹络服务器是端系统R2. The word protocol is often used to describe diplomatic relations. How does Wikipedia describe diplomatic protocol?There are two meanings of the word "protocol". In the legal sense, it is defined as an international agreement that supplements or amends a treaty. In the diplomatic sense, the term refers to the set of rules, procedures, conventions and ceremonies that relate to relations between states. In general, protocol represents the recognized and generally accepted system of international courtesy.“协议”⼀词有两种含义。
专业.专注 .。
Chapl: l 、描述in te rn e t 的方法:一种是描述 internet 的具体构成,也就是构成 interne t 的硬件和软件 。
另一种是根据为分布式应用提供服务联网基础设施来描述的。
协议概念: 协议定义了在两个或多个通信实体 之间交换的报文格式和改序 , 以及在报文传输 和接收或其它事件方面所采取的确 3、因特网的面向连接服务包括可靠数据传送 、流控制和拥塞控制。
可靠数据传送 :指一个应用程序能够依赖该连接无差错的和按顺序传递其所有数据。
流控制:确保连接的任何一方都不会过快的发送过量的分组而淹没另一方 。
拥塞控制:有助于防止因特网进入迟滞状态 。
4 、In terne t protocol s t ack口application 应用层:suppor 寸的g network applications 报文 FTP, SMTP,HTTP口transport 运输层;process -process data transfer 报文段 ·:·TC P ,UDP口network 网络层: rout i ng of datagrams from source to destinat i on 数据报 ·:·I P , ro u ting protocols口l i nk 链路层:“t a transfer betwe e n ne i g h boring network e lem e nts 帧 ·:·PPP, Ethernet口phys i cal 物理层:b i ts ”on the w i re"cbap2 应用层l 、3 种主流体系结构 :客户机/服务器结构: P2P 体系结构:两者混合的结构2、web 的应用层协议是 HTTP OfyperText Transfer Protocol ),使用 TCP 而不是 UDP 作为底层传输协议3、TCP 握手方式 :客户机发送一个小 TCP 报文段到服务器 ,服务器用一个小 TCP 报文段确认和响应,最后,客户机向服务器返回确认。
7第一章R11 L/R1 + L/R2R13a. 两个用户b. 每个用户需要1Mbps进行传输,若两个或更少用户同时进行传输,则带宽需求量最大为2Mbps,由于链路总带宽为2Mbps,所以无排队时延;若三个或更多用户同时进行传输,带宽需求超过3Mbps,多于链路总带宽,因此会出现排队时延。
c. 0.27d. 0.008;0.008R19a. 500kbpsb. 64sc. 100kbps;320sR23应用层:网络应用程序及应用层协议存留的地方;传输层:在应用程序端点之间传送应用层报文;网络层:将网络层分组(数据报)从一台主机移动到另一台主机;链路层:将分组从一个结点移动到路径上的下一个结点;物理层:将帧(链路层分组)中的一个一个比特从一个结点移动到下一个结点。
R25路由器:网络层,链路层,物理层链路层交换机:链路层,物理层主机:所有五层P3a. 电路交换网。
因为应用包含可预测的稳定带宽需求的长运行时间,由于传输率已知且非猝发,可在无明显浪费的情况下为每个应用周期预留带宽。
且建立与中断连接的总开销可被均摊在应用长时间的运行时间中。
b. 在最坏的情况下,所有应用同时经一条或多条链路传输。
然而由于每条链路都有足够带宽提供给所有应用,不会出现拥塞情况,因此不需要拥塞控制。
第二章R5目的主机的IP地址与目的进程套接字的端口号R12当用户首次访问网站时,服务器创建一唯一标识码,在其后端服务器中创建一入口,将该唯一标识码作为Cookie 码返回,该cookie 码储存在用户主机中,由浏览器管理。
在后来每次的访问与购买中,浏览器将cookie 码发送给网站,因此当该用户(准确地说,该浏览器)访问该网站时,网站会立即获知。
R15FTP 使用两平行TCP 连接,一条连接发送控制信息(例如文件传输请求),另一条连接用作实际传输文件。
由于控制信息不会通过与文件传输相同的连接发送,因此FTP 在“带外”发送控制信息。
R19是的,一个机构的邮件服务器和Web 服务器可以有完全相同的主机名别名。
计算机网络习题解答教材计算机网络谢希仁编著第一章概述习题1-01 计算机网络的发展可划分为几个阶段?每个阶段各有何特点?答: 计算机网络的发展过程大致经历了四个阶段。
第一阶段:(20世纪60年代)以单个计算机为中心的面向终端的计算机网络系统。
这种网络系统是以批处理信息为主要目的。
它的缺点是:如果计算机的负荷较重,会导致系统响应时间过长;单机系统的可靠性一般较低,一旦计算机发生故障,将导致整个网络系统的瘫痪。
第二阶段:(20世纪70年代)以分组交换网为中心的多主机互连的计算机网络系统。
为了克服第一代计算机网络的缺点,提高网络的可靠性和可用性,人们开始研究如何将多台计算机相互连接的方法。
人们首先借鉴了电信部门的电路交换的思想。
所谓“交换”,从通信资源的分配角度来看,就是由交换设备动态地分配传输线路资源或信道带宽所采用的一种技术。
电话交换机采用的交换技术是电路交换(或线路交换),它的主要特点是:①在通话的全部时间内用户独占分配的传输线路或信道带宽,即采用的是静态分配策略;②通信双方建立的通路中任何一点出现了故障,就会中断通话,必须重新拨号建立连接,方可继续,这对十分紧急而重要的通信是不利的。
显然,这种交换技术适应模拟信号的数据传输。
然而在计算机网络中还可以传输数字信号。
数字信号通信与模拟信号通信的本质区别在于数字信号的离散性和可存储性。
这些特性使得它在数据传输过程中不仅可以间断分时发送,而且可以进行再加工、再处理。
③计算机数据的产生往往是“突发式”的,比如当用户用键盘输入数据和编辑文件时,或计算机正在进行处理而未得出结果时,通信线路资源实际上是空闲的,从而造成通信线路资源的极大浪费。
据统计,在计算机间的数据通信中,用来传送数据的时间往往不到10%甚至1%。
另外,由于各异的计算机和终端的传输数据的速率各不相同,采用电路交换就很难相互通信。
为此,必须寻找出一种新的适应计算机通信的交换技术。
1964年,巴兰(Baran)在美国兰德(Rand)公司“论分布式通信”的研究报告中提出了存储转发(store and forward)的概念。
计算机网络课后题答案目录第一次作业 (2)1.计算机网络的发展经历哪四代?其特点是什么? (2)第二次作业 (2)2、计算机网络主要由哪几部分组成?每部分的作用是什么? (2)4.数据通信系统主要由哪几部分组成?每部分作用是什么? (2)4.什么是单工通信、半双工通信、全双工通信? (3)2G、3G、4G、的含义是什么? (3)第三次作业 (3)6.什么是传输信道?目前数据通信中经常使用的有线信道主要有哪些? (3)7.什么是基带传输和宽带传输?二者相比较宽带传输的优点有哪些? (4)第四次作业 (4)8.分别简述数字调制的三种基本形式? (4)9.当给出的数据信号为00101101时,试分别画出曼彻斯特编码和差分曼彻斯特编码的波形图。
(4)10.什么是多路复用技术?简述时分多路复用的工作原理是什么?(5)第五次作业 (5)13、资源子网和通信子网的作用分别是什么? (5)14、计算机网络拓扑可分为哪几种?每一种的特点是什么? (5)第一次作业1.计算机网络的发展经历哪四代?其特点是什么?答:1)、第一代计算机网络——面向终端的计算机网络特点:构成了计算机网络的雏形,但通信线路昂贵,主机负担过重。
2)、第二代计算机网络——共享资源的计算机网络特点:多台计算机通过通信线路连接起来,相互共享资源,这样就形成了以共享资源为目的的第二代计算机网络。
3)、第三代计算机网络——标准化的计算机网络特点:OSI标准确保了各厂商生产的计算机和网络产品之间的互联,推动了网络技术的应用和发展。
4)、第四代计算机网络——国际化的计算机网络特点:使连接到网上的所有计算机能够相互交流信息,体现了各要素之间的紧密性,人工智能技术与网络基础的结合第二次作业2、计算机网络主要由哪几部分组成?每部分的作用是什么?答:计算机网络由三个主要组成部分:1)若干个主机作用:它们为用户提供服务;2)一个通信子网它主要由结点交换机和连接这些结点的通信链路所组成;作用:主要负责全网的数据通信,为用户提供数据传输、转接、加工和变换等通信处理工作。
Computer Networking: A Top-Down Approach,7th Edition计算机网络自顶向下第七版Solutions to Review Questions and ProblemsChapter 7 Review Questions1.In infrastructure mode of operation, each wireless host is connected to the largernetwork via a base station (access point). If not operating in infrastructure mode, a network operates in ad-hoc mode. In ad-hoc mode, wireless hosts have noinfrastructure with which to connect. In the absence of such infrastructure, the hosts themselves must provide for services such as routing, address assignment, DNS-like name translation, and more.2.a) Single hop, infrastructure-basedb) Single hop, infrastructure-lessc) Multi-hop, infrastructure-basedd) Multi-hop, infrastructure-less3.Path loss is due to the attenuation of the electromagnetic signal when it travelsthrough matter. Multipath propagation results in blurring of the received signal at the receiver and occurs when portions of the electromagnetic wave reflect off objects and ground, taking paths of different lengths between a sender and receiver. Interference from other sources occurs when the other source is also transmitting in the samefrequency range as the wireless network.4.a) Increasing the transmission powerb) Reducing the transmission rate5.APs transmit beacon frames. An AP’s beacon frames will be transmitted over one ofthe 11 channels. The beacon frames permit nearby wireless stations to discover and identify the AP.6.False7.APs transmit beacon frames. An AP’s beacon frames will be transmitted over one ofthe 11 channels. The beacon frames permit nearby wireless stations to discover and identify the AP.8.False9.Each wireless station can set an RTS threshold such that the RTS/CTS sequence isused only when the data frame to be transmitted is longer than the threshold. This ensures that RTS/CTS mechanism is used only for large frames.10.No, there wouldn’t be any advantage. Suppose there are two stations that want totransmit at the same time, and they both use RTS/CTS. If the RTS frame is as long asa DATA frames, the channel would be wasted for as long as it would have beenwasted for two colliding DATA frames. Thus, the RTS/CTS exchange is only useful when the RTS/CTS frames are significantly smaller than the DATA frames.11.Initially the switch has an entry in its forwarding table which associates the wirelessstation with the earlier AP. When the wireless station associates with the new AP, the new AP creates a frame with the wireless station’s MAC address and broadcasts the frame. The frame is received by the switch. This forces the switch to update itsforwarding table, so that frames destined to the wireless station are sent via the new AP.12.Any ordinary Bluetooth node can be a master node whereas access points in 802.11networks are special devices (normal wireless devices like laptops cannot be used as access points).13.False14.“Opportunistic Scheduling” refers to matching the physical layer protocol to channelconditions between the sender and the receiver, and choosing the receivers to which packets will be sent based on channel condition. This allows the base station to make best use of the wireless medium.15.UMTS to GSM and CDMA-2000 to IS-95.16.The data plane role of eNodeB is to forward datagram between UE (over the LTEradio access network) and the P-GW. Its control plane role is to handle registration and mobility signaling traffic on behalf of the UE.The mobility management entity (MME) performs connection and mobility management on behalf of the UEs resident in the cell it controls. It receives UE subscription information from the HHS.The Packet Data Network Gateway (P-GW) allocates IP addresses to the UEs and performs QoS enforcement. As a tunnel endpoint it also performs datagram encapsulation/decapsulation when forwarding a datagram to/from a UE.The Serving Gateway (S-GW) is the data-plane mobility anchor point as all UE traffic will pass through the S-GW. The S-GW also performs charging/billing functions and lawful traffic interception.17.In 3G architecture, there are separate network components and paths for voice anddata, i.e., voice goes through public telephone network, whereas data goes through public Internet. 4G architecture is a unified, all-IP network architecture, i.e., both voice and data are carried in IP datagrams to/from the wireless device to severalgateways and then to the rest of the Internet.The 4G network architecture clearly separates data and control plane, which is different from the 3G architecture.The 4G architecture has an enhanced radio access network (E-UTRAN) that is different from 3G’s radio access network UTRAN.18.No. A node can remain connected to the same access point throughout its connectionto the Internet (hence, not be mobile). A mobile node is the one that changes its point of attachment into the network over time. Since the user is always accessing theInternet through the same access point, she is not mobile.19.A permanent address for a mobile node is its IP address when it is at its homenetwork. A care-of-address is the one its gets when it is visiting a foreign network.The COA is assigned by the foreign agent (which can be the edge router in theforeign network or the mobile node itself).20.False21.The home network in GSM maintains a database called the home location register(HLR), which contains the permanent cell phone number and subscriber profileinformation about each of its subscribers. The HLR also contains information about the current locations of these subscribers. The visited network maintains a database known as the visitor location register (VLR) that contains an entry for each mobile user that is currently in the portion of the network served by the VLR. VLR entries thus come and go as mobile users enter and leave the network.The edge router in home network in mobile IP is similar to the HLR in GSM and the edge router in foreign network is similar to the VLR in GSM.22.Anchor MSC is the MSC visited by the mobile when a call first begins; anchor MSCthus remains unchanged during the call. Throughout the call’s duration and regardless of the number of inter-MSC transfers performed by the mobile, the call is routed from the home MSC to the anchor MSC, and then from the anchor MSC to the visitedMSC where the mobile is currently located.23.a) Local recoveryb) TCP sender awareness of wireless linksc) Split-connection approachesChapter 7 ProblemsProblem 1Output corresponding to bit d 1 = [-1,1,-1,1,-1,1,-1,1]Output corresponding to bit d 0 = [1,-1,1,-1,1,-1,1,-1]Problem 2Sender 2 output = [1,-1,1,1,1,-1,1,1]; [ 1,-1,1,1,1,-1,1,1]Problem 3181111)1()1(111111)1()1(1112=⨯+⨯+-⨯-+⨯+⨯+⨯+-⨯-+⨯=d 181111)1()1(111111)1()1(1122=⨯+⨯+-⨯-+⨯+⨯+⨯+-⨯-+⨯=dProblem 4Sender 1: (1, 1, 1, -1, 1, -1, -1, -1)Sender 2: (1, -1, 1, 1, 1, 1, 1, 1)Problem 5a) The two APs will typically have different SSIDs and MAC addresses. A wirelessstation arriving to the café will associate with one of the SSIDs (that is, one of the APs). After association, there is a virtual link between the new station and the AP. Label the APs AP1 and AP2. Suppose the new station associates with AP1. When the new station sends a frame, it will be addressed to AP1. Although AP2 will alsoreceive the frame, it will not process the frame because the frame is not addressed to it. Thus, the two ISPs can work in parallel over the same channel. However, the two ISPs will be sharing the same wireless bandwidth. If wireless stations in different ISPs transmit at the same time, there will be a collision. For 802.11b, the maximum aggregate transmission rate for the two ISPs is 11 Mbps.b) Now if two wireless stations in different ISPs (and hence different channels) transmitat the same time, there will not be a collision. Thus, the maximum aggregatetransmission rate for the two ISPs is 22 Mbps for 802.11b.Problem 6Suppose that wireless station H1 has 1000 long frames to transmit. (H1 may be an AP that is forwarding an MP3 to some other wireless station.) Suppose initially H1 is the onlystation that wants to transmit, but that while half-way through transmitting its first frame, H2 wants to transmit a frame. For simplicity, also suppose every station can hear every other station’s signal (that is, no hidden terminals). Before transmitting, H2 will sense that the channel is busy, and therefore choose a random backoff value.Now suppose that after sending its first frame, H1 returns to step 1; that is, it waits a short period of times (DIFS) and then starts to transmit the second frame. H1’s second frame will then be transmitted while H2 is stuck in backoff, waiting for an idle channel. Thus, H1 should get to transmit all of its 1000 frames before H2 has a chance to access the channel. On the other hand, if H1 goes to step 2 after transmitting a frame, then it too chooses a random backoff value, thereby giving a fair chance to H2. Thus, fairness was the rationale behind this design choice.Problem 7A frame without data is 32 bytes long. Assuming a transmission rate of 11 Mbps, the time to transmit a control frame (such as an RTS frame, a CTS frame, or an ACK frame) is (256 bits)/(11 Mbps) = 23 usec. The time required to transmit the data frame is (8256 bits)/(11 Mbps) = 751DIFS + RTS + SIFS + CTS + SIFS + FRAME + SIFS + ACK= DIFS + 3SIFS + (3*23 + 751) usec = DIFS + 3SIFS + 820 usecProblem 8a) 1 message/ 2 slotsb) 2 messages/slotc) 1 message/slota)i) 1 message/slotii) 2 messages/slotiii) 2 messages/slotb)i) 1 message/4 slotsii) slot 1: Message A→ B, message D→ Cslot 2: Ack B→ Aslot 3: Ack C→ D= 2 messages/ 3 slotsiii)slot 1: Message C→ Dslot 2: Ack D→C, message A→ BRepeatslot 3: Ack B→ A= 2 messages/3 slotsProblem 10a)10 Mbps if it only transmits to node A. This solution is not fair since only A is gettingserved. By “fair” it m eans that each of the four nodes should be allotted equal number of slots.b)For the fairness requirement such that each node receives an equal amount of dataduring each downstream sub-frame, let n1, n2, n3, and n4 respectively represent the number of slots that A, B, C and D get.Now,data transmitted to A in 1 slot = 10t Mbits(assuming the duration of each slot to be t)Hence,Total amount of data transmitted to A (in n1 slots) = 10t n1Similarly total amounts of data transmitted to B, C, and D equal to 5t n2, 2.5t n3, and t n4 respectively.Now, to fulfill the given fairness requirement, we have the following condition:10t n1 = 5t n2 = 2.5t n3 = t n4Hence,n2 = 2 n1n3 = 4 n1n4 = 10 n1Now, the total number of slots is N. Hence,n1+ n2+ n3+ n4 = Ni.e. n1+ 2 n1 + 4 n1 + 10 n1 = Ni.e. n1 = N/17Hence,n2 = 2N/17n3 = 4N/17n4 = 10N/17The average transmission rate is given by:(10t n1+5t n2+ 2.5t n3+t n4)/tN= (10N/17 + 5 * 2N/17 + 2.5 * 4N/17 + 1 * 10N/17)/N= 40/17 = 2.35 Mbpsc)Let node A receives twice as much data as nodes B, C, and D during the sub-frame.Hence,10tn1 = 2 * 5tn2 = 2 * 2.5tn3 = 2 * tn4i.e. n2 = n1n3 = 2n1n4 = 5n1Again,n1 + n2 + n3 + n4 = Ni.e. n 1+ n1 + 2n1 + 5n1 = Ni.e. n1 = N/9Now, average transmission rate is given by:(10t n1+5t n2+ 2.5t n3+t n4)/tN= 25/9 = 2.78 MbpsSimilarly, considering nodes B, C, or D receive twice as much data as any other nodes, different values for the average transmission rate can be calculated.Problem 11a)No. All the routers might not be able to route the datagram immediately. This isbecause the Distance Vector algorithm (as well as the inter-AS routing protocols like BGP) is decentralized and takes some time to terminate. So, during the time when the algorithm is still running as a result of advertisements from the new foreign network, some of the routers may not be able to route datagrams destined to the mobile node.b)Yes. This might happen when one of the nodes has just left a foreign network andjoined a new foreign network. In this situation, the routing entries from the oldforeign network might not have been completely withdrawn when the entries from the new network are being propagated.c)The time it takes for a router to learn a path to the mobile node depends on thenumber of hops between the router and the edge router of the foreign network for the node.Problem 12If the correspondent is mobile, then any datagrams destined to the correspondent would have to pass through the correspondent’s home agent. The foreign agent in the network being visited would also need to be involved, since it is this foreign agent thatnotifies the correspondent’s home agent of the location of the correspondent. Datagrams received by the correspondent’s home agent would need to be encapsulated/tunneled between the correspondent’s home agent and for eign agent, (as in the case of the encapsulated diagram at the top of Figure 6.23.Problem 13Because datagrams must be first forward to the home agent, and from there to the mobile, the delays will generally be longer than via direct routing. Note that it is possible, however, that the direct delay from the correspondent to the mobile (i.e., if the datagram is not routed through the home agent) could actually be smaller than the sum of the delay from thecorrespondent to the home agent and from there to the mobile. It would depend on the delays on these various path segments. Note that indirect routing also adds a home agent processing (e.g., encapsulation) delay.Problem 14First, we note that chaining was discussed at the end of section 6.5. In the case of chaining using indirect routing through a home agent, the following events would happen: •The mobile node arrives at A, A notifies the home agent that the mobile is now visiting A and that datagrams to the mobile should now be forwarded to thespecified care-of-address (COA) in A.•The mobile node moves to B. The foreign agent at B must notify the foreign agent at A that the mobile is no longer resident in A but in fact is resident in Band has the specified COA in B. From then on, the foreign agent in A willforward datagrams it receives that are addressed to the mobile’s COA in A to t he mobile’s COA in B.•The mobile node moves to C. The foreign agent at C must notify the foreign agent at B that the mobile is no longer resident in B but in fact is resident in C and has the specified COA in C. From then on, the foreign agent in B will forwarddatagrams it receives (from the foreign agent in A) that are addressed to themobile’s COA in B to the mobile’s COA in C.Note that when the mobile goes offline (i.e., has no address) or returns to its home network, the datagram-forwarding state maintained by the foreign agents in A, B and C must be removed. This teardown must also be done through signaling messages. Note that the home agent is not aware of the mobile’s mobility beyond A, and that the correspondent is not at all aware of the mobil e’s mobility.In the case that chaining is not used, the following events would happen: •The mobile node arrives at A, A notifies the home agent that the mobile is now visiting A and that datagrams to the mobile should now be forwarded to thespecified care-of-address (COA) in A.•The mobile node moves to B. The foreign agent at B must notify the foreign agent at A and the home agent that the mobile is no longer resident in A but infact is resident in B and has the specified COA in B. The foreign agent in A can remove its state about the mobile, since it is no longer in A. From then on, thehome agent will forward datagrams it receives that are addressed to the mobile’sCOA in B.•The mobile node moves to C. The foreign agent at C must notify the foreign agent at B and the home agent that the mobile is no longer resident in B but in fact is resident in C and has the specified COA in C. The foreign agent in B canremove its state about the mobile, since it is no longer in B. From then on, thehome agent will forward datagrams it receives that are addressed to the mobile’sCOA in C.When the mobile goes offline or returns to its home network, the datagram-forwarding state maintained by the foreign agent in C must be removed. This teardown must also bedone through signaling messages. Note that the home agent is always aware of the mobile’s cu rrent foreign network. However, the correspondent is still blissfully unaware of the mobile’s mobility.Problem 15Two mobiles could certainly have the same care-of-address in the same visited network. Indeed, if the care-of-address is the address of the foreign agent, then this address would be the same. Once the foreign agent decapsulates the tunneled datagram and determines the address of the mobile, then separate addresses would need to be used to send the datagrams separately to their different destinations (mobiles) within the visited network.Problem 16If the MSRN is provided to the HLR, then the value of the MSRN must be updated in the HLR whenever the MSRN changes (e.g., when there is a handoff that requires the MSRN to change). The advantage of having the MSRN in the HLR is that the value can be provided quickly, without querying the VLR. By providing the address of the VLR Rather than the MSRN), there is no need to be refreshing the MSRN in the HLR.。
计算机网络自顶向下方法习题答案(中文版)第一章从电路到分组交换网习题11.电路交换和分组交换的主要区别在于数据传输的方式不同。
电路交换是建立一条专用的、固定的通信路径,该路径在通信会话期间始终保持不变。
而分组交换是将数据分割成小的数据包(分组),然后通过共享网络进行传输。
分组交换中,数据包可以通过不同的路径传输,并且可以与其他数据包并行传输。
习题21.源主机和目的主机之间建立虚拟连接的目的是为了提供可靠的数据传输服务。
通过虚拟连接,源主机和目的主机可以通过创建逻辑上的连接来确保数据的顺序和完整性。
习题31.端系统用于与互联网进行通信的网络接口称为网络接入点(Network Access Point,NAP)。
网络接入点是一个物理设备,允许端系统将数据发送到互联网或从互联网接收数据。
2.互联网服务提供商(Internet Service Provider,ISP)是为端系统提供与互联网连接的服务的公司或组织。
ISP通过网络接入点提供访问互联网的能力,并提供其他与互联网相关的服务。
第二章应用层习题41.应用层协议是在应用层进行通信的一组规则和约定。
应用层协议定义了应用程序如何在网络上进行通信,包括数据格式、数据传输方式等。
常见的应用层协议包括HTTP、FTP、SMTP等。
习题51.使用HTTP协议对特定URL的访问过程如下:1.客户端向服务器发送一个包含URL的HTTP请求。
2.服务器接收到请求后,根据URL找到对应的网页文件。
3.服务器将网页文件作为HTTP响应发送回客户端。
4.客户端接收到服务器的响应后,将网页文件显示在用户的浏览器上。
习题61.DNS(Domain Name System)在应用层提供了将域名转换为IP地址的服务。
当用户在浏览器中键入一个域名时,浏览器会向DNS服务器发送一个DNS请求,以获取对应的IP地址。
DNS服务器返回对应的IP地址给浏览器,浏览器根据IP地址访问对应的服务器。
1. Design and describe an application-level protocol to be used between an automatic teller machine and a bank’s centralized computer. You protocol should allow a user’s card and password to be verified, the account balance (which is maintained at the centralized computer) to be queried, and an account withdrawal to be made (that is, money disbursed to the user). Your protocol entities should be able to handle theall-too-common case in which there is not enough money in the account to cover the withdrawal. Specify your protocol by listing the messages exchanged and the action taken by the automatic teller machine or the bank’s centralized computer on transmission and receipt of messages. Sketch the operation of your protocol for the case of a simple withdrawal with no errors, using a diagram similar to that in Figure 1.2. Explicitly state the assumption made by your protocol about underlying end-to-end transport service. Answers:Messages from ATM machine to ServerMsg name purpose-------- -------HELO <userid> Let server know that there is a card in the ATMmachineATM card transmits user ID to ServerPASSWD <passwd> User enters PIN, which is sent to server BALANCE User requests balanceWITHDRAWL <amount> User asks to withdraw moneyBYE user all doneMessages from Server to ATM machine (display)Msg name purpose-------- -------PASSWD Ask user for PIN (password)OK last requested operation (PASSWD, WITHDRAWL) OK ERR last requested operation (PASSWD, WITHDRAWL) inERRORAMOUNT <amt> sent in response to BALANCE requestBYE user done, display welcome screen at ATM Correct operation:client serverHELO (userid) --------------> (check if valid userid)<------------- PASSWDPASSWD <passwd> --------------> (check password)<------------- OK (password is OK)BALANCE --------------><------------- AMOUNT <amt>WITHDRAWL <amt> --------------> check if enough $ to coverwithdrawl<------------- OKATM dispenses $BYE --------------><------------- BYEIn situation when there's not enough money:HELO (userid) --------------> (check if valid userid)<------------- PASSWDPASSWD <passwd> --------------> (check password)<------------- OK (password is OK)BALANCE --------------><------------- AMOUNT <amt>WITHDRAWL <amt> --------------> check if enough $ to cover withdrawl <------------- ERR (not enough funds)error msg displayedno $ given outBYE --------------><------------- BYEProblem 5 ==================================================== Consider sending a packet of F bits over a path of Q links. Each link transmits at R bps. The network is lightly loaded so that there are no queuing delays. Propagation delay is negligible.a.Suppose the network is a packet-switched virtual circuit network. Denote the VCset-up time by ts seconds. Suppose the sending layers add a total of h bits of header to each packet. How long does it take to send the file from source to destination?b. Suppose the network is a packet-switched datagram network and a connectionless service is used. Now suppose each packet has 2h bits of header. How long does it take to send the file?c. Finally, suppose that the network is a circuit-switched network. Further suppose that the transmission rate of the circuit between source and destination is R bps. Assuming ts set-up time and h bits of header appended to the entire file, how long does it take to send the file?Answera.Time cost = ts+(F+h)*Q/Rb.Time cost = (F+2h)*Q/Rc.Time cost = ts +(F+h)*Q/RProblem6 ====================================================This elementary problem begins to explore propagation delay and transmission delay, two central concepts in data networking. Consider two hosts, Host A and B, connected by a single link of rate R bps. Suppose that the two hosts are separated by m meters, and suppose the propagation speed along the link is s meters/sec. HostA is to send a packet of size L bits to Host B.a. Express the propagation delay, dprop in terms of m and s.b. Determine the transmission time of the packet, dtrans in terms of L and R.c. Ignoring processing and queuing delays, obtain an expression for the end-to-end delay.d. Suppose Host A begins to transmit the packet at time t = 0. At time t = dtrans, where is the last bit of the packet?e. Suppose dprop is greater than dtrans. At time t = dtrans, where is the first bit of the packet?f. Suppose dprop is less than dtrans. At time t = dtrans, where is the first bit of the packet?g. Suppose s = 2.5*108, L = 100 bits, and R = 28 kbps. Find the distance m so that dprop equals dtrans.Answera.dprop = m/s;b.dtrans = L/Rc.The end to end delay = dprop + dtrans = m/s +L/R;d.The last bit has just left Host A;e.The first bit is on the link and with a distance L*s/R from the host A;f.The first bit has left the link and arrived at Host B.g.m = L*s/R= 100bits *2.5*108 /(28kbps)=893kmProblem7====================================================In this problem we consider sending voice from Host A to Host B over a packet-switched network (for example, Internet phone). Host A converts on-the-fly analog voice to a digital 64- Kbps bit stream. Host A then groups the bits into 48-byte packets. There is one link between host A and B; its transmission rate is 1 Mbps and its propagation delay is 2 mesc. As soon as Host A gathers a packet, it sends it to Host B. As soon as Host B receives an entire packet, it converts the packet’s bits to an analog signal. How much time elapses from the time a bit is created (from the original analog signal at A) until a bit is decoded (as part of the analog signal at B)?AnswerThe processing time on host A = 48Byte/64Kbps=6mescThe decoding time on host B =The processing time on host A =6mescThe transmission time = 48Byte/1Mbps= 0.384mescTime cost from the time bit is created to the time a bit is decoded =6mesc+0.384mesc+2mesc = 8.384 mescProblem 10 ================================================== Consider the queuing delay in a router buffer (preceding an outbound link). Suppose all packets are L bits, the transmission rate is R bps, and that N packets arrive to the buffer every LN/R seconds. Find the average queuing delay of a packet.AnswerIt takes LN/R seconds to transmit N packets ,and when the last packet is transmitted over ,the buffer is empty ,at the same time another N packets arrive.The queuing delay for the first packet is 0;The queuing delay for the second packet is L/R;The queuing delay for the third packet is 2L/R; ......The queuing delay for the Nth packet is (N-1)L/R;Then the average queuing delay of a packet is(0+L/R+2L/R+......+(N-1)L/R)/N=(N-1)L/(2R)Problem 14==================================================Suppose two hosts, A and B, are separated by 10,000 kilometers and are connected by a direct link of R = 1 Mbps. Suppose the propagation speed over the link is 2.5* 810meters/sec.a.Calculate the bandwidth-delay product, R* proptb.Consider sending a file of 400,000 bits from Host A to Host B. Suppose the file issent continuously as one big message. What is the maximum number of bits that will be in the link at any given time?c.Provide an interpretation of the bandwidth-delay product.d.What is the width (in meters) of a bit in the link? Is it longer than a football field?e.Derive a general expression for the width of a bit in terms of the propagation speed s,the transmission rate R, and the length of the link m.Answera.R*tprop = 1Mbps *10000km/2.5*810meters/sec=40000bitsb. dprop=10000km/2.5*810meters/sec=0.04sec, dtrans = 400000bits/1Mbps=0.4secConsidering dtrans is far more than dprop,so we know that when first bit arrives at Host B the transmission is not over. So the maximum number of bits that will be in the link at any given time is 0.04sec *1Mbps = 40000bitsc.The bandwidth-delay product means the maximum number of bits that is in the link at given time.d.The width (in meters) of a bit in the link =10000km/40000=250m.e. Assume that the length of the packet is L,and we use w to represent width of a bit.If(m/s <= L/R) then w =m/(R*tprop)=m/(R*m/s)=s/RIf (m/s>L/R) then w =(L*s/R)/L=s/RIn a nutshell, the w =s/RProblem17================================================== Refer again to problem 14.a.How long does it take to send the file, assuming it is sent continuously?b.Suppose now the file is broken up into 10 packets with each packet containing40,000bits. Suppose that each packet is acknowledged by the receiver and thetransmission time of an acknowledgment packet is negligible. Finally, assume that the sender cannot send a packet until the preceding one is acknowledged. How long does it take to send the file?pare the results from (a) and (b).Answera.Assume t is the time it takes to send the file when it is sent continuously.Then t = tprop + dtrans= 0.04sec+0.4sec=0.44sec.b.Assume T is the time it takes to send the file .T=10*(40000bit/1Mbps +0.04sec +0.04sec)=1.2sec.c.When the file is broken up into several packets ,it takes more time to send it than in a whole packet,the time cost including the but it's safer to use smaller packets .Problem 20==================================================In modern packet-switched networks, the source host segments long, application-layer messages (for examples, an image or a music file) into smaller packets and sends the packets into the network. The receiver then reassembles the packets back into the original message. We refer to this process as message segmentation. Figure 1.21 illustrates the end-to-end transport of a message with and without message segmentation. Consider a message that is 7.5*10e6 bits long that is to be sent from source to destination inFigure1.21. Suppose each link in the figure is 1.5Mbps. Ignore propagation, queuing, and processing delaysa. Consider sending the message from source to destination without message segmentation. How long does it take to move the message from source to destination without message segmentation? How long does it take to move the message from the source host to the first packet switch, what is the total time to move the message from source host to destination host?b. Now suppose that the message is segmented into 5,000 packets, with each packet being 1,500 bits long. How long does it take to move the first packet from the source host to the first packet switch? When the first packet is being sent from the first switch to the second switch, the second packet is being sent from the source host to the first switch. At what time will the second packet be fully received at the first switch?c. How long does it take to move the file from source host to destination host when message segmentation is used? Compare this result with your answer in a part (a) and comment.d. Discuss the drawbacks of message segmentation.Answera.Time to send message from source host to first packet switch =7.5*10e6bits/1.5Mbps=5sec. So the total time to move message from source host to destination host =5sec *3 =15sec.b.Time to send first packet from source host to first packet switch =1500bits/1.5Mbps=1msec;It takes 1msec for the second packet to arrive at the first switch,so at the time 2msec the second packet is fully received by the first switch.ing segmentation ,the time to send the file from source to destination=1msec*3+4999*1msec=5002msec=5.002s Compare this number with 15sec ,we learn that segmentation will decrease the delay by 60%.d.The drawback of segmentation is: these packets must be in the right order when they arrived at the destination. And also that the total length of all the packets is larger. Problem 22================================================== Consider sending a large file of F bits from Host A to Host B. There are two links (and one switch) between A and B, and the links are uncongested (that is, no queuing delays). Host A segments the file into segments of S bits each and adds 40 bits of header to each segment, forming packets of L = 40 + S bits. Each link has a transmission rate of R bps. Find the value of S that minimizes the delay of moving the packet from Host A to Host B. Neglect propagation delay.AnswerThe time that send first packet from A to B =L*2/R sec=(40+S)*2/R.Then after each L/R time , B received a packet.So the total time cost to send the file from A to BT=2*L/R+((F/S-1)*L/R=(F/S+1)(40+S)/RTo minimizes the delay of moving the packet from A to B , we have dT/dS=0, so we get S =sqrt(40F).Problem in chapter 1 slides PPT 95.==================================A router’s outgoing bandwidth is 100 kbps.Arrival packet’s number of bits has expo. distr. With mean number of 1 kbitsPoisson arrival process, λ = 80 packets/seca.How many packets in router expected by a new arrival?b.What is the expected waiting time in queue for a new arrival?c.What is the expected access delay (response time)?d.What is the prob. that the server is idle?e.What is P( N > 5 )?f.Suppose you can increase router bandwidth, what is the minimum bandwidth to support avg. access delay of 20ms?AnswerA.μ=100kbps/(1kbits/packet)=100packet/sec, then ρ = λ/μ= 80/100=0.8Pn=ρ^n*P0,P0= 1-ρ=0.2So packets in server when a new arrival comes =∑∞=0*n Pn n =ρ/(1-ρ)=4 B.The average waiting time =ρρ-*1R L = 1/100 *(0.8/(1-0.8))=0.04sec=40msec C.The access delay = average waiting time +outgoing time=0.04sec+1/μ=0.05sec=50msecD.P(server idle)=P(0)=1-ρ=1-0.8=0.2E.P(N>5)=1-P(N<5)=1-(P0+P1+P2+P3+P4)Pn=ρ^n*P0,P0= 1-ρ=0.2Hence,P(N>5)=1-0.67232=0.32768F. We can conclude that access delay =average waiting time +outgoing time =ρρ-*1R L +RL =20msec And we have ρ=λ/μ=L λ/R Then we can figure out that the minimum R is 130kbps to support avg. access delay of 20msComputer networks Homework Assignment 21. When a user requests a Web page that consists of some text and two images. For this page, the client will send one request message and receive three response messages.False2. Two distinct Web pages(for example,/reaearch.html and/students.html)can be send over the same persistent connection.True6.================================================================Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the OP address form DNS; the successive visits incur an RTT of 1RTT ,…n RTT .Further suppose that the Web page associated with the link contains exactly one object, consisting of a small amount of HTML text. Let 0RTT denote the RTT between the local host and the server containing the object. Assuming zero transmission time of the object, how much time elapses form when the client clicks on the link untilthe client receives the objects?Time elapses form when the client clicks on the link until the client receives the objects=1RTT +.....+n RTT +2*0RTT7.================================================================Referring to Problem 6, suppose the HTML file references three very small objects on the same server. Neglecting transmission times, how much time elapses witha. Non-persistent HTTP with no parallel TCP connections?1RTT +.....+n RTT +2*0RTT +3*20RTT =1RTT +.....+n RTT +80RTTb. Non-persistent HTTP with parallel connections?1RTT +.....+n RTT +2*0RTT +20RTT =1RTT +.....+n RTT +40RTTc. Persistent HTTP with pipelining?1RTT +.....+n RTT +20RTT +0RTT =1RTT +.....+n RTT +30RTT9.================================================================Consider Figure 2.11,for which there is an institutional network connected to the Internet. Suppose that the average object size is 900,000 bits and that the average request rate from institution ’s browsers to the origin servers is 1.5 requests per second. Also suppose that the amount of time it takes from when the router on the Internet side of the access link forwards an HTTP request until it receives the response in two seconds on average(see Section 2.2.6). Model the total average response time as the sum of the average access delay (that is, the delay from Internet router to institution router)and the average Internet delay. For the average access delay, use /(1)β∆-∆, where ∆ is the average time required to send an object over the access link and β is the arrival rate of objects to the access link. a. Find the total average response time.The object size L=900,000bits, the access link has a rate R of 15Mbps;Hence ∆=L/R=900,000bits/15Mbps=0.06s;The arrival rate of objects to the access link β equals the request rate from institution ’s browsers to the origin servers ,thus β=1.5request/secSo the average response time = average access delay + average Internet delay =/(1)β∆-∆+2 =0.06s/(1-0.06*1.5)+2=0.066s+2s=2.066s;b. Now suppose a cache is installed in the institutional LAN. Suppose the hit rate is 0.4. Find the total response time.Since we have a cache of hit rate 0.4 installed in the institutional LAN ,then only 60%requests needed to be send outside, the left 40% will be satisfied all most immediately, let's say zero compared with the access delay.Then the average response time for the 60%= 0.06s/0.06s/(1-0.06*1.5*0.6)+2=2.0634s Thus the total average response time =0.6*2.0634s+0.4* 0=1.238sA) The time to transmit an object of size L over a link or rate R is L/R . The average timeis the average size of the object divided by R:Δ= (900,000 bits)/(1,500,000 bits/sec) = .6 secThe traffic intensity on the link is (1.5 requests/sec)(.6 msec/request) = .9. Thus, the average access delay is (.6 sec)/(1 - .9) = 6 seconds. The total average response time is therefore 6 sec + 2 sec = 8 sec.B) The traffic intensity on the access link is reduced by 40% since the 40% of the requests are satisfied within the institutional network. Thus the average access delay is (.6 sec)/[1 – (.6)(.9)] = 1.2 seconds. The response time is approximately zero if the request is satisfied by the cache (which happens with probability .4); the average response time is 1.2 sec + 2 sec = 3.2 sec for cache misses (which happens 60% of the time). So the average response time is (.4)(0 sec) + (.6)(3.2 sec) = 1.92 seconds. Thus the average response time is reduced from 8 sec to 1.92 sec.20.================================================================ Consider query flooding in P2P file sharing, as discussed in Section 2.6. Suppose that each peer is connected to at most N neighbors in the overlay network.. Also suppose that the node-count field is initially set to K.Suppose Alice makes a query. Find an upper bound on the number of query messages that are sent into the overlay network.The upper bound on the number of query messages that are sent into the overlay network happens when the query flooding access all different nodes .The query flooding process builds a tree with each nodes have N-1 child nodes and have K layers.Then the number of query messages equals to the number of edges in this tree.On the first layer , in which each node have a node-count field of K-1, number of edges N,on the 2th layer , the number of edges goes to (N-1)*N.3th layer ------N*(N-1)*(N-1) Kth layer-----N*(N-1)1-KThe total edges = N+(N-1)*N+N*(N-1)*(N-1)+.......+N*(N-1)1-K=N*21)1 (---NN KProblem4===================================================== Consider our motivation for correcting protocol rtd2.1. Show that the receiver, shown in the figure on the following page, when operating with the sender shown in Figure3.11, can lead the sender and receiver to enter into a deadlock state, where each is waiting for an event that will never occur.Suppose that the sender is in state "wait for the ack or nak 0", and the receiver is in state "wait for 1 from below". If the ack0 packet is corrupted when it arrives at sender, the sender will retransmit the packet0, but when this packet0 arrives at the receiver ,the receiver will send a nack0 to the sender. The sender receives the nack0 and will resend the packet0, then it will repeat these steps above. Thus they enter into a deadlock state. Problem 11=====================================================Consider a reliable data transfer protocol that uses only negative acknowledgments. Suppose the sender sends data only infrequently. Would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? Now suppose the sender has a lot of data to send and the end-to-end connection experiences few losses. IN this second case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why?In a NAK-only protocol, the receiver get a packet x without corruption will do nothinglater. If receiver get a corrupted one ,it will send a nak. Then the sender will know that the former packets is correctly received. At the receiver side, if packet receives packet x then packet x+2, the receiver will realize that packet x+1 is missed,then nak(x+1) will be sent. If there is a long delay between packet x and x+1, then there will be a long time for packet x to resend. If the nak is lost or corrupted , things get more complicated.But if data is being sent often, then recovery will happen quickly.And if error occurs infrequently, the nak will be occasionally sent and ack never be sent. The backward channel has only a small amount of packets . In this point of view ,it's somehow better than the acks protocol.Problem 14=====================================================In the generic SR protocol that we studied in Section 3.4.4, the sender transmits a message as soon as it is available (if it is in the window) without waiting for an acknowledgment. Suppose now that we want an SR protocol that sends messages tow at a time. That is, the sender will send a pair of messages and will send the next pair of messages only when it knows that both messages in the first pair have been received correctly.Suppose that the channel may lose messages but will not corrupt or reorder messages. Design an error-control protocol for the unidirectional reliable transfer of messages. Give an FSM description of the sender and receiver. Describe the format of the packets sent between sender and receiver, and vice versa. If you use any procedure calls other than those in Section3.4, clearly state their actions. Give an example(a timeline trace of sender and receiver) showing how your protocol recovers from a lost packet.The sender The ReceiverProblem 16=====================================================Consider the GBN protocol with a sender window size of 3 and a sequence number range of 1,024. Suppose that at time t, the next in- order packet that the receiver is expecting has a sequence number of k. Assume that the medium doesn’t reorder messages. Answer the following questions:a. what are the possible sets of sequence numbers inside the sender’s window at time t? Justify your answer.b. what are all possible values of the ACK field in all possible messages currently propagating back to the sender at time t? Justify your answer.a.The receiver has acked k-1 and all the proceeding packets .If all the acks has been received by the sender ,then the set is {k,k+1, k+2}. If all the acks are lost, then the set is {k-3, k-2,k-1}b.The receiver is expecting the packet k, so the acks of the proceeding packets must be sent to the receiver. If all the former 3 acks hasn't arrived at the sender ,then values of ack includes k-1,k-2,k-3; since packet k-1 has been sent , the ack of packet k-4 is no doubt that has got the sender so there are no acks less than k-3 in the currently propagating back to the sender ,neither acks more than or equal to k.Thus the possible values is {k-3,k-2,k-1}Problem 18=====================================================Consider the GBN and SR protocols.Suppose the sequence number spaceis of size k. What is the largestallowable sender window that willavoid the occurrence of problemssuch as that in Figure 3.27 for eachof these protocols?Suppose the window size is NThe GBN protocol: k>N TheSR protocol: k>=2NIn order to avoid the scenario ofFigure 3.26, we want to avoidhaving the leading edge of thereceiver's window (i.e., the one with the “highest” sequence number) wrap around in the sequence number space and overlap with the trailing edge (the one with the "lowest" sequence number in the sender's window). That is, the sequence number space must be large enough to fit the entire receiver window and the entire sender window without this overlap condition. So - we need to determine how large a range of sequence numbers can be covered at any given time by the receiver and sender windows (see Problem 13).Suppose that the lowest-sequence number that the receiver is waiting for is packet m. In this case, it's window is [m,m+w-1] and it has received (and ACKed) packet m-1 and the w-1 packets before that, where w is the size of the window. If none of those w ACKs have been yet received by the sender, then ACK messages with values of [m-w,m-1] may still be propagating back. If no ACKs with these ACK numbers have been received by the sender, then the sender's window would be [m-w,m-1].Thus, the lower edge of the sender's window is m-w, and the leading edge of the receivers window is m+w-1. In order for the leading edge of the receiver's window to not overlap with the trailing edge of the sender's window, the sequence number space must thus be big enough to accommodate 2w sequence numbers. That is, the sequence number space must be at least twice as large as the window size, wk2Problem 19=====================================================Answer true or false to the following questions and briefly justify your answer:a. With the SR protocol, it is possible for the sender to receive an ACK for a Pkt that falls outside of its current window.b. With GBN, it is possible for the sender to receive an ACK for a Pkt that falls outsideof its current window.c. The alternating-bit protocol is the same as the SR protocol with a sender and receiver window size of 1d. The alternating-bit protocol is the same as the GBN protocol with a sender and receiver window size of 1A.True. When the below circumstances occurred , at the time the sender get the ack1 for the second time , the window has slide to next three packets and the packet 1-3 has been outside of the current window.B. True . The same reason as a. C true;D true;In this case ,a cumulative ACK is just an ordinary ACK in this situation, since it can only refer to the single packet within the window.Problem 21=====================================================Consider the TCP procedure for estimating RTT. Suppose that x = 0.1. Let SampleRTT1 be the most recent sample RTT, let SampleRTT2 be the next most recent sample RTT, etc.(a) For a given TCP connection, suppose 4 acknowledgements have been returned with corresponding sample RTTs Sample RTT4 , SampleRTT3 , SampleRTT2 , and SampleRTT1 . Express Estimated RTT in terms of the four sample RTTs.(b) Generalize your formula for n sample round-trip times.(c) For the formula in part (b) let n approach infinity. Comment on why this averaging procedure is called an exponential moving average.A.Estimated RTT(1)=sampleRTT1EstimatedRTT(2)=(1-x)*Estimated RTT(1)+x*sampleRTT2=(1-x)*sampleRTT1+x*sampleRTT2Estimated RTT(3)=(1-x)*Estimated RTT(2)+x*sampleRTT3=(1-x)*((1-x)*sampleRTT1+x*sampleRTT2)+x*sampleRTT3=(1-x)^2*sampleRTT1+(1-x)*x*sampleRTT2+x*sampleRTT3Estimated RTT(4)=(1-x)*Estimated RTT(3)+x*sampleRTT4=(1-x)^3*sampleRTT1+(1-x)^2*x*sampleRTT2+(1-x)*x*sampleRTT3+x*sampleRTT4=0.9^3*sampleRTT1+0.9^2*0.1*sampleRTT2+0.9*0.1*sampleRTT3+0.1*sampleRTT4B.Estimated RTT(n)=112*)1(*)1(*sampleRTT x sampleRTT x x n i in n i --=-+-∑ C. If a = 0.1 and n -> ∞, Estimated RTT(n) ≈sampleRTTi ni i n ∑=-29.0. Since little value isgiven to past samples, the average changes and remains recent. I would assume that this is why it is considered the exponential moving average.Denote )(n TT EstimatedRfor the estimate after the n th sample. 1)1(SampleRTT TT EstimatedR = 21)2()1(SampleRTT x xSampleRTT TT EstimatedR -+=1)3(xSampleRTT TT EstimatedR =])1()[1(32SampleRTT x xSampleRTT x -+-+ 21)1(xSampleRTT x xSampleRTT -+=32)1(SampleRTT x -+ )3(1)4()1(TT EstimatedR x xSampleRTT TT EstimatedR -+=21)1(x S a m p l e R T T x x S a m p l e R T T -+= 4332)1()1(SampleRTT x xSampleRTT x -+-+ b)jn j j n SampleRTT x x TT EstimatedR ∑-=-=11)()1(n n SampleRTT x )1(-+。