DEV Community

Cover image for TCP and UDP did you ever use them directly?
Tobias Nickel
Tobias Nickel

Posted on

TCP and UDP did you ever use them directly?

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?

Latest comments (24)

Collapse
 
ricobrase profile image
Rico Brase

Yes. For our trainee, I developed a reference chat application (client + server) with it's own client <-> server communication protocol directly over TCP.

Collapse
 
kyorohiro profile image
kyorohiro (kiyohiro kawamura) • Edited

Yes. I have used udp and tcp to build a p2p network protocol like kademlia and upnp and bonjure for embedded system and a special repeater.
Basically, it uses several methods to establish a connection.

Besides that , I used for the server-side low-latency game library etc..

Collapse
 
slavius profile image
Slavius

I have developed a threaded TCP server for one project talking proprietary binary protocol. We received an IoT device that could only speak TCP (updating the code to support MQTT deemed too expensive as it was an 8bit ATMEL chip based solution with poor protocol support) and it didn't go very well. It turned out that sometimes the device decided randomly to insert PSH (TCP PUSH) flag to bigger packets that resulted in the TCP server trying to process data with the PSH flag immediately instead of waiting for the remaining split packet. This caused application errors because data was truncated and following packets were missing beginnings. After a week of debugging they could not find the problem let alone fix it so I had to implement higher level virtual packet reassembly in my TCP server to mitigate the issue. Luckily this device was soon replaced by one that speaks certified MQTT...

Collapse
 
kmistele profile image
Kyle Mistele

I do a lot of work in Cybersecurity, so I have on a couple occasions. I built a recursive β€˜whois’ resolver in golang since all the libraries I could find wrapped the Linux whois binary. I wrote that on top it TCP, since it’s a pretty simple protocol. I also wrote an SMB network scanner on top of TCP to concurrently scan an active directory domain for vulnerabilities and misconfigurations

Collapse
 
insanusmokrassar profile image
InsanusMokrassar

I've used it in one of mobile applications:) it was experience related to live streaming of android screen from PC into Android device to emulate powerful hardware on the weak smartphones/tabs:)

Collapse
 
recursivefaults profile image
Ryan Latta

It's been quite a long time, but I've used both from when I was working with some MMO games and the like.

Collapse
 
frankszendzielarz profile image
Frank Szendzielarz

Yes, UDP for Kademlia P2P implementations.

Collapse
 
darkwiiplayer profile image
π’ŽWii πŸ³οΈβ€βš§οΈ

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.

Collapse
 
razi91 profile image
jkonieczny

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.

Collapse
 
ecyrbe profile image
ecyrbe

Yes, i developped proprietary protocols for :

  • USB drivers over network
  • SIP protocol implementation with proprietary extensions
  • Reverse engineered Windows RDP protocol and reimplemented it for proprietary appliance
  • TCP like protocol over UDP with better slow start algoritms (i lot like http/3)

Others that are minor and that i forgot...

Collapse
 
kievandres profile image
Kiev Andres

cool! 😲

Collapse
 
bias profile image
Tobias Nickel

this sounds like some cool stuff. thanks for sharing