File: script6.1

package info (click to toggle)
ipv6toolkit 2.0%2Bds.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,260 kB
  • sloc: ansic: 26,831; perl: 1,058; makefile: 137
file content (321 lines) | stat: -rw-r--r-- 10,070 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
.TH SCRIPT6 1
.SH NAME
script6 \- A tool to make complex IPv6 tasks easy
.B script6
.RB SCRIPT\| 
.IR [PARAMETERS \|]

.SH DESCRIPTION
.B script6
is a set up scripts that make frequent and/or rather complex IPv6\-related tasks easy.

\fBSCRIPTS\fR

\fBget\-aaaa\fR

This script takes no further arguments, and operates as follows:

.sp
.RS 4
.nf
\+ The tool reads domain names from standard-input (one per line),
\  and obtains the AAAA records for the corresponding domain. If the
\  domain name does not contain AAAA records, the tool will add
\  the suffix "www.", in the hopes that the resulting domain name
\  might contain some.

\+ Lines where the first non-blank character is the numeral sign (#)
\  are consdered to contain comments, and hence are ignored.

\+ The format of the resulting output is:
.fi
.RE

.sp
.RS 4
.nf
  # DOMAIN_NAME (CANONIC_NAME)
  IPV6_ADDRESS_1
  IPV6_ADDRESS_2
.fi
.RE


\fBget\-alexa-domains\fR

This script takes no further arguments, and operates as follows:

.sp
.RS 4
.nf
\+ It reads from standard input lines with the same format as those
of Alexa's Top 1M web sites. That is, lines with the folowing syntax:
.fi
.RE

.sp
.RS 4
.nf
RANKING,DOMAIN_NAME
.fi
.RE

.sp
.RS 4
.nf
\+ It extracts the domainname from each line, and prints the corresponding
domain name to standard output.
.fi
.RE

This script is typically useful for extracting domain names from Alexa's
Top 1M web sites file, such that they can be processed by other tools (e.g. the get\-aaaa
command of script6).


\fBget\-ns\fR

This script takes no further arguments, and operates as follows:

.sp
.RS 4
.nf
\+ The tool reads domain names from standard-input (oner per line),
\  and obtains the NS records for the corresponding domain.

\+ Lines where the first non-blank character is the numeral sign (#)
\  are consdered to contain comments, and hence are ignored.

\+ The format of the resulting output is:
.fi
.RE

.sp
.RS 4
.nf
  # DOMAIN_NAME (CANONIC_NAME)
  MX_RECORD_1
  MX_RECORD_2
.fi
.RE


\fBget\-mx\fR

This script takes no further arguments, and operates as follows:

.sp
.RS 4
.nf
\+ The tool reads domain names from standard-input (oner per line),
\  and obtains the MX for the corresponding domain.

\+ Lines where the first non-blank character is the numeral sign (#)
\  are consdered to contain comments, and hence are ignored.

\+ The format of the resulting output is:
.fi
.RE

.sp
.RS 4
.nf
  # DOMAIN_NAME (CANONIC_NAME)
  MX_RECORD_1
  MX_RECORD_2
.fi
.RE

\fBget\-ns\fR

This script takes no further arguments, and operates as follows:

.sp
.RS 4
.nf
\+ The tool reads domain names from standard-input (oner per line),
\  and obtains the NS records for the corresponding domain.

\+ Lines where the first non-blank character is the numeral sign (#)
\  are consdered to contain comments, and hence are ignored.

\+ The format of the resulting output is:
.fi
.RE

.sp
.RS 4
.nf
  # DOMAIN_NAME (CANONIC_NAME)
  MX_RECORD_1
  MX_RECORD_2
.fi
.RE


\fBget\-trace\-stats\fR

This command causes the script6 tool to read from standard input the results of a "script6 trace" command (typically piped from a file), and produce statistics based on such results.

Among the statistics produced by this command are:

   * Packet drop rate: That is, the percentage of destination IPv6 
     addresses that result unreachable if IPv6 extension headers are
     employed.

   * Packet drop rate by different AS: That is, the percentage of packet
     drops that occur at an Autonomous System (AS) other than the AS 
     corresponding to the destination IPv6 address.

   * Packet drop rate by same AS: That is, the percentage of packet
     drops that occur at the same Autonomous System (AS) as that
     corresponding to the destination IPv6 address.

   * Delta\-Hops statistics: Statistics regarding the Delta-Hops at which
     the packet drops occur, with "delta\-hops" defined as "the number of
     hops from the intended destination".

The get-trace-stats performs a number of sanity checks on the input data (i.e., the output from "script6 trace"). For example, if a line of input indicates that the last responding node for the non-EH-enabled path6 command is not the intended destination, this means that the destination is unreachable even when no IPv6 extension headers are employed, and hence the corresponding line will be discarded.


\fBtrace DESTINATION [EHTYPE[EHSIZE]] [PROTOCOL [DESTPORT]]]\fR

The trace command causes the script6 to read IPv6 addresses from standard input (typically piped from a file). For each IPv6 address, the script6 will try to isolate IPv6 blackholes resulting from employing IPv6 extension headers. By default, the probe packets (containing IPv6 Extension Headers) are IPv6 packets with a Destination Options Header of 8 bytes, encapsulating an ICMPv6 Echo Request message. However, this can be overridden by specifying the EHTYPE {DO,HBH,FH}, EHSIZE (an integer), PROTOCOL {tcp,udp,icmpv6}, and DESTPORT (a short integer) parameters.

The "trace" command of the script6 tool internally employs the path6 tool of the toolkit as follows. Let us assume that we want to isolate an IPv6 blackhole on the path towards the destination system 2001:db8:d::1. Firstly, script6 will obtain the output of path6 towards such destination:

.sp
.RS 4
.nf
      1. 2001:db8:1:1000::1
      2. 2001:db8:2:2000::4
      3. 2001:db8:2:4000::1
      4. 2001:db8:3:4000::1
      5. 2001:db8:3:1000::1
      6. 2001:db8:4:4000::1
      7. 2001:db8:4:1000::1
      8. 2001:db8:5:5000::1
      9. 2001:db8:5:6000::1
      10. 2001:db8:d::1
.fi
.RE

Subsequently, script6 will obtain the output of EH-enabled path6 to the same destination:

.sp
.RS 4
.nf
      1. 2001:db8:1:1000::1
      2. 2001:db8:2:2000::4
      3. 2001:db8:2:4000::1
      4. 2001:db8:3:4000::1
      5. 2001:db8:3:1000::1
      6. 2001:db8:4:4000::1
.fi
.RE

For the sake of brevity, let us refer to the last\-responding node in the EH-enabled path6 ("2001:db8:4:4000::1" in this case) as "M". Assuming both packets in both path6 commands employ the same path, we will refer to "the node following the last responding node in the EH-enabled path6" ("2001:db8:4:1000::1" in our case), as "M+1", etc.

Based on traceroute information above, which node is the one actually dropping the EH-enabled packets will depend on whether the dropping node filters packets on ingress or the egress. If the former, the dropping node will be M+1.  If the latter, the dropping node will be  "M".

path6 assumes that nodes perform ingress-filtering.  Thus, in our example above the last responding node to the EH-enabled traceroute ("M") is "2001:db8:4:4000::1", and therefore we assume the "node" dropping node to be "2001:db8:4:1000::1" ("M+1").

The resulting output will have the following syntax:

.sp
.RS 4
.nf
    DEST#LAST_NOEH#HOPS_NOEH#LAST_EH$HOPS_EH#DROPN#DROPN2
.fi
.RE

where:

   * DEST: Destination IPv6 address (as read from standard input). 
     In our example above, this would be 2001:db8:d::1.

   * LAST_NOEH: Last responding IPv6 address for the path6 command 
     with no IPv6 extension headers (this will be the same as DEST
     if there is a working path to the destination). In our example
     above, this would be 2001:db8:d::1.

   * HOPS_NOEH: Number of hops to LAST_NOEH. In our example above, 
     this would be "10".

   * LAST_EH: Last responding IPv6 address in the EH\-enabled path6
     command. In our example above, this would be 2001:db8:4:4000::1.

   * HOPS_EH: Number of hops to LAST_EH. In our example above, this
     would be "6".

   * DROPN: Dropping node (M+1 in our explanation above). In our
     example above, this would be 2001:db8:4:1000::1.

   * DROPN: Node after the dropping node (M+2). In our example, 
     this would be 2001:db8:5:5000::1.


The output of the "trace" command is meant to be processed by the get-trace-stats command of the script6 tool. Please check the blackhole6(1) tool for a more human-friendly tool for isolating IPv6 blackholes.


.SH EXAMPLES

The following sections illustrate typical use cases of the
.B script6
tool.

\fBExample #1\fR

$ script6 get-asn 2001:db8::1

Obtain the Origin Autonomous System (AS) number for the IPv6 address 2001:db8::1.


\fBExample #2\fR

$ script6 get-as 2001:db8::1

Obtain information about the Origin Autonomous System (AS) of the IPv6 address 2001:db8::1.


\fBExample #3\fR

$ cat domains.txt | script6 get-aaaa > domains-aaaa.txt

Map the domain names contained in the file "domains.txt" into AAAA records, and save the results in the file "domains-aaaa.txt".


\fBExample #4\fR

# cat domains-aaaa.txt | script6 trace do8 tcp port 25 > trace-results.txt

Find IPv6 blackholes in the path to each of the IPv6 addresses contained in the file "domains-aaaa.txt" (one per line), and save the results to the file "trace-results.txt". The probe packets to be employed are IPv6 packets with a Destination Options header of 8 bytes, encapsulating a TCP segment with the Destinatio Port set to 25.

\fBExample #5\fR

$ cat trace-results.txt | script6 get-trace-stats

Produce statistics based on the trace results from the file "trace-results.txt" (produced with "script6 trace").

.SH SEE ALSO
.BR blackhole6 (1)
.BR path6 (1)

draft\-gont\-v6ops\-ipv6\-ehs\-in\-real-world (available at: 
.IR <http://tools.ietf.org/html/draft\-gont\-v6ops\-ipv6\-ehs\-in\-real\-world> )
for a discussion of support of IPv6 Extension Headers in the public Internet.


.SH AUTHOR
The
.B script6
tool and the corresponding manual pages were produced by Fernando Gont 
.I <fgont@si6networks.com>
for SI6 Networks 
.IR <http://www.si6networks.com> .

.SH COPYRIGHT
Copyright (c) 2014\-2015 Fernando Gont.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front\-Cover Texts, and no Back\-Cover Texts.  A copy of the license is available at
.IR <http://www.gnu.org/licenses/fdl.html> .