计算机网络第五章作业参考答案

合集下载

《计算机网络自顶向下》课后习题答案(第五章_中文版)

《计算机网络自顶向下》课后习题答案(第五章_中文版)

5复习题1.虽然每条链路都能保证数据包在端到端的传输中不发生差错,但它不能保证IP数据包是按照正确的顺序到达最终的目的地。

IP数据包可以使用不同的路由通过网络,到达接收端的顺序会不一致,因此,TCP需要用来使字节流按正确的序号到达接收端。

2.链路层能够向网络层提供的服务有:成帧,链路接入,可靠传送,流量控制,纠错,检错,全双工传输等。

其中,在IP中有的服务是:成帧,检错。

在TCP有的服务是:成帧,可靠传送,流量控制,检错以及全双工传输。

3.会出现冲突。

因为当一个节点在传输数据的同时,又开始接受数据,这种情况下必然会发生冲突。

4.时隙ALOHA:1,2和4(时隙ALOHA只是部分分散,因为它要求所有节点的时钟同步)。

令牌传输:1,2,3和4.5.略6.当一个节点传送一个帧时,该节点只有在此帧在整个环网中传播一遍后才释放令牌,这样,如果L/R比传播延时小,令牌环协议的效率将是很低的。

7.248个MAC addresses; 232个IPv4 addresses; 2128个IPv6 addresses8.c的适配器会处理这些帧,但是不会将这些帧中的IP数据包传递给c。

如果A使用的是广播地址,则c不仅会处理而且会传递这些数据包。

9.ARP查询要在广播帧中发送是因为查询主机不知道哪个适配器的地址对应于要查询的IP地址。

而ARP响应时,由于发送节点知道要给哪个适配器发送响应,所以该响应在包含具体目的MAC地址的帧中发送,而不必发送广播帧。

10.不可能。

每个ARP模块管理该局域网内的适配器,并且每个适配器(MAC)拥有唯一的LAN地址。

11.这三种以太网技术具有相同的帧结构。

12.每个比特发生一次跳变,由于是全1码,因此每两个比特之间也会发生跳变。

2*10M次,即每秒2千万次跳变。

13.第5次冲突后,适配器从{0,1,2…,31}中选择K,故K为4的概率为1/32,它对应于204.8ms的时延。

第五章习题:1.最右面的一列和最下面的一行是校验比特。

(完整版)计算机网络(第二版)胡亮等编著第五章习题及答案

(完整版)计算机网络(第二版)胡亮等编著第五章习题及答案

(完整版)计算机⽹络(第⼆版)胡亮等编著第五章习题及答案复习指南:本章共有5.1-5.7七节内容,没有在考试之外的。

5.1-5.2,⽤时25min。

5.3-5.4,⽤时90min。

5.5,⽤时30min。

5.6,⽤时60min。

5.7,⽤时35min。

参考上课⽤时,可推测重点章节为5.3,5.4,5.6。

推荐看PPT。

5.5,5.7掌握概念。

5.1,5.2简单了解。

课后习题:5.1 通讯⼦⽹的最⾼层是哪⼀层?5.2 ⽹络层的两个主要功能是什么?5.3 在OSI模型中,⽹络层提供了哪两种服务?5.4 ⾯向连接的⽹络服务完成⼀次传输需要哪⼏个过程?5.5 说明⾯向连接的服务和⾯向⽆连接的服务的优缺点。

5.6 说明为什么在⽹络中各个结点对虚电路进⾏独⽴编号。

5.7 第三层交换机与传统的路由器相⽐有哪些优点?5.8 路由选择的最基本要求是什么?5.9 什么是⾮适应性路由选择?什么是适应性路由选择?5.10 什么是拥塞?拥塞产⽣的原因是什么?拥塞对系统有什么影响?5.11 拥塞控制的⽅法有哪些?5.12 在流量控制中,如果采⽤数据报⽅式⼯作,容易产⽣什么样的死锁?如果采⽤虚电路的⽅式⼯作,容易产⽣什么样的死锁?5.13 常⽤的计算最短路径的⽅法有哪两种?5.14 ⽐较距离向量路由和链状状态路由?OSPF属于哪类路由协议?BGP协议属于哪类协议?习题参考答案:5.1 通讯⼦⽹的最⾼层是哪⼀层?⽹络层是通讯⼦⽹的最⾼层,也是主机和通讯⼦⽹的接⼝。

