跳到主要内容

2016-2017学年上学期期末

2016-2017学年上学期期末试卷(A)(含答案)

一、Briefly explain the following jargons(3 points each,30 points in all)

  1. Slotted ALOHA

    答案:

    时隙 ALOHA 协议,划分时隙,仅开始时刻可以发送,每个时隙结束时检测冲突,以随机方法在下一个时隙重传。


  2. Link-state Routing Algorithm

    答案:

    以 FLOODING(泛洪)方法传播链路状态,结点收集整个子网的链路状态,利用 Dijkstra 算法计算从自己出发到达其余各节点的最短路由,无慢收敛问题。


  3. Manchester coding

    答案:

    标准以太网物理层使用的信号编码方法,具有自同步特点,每个比特窗口的电平变化作为同步时钟信号,常见的编码为 L->H 表示“0”,H->L 表示“1”。


  4. Flow Control

    答案:

    防止发送方速度超过接收方处理能力。


  5. Three-way Handshaking

    答案:

    这是 TCP 建立连接的过程,分三个步骤:SYN->SYN/ACK->ACK,目的是防止建立错误的连接。


  6. Pseudo Header (of TCP)

    答案:

    伪头(或叫伪首部)包括源 IP、目的 IP、协议号和报文长度,仅用于计算 TCP 报文的校验和。作用是用于唯一确定一条连接。


  7. Packet Switching

    答案:

    分组交换技术,典型的例子是因特网。以存储-转发为基础,分数据报和虚电路两种操作方式。


  8. OSI Reference Model

    答案:

    OSI RM 是 ISO 制定的计算机网络国际标准,7 层模型:应用、表示、会话、传输、网络、数据链路、物理层。


  9. CIDR (Classless InterDomain Routing)

    答案:

    解决路由器表项过大问题,将连续几块小地址合并为一个大地址项,与地址类别无关,可提高地址利用率。


  10. Go-back-n Protocol

    答案:

    是连续 ARQ 方法,可以在未收到接收方对先前发送的报文确认时连续发送多个报文,但必须严格按顺序接收。


