COMP211 Class Test: Canvas Quiz
1.What is the name of a packet in each of the following layers?
- 在每一层中,数据包的名称是什么?
- (a) Transport Layer
(a) 传输层Segment (段) or Datagram (数据报)
- (b) Network Layer
(b) 网络层Packet (包)
- (c) Link Layer
(c) 链路层Frame(帧)
2.What is the difference between routing and forwarding?
- 路由和转发有什么区别?
4-5 Two key network-layer functions
两个关键的网络层功能
- Network-layer functions:
-
网络层功能:
- forwarding: move packets from a router's input link to appropriate router output link
-
转发:将数据包从路由器的输入链路移动到适当的路由器输出链路
- routing: determine route taken by packets from source to destination
-
路由:确定数据包从源到目的地所采取的路由
- routing algorithms
-
路由算法
-
Analogy: taking a trip
-
类比:进行旅行
- forwarding: process of getting through single interchange
-
转发:通过单个交叉路口的过程
- routing: process of planning trip from source to destination
-
路由:规划从起点到终点的旅程过程
3.Draw a diagram illustrating the architecture of a router.
- 画一个图来说明路由器的架构。
4-14 Router architecture overview
路由器架构概述
high-level view of generic router architecture: 一般路由器架构的高级视图:
4.We discussed 3 types of switching fabrics. Briefly describe each of them.
- 我们讨论了三种类型的交换结构。简要描述每一种类型。
4-23 Switching fabrics
交换结构
- transfer packet from input link to appropriate output link
-
将数据包从输入链路传输到适当的输出链路
- switching rate: rate at which packets can be transfer from inputs to outputs
-
交换速率:数据包可以从输入传输到输出的速率
- often measured as multiple of input/output line rate
-
通常以输入/输出线路速率的倍数来衡量
- N inputs: switching rate N times line rate desirable
-
N个输入:期望交换速率是线路速率的N倍
图中展示了: - N个输入端口(每个端口速率为R) - 高速交换结构(理想速率为NR) - N个输出端口(每个端口速率为R)
Image shows: - N input ports (each with rate R) - High-speed switching fabric (ideal rate: NR) - N output ports (each with rate R)
4-24 Switching fabrics
交换结构 - transfer packet from input link to appropriate output link - > 将数据包从输入链路传输到适当的输出链路 -switching rate: rate at which packets can be transfer from inputs to outputs - > 交换速率:数据包可以从输入传输到输出的速率 - often measured as multiple of input/output line rate - > 通常以输入/输出线路速率的倍数来衡量 - N inputs: switching rate N times line rate desirable - > N个输入:期望交换速率是线路速率的N倍
three major types of switching fabrics:
三种主要的交换结构类型: 1. memory 内存式 2. bus 总线式 3. interconnection network 互连网络式
4-25 Switching via memory
通过内存进行交换
first generation routers:
第一代路由器: - traditional computers with switching under direct control of CPU - > 在CPU直接控制下进行交换的传统计算机 - packet copied to system's memory - > 数据包被复制到系统内存中 - speed limited by memory bandwidth (2 bus crossings per datagram) - > 速度受内存带宽限制(每个数据报需要2次总线穿越)
4-26 Switching via a bus
通过总线进行交换
- datagram from input port memory to output port memory via a shared bus
-
数据报通过共享总线从输入端口内存传输到输出端口内存
- bus contention: switching speed limited by bus bandwidth
-
总线争用:交换速度受总线带宽限制
- 32 Gbps bus, Cisco 5600: sufficient speed for access routers
-
32 Gbps总线,思科5600:对接入路由器来说速度足够
Switching via interconnection network
通过互连网络进行交换
- Crossbar, Clos networks, other interconnection nets initially developed to connect processors in multiprocessor
-
交叉条、Clos网络和其他互连网络最初是为了连接多处理器中的处理器而开发的
- multistage switch: nxn switch from multiple stages of smaller switches
-
多级交换:由多级小型交换器构成的n×n交换器
- exploiting parallelism:
-
利用并行性:
- fragment datagram into fixed length cells on entry
-
在入口将数据报分片成固定长度的信元
- switch cells through the fabric, reassemble datagram at exit
-
通过交换结构转发信元,在出口重组数据报
5.Describe how packet loss can occur at input ports of routers.
- 描述在路由器输入端口处如何发生数据包丢失。
1-32 Packet-switching: queueing
分组交换:排队
Packet queueing and loss: If arrival rate (in bps) exceeds transmission rate (bps) of link for some period of time:
数据包排队和丢失:如果在某段时间内,到达率(以bps计)超过链路的传输率(bps): - Packets will queue, waiting to be transmitted on output link - 数据包将排队,等待在输出链路上传输 - Packets can be dropped (lost) if memory (buffer) in router fills up - 如果路由器中的内存(缓冲区)已满,数据包可能被丢弃(丢失)
1-36 Packet switching versus circuit switching
分组交换与电路交换的比较
Is packet switching a "slam dunk winner"?
分组交换是否是"压倒性的胜利者"? - Great for "bursty" data – sometimes has data to send, but at other times not - > 非常适合"突发性"数据 - 有时有数据要发送,有时却没有 - Resource sharing > - 资源共享 - Simpler, no call setup > - 更简单,无需呼叫建立
Excessive congestion possible:Packet delay and loss due to buffer overflow
可能出现过度拥塞:由于缓冲区溢出导致的数据包延迟和丢失 - Protocols needed for reliable data transfer, congestion control - 需要可靠数据传输和拥塞控制的协议
Q: How to provide circuit-like behavior with packet-switching?
问:如何用分组交换提供类似电路的行为? - "It's complicated." We'll study various techniques that try to make packet switching as "circuit-like" as possible. - "这很复杂。"我们将研究各种试图使分组交换尽可能"类似电路"的技术。
Q: Human analogies of reserved resources (circuit switching) versus on-demand allocation (packet switching)?
- 问:预留资源(电路交换)与按需分配(分组交换)的人类类比是什么?
1-47 How do packet delay and loss occur?
数据包延迟和丢失是如何发生的?
- Packets queue in router buffers, waiting for turn for transmission
-
数据包在路由器缓冲区中排队,等待轮到自己传输
- Queue length grows when arrival rate to link (temporarily) exceeds output link capacity
- 当到达链路的速率(暂时)超过输出链路容量时,队列长度增加
- Queue length grows when arrival rate to link (temporarily) exceeds output link capacity
-
Packet loss occurs when memory to hold queued packets fills up
- 当用于存放排队数据包的内存填满时,就会发生数据包丢失
Diagram shows:
图示显示:
-
Computers A and B connecting to routers
- 计算机A和B连接到路由器
-
Packet being transmitted (transmission delay)
- 正在传输的数据包(传输延迟)
-
Packets in buffers (queueing delay)
- 缓冲区中的数据包(排队延迟)
-
Free (available) buffers: arriving packets dropped (loss) if no free buffers
- 空闲(可用)缓冲区:如果没有空闲缓冲区,到达的数据包将被丢弃(丢失)
1-53 "Real" Internet delays and routes
"真实"互联网延迟和路由
-
What do "real" Internet delay & loss look like?
- "真实"的互联网延迟和丢失是什么样的?
-
Traceroute program: Provides delay measurement from source to router along end-end Internet path towards destination.For all i:
-
Traceroute程序:提供从源到路由器沿着端到端互联网路径到目的地的延迟测量.对于所有的i:
- Sends three packets that will reach router i on path towards destination (with time-to-live field value of i)
-
发送三个数据包到达路径上的路由器i(使用生存时间字段值为i)
- Router i will return packets to sender
-
路由器i将数据包返回给发送者
- Sender measures time interval between transmission and reply
-
发送者测量传输和回复之间的时间间隔
1-55 Packet loss
图5:数据包丢失
-
Queue (aka buffer) preceding link in buffer has finite capacity
- 缓冲区中链路前的队列(即缓冲区)具有有限容量
-
Packet arriving to full queue dropped (aka lost)
- 到达已满队列的数据包被丢弃(即丢失)
-
Lost packet may be retransmitted by previous node, by source end system, or not at all
- 丢失的数据包可能由前一个节点重传,由源端系统重传,或者根本不重传
6.Describe how packet loss can occur at output ports of routers.
-
描述在路由器输出端口处如何发生数据包丢失。
-
Packet Loss at Input Ports of Routers
-
路由器输入端口的丢包
-
Buffer Overflow: If the input buffer is full and more packets arrive, the new packets are dropped.
缓冲区溢出:如果输入缓冲区已满且有更多数据包到达,这些新的数据包将被丢弃。 -
High Arrival Rate: If the rate of incoming packets exceeds the router's capacity to process or forward them to the switching fabric, packets can be dropped.
高到达率:如果到达数据包的速率超过路由器处理或转发到交换结构的能力,数据包可能会被丢弃。 -
Switching Fabric Contention: When multiple packets from different input ports need to access the same output port simultaneously, some packets might face delays or be dropped if the contention persists.
交换结构冲突:当多个输入端口的包同时需要访问同一个输出端口时,可能会导致部分数据包延迟或被丢弃。 -
Hardware Limitations: Insufficient processing power or memory at the input port can also cause packet loss.
硬件限制:输入端口的处理能力或内存不足也可能导致数据包丢失。
- Packet Loss at Output Ports of Routers
-
路由器输出端口的丢包
-
Output Buffer Overflow: When multiple packets destined for the same output port arrive faster than they can be transmitted, the buffer fills up, and excess packets are dropped.
输出缓冲区溢出:当多个指向同一输出端口的数据包到达速度超过传输速度时,缓冲区会填满,超出部分的数据包将被丢弃。 -
Congestion in Downstream Links: If the outgoing link is experiencing congestion, the router may not transmit packets quickly enough, causing its output buffer to overflow.
下游链路拥堵:如果下行链路出现拥堵,路由器可能无法快速传输数据包,从而导致输出缓冲区溢出。 -
Traffic Aggregation: Packets from different input ports may converge on the same output port, exceeding its bandwidth capacity and leading to loss.
流量聚合:来自不同输入端口的数据包可能汇聚到同一个输出端口,超出其带宽容量并导致丢包。 -
Link Failures or Errors: If the physical or logical link to the next hop is unreliable, packets may accumulate and be dropped.
链路故障或错误:如果到下一跳的物理或逻辑链路不可靠,数据包可能会积压并被丢弃。
这些问题可以通过有效的缓冲区管理、拥塞控制算法和服务质量(QoS)机制来缓解。
These issues can be mitigated using efficient buffer management, congestion control algorithms, and Quality of Service (QoS) mechanisms.
7.What is HOL blocking? Does it occur in input ports or output ports?
- 什么是HOL阻塞?它发生在输入端口还是输出端口?
Input port queuing
输入端口排队
- If switch fabric slower than input ports combined -> queueing may occur at input queues
-
如果交换结构比输入端口的总和慢 -> 可能在输入队列处发生排队
- queueing delay and loss due to input buffer overflow!
-
由于输入缓冲区溢出导致的排队延迟和丢失!
- Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward
-
队头阻塞(HOL):队列前端的数据报阻止队列中的其他数据报向前移动
8.Consider sending a 3100 byte datagram into a link that has an MTU of 320 bytes. How many fragments are generated?
- 考虑将一个3100字节的数据报发送到一个MTU为320字节的链路中。生成多少个碎片?
IP fragmentation/reassembly
IP 分片/重组
- network links have MTU (max. transfer size) - largest possible link-level frame
-
网络链路有 MTU(最大传输单元)- 最大可能的链路层帧
- different link types, different MTUs
-
不同的链路类型,不同的 MTU
-
large IP datagram divided (“fragmented”) within net
-
大的 IP 数据报在网络中被划分(“分片”)
- one datagram becomes several datagrams
-
一个数据报变成多个数据报
- “reassembled” only at destination
-
仅在目的地“重组”
- IP header bits used to identify, order related fragments
-
IP 头部位用于识别、排序相关的片段
9.What is the 32-bit binary equivalent to the IP address 225.1.3.51?
- IP地址225.1.3.51的32位二进制等价是什么?
10. You have captured an IPv4 datagram and the first 160 bits are as follows:
你捕获了一个IPv4数据报,前160位如下:
01000101 00000000 00000000 11111010 00001010 01111110 01000000 00000000 10000000 00000110 10110101 10100010 10101000 00100100 00000100 00010100 11001000 00101001 00000100 00011000 What is the destination IP address of this datagram in the standard a.b.c.d notation? Source IP address? Length in bytes of the datagram? 这个数据报的目的IP地址是什么?源IP地址是什么?数据报的长度是多少字节?
11. Consider a router that interconnects three subnets: A, B, and C. Suppose all of the interfaces
in each of these subnets are required to have the prefix 223.200.0.0/20. Suppose subnet A is required to support 2000 interfaces, and subnet B and C are each required to support 1000 interfaces. Provide network addresses for A,B and C (in the form a.b.c.d/x) that satisfy these constraints.
考虑一个连接三个子网的路由器:A、B和C。假设这些子网中的所有接口都必须具有前缀223.200.0.0/20。假设子网A需要支持2000个接口,子网B和C各需要支持1000个接口。提供满足这些约束条件的A、B和C的网络地址(形式为a.b.c.d/x)。
12. Do routers have IP addresses? If so, how many?
路由器有IP地址吗?如果有,有多少?
Yes, routers have IP addresses, and typically, they have at least two IP addresses: 是的,路由器有 IP 地址,通常至少有 两个 IP 地址:
13. Suppose there are 5 routers between a source host and a destination host. Over how many
interfaces will an IP datagram travel if it is sent from the source host to the destination host? How many forwarding tables will be looked up in the process?
假设源主机和目的主机之间有5个路由器。如果从源主机到目的主机发送一个IP数据报,该数据报将通过多少个接口?在此过程中将查阅多少个转发表?
问题分析
-
数据报将经过多少个接口?
IP数据报从源主机到目的主机会经过多个网络接口,包括路由器的入接口和出接口。 -
源主机有 1个出接口。
- 每个路由器有 2个接口(1个入接口和1个出接口)。
- 目的主机有 1个入接口。
假设有5个路由器: [ 总接口数 = 1(源主机出接口) + (2 \times 5)(5个路由器的接口) + 1(目的主机入接口) = 12 ]
答案:数据报将经过 12 个接口。
- 查阅多少次转发表?
转发表(Forwarding Table)仅在路由器中用于决定下一跳接口。 - 源主机不查阅转发表。
- 每个路由器查阅 1次转发表。
- 目的主机不查阅转发表。
因此,5个路由器对应 5次转发表查阅。
答案:转发表将被查阅 5 次。
最终答案
英文:
- Number of interfaces: 12
- Number of forwarding table lookups: 5
中文:
- 经过的接口数: 12
- 查阅的转发表次数: 5
14. Suppose an application generates chunks of 20 byte of data every 20msec and each chunk
gets encapsulated in a TCP segment and then an IPv4 datagram. What percentage of each datagram will be application data?
假设一个应用程序每20毫秒生成20字节的数据块,每个数据块被封装在一个TCP段中,然后是一个IPv4数据报。每个数据报中应用数据占的百分比是多少?
15. How big is the IPv4 address space? The IPv6 address space? The MAC address space?
IPv4地址空间有多大?IPv6地址空间有多大?MAC地址空间有多大?
-
Is it necessary that every AS uses the same Intra-AS routing protocol? Why or why not?
- 是否每个AS都需要使用相同的Intra-AS路由协议?为什么或为什么不?
-
不需要相同的协议:每个AS可以选择不同的Intra-AS路由协议(如RIP、OSPF、EIGRP等)。
Not necessary to use the same protocol: Each AS can choose different Intra-AS routing protocols (such as RIP, OSPF, EIGRP, etc.). -
自治系统独立管理:每个AS由一个单独的管理实体控制,因此可以根据自身需求选择协议。
Autonomous System is independently managed: Each AS is controlled by a single managing entity, allowing them to choose protocols based on their own needs. -
跨AS通信使用BGP:不同AS之间必须使用统一的BGP协议进行路由信息交换。
BGP used for Inter-AS communication: Different ASes must use the standardized BGP protocol for exchanging routing information. -
灵活性与网络需求:AS内部的路由协议选择依据其网络规模、复杂性和管理需求。
Flexibility and network requirements: The choice of Intra-AS routing protocol depends on the network size, complexity, and management needs of the AS. -
Why are there different protocols for Inter-AS and Intra-AS routing?
- 为什么Inter-AS和Intra-AS路由协议不同?
-
作用不同:Intra-AS协议用于单个AS内部的路由,Inter-AS协议用于不同AS之间的路由交换。
Different purposes: Intra-AS protocols manage routing within a single AS, while Inter-AS protocols handle routing between different ASes. -
网络规模不同:Intra-AS协议处理小规模的内部网络,Inter-AS协议处理大范围的跨AS路由。
Different network scales: Intra-AS protocols manage smaller internal networks, while Inter-AS protocols deal with large-scale routing across ASes. -
路由选择标准不同:Intra-AS协议关注最短路径,而Inter-AS协议更注重策略性和可扩展性。
Different routing criteria: Intra-AS protocols focus on shortest path, while Inter-AS protocols emphasize policy and scalability. -
协议目标不同:Intra-AS协议优化局部网络性能,Inter-AS协议确保AS之间的稳定连接。
Different design goals: Intra-AS protocols optimize local network performance, while Inter-AS protocols ensure stable inter-AS connectivity. -
Compute the CRC bits defined by the generator 1011 and the data bit string 110101.
- 计算由生成器1011和数据位串110101定义的CRC位。
-
An Ideal Multiple Access Protocol should have 4 characteristics. List them.
- 一个理想的多路访问协议应该具备4个特点。列举它们。
公平性(Fairness) 每个用户都应该有平等的机会访问共享的通信信道,避免某些用户占用过多带宽。
效率(Efficiency) 协议应尽量提高信道利用率,减少空闲时间和浪费,确保系统资源得到最大程度的利用。
抗冲突能力(Collision Avoidance) 理想的协议应能够有效避免或减少数据冲突,以避免因冲突而浪费带宽和增加延迟。
低延迟(Low Latency) 协议应确保数据的快速传输,减少传输延迟,使通信能够迅速响应和处理。
- Sketch the operation of Slotted ALOHA.
- 描绘Slotted ALOHA的操作过程。
operation: when node obtains fresh frame, transmits in next slot • if no collision: node can send new frame in next slot • if collision: node retransmits frame in eachsubsequent slot with probability p until success 操作: 当节点获得新帧时,在下一时隙发送 - 如果没有碰撞:节点可在下一个时隙发送新帧 - 如果发生碰撞:节点以 p 的概率在随后的每个时隙重新传输帧,直到成功为止。以概率 p 重传帧,直至成功
-
Why is an ARP query sent within a broadcast frame? Why is an ARP response sent within a frame with specific destination MAC address?
- 为什么ARP查询是在广播帧中发送的?为什么ARP响应是在具有特定目的地MAC地址的帧中发送的?
-
ARP查询使用广播:
由于发送方不知道目标设备的MAC地址,它将ARP查询作为广播发送到整个网络,确保所有设备都有机会回应。
ARP query uses broadcast: Since the sender doesn't know the target device's MAC address, it broadcasts the ARP query to the entire network to ensure all devices can respond. -
ARP响应使用单播:
响应中包含目标设备的MAC地址,因此只需要将其发送给请求设备的特定MAC地址,而不再是广播。
ARP response uses unicast: The response contains the target device's MAC address and is sent directly to the requesting device's specific MAC address, not as a broadcast. -
提高效率:
通过广播查询和单播响应,ARP协议确保了网络效率并减少了不必要的广播流量。
Improved efficiency: By using broadcast for the query and unicast for the response, ARP ensures network efficiency and reduces unnecessary broadcast traffic. -
At which layer do routers operate? Switches?
- 路由器工作在哪一层?交换机呢?
路由器:工作在 网络层(Layer 3),负责跨网络路由。 交换机:通常工作在 数据链路层(Layer 2),通过MAC地址转发数据。
-
路由器工作在网络层:
路由器根据目标IP地址进行数据转发,决定数据包的路径。
Routers operate at the Network Layer: Routers forward data based on the destination IP address and determine the path. -
交换机工作在数据链路层:
交换机根据MAC地址转发数据帧,主要用于局域网内的通信。
Switches operate at the Data Link Layer: Switches forward data frames based on MAC addresses, mainly used in LAN communication. -
三层交换机:
三层交换机可以同时进行数据链路层交换和网络层路由。
Layer 3 Switches: Layer 3 switches can perform both data link layer switching and network layer routing. -
What is a CSMA protocol?
- 什么是CSMA协议?
-
Consider CSMA/CD with exponential backoff. After the 5th collision, what is the probability that a node chooses K=4?
- 考虑具有指数退避的CSMA/CD。在第5次碰撞后,节点选择K=4的概率是多少?
-
Is it true that at high load channel partitioning multiple access protocols are more efficient than random access multiple access protocols? Why or why not?
- 在高负载下,频道分区多路访问协议比随机访问多路访问协议更有效率,这是真的吗?为什么或为什么不?
-
Which multiple access protocol is used in 802.11 wireless LANs? Briefly explain its functionality.
- 在802.11无线局域网中使用哪种多路访问协议?简要解释其功能。