|
|
Home // Tutorials/Guides // Research Ponders Theories // Programs // Services // Misc // Forums // Links // Contacting Me |
| UDP Protocol The UDP protocol is a protocol supported by Winsock that is very useful for making things communicate without technical arraying code. The UDP protocol doesn't use 'Keep-Alive' connections, but instead only supports sending & receiving packets, but another great feature is 'Broadcast'. What Broadcast is is a way for a UDP socket to send a message to ALL other UDP sockets on the same port specified on that socket. UDP Broadcast is used by setting the RemoteHost to 255.255.255.255 (naturally this address is uninhabitable). UDP also has the downside that there is no way of telling if a packet made it or even if the host is online. Because UDP can do Broadcasts a lot of multiplayer games use it (at least for listing games) so that clients don't have to array thousands of TCP sockets (which would take lots of time and memory) and can just send out a Broadcast packet. Some other good things about UDP is it is very easy to use to make 'Server-less' applications, by making all of the instances 'Bind' (same as TCP term listen, basically, but more than 1 application can bind on the same port) to the same port, and new instances do a Broadcast to find other 'nodes' (Basically a node is mini server used to route minimal traffic) and wait for the other nodes to respond so the application can remember the nodes host. UDP is also useful because packets don't stick (Join when sent too quickly after the previous send) and you can send so many packets so fast. UDP connections are harder to trace than TCP connections because the connection is not constant, but for a matter of milliseconds, making it barely traceable except by the host. Because more than one application can be bound (Binded to) a UDP port it is also easier to 'sniff packets'. Most programs use TCP for communication at this stage as it is more reliable (and, always will be) and all errors are seen by the socket, if apparent. TCP is used by all major services such as HTTP, FTP, Telnet, Messenger, and a lot of other instant messaging and file sharing services such as 'AIM' and 'Winnap'. A good example of a server-less UDP application is 'UDPChat', written by LFI.net developers, available on Planet-Source-Code or in the "Programs" section. |
Copyright 2004-2005 LFI.net - Generated by Template It Build 4
Best viewed at 1024x768 in a standards-compliant browser