5.2 ⽹络层的两个主要功能是什么?交换和路由。

交换是在两个或者多个设备之间建⽴临时链接,使没有物理链路直接相连的两个或者多个设备之间能够通信。

路由是选择从⼀点到另⼀点发送数据包的最佳路径。

5.3 在OSI模型中,⽹络层提供了哪两种服务?OSI: ⾯向连接的⽹络服务(CONS)和⾯向⽆连接的⽹络服务(CLNS)。

TCP/IP: ⾯向⽆连接的⽹络服务(CLNS)。

5.4 ⾯向连接的⽹络服务完成⼀次传输需要哪⼏个过程?发送者发送⼀个连接请求包,接收者使⽤⼀个连接确认包进⾏确认,发送者传输数据,发送者发送⼀个连接终⽌请求包,接收者使⽤⼀个连接终⽌包进⾏确认。

作业的参考答案

作业的参考答案

《计算机网络技术》课程作业参考答案第五章运输层5.1 试说明运输层在协议栈中的地位和作用。

运输层的通信和网络层的通信有什么重要的区别?为什么运输层是必不可少的?答案:(1)运输层是OSI七层模型中最重要最关键的一层,是唯一负责总体数据传输和控制的一层。

运输层要达到两个主要目的:第一提供可靠的端到端的通信;第二,向会话层提供独立于网络的运输服务。

在讨论为实现这两个目标所应具有的功能之前,先考察一下运输层所处的地位。

首先,运输层之上的会话层、表示层及应用层均不包含任何数据传输的功能,而网络层又不一定需要保证发送站的数据可靠地送至目的站;其次,会话层不必考虑实际网络的结构、属性、连接方式等实现的细节。

根据运输层在七层模型中的目的和地位,它的主要功能是对一个进行的对话或连接提供可靠的传输服务;在通向网络的单一物理连接上实现该连接的利用复用;在单一连接上进行端到端的序号及流量控制;进行端到端的差错控制及恢复;提供运输层的其它服务等。

运输层反映并扩展了网络层子系统的服务功能,并通过运输层地址提供给高层用户传输数据的通信端口,使系统间高层资源的共享不必考虑数据通信方面的问题。

(2)运输层提供应用进程间的逻辑通信,也就是说,运输层之间的通信并不是真正在两个运输层之间直接传送数据。

运输层向应用层屏蔽了下面网络的细节(如网络拓扑、所采用的路由选择协议等),它使应用进程看见的就是好像在两个运输层实体之间有一条端到端的逻辑通信信道。

网络层为主机之间提供逻辑通信,而运输层为应用进程之间提供端到端的逻辑通信。

(3)运输层的最终目标是为用户提供有效、可靠和价格合理的服务。

在一个系统中,运输实体通过网络服务与其它运输实体通信,向运输层用户(可以是应用进程,也可以是会话层协议)提供运输服务。

运输层的服务包括的内容有:服务的类型、服务的等级、数据运输、用户接口、连接管理、快速数据运输、状态报告、安全保密等。

因此,运输层是必不可少的。

计算机网络(第三版)第5章 习题答案

计算机网络(第三版)第5章 习题答案

1.广义的网络互连可以在那几个层次上实现?分别需要用到哪些网络互连设备?答:广义的网络互连包括:物理层的互连、数据链路层互连、网络层互连、高层互连。

1)物理层的互连是在不同的电缆段之间复制位信号。

物理层的连接设备主要是中继器。

2)数据链路层互连是在网络之间存储转发数据帧。

互连的主要设备是网桥。

3)网络层互连是在不同的网络之间存储转发分组。

互连的主要设备是路由器。

4)传输层及以上各层的互连属于高层互连。

实现高层互连的设备是网关。

2.为什么说因特网可以在不可靠的网络层上实现可靠的传输服务?答:因为因特网的网络层使用数据报通信,没有应答,重传等保证机制,所以提供的是一种不可靠的网络服务;因特网的可靠传输服务主要由TCP协议来完成,TCP协议不仅保证可靠传输,还提供流量控制和拥塞控制等服务,这样TCP与IP协议的结合就可以完成可靠的网络传输服务。

