UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2016-10-14 04:48 AM

nobita_it
Member
Registered: 2016-10-14
Posts: 4

Server cannot receive data on centos 6.6

Hi all,
I have a problem when I send data from server use centos 6.6
Now I have two server:
- Server A: (have udp port range : 20000->30000), and run long time and reuse port and connect with many server.
- Server B: run long time send and receive with many server
Two server use bonding (active-standby), on day server A open port UDP (21533) send to server B but server B not receive data. But server A send another UDP then server B received. I do'nt know why server B not receive data with source port 21533???? And I capture tcpdump on server A, I saw packet with source port 21533 sent.
What is problem?
Please help me!!
Thanks!

Offline

#2 2016-10-14 12:00 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Server cannot receive data on centos 6.6

Well, the basic problem sounds like the use of UDP, which is unreliable and not guaranteed to make it to its destination...  Any little temporary network issue could cause the packet to be dropped somewhere enroute...  As for what the actual issue was that caused the drop, there's probably no way to know at this point...

Offline

#3 2016-10-17 02:08 AM

nobita_it
Member
Registered: 2016-10-14
Posts: 4

Re: Server cannot receive data on centos 6.6

Thank RobSeace,
But when I send UDP packet by raw socket, server B received.
I don't know why, I use same "sendto" function???

Offline

#4 2016-10-17 11:26 AM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Server cannot receive data on centos 6.6

So, now you're saying you NEVER receive any packets send via normal UDP, but do receive them if sent via raw socket?  I thought from your initial description that it was just one missed packet, which could be explained by temporary network issues...  And, just because the same network issues never popped up when you tested the raw socket, you wouldn't see the drop there...  But, the fact remains that UDP (whether sent normally or via raw socket) is an unreliable protocol, so you have to expect some packets may never make it...

Offline

#5 2016-10-17 12:08 PM

nobita_it
Member
Registered: 2016-10-14
Posts: 4

Re: Server cannot receive data on centos 6.6

No, normally I still send udp packet with os but I run my app about 2 months (each port reused and many traffic) then now I sent out udp packet (source port 21533) but server B not received yet.

Offline

#6 2016-10-17 06:24 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Server cannot receive data on centos 6.6

Had you previously successfully sent and received a packet using that same source port (and to the same destination port) before?  If so, then it was probably just temporary network issues of some sort and the packet got dropped somewhere enroute...  If you haven't been able to ever successfully send and receive using those same ports, then it's possible it might be a firewall somewhere in between the servers blocking it...

Offline

#7 2016-10-24 09:23 AM

nobita_it
Member
Registered: 2016-10-14
Posts: 4

Re: Server cannot receive data on centos 6.6

Thank RobSeace,
I and have a last question for you, I hope you can help me.
I send packet by udp and tcp to server, but server not receives udp packet, server only received  tcp packet?
Where is the problem?
Thanks!

Offline

#8 2016-10-24 11:47 AM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Server cannot receive data on centos 6.6

Your question is too vague to guess what the problem is...  But, as I said, UDP is unreliable, so any network problems anywhere enroute between source and destination will cause it to be dropped and lost...  TCP will automatically retry sending of lost packets, which will work around temporary network flakiness...

But, if the UDP packet NEVER arrives when sent, then something else is probably going on, like a firewall somewhere enroute blocking it...

Offline

Board footer

Powered by FluxBB