二、Briefly answer the following questions(5 points each,30 points in all)

  1. Generally, hosts behind a NAT gateway will not be seen directly from Internet. Why? If you need to use one of these hosts to provide network services for the outside world, what measures should you take to configure the NAT gateway?

    答案:

    (1)位于 NAT 之后的内网主机使用的是专用的内部网 IP 地址,使用这种地址的 IP 分组在因特网中是不能被路由的,而且使用同一个地址的主机可能很多,因此从外部是无法直接访问这些主机的。(3 分)

    (2)在 NAT 网关上以人工方式设置一条静态映射表项即可实现外网客户机访问内网服务器。(2 分)


  2. Give the four methods the data link layer uses for framing. Which method does PPP use in order to meet the requirement of data transmission transparency?

    答案:

    四种帧的构造方法(或帧定界方法):字符计数、字符填充、比特填充、物理层信号违法编码。(4 分)

    PPP 常用字符填充法。(1 分)


  3. “Path MTU” is the smallest MTU of any link on the current path (route) between two communicating hosts on Internet. Design an algorithm to discover the “path MTU” of a path in IPv4 environment.

    答案:

    源主机从本子网(本地链路)的 MTU 开始作为数据区的数据长度向目的主机发送 IP 报文,同时将 IP 首部的 DF 标志设置为 1,表示不允许分片。如果收到目的主机的响应,则表示找到了 Path MTU,否则如果收到 Destination Unreachable 报文,则将数据区长度减少,再次构造 IP 报文发送到目的主机。(4 分)

    减少数据长度可以使用线性法(每次减少 1)或二分法。(1 分)


  4. We use binary data to represent information and share information with each other by network. Suppose host A send a number to host B and B get the number with no error, does this mean that the semantics of the information transmitted remains unchanged? Briefly explain your answer.

    答案:

    即使传输没有错误,也不能保证信息的语义不变。(2 分)

    例如两个主机使用不同的字符集,那么发送方所传输的代表某个字符的数值在接收方一侧可能表示另一个不同的字符。(2 分)

    解决方法是实现抽象语法与传送语法之间的相互转换。(1 分)


  5. We conclude that subnetting is a technique to improve the utilization(利用率)of IP addresses. Now let's take a look at this case. Company ABC has been assigned a class-C network address for its networking. If that address is not subnetted, then total 254(=282=2562=2^8-2=256-2)addresses can be used for hosts. If it is subnetted by using 3 bits as subnet id, then total addresses available for hosts become 180(=256(32+32+26)=25676=256-(32+32+2*6)=256-76). We can see from the results that the no-subnetting scheme has much more addresses available for hosts than the subnetting one. Is the conclusion we have just made wrong? Explain your answer.

    答案:

    子网划分是提高 IP 地址利用率的技术,此结论没有错。(2 分)

    子网划分的前提就是有多余的主机地址空间可能被浪费。(1 分)

    因此,在满足用户对主机地址空间需求的条件下,利用率是从可用的子网数量来衡量的。(1 分)

    例如,ABC 公司有 6 个部门都要求独立建网,每个部门的主机数都少于 30 台,那么不划分子网时就需要 6 个 C 类网络地址,而划分子网时只要用 1 个 C 类网络地址即可满足需要。(1 分)


  6. Briefly describe the MAC protocol which Ethernet uses to allocate the shared channel.

    答案:

    以太网使用 1-坚持 CSMA/CD(1-Persistent CSMA/CD)MAC 协议分配信道。(2 分)

    站点在发送前先侦听信道状态是否为空闲,如果为空闲则立即发送,否则侦听至信道由忙变空为止,然后立即发送。发送过程中如果发现有碰撞,则立即停止传输,并发送一串干扰码。然后使用截断的二进制指数退避算法实施重传。(3 分)


