Implementing UDP

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
apamment
Member
Member
Posts: 28
Joined: Thu Aug 20, 2015 9:02 pm
Contact:

Implementing UDP

Post by apamment »

Hi

I'm just starting to implement UDP on my OS, and I think I understand it correctly, I am just wondering what happens to the packets who are from addresses you don't recv_from. Does the tcp/ip stack just time them out and delete them after a little while? Or retain them in case you do a recv_from for that address later on? I imagine you wouldn't normally get random packets from internet addresses unless you were a server and expecting them or a client and someone was trying to do something sinister?

thanks..
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Implementing UDP

Post by Nable »

Either there is a listening application for this pair "destination address, port" and packet is added to queue (and dropped if there's no space left) or it's dropped immediately (if there's no such queue).
apamment
Member
Member
Posts: 28
Joined: Thu Aug 20, 2015 9:02 pm
Contact:

Re: Implementing UDP

Post by apamment »

Ok, thanks. I misunderstood recvfrom, I thought it only returned packets for a specific address, but it seems to return packets from any address with the address. So the application deals with packets from addresses it doesn't want.
Post Reply