What happens if a traceroute with the same TTL/hop limit is received from two different source addresses? How will they react?

Marek Küthe a0b36b320a Add link to BUILDING.md 1 рік тому
.woodpecker 86b57dbc6b Do not upload debug symbols in release 1 рік тому
debian dfd4f41aa0 Add changelog in debian package metadata 1 рік тому
src 839a23108b Fix coverity #1594530, #1594531 1 рік тому
systemd 3d42acfbde Add systemd unit 1 рік тому
tests b95fd4c31a Improve style 1 рік тому
.clang-format bac59b75ac Improve style 1 рік тому
.clang-format-include c3bf0e0bb3 Add more tests 1 рік тому
.clang-tidy b95fd4c31a Improve style 1 рік тому
.gitignore c8f7f100d0 Update debian package 1 рік тому
BUILDING.md a6be8bbdfd Improve building documentation 1 рік тому
CHANGELOG.md 59929af243 Remove rolling release 1 рік тому
LICENSE a451b0c588 Initial commit 1 рік тому
Makefile a6be8bbdfd Improve building documentation 1 рік тому
README.md 63fc680aae Add link to BUILDING.md 1 рік тому
meson.build 911b1d2524 Add test for RandomGenerator 1 рік тому
meson_options.txt 3d42acfbde Add systemd unit 1 рік тому
topology.drawio 1dd36e15d1 Update README 1 рік тому
topology.png 1dd36e15d1 Update README 1 рік тому

README.md

Crazy traceroute

pipeline badge

What happens if a traceroute with the same TTL/hop limit is received from two different source addresses? How will they react?

crazytrace is a network simulation program that can be used to see how different ping and traceroute implementations react when the sender address is different than expected.

Building

See BUILDING.md.

How it works?

crazytrace uses several libraries and tricks to create a virtual TAP adapter behind which the simulated network is hidden.

  • libtuntap: This library is used to create and close the TAP device.
  • libtins: This library is used for packet parsing and crafting.
  • yaml-cpp: This library is used to read the configuration file in YAML format.
  • Boost.log: This library is used as a logger. Various log levels can be set in the configuration file.
  • Boost.Asio: This library is used to communicate with the socket of the TAP device and to receive and send several packets simultaneously (asynchronously).

Here is how the program works:

  1. reading the configuration file
  2. setting the log level
  3. output of the libtuntap version
  4. output of the configuration
  5. creation of the TAP device
  6. initialization of the network simulator
  7. starting the network simulator

The following is how the network simulator works when a packet is received:

  1. reading the packet with tins
  2. reading the packet into a NodeRequest
  3. generate a NodeReply using the configuration
  4. check whether a reply should be sent 4a. If no, abort
  5. if yes, create a NodeReply package using libtins
  6. write the packet to the socket of the TAP device

Configuration file

The following is a example configuration file:

---
log_level: info
device_name: crazytrace
post_up_commands:
  - ip route add fd00::/64 dev crazytrace via fe80::b1:4fff:fe7e:9dc3
nodes:
  - mac: 02:B1:4F:7E:9D:C3
    addresses: [fe80::b1:4fff:fe7e:9dc3]
    hoplimit: 255
    nodes:
      - addresses: [fd00::1]
        nodes:
          - addresses: [fd00::21, fd00::22, fd00::23]
            nodes:
              - addresses: [fd00::3]
  - mac: 02:B1:4F:7E:9D:C4
    addresses: [fe80::b1:4fff:fe7e:9dc4]

This would generate the following topology: Topology

If a node has several IPv6 addresses, it listens to all of them and responds randomly with one. If no hop limit is specified, 64 is used.

Which MAC addresses can I use without any problems?

The following belong to the locally administered range and can be used without any problems:

x2-xx-xx-xx-xx-xx
x6-xx-xx-xx-xx-xx
xA-xx-xx-xx-xx-xx
xE-xx-xx-xx-xx-xx

How do I start crazytrace?

# /path/to/crazytrace /path/to/config.yaml