Did you ever had a project where you used lower level protocols directly?
Usually we use http(s), a lib like grpc or service SDKs such as for databases.
But did you ever build an app that use tcp or udp directly or define your own protocol on top of them?
Oldest comments (24)
Never 😬
yes that is what I expected.
can all others like @itsjzt comment if you never used UDP and TCP?
I have used for port forwarding kind of. So every time I create a new application in our dev server, I have to open the port using TCP and UDP and default port 80 is used by another application.
At the time of warcraft3 I opened portforwarding on my router as well, to be able to open maps myself. Is that what you mean?
you say port 80, did you want to access a local webservice from remote?
So our main application is using the default port 8080 and hosted in IIS so that we can use the url from remote without passing the port. but if I have to deploy any other application with let's say with port 5000, I have to use UDP and TCP to open the port so that I can access the service from the remote.
Not since network lab in college.
personally I never used them directly productive. professional or private.
But I never get over doing some experiments. such as an http server using the node.js net(tcp) module . Or implementing a primitive
RPClibrary.While it worked and was fun to develop, I would not want to use it seriously.
I've used UDP before. We were experimenting on how Dos works(for educational purposes).
So when using TCP for Dos attacks the sender of the attack also gets hit with a traffic of response. So if you send 1m requests you also receive 1m responses. This becomes a resource fight not an attack. That's why mostly attacks are performed with multiple computers(DDos) so that the senders won't be hurt since it's collective.
But with UDP the requests are one-way. No response. hence might be efficient here but the problem with it is you don't seem to know whether the packet was successfully delivered.
Above was an educational research with my friends. Thanks
Yes, I am very interested actually in defending from attacks, and the best is to know and understand how attackers can work.
With Udp you mostly can only go for some network services right? the webserver is tcp so just drop the messages.
I was wondering if I could not send a response to an attacker with my node.js web server (not even the tcp termination). But it would also keep the connection open on my side as well. When closing in any way, the attacker get an 'end' package.
You do not do this at application level, so not with nodeJs.
DDOS detection/protection can be implemented at Kernel level with IPTables : javapipe.com/blog/iptables-ddos-pr...
UDP can get very nasty when it comes to DDoS. You can use so called amplification attack to DDoS servers/infrastructure. The fact that UDP is stateless means, compared to TCP, that no prior connection establishment is needed to force the remote end to processes received UDP data packets. In a firewall you can define rules that all TCP packets that did not follow an already established connection (called in TCP a 3-way handshake) can be dropped immediately.
Let's get back to the amplification. By finding a misconfigured DNS server that responds with large data (DNS UDP packet can be up to 4096 bytes large), e. g. sending a full DNS zone response with lots of DNSSec keys you can craft very small UDP DNS request that pretends to come from your victim's public IP address to the misconfigured DNS server which will happily send the response to the victim due to lack of state establishment in UDP. If you'd try this with TCP you'd have to first send SYN packet, and then respond with SYN/ACK (acknowledgement) from remote end, followed by another ACK packet to the server before being able to send/request real data packets. Since you faked the victim IP address a server would send SYN/ACK to the victim resulting in the victim to drop the packet since it never initiated the connection in the first place followed by the server closing the connection soon after due to lack of response to the handshake. This is not the case for UDP though so in one packet with few bytes forming a request you can force misconfigured server to send large response to the victim without any validation - hence the name "amplification".
Exactly, it works for some services.
Yes, i developped proprietary protocols for :
Others that are minor and that i forgot...
this sounds like some cool stuff. thanks for sharing
cool! 😲
I was working on a project that includes a hardware device based on STM32. I had to use bare TCP connection with app written in electron to make communication possible. It was simple protocol based on simple frames with headers describing what is sent.
Nothing big, but several small tools that use UDP, like (abandoned) a linux client for battleye rcon, a simple protocol for controlling LEDs (switched to MQTT instead) and probably more stuff that I can't remember.
Yes, UDP for Kademlia P2P implementations.
It's been quite a long time, but I've used both from when I was working with some MMO games and the like.