Beruflich Dokumente
Kultur Dokumente
CSMA/CD
Introduction
This tutorial presents detailed examples that illustrate
the modeling and analysis of the well-known Aloha
and CSMA channel access protocols. In this lesson,
you will learn how to:
• Construct more advanced protocols
• Design a simple channel interface to a multi-tap
bus
• Execute parametric simulations
• Analyze the simulated results against theoretical
predictions
1
Introduction
2
Getting Started
Getting Started
Before designing the models, you may be interested in
an overview of the model hierarchy.
Generic Receiver
Process Model: cct_rx
3
Getting Started
4
Getting Started
5
Getting Started
6
Getting Started
7
Getting Started
8
Building the Aloha Model
9
Building the Aloha Model
You are now ready to specify the code for the process
model. Start with the header block:
/* Conditional macros */
#define PKT_ARVL (op_intrpt_type() == OPC_INTRPT_STRM)
/* Global Variable */
extern int subm_pkts;
12
Building the Aloha Model
13
Building the Aloha Model
14
Building the Aloha Model
15
Building the Aloha Model
16
Building the Aloha Model
17
Building the Aloha Model
18
Building the Aloha Model
19
Building the Aloha Model
20
Building the Aloha Model
21
Building the Aloha Model
22
Building the Aloha Model
23
Building the Aloha Model
24
Building the Aloha Model
25
Building the Aloha Model
26
Building the Aloha Model
27
Building the Aloha Model
Next, enter the code for the header block and the state
variables.
/*Conditional macros */
#define PKT_RCVD (op_intrpt_type () == OPC_INTRPT_STRM)
#define END_SIM (op_intrpt_type () == OPC_INTRPT_ENDSIM)
/* Global variable */
int subm_pkts = 0;
The index for the input stream from the bus receiver
module (IN_STRM) is defined here. The PKT_RCVD
macro determines if the interrupt delivered to the
process is a stream interrupt. Only one kind of stream
28
Building the Aloha Model
29
Building the Aloha Model
30
Building the Aloha Model
31
Building the Aloha Model
33
Building the Aloha Model
35
Building the Aloha Model
This link model supports only the bus and bus tap
types.
36
Building the Aloha Model
37
Building the Aloha Model
38
Building the Aloha Model
39
Building the Aloha Model
40
Building the Aloha Model
41
Building the Aloha Model
42
Building the Aloha Model
43
Building the Aloha Model
44
Building the Aloha Model
46
Building the Aloha Model
47
Building the Aloha Model
48
Analyzing the Aloha Results
49
Analyzing the Aloha Results
50
Analyzing the Aloha Results
3 Click OK.
➥ The scalar graph appears in the workspace.
Your graph should resemble the one in the
following figure:
Aloha Protocol: Channel Throughput as a Function of Channel
Traffic
Maximum
throughput
51
Analyzing the Aloha Results
52
Adding Deference
Adding Deference
53
Adding Deference
54
Adding Deference
55
Adding Deference
/* Conditional macros */
#define FREE (op_stat_local_read (CH_BUSY_STAT) == 0.0)
#define PKTS_QUEUED (!op_strm_empty (IN_STRM))
#define CH_GOES_FREE (op_intrpt_type () == \
OPC_INTRPT_STAT)
56
Adding Deference
57
Adding Deference
58
Adding Deference
59
Adding Deference
6 Click Yes.
➥ The node models are changed to
<initials>_cct_csma_tx. The phrase “20
objects changed” appears in the message
buffer.
60
Adding Deference
61
Adding Deference
62
Adding Deference
63
Adding Deference
64
Adding Deference
Maximum
throughput
65
Adding Deference
4 Click Show.
➥ The graph of the two scalars should resemble
the following graph:
66
Adding Deference
67
Adding Deference
68
Adding Deference
5 Click OK.
➥ The graph should appear as follows:
69
Adding Deference
70
Adding Collision Detection and Backoff
71
Adding Collision Detection and Backoff
72
Adding Collision Detection and Backoff
73
Adding Collision Detection and Backoff
74
Adding Collision Detection and Backoff
75
Adding Collision Detection and Backoff
76
Adding Collision Detection and Backoff
77
Adding Collision Detection and Backoff
1 Go to <opnet_dir>\<release>\models\std\
tutorial_req\modeler.
78
Analyzing the Ethernet Results
5 Click Show.
79
Analyzing the Ethernet Results
81
Analyzing the Ethernet Results
82
Analyzing the Ethernet Results
83
Analyzing the Ethernet Results
84
Analyzing the Ethernet Results
85