TELE 4642: Network Performance: Lab 1 [10 points, Due Week 2]
TELE 4642:网络性能:实验 1 [10 分,应于第 2 周提交]
Note: This lab should be done in pairs, i.e., in groups of two
students.
注意: 这个实验应该成对进行,即两人一组
学生。
The objective of this exercise is to develop software that lets you
observe and measure the performance of a modified M/M/1 queueing system
via simulation. Wikipedia provides good introductory information on
network
simulation; you will specifically develop software for a
discrete
event simulation of an M/M/1 system with burst arrivals.
本练习的目标是开发软件,让您
观察和测量修改后的 M/M/1 排队系统的性能
通过模拟。维基百科提供了很好的介绍性信息
网络模拟 ;您将专门为
具有突发到达的 M/M/1 系统的离散事件模拟 。
Your discrete-event simulation should be implemented as a single thread (i.e., single process) that consists of the following functional blocks:
您的离散事件仿真应实现为由以下功能块组成的单个线程(即单个进程):
- An event management library that provides library functions to store events in order of their occurrence time. You need functions to efficiently add a new event, delete an existing event, and retrieve the next event. You may use a simple linked list to begin with. Think carefully about the types of events that can happen in your system (source state change, packet arrival/departure, ...)
一个事件管理库 ,它提供库函数以按事件发生时间的顺序存储事件。您需要函数来有效地添加新事件、删除现有事件和检索下一个事件。您可以从简单的链表开始。仔细考虑系统中可能发生的事件类型(源状态更改、数据包到达/离开等) - A source model that manages packet arrivals and
schedules appropriate events. You will explore two different source
models in this lab.
一个源模型 ,用于管理数据包到达并安排适当的事件。在本实验中,您将探索两种不同的源模型。 - A service model that serves packets in the queue. When a
packet enters service, an event is created corresponding to the
departure time of the packet (determined by service rate and length
of packet). At each departure event, the next packet (if any) in
queue should enter service. Note that you should compute the
departure time of a packet only when the packet enters
service, not upon packet arrival to a non-empty queue (think
why). The service model is invoked upon each packet departure.
在队列中提供数据包的服务模型 。当数据包进入服务时,会创建一个与数据包的离开时间相对应的事件(由服务速率和数据包长度决定)。在每个出发事件中,队列中的下一个数据包(如果有)应进入服务。请注意,您应该仅在数据包进入服务时计算数据包的离开时间, 而不是在数据包到达非空队列时计算(想想为什么)。服务模型在每次数据包离开时调用。
(Part a)[8 points]: Poisson Process Source Model
(第 a 部分)[8 分]: 泊松过程源模型
In this part, you need to write a program for a source model that generates packet arrivals as a Poisson Process (with given parameter lambda) and schedules appropriate events. Note that at any point of time you need to have an event scheduled for the source: the next packet arrival. The source model gets invoked upon each packet arrival (to schedule the next packet).
在这一部分中,您需要为源模型编写一个程序,该程序将数据包到达生成为 Poisson 进程(使用给定的参数 lambda)并安排适当的事件。请注意,在任何时间点,您都需要为源安排一个事件:下一个数据包到达。源模型在每个数据包到达时调用(以调度下一个数据包)。
Your simulations will make the following assumptions:
您的模拟将做出以下假设:
- Packet sizes are exponentially distributed with a mean size of
10,000 bits or 1250 Bytes. Even though the exponential is a
continuous distribution, you will approximate it by discretising the
packet size by rounding to the closest integral byte value.
数据包大小呈指数分布,平均大小为 10,000 位或 1250 字节。即使指数是连续分布,您也可以通过四舍五入到最接近的整数字节值来离散数据包大小来近似它。
- The server (communication link) has a fixed capacity 10Gbps,
which, for mean packet size of 10,000 bits, is equivalent to serving 1
million packets per second (or one packet per microsecond) on average.
服务器(通信链路)具有 10Gbps 的固定容量,对于平均 10000 比特的数据包大小,这相当于平均每秒处理 100 万个数据包(或每微秒 1 个数据包)。
- The source generates packets as a Poisson process at a
specified rate lambda.
源以指定的速率 lambda 生成数据包作为泊松进程。
- Queueing space in infinite, i.e., packets are never dropped.
无限排队空间,即数据包永远不会被丢弃。
- The following notation is used: us for microseconds, ms for
milliseconds, and sec for seconds.
使用以下表示法:us 表示微秒,ms 表示毫秒,sec 表示秒。
Your program should perform the packet-level simulation of
arrivals and departures, and alongside maintain statistics that will
be displayed at the end of the simulation (as described below).
Your demonstration should include the following:
您的程序应执行到达和离开的数据包级模拟,并维护将在模拟结束时显示的统计数据(如下所述)。您的演示应包括以下内容:
- Your main program should be invoked with command-line arguments as
follows: sim npkts lambda where sim
refers to the name of the executable, npkts refers to the
number of packets to be simulated, lambda is the packet
arrival rate (in packets per us). Upon
termination of the simulation your program should print out statistics
(as described below).
应使用命令行参数调用主程序,如下所示: sim npkts lambda 其中 sim
指可执行文件的名称, npkts 指要模拟的数据包数, lambda 是数据包的到达速率(以每 us 的数据包数为单位)。在模拟终止时,您的程序应打印出统计信息(如下所述)。 - As each event occurs, your simulation should print out a message
indicating the time (in us) at which the event occurs, the nature of
the event, and any additional statistics information. For example,
packet arrivals could print the message: "[3749.00]: pkt 2748 arrives
and finds 38 packets in the queue". Packet departures could print the
message "[4638.00]: pkt 6102 departs having spent 243.00 us in the
system". Please note that the messages printed by your simulation have
(by definition) to be in chronological order, otherwise it defeats the
purpose of a simulation.
当每个事件发生时,您的模拟应打印出一条消息,指示事件发生的时间(以我们为单位)、事件的性质以及任何其他统计信息。例如,数据包到达可以打印消息:“[3749.00]: pkt 2748 arrives and found 38 packets in the queue”。数据包离开可以打印消息“[4638.00]: pkt 6102 depasses has spent 243.00 us in the system”。请注意,您的模拟打印的消息(根据定义)必须按时间顺序排列,否则就违背了模拟的目的。 - When the simulation ends (i.e., all packets have been served), your
program should print the following:
当模拟结束时(即,所有数据包都已提供),您的程序应打印以下内容:
- N, the average number of customers in the system,
N,系统中的平均客户数, - T, the average time spent by customer in the system,
T,客户在系统中花费的平均时间, - For each n between 0 and 10, the
probability P(n) that an arriving packet finds n
packets already in the system.
对于介于 0 和 10 之间的每个 n,到达数据包找到 n 的概率 P(n)
数据包。
You will run your program (each run should simulate at least a million
packets) for the following three combinations of parameters (verify
that each combination yields a stable system):
您将针对以下三种参数组合运行程序(每次运行应至少模拟 100 万个数据包)(验证每种组合是否产生稳定的系统):
- [smooth]: lambda = 1 pkts/us
[平滑]:Lambda = 1 包/us - [bursty]: lambda = 9 pkts/us
[突发]:lambda = 9 包/us - [balanced]: lambda = 1.8 pkts/us
[平衡]:Lambda = 1.8 包/us
For each run, your submission will show N and T.
Additionally for each run you will also show a plot of P(n)
versus n.
对于每次运行,您的提交将显示 N 和 T。此外,对于每次运行,您还将显示 P(n) 与 n 的关系图。 (Part b)[2 points]: Long Range Dependence (LRD) Source Model
(乙部)[2 分]: 长距离依赖性 (LRD) 源模型
In this part, you need to write a program for a source model that
reads packet arrivals from a trace file (i.e., trace1) of real Internet traffic and
schedules appropriate events. The trace file represents a traffic with average rate of 4Gbps and contains two columns: the first column represents the inter-arrival time in microseconds(us) and the second column represents the packet size in Bytes. Your simulator next uses another traffic trace (i.e., trace2) with average rate of 7Gbps.
在这部分,您需要为源模型编写一个程序,该程序从真实 Internet 流量的跟踪文件 (即 trace1)中读取数据包到达并安排适当的事件。跟踪文件表示平均速率为 4Gbps 的流量,包含两列:第一列表示以微秒 (us) 为单位的到达间隔时间,第二列表示以字节为单位的数据包大小。您的模拟器接下来使用另一个平均速率为 7Gbps 的流量跟踪 (即 trace2)。
Your program should perform the packet-level simulation of arrivals and departures, and alongside maintain statistics that will be displayed at the end of the simulation. Your demonstration should include the following:
您的程序应执行到达和离开的数据包级模拟,并维护将在模拟结束时显示的统计数据。您的演示应包括以下内容:
Your main program should be invoked with command-line arguments as follows:
sim trace where sim refers to the name of the executable,
trace refers to the name of the traffic trace file.
Upon termination of the simulation your program should print out statistics (as described above in part a).
应使用命令行参数调用主程序,如下所示:
sim trace 其中 sim 引用可执行文件的名称,
trace 是指流量追踪文件的名称。在模拟终止时,您的程序应打印出统计信息(如上文 a 部分所述)。
[Note]: This exercise is to be done in your own time on your own computing
equipment, and demonstrated in lab by week 2. Lab times should be used
to clarify any questions and to get any assistance from the lab
demonstrator, and for demonstrating your final working code.
[注]: 本练习将在您自己的时间使用自己的计算设备完成,并在第 2 周之前在实验室中演示。实验时间应该用于澄清任何问题,从实验演示者那里获得任何帮助,以及演示您的最终工作代码。