Setting the sender_ip of a UDP packet

Hi. I am writing some code and I want to send a request to server A from me sender A and for the server to respond to sender B (seperate computer). I would like to do this form the client side , I am wandering how I change the sender IP for a UDP packet if it can be done within java.

Forgive my comment on a question thread; I’ve not ever looked in to networking, but to me that seems like a security risk. Wouldn’t doing that allow for a random user to perform an action that affects another user?

You can’t do this with the java.net.* classes, obviously.

And also, this is the worst dos ‘trick’ ever. Your ISP will very likely not propagate such a packet anyway.

Those filthy hackers gotta be punished in some way!