Here is another example and explaination:
My home e-smith box runs as a dialup gateway to the internet. It gets a dynamic IP assigned to it from the isp, eg 203.12.46.50, but I have an internal network which my personal computer lives on, it has an ip address of 192.168.0.77. The e-smith box is also on this internal network with IP address 192.168.0.254
now I play games on my pc, but I need port 12456 visible to the internet, so I go to my linux box, enter the port forwarding details as follows:
Protocol: TCP
External Port Number: 12456
Destination IP address: 192.168.0.77
Destination IP address: 12456
this means that any packet arriving at the e-smith box at port 12456 will get forwarded to port 12456 on my pc (ip address 192.168.0.77). So when the game is running, and my friends try to connect to me over the internet, they connect to me through my linux box.
The external port and destination port don't have to be the same. I could specify an external port of 8000 and a destination IP of 192.168.0.77 and destination port of 80 and run a web server on my pc (ip address 192.168.0.77) on port 80 and then whenever someone tries to access the web on my linux box on port 8000, it will actually go to my pc on port 80. Get it yet?
The different between UDP and TCP is this. They are simply two different protocols. Most applications use TCP. This is almost exclusively. Very few things use UDP. TCP stands for transmission control protocol. It's a protocol which ensures that if a packet is sent, it will arrive at the destination. UDP doesn't do this, so it's not as good, but the advantage of UDP is there is less overhead when transmitting packets. Usually, you'll be pretty safe using TCP since most things use this. It'll probably say somewhere if it is using UDP. just stick to TCP for now.
Hope this helps and makes sense.
- Andrew Gray