三、Computation and application(40 points in all)

  1. Consider a router interconnecting two Ethernet subnets, Sub1 and Sub2. Suppose we have changed the MTU of the router's interface which connects Sub2 from 1500 to 820. The MTU of the interface which connects Sub1 remains as default. If an ICMP echo request with 1000 data is sent from host A in Sub1 to host B in Sub2, the router needs to fragment this packet into some smaller pieces. Compute Fragment Offset and Total Length fields for each fragments.(10 points)

    答案:

    IP 碎片的最大数据长度为:82020=800820-20=800 字节,800/8=100800/8=100,因此最大分片包含的数据量为:1008=800100*8=800 字节。(3 分)

    ICMP ECHO 报文的总长度为:1000+8=10081000+8=1008 字节(其中 8 是 ECHO 首部长度)。(2 分)

    按照 800 来分片,可以分成 2 片,第一片数据 800 字节,第二片数据 208 字节。(1 分)

    片偏移从 0 开始计算,而总长度要加上 20 字节的 IP 首部长度,最终结果如下表:(4 分)

    字段第一片第二片
    Fragment Offset0100
    Total Length820228

  2. Suppose for one newly established TCP connection, round-trip time is 20 msecs and no congestion occurs. The receive window is 18 KB, and the maximum segment size is 1 KB. How long does it take before the first full window can be sent? And now suppose triple duplicate ACK event happens rightly after that, how big will the window be if the next five transmission bursts are all successful?(10 points)

    答案:

    (1)拥塞窗口:1 KB,2 KB,4 KB,8 KB,16 KB,因此发送方在 5×20 ms=100 ms5\times20\text{ ms}=100\text{ ms} 后达到满窗口 18 KB。(5 分)

    (2)如果此时发生三次重复确认引起的重传,则新的阈值降为 9 KB,而拥塞窗口从新阈值开始线性增长。拥塞窗口:9 KB、10 KB、11 KB、12 KB、13 KB,因此经过 5 轮传输后拥塞窗口为 14 KB。(5 分)


  3. A 12-bit Hamming code whose hexadecimal value is 0xa7c arrives at a receiver. What was the original value in hexadecimal? Assume that not more than 1 bit is in error.(5 points)

    答案:

    海明码从左至右进行位的编号,第 8 位出错,接收端收到的 12 位海明码正确值应为 0xa6c。(4 分)

    12 位海明码中的原始数据为 0xbc。(1 分)


  4. A CDMA receiver gets the following chips: (-1 +1 -3 +1 -1 -3 +1 +1). Assuming the chip sequences defined: A (-1 -1 -1 +1 +1 -1 +1 +1), B (-1 -1 +1 -1 +1 +1 +1 -1), C (-1 +1 -1 +1 +1 +1 -1 -1), D (-1 +1 -1 -1 -1 -1 +1 -1), which stations transmitted, and which bits did each one send?(5 points)

    答案:

    计算四个站点的归一化内积:

    (1,+1,3,+1,1,3,+1,+1)(1,1,1,+1,+1,1,+1,+1)/8=1(-1,+1,-3,+1,-1,-3,+1,+1)\cdot(-1,-1,-1,+1,+1,-1,+1,+1)/8=1

    (1 分)

    (1,+1,3,+1,1,3,+1,+1)(1,1,+1,1,+1,+1,+1,1)/8=1(-1,+1,-3,+1,-1,-3,+1,+1)\cdot(-1,-1,+1,-1,+1,+1,+1,-1)/8=-1

    (1 分)

    (1,+1,3,+1,1,3,+1,+1)(1,+1,1,+1,+1,+1,1,1)/8=0(-1,+1,-3,+1,-1,-3,+1,+1)\cdot(-1,+1,-1,+1,+1,+1,-1,-1)/8=0

    (1 分)

    (1,+1,3,+1,1,3,+1,+1)(1,+1,1,1,1,1,+1,1)/8=1(-1,+1,-3,+1,-1,-3,+1,+1)\cdot(-1,+1,-1,-1,-1,-1,+1,-1)/8=1

    (1 分)

    The result is that A and D sent 1 bits, B sent a 0 bit, and C was silent.(1 分)


  5. Below are the first 96 bytes of a TCP/IP packet captured using Wireshark on an Ethernet network. Decode the packet for the following fields:(10 points)

    (1)Ethernet MAC source and destination addresses (in hexadecimal)

    (2)IP source and destination addresses (in dotted-decimal format)

    (3)TCP source and destination port numbers (in decimal)

    (4)Type of TCP segment (e.g., SYN, FIN, ACK, etc.)

    (5)Application layer protocol and command (if applicable)

    08 00 20 f7 88 7d 00 11   43 b7 92 43 08 00 45 00    .. ..}..C..C..E.
    02 4b 1f f8 40 00 80 06 ca 9b 83 f7 03 2a 83 f7 .K..@........*..
    03 01 08 68 00 50 e0 5a 79 da 38 0b ef 53 50 18 ...h.P.Zy.8..SP.
    ff ff 80 d7 00 00 47 45 54 20 2f 7e 63 68 72 69 ......GET /~chri
    73 74 65 6e 2f 63 68 72 69 73 74 65 6e 2e 68 74 sten/christen.ht
    6d 6c 20 48 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 ml HTTP/1.1..Hos
    答案:

    (1)目的 MAC 地址 = 080020f7887d,源 MAC 地址 = 001143b79243。(2 分)

    (2)源 IP 地址 = 131.247.3.42,目的 IP 地址 = 131.247.3.1。(2 分)

    (3)TCP 源端口 = 2152,TCP 目的端口 = 80。(2 分)

    (4)TCP 段类型 = PUSH, ACK。(2 分)

    (5)应用层协议 = HTTP,这是一个 HTTP/1.1 GET 命令。(2 分)