Questions tagged [so-reuseport]
13 questions
1
vote
0 answers
Python (3.8.12) UDP sockets does not distribute packets when SO_REUSEPORT option is set (Linux 3.10)
When looking at python UDP sockets option 'SO_REUSEPORT', I found something strange. According to the article, How do SO_REUSEADDR and SO_REUSEPORT differ?,
'Additionally the kernel performs some "special magic" for SO_REUSEPORT sockets that isn't…

Victor Windy
- 31
- 1
1
vote
1 answer
syscall.SO_REUSEPORT not available in net package
I want to open multiple UDP sockets bound to the same port( say 8888). The different sockets will be bound to different vrfs in the system.
What I understand is we need to set SO_REUSEPORT sockopts, but I don't see this available in net package of…

Saurabh Suman
- 19
- 2
1
vote
1 answer
how to create multiple UDP Datagram channels/streams on same local/src address
I have to receive data from diff clients on same port of server.
I want to create separate channels for each client for this purpose and receive data on each of them.
I am exploring all the options available to design this.
Option 1 : Listen on a…

Onki
- 1,879
- 6
- 38
- 58
1
vote
2 answers
Get UDP packets from the same client delivered to the same server process, when using SO_REUSEPORT?
I'm writing a multi-process UDP server, which uses SO_REUSEPORT to let multiple worker processes listen on the same port.
Is there a way of telling the kernel that I would like consistent delivery of packets to processes, based on the packets'…

fadedbee
- 42,671
- 44
- 178
- 308
0
votes
0 answers
How to load value from memory into accumulator in bpf
I want to write a bpf program which return [1,n] in round-robin pattern.
e.g if n=4 then it should return 1,2,3,4,1,2,3,4,1,2..
Algorithm for above idea is:
A = read M[0]
A = A % n-1
A = A+1
store M[0] = A
return A
Apart from first step,…

Upendra Kumar
- 1
- 3
0
votes
0 answers
Collocating mutiple services on the same UDP port
Say, there are 2 services (A and B) bound to listen onto the same UDP port.
service A employs SO_REUSEPORT socket option and service B doesn't.
Is there a way to make both services to work together on the same ip/port?
Specifically, would it matter…

Dmitry
- 1,275
- 1
- 5
- 14
0
votes
0 answers
can i attach bpf program to all socket binding on same ip:port using so_reuseport
From Linux manual page About so_attach_cbpf
For use with the SO_REUSEPORT option, these options allow
the user to set a classic BPF (SO_ATTACH_REUSEPORT_CBPF)
or an extended BPF (SO_ATTACH_REUSEPORT_EBPF) program
which defines how packets are…

Upendra Kumar
- 1
- 3
0
votes
0 answers
SO_REUSEADDR just make sense for server?
I am working with two binaries which use UDP sockets. Process A waits for messages on a UDP socket (IP_1:PORT_1) by select(), and process B eventually sends through an UDP socket.
By some constraints out of scope, process B needs to send by a socket…

Javi
- 1
- 4
0
votes
1 answer
SO_REUSEPORT and multiple listeners in the same thread
Background references...
https://lwn.net/Articles/542629/
https://blog.n0p.me/2018/02/2018-02-20-portsharding/
I'm curious how well this feature performs with multiple listeners on the same thread?
For example, suppose my server enforces a limit of…

user1715587
- 155
- 1
- 10
0
votes
1 answer
gRPC Java server with setReuseAddress(true)?
I am working on a gRPC server written in Java. It uses NettyServerBuilder to start/run the server. I am wondering, how to set setReuseAddress(true) for the server, so that it can restart quickly (either on crashes or maintenance restarts.)
This is…

JaM
- 549
- 4
- 15
0
votes
1 answer
how to connect to specific grpc server process under so_reuseport
I have multiple GRPC servers, all bounded to the same port using GRPC linux so_reuseport option.
This works great but for health checking I would like to iterate on all servers, one by one and identify unhealthy servers.
Because they are all have…

Lior Cohen
- 5,570
- 2
- 14
- 30
-1
votes
0 answers
SO_REUSEPORT on UDP is not working as expected when listening on same port from 2 different processes
I am very new to socket programming. I am trying to subscribe to (listen on) same port from 2 different processes. Not working as expected. I started two server programs on seperate windows and then started the client program. Only one server…

Preethi
- 43
- 9
-1
votes
2 answers
Not able to attach so_reuseport_cbpf in cpp
Below BPF prgram in cpp is throwing error when binding to udp socket using SO_ATTACH_REUSEPORT_CBPF
struct sock_filter code[] = {
{BPF_LD | BPF_MEM, 0, 0, 0x00000000}, // load memory to accumulator
//{BPF_ALU | BPF_ADD, 0, 0,…

Upendra Kumar
- 1
- 3