From what I know, (since I'm semi new to this as well) ddos attacks are illegal. They are targeted at a specific IP address and it attacks their router and completely cuts them off from the internet, for a specific amount of time. (I'm not sure if the specific amount of time part is optional, but who knows.) It can also have the router leak out information. I'm not sure what kind, but I'm guessing it is like private information such as where you were born, where you live, etc. I have a friend who knew how to ddos, though I don't think they ever did.
Some ways to gain someone's IP is by hacking into the server control system and checking there, Skype, or other forms of media that link one person's IP address to someone else's. My friend once asked how to find out their IP address, and my friend who knew how to ddos showed them the IPs.
You can put up defense for your router I believe, and I've heard you can take someone's ddos attack away from your own router and back at theirs.
At least, that's what another one of my friends have told me before. I'm not sure if it is illegal to defend yourself from ddos attacks, however it is illegal to send them, and possibly even threaten with them. As I said, I'm new to this too, so I only know a few basics and I'm not sure if it is all 100% true, so I'd like a notification on that as well. xD