3.有人说,既然局域网接入因特网需要使用路由器,而路由器已经能完成本地网络与因特网之间的连接问题,何必还要使用NAT或PAT?请你对这个疑问做出合理的解答。

答:(略)4.因特网中存在三种地址和两种地址转换机制,这两种机制的特点和区别是什么?这三种地址存在的意义何在?答:因特网上普遍存在的三种地址分别是主机域名,IP地址和局域网卡上的MAC地址,两种地址转换机制分别是DNS(用于完成主机域名到IP地址的转换,是一个全球性的分布式应用)和ARP(完成局域网内主机IP到MAC地址的转换,是一种局部性的应用)。

存在的意义是主机域名可以帮助人们记忆网络主机地址,因为它是用英文拼写,IP地址则是完成TCP/IP网络通信所必须,是用IP地址可以唯一性的确定通信所需的网络主机或路由器,所有域名也必须转换成IP地址之后才能用于网络通信。

MAC地址是网卡的物理地址,它由48位二进制数表示。

MAC地址是网卡的物理地址。

每块网卡都有一个唯一的MAC地址。

虽然此地址没法改变,但是可以通过软件的方法欺骗系统。

计算机网络第五版答案完整版

计算机网络第五版答案完整版

计算机网络第五版答案完整版《计算机网络》课后习题答案第一章概述1-10 试在下列条件下比较电路交换和分组交换。

要传送的报文共x(bit),从源站到目的站共经过k 段链路,每段链路的传播时延为d(s),数据率为C(bit/s)。

在电路交换时电路的建立时间为s(s)。

在分组交换时分组长度为p(bit),且各结点的排队等待时间可忽略不计。

问在怎样的条件下,分组交换的时延比电路交换的要小?答:对电路交换,当t=s 时,链路建立;当t=s+x/C,发送完最后一bit;当t=s+x/C+kd,所有的信息到达目的地。

对分组交换,当t=x/C,发送完最后一bit;为到达目的地,最后一个分组需经过k-1 个分组交换机的转发,每次转发的时间为p/C,所以总的延迟= x/C+(k-1)p/C+kd所以当分组交换的时延小于电路交换x/C+(k-1)p/C+kd<s+x/C+kd 时,(k-1)p/C<s1-11 在上题的分组交换网中,设报文长度和分组长度分别为x 和(p+h)( bit),其中p 为分组的数据部分的长度,而h 为每个分组所带的控制信息固定长度,与p 的大小无关。

通信的两端共经过k 段链路。

链路的数据率为b(bit/s),但传播时延和结点的排队时间均可忽略不计。

若打算使总的时延为最小,问分组的数据部分长度p 应取为多大?答:分组个x/p,传输的总比特数:(p+h)x/p源发送时延:(p+h)x/pb最后一个分组经过k-1 个分组交换机的转发,中间发送时延:(k-1)(p+h)/b总发送时延D=源发送时延+中间发送时延D=(p+h)x/pb+(k-1)(p+h)/b 令其对p 的导数等于0,求极值p=√hx/(k-1)1-17 收发两端之间的传输距离为1000km,信号在媒体上的传播速率为2.3×108 。

试计算以下两种情况的发送时延和传播时延:(1)数据长度为107bit,数据发送速率为100kbit/s,传播距离为1000km,信号在媒体上的传播速率为2×108m/s。

谢希仁计算机网络第五版课后习题答案(1~6章)

谢希仁计算机网络第五版课后习题答案(1~6章)

谢希仁计算机网络第五版课后习题答案(1~6章)计算机网络课后习题答案第一章概述 (1)第二章物理层 (7)第三章数据链路层 (11)第四章网络层 (18)第五章传输层 (32)第六章应用层 (40)第一章概述1-01 计算机网络向用户可以提供那些服务?答:连通性和共享1-02 简述分组交换的要点。

答:(1)报文分组,加首部(2)经路由器储存转发(3)在目的地合并1-03 试从多个方面比较电路交换、报文交换和分组交换的主要优缺点。

