buger / goreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
https://goreplay.org
Other
18.53k stars 13 forks source link

VXLAN engine is inconsistent with request capture #1096

Open monrax opened 2 years ago

monrax commented 2 years ago

Often only the response part of the HTTP message is being displayed when using --input-raw-engine-vxlan and --output-stdout, without the corresponding request.

I previously mentioned this issue in #1095 . The environment and instructions for reproducing the issue are the same, except for the last step.

Environment: AWS How to repeat issue: Launch 2 t3-type EC2 instances, and set up a VPC traffic mirror filter and session between them. The ENI for one of them acts as a target and the other as the source. Create an inbound rule on the target's security group to allow UDP traffic on port 4789. SSH into both machines:

sudo ./gor --input-raw :8323 --input-raw-engine vxlan --input-raw-vxlan-vni 123 --input-raw-bpf-filter "(src port 8323) or (dst port 8323)" --output-stdout

In this case, 123 was chosen for VXLAN ID when creating the mirror session.

echo world > hello.txt && python3 -m http.server 8323

In this case, a simple webserver is exposed at port 8323. Remember to create an inbound rule in the security group of the source machine to be able to reach port 8323 from your local machine

From you local machine curl this simple server at http://<source machine public ip>:8323/hello.txt

Expected result: Both parts of the HTTP message printed to stdout in target machine, including request (1) and response (2). Actual result: Only HTTP responses (2) are printed . See attached image.

image

Additional info: It appears that sometimes the issue does not happen when accessing the web server from the browser, instead of using curl or another client like wget or Insomnia.

Note: I experienced another issue while trying this engine (#1095) only headers show up, without the body. Both issues could be related but we cannot be sure until further debug.

monrax commented 2 years ago

After a couple weeks of trying different things to get to the root cause I've learned the following:

RoeiGanor commented 1 year ago

Hey @monrax , I think we are experiencing the same issue, can you check if it related to MTU and if changing it fix it?

1134