For anyone having problems with their PS3 online, I recommend giving the PS3 a static ip address, use an ethernet cable instead of wireless, get a decent router instead of isp provided rubbish and put the PS3 into the DMZ of the router or forward ports on the router for the Playstation Network and each game that uses online features.
The DMZ is easier as it opens up all of the ports for the PS3 so you won't have to find the ports for any new games that you get. Note that with my router when using the DMZ I have problems with ip fragments so I cannot use it and I have not found a fix for it yet. I have to use port forwarding which does work as well as long as the correct ports are forwarded and done properly.
You should be able to find all of the ports that are needed here
http://portforward.com/ there is also a router list so if you find your router and then find your ports it will then bring up a guide in how to do it.
There are also other guides on here, if you can't find all what is mentioned above then google them as there are plenty of guides that can be found this way it is how I learned after having problems myself.
I also use opendns as my isp's servers are bad so this also fixed some of my problems, take a look here
http://www.opendns.com/. My whole network at home uses this but you can specifically assign it to the PS3 if you want to but I recommend using it for the whole network as it does benefit from it. All info on how to use it is on the site and you can sign up for free.