答:(1)电路交换:端对端通信质量因约定了通信资源获得可靠保障,对连续传送大量数据效率高。

(2)报文交换:无须预约传输带宽,动态逐段利用传输带宽对突发式数据通信效率高,通信迅速。

(3)分组交换:具有报文交换之高效、迅速的要点,且各分组小,路由灵活,网络生存性能好。

1-04 为什么说因特网是自印刷术以来人类通信方面最大的变革?答:融合其他通信网络,在信息化过程中起核心作用,提供最好的连通性和信息共享,第一次提供了各种媒体形式的实时交互能力。

1-05 因特网的发展大致分为哪几个阶段?请指出这几个阶段的主要特点。

答:从单个网络APPANET向互联网发展; TCP/IP协议的初步成型建成三级结构的Internet;分为主干网、地区网和校园网;形成多层次ISP结构的Internet; ISP首次出现。

1-06 简述因特网标准制定的几个阶段?答:(1)因特网草案(Internet Draft) ——在这个阶段还不是 RFC 文档。

(2)建议标准(Proposed Standard) ——从这个阶段开始就成为 RFC 文档。

(3)草案标准(Draft Standard)(4)因特网标准(Internet Standard)1-07小写和大写开头的英文名字 internet 和Internet在意思上有何重要区别?答:(1)internet(互联网或互连网):通用名词,它泛指由多个计算机网络互连而成的网络。

计算机网络(谢希仁第五版)-第五章_习题答案

计算机网络(谢希仁第五版)-第五章_习题答案

第五章传输层5—01 试说明运输层在协议栈中的地位和作用,运输层的通信和网络层的通信有什么重要区别为什么运输层是必不可少的答:运输层处于面向通信部分的最高层,同时也是用户功能中的最低层,向它上面的应用层提供服务运输层为应用进程之间提供端到端的逻辑通信,但网络层是为主机之间提供逻辑通信(面向主机,承担路由功能,即主机寻址及有效的分组交换)。

各种应用进程之间通信需要“可靠或尽力而为”的两类服务质量,必须由运输层以复用和分用的形式加载到网络层。

5—02 网络层提供数据报或虚电路服务对上面的运输层有何影响答:网络层提供数据报或虚电路服务不影响上面的运输层的运行机制。

但提供不同的服务质量。

5—03 当应用程序使用面向连接的TCP和无连接的IP时,这种传输是面向连接的还是面向无连接的答:都是。

这要在不同层次来看,在运输层是面向连接的,在网络层则是无连接的。

<5—05 试举例说明有些应用程序愿意采用不可靠的UDP,而不用采用可靠的TCP。

答:VOIP:由于语音信息具有一定的冗余度,人耳对VOIP数据报损失由一定的承受度,但对传输时延的变化较敏感。

有差错的UDP数据报在接收端被直接抛弃,TCP数据报出错则会引起重传,可能带来较大的时延扰动。

因此VOIP宁可采用不可靠的UDP,而不愿意采用可靠的TCP。

5—06 接收方收到有差错的UDP用户数据报时应如何处理答:丢弃5—07 如果应用程序愿意使用UDP来完成可靠的传输,这可能吗请说明理由答:可能,但应用程序中必须额外提供与TCP相同的功能。

5—08 为什么说UDP是面向报文的,而TCP是面向字节流的答:发送方UDP 对应用程序交下来的报文,在添加首部后就向下交付IP 层。

UDP 对应用层交下来的报文,既不合并,也不拆分,而是保留这些报文的边界。

接收方UDP 对IP 层交上来的UDP 用户数据报,在去除首部后就原封不动地交付上层的应用进程,一次交付一个完整的报文。

计算机网络第五章课后习题答案

计算机网络第五章课后习题答案

5—01 试说明运输层在协议栈中的地位和作用,运输层的通信和网络层的通信有什么重要区别?为什么运输层是必不可少的?答:运输层处于面向通信部分的最高层,同时也是用户功能中的最低层,向它上面的应用层提供服务运输层为应用进程之间提供端到端的逻辑通信,但网络层是为主机之间提供逻辑通信(面向主机,承担路由功能,即主机寻址及有效的分组交换)。

