Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add trace options #39

Merged
merged 3 commits into from
Mar 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions tracevis.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ def get_args():
parser.add_argument('--annot2', type=str,
help="annotation for the second packets (dns and packet trace)")
parser.add_argument('--rexmit', action='store_true',
help="change the behavior of the trace route to be similar to doing retransmission. (only one packet, and all steps, same stream)")
parser.add_argument('--rexmit2', action='store_true',
help="change the behavior of the trace route to be similar to doing retransmission. (each step, different stream)")
help="same as rexmit option (only one packet. all TTL steps, same stream)")
parser.add_argument('-o', '--options', type=str, default="new",
help="change the behavior of the trace route"
+ " - 'rexmit' : to be similar to doing retransmission with incremental TTL (only one packet, one destination)"
+ " - 'new' : to change source port, sequence number, etc in each request (default)"
+ " - 'new,rexmit' : to begin with the 'new' option in each of the three steps for all destinations and then rexmit"
)
args = parser.parse_args()
return args

Expand Down Expand Up @@ -117,8 +121,14 @@ def main(args):
edge_lable = args["label"].lower()
if args.get("rexmit"):
trace_retransmission = True
if args.get("rexmit2"):
trace_with_retransmission = True
if args.get("options"):
trace_options= args["options"].replace(' ', '').split(',')
if "new" in trace_options and "rexmit" in trace_options:
trace_with_retransmission = True
elif "rexmit" in trace_options:
trace_retransmission = True
else:
pass # "new" is default
if args.get("dns") or args.get("dnstcp"):
do_traceroute = True
name_prefix += "dns"
Expand All @@ -127,15 +137,15 @@ def main(args):
dns_over_tcp=(args["dnstcp"]))
if len(request_ips) == 0:
request_ips = DEFAULT_REQUEST_IPS
if args.get("packet"):
if args.get("packet") or args.get("rexmit"):
do_traceroute = True
name_prefix += "packet"
packet_1, packet_2, do_tcph1, do_tcph2 = utils.packet_input.copy_input_packets(
OS_NAME, trace_retransmission)
if do_tcph1 or do_tcph2:
name_prefix += "-tcph"
if trace_with_retransmission:
name_prefix += "-rexmit2"
name_prefix += "-newrexmit"
if do_traceroute:
was_successful, measurement_path = utils.trace.trace_route(
ip_list=request_ips, request_packet_1=packet_1, output_dir=output_dir,
Expand Down