Actually there is no "very simple" udp netcode. The reason why is: UDP is a very basic transmission method. It has no error checks and is not packet oriented etc. It's like a wire in space, nothing more, and the whole transfer protocol must be coded by the programmer, eg. morse or something.
So a Multiplayer netcode may contain 2 parts: the UDP netcode that handles the game between the players, and some TCP code that is connecting to a webserver that stores all neccessary infos to allow people to join the game. So imagine on www.DCs_game.com there could be gnet running, or maybe something you used to write by your own (probably using Gnet as basement). A player will connect to the webserver, receive the IP of the UDP game server, what ports are used, what people are already there, how long the game is already running etc etc.
Then he may join the game as a client. The game (udp) host will then update the infos on the webserver.
Let's have a look at the UDP part only. First you have to design a packet system. Every packet should contain a purpose ID, a sequence number and an encrypted integrity checksum. These numbers should be part of the header.
The purpose ID allows the receiver to decide how to use the packet, examples: a join-request packet, a player-data packet, a player leaving packet, a chat packet...
The sequence number allows the receiver to detect missing packets. So when he receives packet 24 and then packet 26, he should send a reorder-packet that asks for packet 25.
The integrity checksum is a checksum of the rest of the packet and allows to compare a checksum that is created locally to be compared with it. If the 2 checksums are not the same, there must be some error in the packet and it should be reordered as well.
Probably the header should also contain information about the packet lenght.
Then there should be acknowledge packets that are used as a handshake, after a successfully delivered packet. These ack packets are the only packets that don't need an ack packet (because this would result in an endless loop of ack packets)
The whole "player join, add to list" etc. logic should be coded by the programmer, as well as all other things, like chat packets and so on. I even added a host-takeover packet that allows the host to quit the game without to end the game. In this case, the player with the next best ping will become the new game host automaticly. This requires a randomly created password that is handed over during the host takeover.
You see, there is no very easy netcode. Depending on the situation, you maybe should try one of the existing libs, like BlitzPlay or so.
BTW. when you connect to a webserver, this may pause the game if you wait for the answer of the webserver. Instead you should simply send the infos to the webserver and then close the stream.
Ehrm - maybe your question wasn't about all this stuff, but simply on how to make UDP work at all. Also make sure if there's a router between the machines, they may alter the port numbers, see this thread:
http://www.blitzbasic.com/Community/posts.php?topic=68202