各种应用进程之间通信需要“可靠或尽力而为”的两类服务质量,必须由运输层以复用和分用的形式加载到网络层。

5—02 网络层提供数据报或虚电路服务对上面的运输层有何影响?答:网络层提供数据报或虚电路服务不影响上面的运输层的运行机制。

但提供不同的服务质量。

5—03 当应用程序使用面向连接的TCP和无连接的IP时,这种传输是面向连接的还是面向无连接的?答:都是。

这要在不同层次来看,在运输层是面向连接的,在网络层则是无连接的。

5—04 试用画图解释运输层的复用。

画图说明许多个运输用户复用到一条运输连接上,而这条运输连接有复用到IP数据报上。

5—05 试举例说明有些应用程序愿意采用不可靠的UDP,而不用采用可靠的TCP。

答:VOIP:由于语音信息具有一定的冗余度,人耳对VOIP数据报损失由一定的承受度,但对传输时延的变化较敏感。

有差错的UDP数据报在接收端被直接抛弃,TCP数据报出错则会引起重传,可能带来较大的时延扰动。

因此VOIP宁可采用不可靠的UDP,而不愿意采用可靠的TCP。

5—06 接收方收到有差错的UDP用户数据报时应如何处理?答:丢弃5—07 如果应用程序愿意使用UDP来完成可靠的传输,这可能吗?请说明理由答:可能,但应用程序中必须额外提供与TCP相同的功能。

5—08 为什么说UDP是面向报文的,而TCP是面向字节流的?答:发送方UDP 对应用程序交下来的报文,在添加首部后就向下交付IP 层。

UDP 对应用层交下来的报文,既不合并,也不拆分,而是保留这些报文的边界。

接收方UDP 对IP 层交上来的UDP 用户数据报,在去除首部后就原封不动地交付上层的应用进程,一次交付一个完整的报文。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

