Skip to content

Instantly share code, notes, and snippets.

@peci1
Created May 24, 2022 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peci1/d2b06682ad511b595d5b1306c3a73258 to your computer and use it in GitHub Desktop.
Save peci1/d2b06682ad511b595d5b1306c3a73258 to your computer and use it in GitHub Desktop.
Test of VSC7511 packet mangling bug
# Run "iperf3 -s" on "Computer 1" and "python3 gblox.py 10000 IP_OF_OTHER_COMPUTER_1" on "Computer 2".
# Run wireshark on Computer 2 and watch the packets arriving on port 5201.
# You will see all IP packets except the first in each UDP transmission have mangled 4 bytes
# near the beginning of their data sections. The test program shoud send repeated patterns of
# 0123456789abcdef, so it should be quite easy to spot. The 00 at position 7 and 8 is always
# there, 69 on the second blue line is also always there, while 87 seems to be randomly changing.
import socket
import sys
from math import ceil
l = 1480
ip = "192.168.88.157"
port = 5201
if len(sys.argv) > 1:
l = int(sys.argv[1])
if len(sys.argv) > 2:
ip = sys.argv[2]
if len(sys.argv) > 3:
port = int(sys.argv[3])
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
payload = ("0123456789ABCDEF" * int(ceil(l/16)))[0:l]
s.sendto(bytes(payload, "ascii"), (ip, port))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment