Skip to content

Commit 5b5d62c

Browse files
minor edits to docs
1 parent 06acf81 commit 5b5d62c

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ Read the documentation below for more options.
8080
- [Update to latest version](docs/update.md)
8181
- [More information for developers](docs/develop.md)
8282
- [All npm commands](docs/develop.md#all-npm-commands)
83-
- [Git flow](docs/release-process.md#git-flow)
84-
- [Report context](docs/context.md)
85-
- [Release process](docs/release-process.md)
83+
- [Reports/alerts templates](docs/context.md)
84+
- [Release process and Git flow](docs/release-process.md)
8685
- [BGPalerter for researchers](docs/research.md)
87-
- [Release process and Git flow](docs/release-process.md)
86+
8887

8988

9089
If you are using BGPalerter, feel free to sign here: [Who is using BGPalerter](docs/friends.md)

docs/research.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
> This is a draft, this tutorial will improve soon
44
5-
BGPalerter has been designed in order to be suitable for research activities.
6-
While for production purposes it's usually enough to monitor some prefixes, for research purposes you might need to monitor the entire address space.
5+
BGPalerter has been designed in order to be suitable also for research activities.
6+
While for production purposes it's usually enough to monitor specific prefixes, for research purposes you might need to monitor the entire address space.
77
In particular, BGPalerter is designed to be able to handle many more BGP messages than the current RIS live streaming produces in total, with a small CPU and memory footprint.
88

99
This tutorial will briefly explain how to use BGPalerter for research.
@@ -26,12 +26,12 @@ If during your analysis you will find a warning of messages dropped in the logs,
2626
2727
1) Check your code to verify if something is taking too much time for the processing of a single BGP message
2828
2) Set a higher value for `maxMessagesPerSecond` (depending on the CPU resources available). Something like 10000 is a good start.
29-
3) Set `multiProcess` to true, in order to use two processes.
29+
3) Set `multiProcess` to true, in order to use two processes (this is rarely required).
3030

3131
If the memory consumption during your analysis increases drastically, you may want to:
3232
1) Check your code for memory leaks
33-
2) Check you are not doing many async calls accumulating in the stack (e.g., if you monitor the entire v6 address space, like on the example above, you cannot do a single network call for each BGP message received. You can instead bundle together multiple calls or pre-filter better).
34-
3) Check that the `squashAlerts` of your monitor component is working as expected. In particular, if the squashAlerts methods returns null it means the bucket of BGP messages is not yet ready for squashing, remaining in memory. See below for more information.
33+
2) Check you are not doing many async calls accumulating in the stack E.g., if you monitor the entire v6 address space, like on the example above, you cannot do a single network call for each BGP message received. You can instead bundle together multiple calls or implement a better `filter` function.
34+
3) Check that the `squashAlerts` of your monitor component is working as expected. In particular, if the squashAlerts methods returns null it means the bucket of BGP messages is not yet ready to be squashed, hence it will remain in memory. See below for more information.
3535
4) Reduce the `fadeOffSeconds`. This will drop all the BGP messages that took too long to be squashed by `squashAlerts`.
3636

3737

@@ -54,21 +54,21 @@ export default class myMonitor extends Monitor { // It MUST extend Monitor
5454
};
5555
5656
updateMonitoredResources = () => {
57-
/* You will probably not need the line below. Essentially you will be notified every
58-
* time the set of monitored prefixes changes (note: this.input is inherited from the super class) */
59-
const monitored = this.input.getMonitoredMoreSpecifics();
57+
/* This function allows you to set what you are going to
58+
* monitor and update the set every time the input changes */
59+
this.monitored = this.input.getMonitoredMoreSpecifics();
6060
};
6161
6262
filter = (message) => {
6363
/* Pre-filtering. This filtering is blocking since it happens synchronously.
6464
* Make this filtering as tight as possible without involving external resources
65-
* (e.g., do NOT do database or API call here). For example base your filtering
65+
* (e.g., do NOT do database or API calls here). For example base your filtering
6666
* on the properties of the BGP message received */
6767
return message.type === 'announcement';
6868
};
6969
7070
squashAlerts = (alerts) => {
71-
/* The input alerts is an array of alerts with the same signature generated by the monitor method.
71+
/* The input 'alerts' is an array of alerts with the same signature generated by the monitor method.
7272
* Alerts with the same signature are usually referring to the same issue (maybe as seen by different peers).
7373
* The expected output is a string. Here you can define what is the summary for the entire "chunk" of alerts.
7474
* If you return null, the alerts will not be sent to the report but will remain in the queue. The next
@@ -86,23 +86,24 @@ export default class myMonitor extends Monitor { // It MUST extend Monitor
8686
new Promise((resolve, reject) => {
8787
/* This method is non blocking since it happens asynchronously.
8888
* Here you can do database or API calls (maybe bundle multiple requests together to reduce network overhead).
89-
* This is where the real analysis happens and when the alerts are generated. Place here your complex filtering/analysis. */
89+
* This is where the real analysis happens and when the alerts are generated. Place here your complex filtering/analysis.
90+
* The 'filter' function described before is needed to avoid useless calls to the 'monitor' function, which is much more expensive in terms of memory. */
9091
9192
const matchedRule = this.getMoreSpecificMatch(message.prefix); //The method getMoreSpecificMatch is inherited from the super class, it provides the rule in prefixes.yml that matches the current BGP message.
9293
9394
if (matchedRule) { // We matched something in prefixes.yml
9495
const signature = message.originAS.getId() + "-" + message.prefix; // All messages with the same origin AS and prefix will be bundled together. Read above the squash method to understand why.
9596
9697
this.publishAlert(signature, // The method publishAlert is inherited from the super class.
97-
message.prefix, // The monitored resource subject of the alert (it can be an AS)
98-
matchedRule, // The monitored rule that was matched (prefixes.yml)
98+
message.prefix, // The monitored resource subject of the alert (it can be an AS or a prefix)
99+
matchedRule, // The monitored rule that was matched (from prefixes.yml)
99100
message, // The entire BGP message (needed for possible further troubleshooting or for storing it)
100101
{
101102
love: "pizza" // Extra information I want to annotate this alert with (this information will be shared with the squash method and all the reports)
102103
});
103104
}
104105
105-
resolve(true); // Remember to resolve the Promise when the calculation is completed. Don't forget!
106+
resolve(true); // Remember to resolve the Promise when the calculation is completed!
106107
});
107108
}
108109
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Software to monitor streams of BGP data. Pre-configured for real-time detection of visibility loss, RPKI invalid announcements, hijacks, and more.",
55
"author": {
66
"name": "Massimo Candela",
7-
"url": "https://massimocandela.com"
7+
"url": "http://massimocandela.com"
88
},
99
"license": "BSD-3-Clause",
1010
"main": "src/worker.js",

0 commit comments

Comments
 (0)