计算机网络第五章作业参考答案Chapter53.Consider the network of Fig. 5-7, but ignore the weights on thelines. Suppose that it uses flooding as the routing algorithm. If a packet sent by A to D has a maximum hop count of 3, list all the routes it will take. Also tell how many hops worth of bandwidth it consumes. Solution:It uses flooding as the routing algorithm, which means to transmit packets to all ports except the coming one. It will use:A,B,C,D,A,B,C,F,A,B,E,F,A,B,E,G,A,G,E,B,A,G,E,F,A,G,H,D,A,G,H,F.So,24 hops bandwidth are used.5.Consider the network of Fig. 5-12(a). Distance vector routing is used, and the following vectors have just come in to router C: from B: (5, 0, 8, 12, 6, 2); from D: (16, 12, 6, 0, 9, 10); and from E: (7, 6, 3, 9, 0, 4). The cost of the links from C to B, D and E, are 6, 3, and 5, respectively. What is C’s new routing table? Give both the outgoingline to use and the cost.Solution:If C transmit packet via B,A,B,C,D,E,F=(5,0,8,12,6,2)+(6,6,6,6,6,6)=(11,6,14,18,12,8)If C transmit packet g viaD,A,B,C,D,E,F=(16,12,6,0,9,10)+(3,3,3,3,3,3)=(19,15,9, 3, 12,13) If C transmit packet via E,A,B,C,D,E,F= (7,6,3,9,0,4) + (5,5,5,5,5,5) =(12,11, 8,14,5, 9), (11,6,0,3,5,8)So, C’s new routing table(from up to down is from C to A,B,C,D,E) Destination Cost outgoing line(next hop)A 11 BB 6 BC 0 -D 3 DE 5 EF 8 B9.Looking at the network of Fig. 5-6, how many packets are generatedby a broadcast from B,using(a) reverse path forwarding?(b) the sink tree?Solution:(a)Reverse path forwarding: when a broadcast packet arrives at a router, the router checks to see ifthe packet arrived on the link that is normally used for sending packets toward the source of the broadcast. This being the case, the router forward copies of it onto all links except the one it arrived on.DFhop1:2packetshop 2:4 packetshop 3:10 packetshop 4:8packetshop5:4packetstotal broadcast packets=2+4+10+8+4=28packets (b) the sink tree:Level1:2packetsLevel2:4packetsLevel3:5packetsLevel4:3packetsTotal broadcast packets=2+4+5+3=14packets.10.Consider the network of Fig. 5-15(a). Imagine that one new line is added, between F and G,but the sink tree of Fig. 5-15(b) remains unchanged. What changes occur to Fig. 5-15(c)?Solution: (figure come from 谭棋)The new tree built by reverse path forwarding should be:/F15.Describe two major differences between the ECN method and the RED method of congestion avoidance.Solution:(1) ECN(Explicit Congestion Notification)A router can tag any packet it forwards to signal that it is experiencing congestion. When the network delivers the packet, the destination can note that there is congestion and inform the sender when it sends a reply packet. The sender can then throttle its transmissions.(2) RED(Random Early Detection)This method prefer to dealing with congestion when it first starts rather than let it gum up the works and then try to deal with it. The motivation for this idea is that most Internet hosts do not yet get congestion signals from routers in the form of ECN. Instead, the only reliable indication of congestion that hosts get from the network is packet loss. Having routers drop packets early, before the situation has become hopeless can help reduce congestion. The affected sender will notice the loss when there is no acknowledgement, and then the transport protocol will slow down. (3) Their differences:a. Application environment: RED is used when hosts cannot receive explicit signal.b. Congestion notified method: ECN delivers a congestion signal explicitly as a chokepacket while RED notices congestion through packet loss.16.Imagine a flow specification that has a maximum packet size of 1000 bytes, a token bucket rate of 10 million bytes/sec, a token bucket size of 1 million bytes, and a maximumtransmission rate of 50 million bytes/sec. How long can a burst at maximum speed last? Solution:The burst length S sec, the maximum output rate M bytes/sec, thetoken bucket capacity B bytes, the token arrival rate R bytes/sec.B+RS=MS,S=B/(M-R)From this problem, B=1MB, M=50MB/s, R=10MB/sS=B/(M-R)=25ms20.Suppose that host A is connected to a router R1, R1 is connected to another router, R2, and R2 is connected to host B. Suppose that a TCP message that contains 900 bytes of data and 20bytes of TCP header is passed to the IP code at host A for delivery to B. Show the Total length, Identification, DF, MF, and Fragment offset fields of the IP header in each packet transmitted over the three links. Assume that link A-R1 can support a maximum frame size of 1024 bytes including a 14-byte frameheader, link R1-R2 can support a maximum frame size of 512 bytes, including an 8-byte frame header, and link R2-B can support a maximum frame size of 512 bytes including a 12-byte frame header.Solution:We have an IP payload of 920 bytes to send. Assume a 20 byte IPv4 header.The first link can carry IP packets up to 1010 bytes, so there will be no fragmentation. The second link can carry IP packets up to 504 bytes, so there will be fragmentation. There may be up to 484 bytes of data, but fragments must carry a multiple of 8 bytes of data (except the last fragment). So the first fragment will carry 480 bytes of data, and the second fragment will carry 440 bytes.The third link can carry IP packets up to 500 bytes, so both fragments will fit and no other fragmentation will occur. The value of the fields is as following table:512B(8)512B(12)1024B(14)BR1R2ATotal length DF MF Fragment offset Identification(random)A,R1 940 0000 0000 0001 0101 0 0 0R1,R2 500 0000 0000 0001 0101 0 1 0460 0000 0000 0001 0101 0 0 60 (8*60=480)R1,R2 500 0000 0000 0001 0101 0 1 0460 0000 0000 0001 0101 0 0 60 (8*60=480)23.Suppose that instead of using 16 bits for the network part of a class B address originally, 20bits had been used. How many class B networks would there have been? Solution:20 bits had been used for the network part of a class B address,but there are 2 bits isfixed,so there18are only 2 class B networks18the number of networks would have been 2 or 262,144. However, all 0s and all 1s are special, so only 262,142 are available.24.Convert the IP address whose hexadecimal representation is C22F1582 to dotted decimalnotation.Solution:According to: C 2 2 F 1 5 8 2,1100 0010 0010 1111 0001 0101 1000 0010,194 47 21 130,194.47.21.13025.A network on the Internet has a subnet mask of 255.255.240.0. Whatis the maximum number of hosts it can handle?Solution:The third 8-bit group in mask:240=11110000,So, there are network bits: 8+8+4=20bitsHosts bits: 32-20=12bitsThe maximum number of IP addresses it can handle:=4096Because the network address and the broadcast network address, hosts =4094.26.While IP addresses are tried to specific networks, Ethernet addresses are not. Can you think of a good reason why they are not?Answer:IP addresses are hierarchical, unlike Ethernet addresses. Each 32-bit address is comprised of a variable-length network partition in the top bits and a host partition in the bottom bits. Using a hierarchy lets Internet routing scale. However, the IP address of a host depends on where it is located in the network. An Ethernet address can be used anywhere in the world, but every IP address belongs to a specific network, and routers will only be able to deliver packets destined to that address to the network.Or: (from 袁子超)Each Ethernet adapter sold in stores comes hardwired with anEthernet (MAC) address in it. When burning the address into the card, the manufacturer has no idea where in the world the card will be used, making the address useless for routing in whole internet. In contrast, IP addresses are either assigned either statically or dynamically by anISP or company, which knows exactly how to get to the host getting the IP address.27.A large number of consecutive IP addresses are available starting at 198.16.0.0. Suppose that four organizations, A, B, C, and D, request 4000, 2000, 4000, and 8000 addresses, respectively, and in that order. For each of these, give the first IP address assigned, the last IP address assigned, and the mask in the w.x.y.z/s notation.Solution:Organization A: allocate hosts=4096=,host partition=12bits,network partition=20bitsOrganization B: allocate hosts=2048=,host partition=11bits,network partition=21bitsOrganization C: allocate hosts=4096=,host partition=12bits,network partition=20bitsOrganization D: allocate hosts=8192=,host partition=13bits,network partition=19bitsOrganization the first address the last address amount prefixA 198.16.0.0 198.16.15.255 4096 198.16.0.0/20B 198.16.16.0 198.16.23.255 2048 198.16.16.0/21C 198.16.32.0 198.16.47.255 4096 198.16.32.0/20D 198.16.64.0 198.16.95.255 8192 192.16.64.0/1928.A router has just received the following new IP addresses:57.6.96.0/21, 57.6.104.0/21, 57.6.112.0/21, and 57.6.120.0/21. If all of them use the same outgoing line, can they be aggregated? If so, to what? If not, why not?Solution:They can be aggregated.57.6.96.0 , 0110 000057.6.104.0,0110 100057.6.112.0,0111 000057.6.120.0,0111 1000,They can be aggregated by 57.6.96.0/19.29.The set of IP addresses from 29.18.0.0 to 29.18.128.255 has been aggregated to 29.18.0.0/17. However , there is a gap of 1024 unassigned addresses from 29.18.60.0 to 29.18.63.255 that are now suddenly assigned to a host using a different outgoing line. Is it now necessary to split up the aggregate address into its constituent blocks, add the new block to the table, and then see if any re-aggregation is possible? If not, what can be done instead? Solution:No, it is not necessary to split up the aggregate address. In CIDR, prefixes are allowed to overlap. The rule is that packets are sent in the direction of the most specific route, or the longest matching prefix that has the fewest IP addresses. So in this problem, we just need to add the block 29.18.60.0/22 to the table. If there is a math for both29.18.0.0/17 and 29.18.60.0/22, 29.18.60.0/22 will be used to lookup the outgoing line for the packet.30.A router has the following (CIDR) entries in its routing table:Address/mask Next hop135.46.56.0/22 Interface 0135.46.60.0/22 Interface 1192.53.40.0/23 Router 1default Router 2For each of the following IP addresses, what does the router do if a packet with that address arrives?(a) 135.46.63.10(b) 135.46.57.14(c) 135.46.52.2(d) 192.53.40.7(e) 192.53.56.7Solution:(a) 135.46.63.10,135.46.0011 1111.10Prefix : /22 ,135.46.0011 1100.10,135.46.60.0,Interface 1(b) 135.46.57.14,135.46.0011 1001.14Prefix : /22 ,135.46.0011 1000.14,135.46.56.0,Interface 0(c) 135.46.52.2,135.46.0011 0100.2Prefix : /22 ,135.46. 0011 0100.2,135.46.52.0,Router 2(d) 192.53.40.7 ,192.53.0010 1000.7Prefix : /22 ,192.53.0010 1000.7,192.53.40.0,Router 1(e) 192.53. 56.7,192.53.0011 1000.7Prefix : /22 ,192.53. 0011 1000.7,192.53.56.0,Router 231.Many companies have a policy of having two (or more) routers connecting the company to the Internet to provide some redundancy in case one of them goes down. Is this policy still possible with NAT? Explain your answer.Answer: (modified)Yes,it’s still possible. Whenever an outgoing packet enters the NAT box, the 10x.y.z source address is replaced by a global IP address. And the same time, the segment’s source port field isreplaced by an index into the NAT box’s 65536-entry translation table. This table entry contains the original IP address and original source port. When a return packet arrives at the NAT box from the outside, the Source Port in the segment header is extracted and used as an index in to the NATbox’s mapping table. From the entry located, the internal IP address and original Source are extracted and inserted into the packet.So it’s c rucial for all the packets pertaining to a single connection pass in and out of the company via the same router, sincethat is where the mapping is kept.IPv4 ARP 协议报文MAC帧头ARP头协议数据0X080632.You have just explained the ARP protocol to a friend. When you areall done, he says: “I’ve got it. ARP provides a service to the network layer, so it is part of the data link layer.” What do you say to him?Answer: (modified)ARP solves the problem of finding out which physical address corresponds to a given IP address. ARP is part of the network layer because it is related to IP address which is the representation of network layer.However, when data is passed down through OSI model, header will be added from each layer and they must be independent. Add a link header to a packet isn’t the function of network layer. ARPworks without using IP header. From this perspective, ARP belongs to the data link layer. (Pay attention: ARP belongs to 2 or 3 layer is not wrong. In fact, ARP is replaced by ND which is part of network layer completely in IPv6)34.Most IP datagram reassembly algorithms have a timer to avoid having a lost fragment tie up reassembly buffers forever. Suppose that a datagram is fragmented into four fragments. The first three fragments arrive, but the last one is delayed. Eventually, the timer goes off and thethree fragments in the receiver’s memory are discarded. A little later, the last fragment stumbles in. What should be done with it?Answer:To buffer all the pieces until the last fragment arrives and we can know the size. Then build a buffer with the right size, and put the fragments into the buffer, maintaining a bit map with 1 bit per 8 bytes to keep track of which bytes are present in the buffer. When all the bits in the bit map are 1, the datagram is complete.As far as the receiver is concerned, this is a part of new datagram, since no other parts of it are known. It will therefore be queued until the rest show up. If they do not, this one will time out too.37.IPv6 uses 16-byte addresses. If a block of 1 million addresses is allocated every picosecond, how long will the addresses last?My answer:16-byte=128bits128 Total address amount=26 1 million address=1012861213 Time lasts: 2/(10*10)/(365*24*60*60)=1.08×10years(Pay at tention: It’s so big a space that we don’t worry about run-out again.)38.The Protocol field used in the IPv4 header is not present in the fixed IPv6 header. Why not? Answer:The protocol field in IPv4 packet is replaced by next header witch tells which of the (currently) six extension headers, if any, followthis one. But if there is no extension header or next header field is in the last extension header, the meaning of next header field is same as protocol field’s.So, we can say that it’s not delet ed protocol field simply, but extension.43.Use the traceroute (UNIX) or tracert (Windows) programs to trace the route from your computer to various universities on other continents.Make a list of transoceanic links you have discovered. Some sites to try are (California) (Massachusetts)www.vu.nl (Amsterdam) (London).au (Sydney)www.u-tokyo.ac.jp (Tokyo)www.uct.ac.za (Cape Town)For problem 43, please add two sites: , , and copy the result interface (image) of tracert (all).Solution:In every test, I will used a red rectangle to show the beginning of transoceanic links. All the routers after it may form the list of transoceanic links. (California): (Massachusetts)www.vu.nl (Amsterdam) (London)As follows, I used tracert in windows to trace the route(use WiFi:CMCC-HEMC).au (Sydney)www.u-tokyo.ac.jp (Tokyo)www.uct.ac.za (Cape Town)。

相关文档
最新文档