1

I am implementing a simple socket application in python and I need it to receive UDP packets with GRO enabled. I have checked that only the Python service is running and that GRO is enabled via

eththool -k eth0 | egrep 'generic'

It shows both GSO and GRO are enabled.

Additionally I use scapy to send those UDP packages similar to that below. They do not have a payload on purpose.

send(IP(dst="123.456.789.123")/UDP(dport=5000),count=10)

This is what I have written in Python so far

import socket, select

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 0)

s.bind(('123.456.789.123',5000))

while True:
  result = select.select([s],[],[])
  output = result[0][0].recv(512)
  print (output)

So this prints out the payload of the package each time one is being sent ( just for monitoring purposes ). It works and by checking the ports with

netstat -tulpen

It shows that port running, opened for UDP.

Now I would like to enable GRO forcefully on this port, how do I do that? Is there any support to do something like that?

I am running Linux Ubuntu with Kernel version 5.0

tombjarne
  • 11
  • 2
  • This is a programming question, so it might be better suited for StackOverflow. It's one of those "inbetween" questions though, that has a networking application. – Andrew Schulman Dec 14 '20 at 14:54

0 Answers0