Page 1 of 1

Traffic generator

Posted: Fri Feb 15, 2019 11:57 am
by torrent
Question on the use of traffic generator.
The manual says that traffic must return to the generator to see the statistics. I want to test the channel "generator - another mikrotik", so the "another mikrotik" should be able to return traffic. Does anyone know how to do this (so that the mikrotik can return packets to the sender on the Internet) ?
And another thing: I tested the traffic generator, sending UDP packets to the Linux host, the IP over Ethernet office channel. UDP packets were rejected by the host, since there was no packet handler installed: the Linux host sent back the "ICMP Port Unreachable" packets in response. As long as the packet size in the generator did not exceed 562 bytes, the generator packet sensed that the packets were being returned from the Linux host (although it sent only ICMP). What is the actual mechanism for detecting returned packets in a traffic generator?
/tool traffic-generator packet-template
add data=specific-byte data-byte=0xEE ip-dst=192.168.1.32 ip-src=192.168.1.254 name=to-dell port=lan udp-dst-port=1701 udp-src-port=1701
Running a traffic generator:
tool traffic-generator quick tx-template=to-dell packet-size=562 pps=1
Thanks.

Re: Traffic generator

Posted: Mon Feb 18, 2019 2:52 am
by tberg
Set the Dst to be the IP of the generator and the Gateway to be the IP of the remote Mikrotik you are testing to. You can leave the Src blank.

Re: Traffic generator

Posted: Mon Feb 18, 2019 11:56 am
by torrent
Set the Dst to be the IP of the generator and the Gateway to be the IP of the remote Mikrotik you are testing to. You can leave the Src blank.
OK thanks.
And how to run a similar test on the Internet:
mikrotik1 <----> gw1 <----> gw2 <----> mikrotik2
?
Is it possible ?

Re: Traffic generator

Posted: Mon Feb 18, 2019 7:43 pm
by tberg
Yes, that is possible. I've not done it over the public Internet, but don't see why it wouldn't work. I've done it across multiple router hops in our ISP network.

Re: Traffic generator

Posted: Tue Feb 19, 2019 6:52 am
by torrent
Yes, that is possible. I've not done it over the public Internet, but don't see why it wouldn't work. I've done it across multiple router hops in our ISP network.
Thanks for the answer, but it is not yet clear how this can work.
If we consider the example above, then, let's say, the IP addresses are:
mikrotik1 - 1.1.1.1
gw1 - 2.2.2.2
gw2 - 3.3.3.3
mikrotik2 - 4.4.4.4
I want to use traffic-generator to test the route between mikrotik1 and mikrotik2. Traffic must pass, in the simplest case, in the following way:
mikrotik1 -> gw1 -> gw2 -> mikrotik2, and then turn around and go back: mikrotik2 -> gw2 -> gw1 -> mikrotik1.
In this diagram, two things look strange:
1. gw1, in order to deliver the packet to mikrotik2, must receive ip packets from mikrotik1 with ip-dst equal to mikrotik2, otherwise gw1 will incorrectly choose the delivery route. As I understand, in order for this item to work correctly, the ip-dst parameter needs to be set exactly as the IP address of mikrotik2, no tricks with the substitution of its own IP addresses.
2. How exactly should mikrotik2 turn traffic back towards mikrotik1?
As I said at the beginning of the topic, there is no action = mirror or similar in ip firewall, and in general I haven’t found such functionality.
Does it make it difficult for you, according to the given scheme and IP addressing, to give an example of running a packet-generator?

Once again, thank you for your time and attention to my question.

Re: Traffic generator

Posted: Wed Feb 20, 2019 12:48 am
by tberg
It's a little confusing, but for the traffic generator set up you don't need to be concerned with GW 1 & 2. Assuming you have a route from 1.1.1.1 to 4.4.4.4 and back, your packet template in 1.1.1.1 would have ip-dst=1.1.1.1 and ip-gateway=4.4.4.4. In my case GW1 and GW1 are Mikrotik routers, but I don't think that matters. The middle gateways are just routing IP packets.