[Twisted-Python] Re: Perspective Broker and UDP, is it possible?
I'm doing my master thesis in computer science, and the topic for the project is "Managment of network delays in computer games". The software im going to use is Python with Twisted and Pygame. Right now I'm trying to get to know how different parts of Twisted interact with each other. And my first question is:
Is it possible to use Perspective Broker with UDP? I've tried modifying the examples here (http://www.twistedmatrix.com/documents/current/howto/pb-usage), with DatagramProtocol and so on, but I haven't got it to work. I suspect that it is impossible due to that UDPs is connectionless, but there's a lot of "magic" in Twisted, so I thought I'd better ask the pros'.
It is certainly possible, just not with the current version of PB. In any modified version (go for it!), I think you would need to provide client identifying info with each burst of data, or limit "connections" to just one client at a time per port, to keep track of things. I'm not a twisted expert, but I do use it extensively. I have also learned an embarrassingly large amount of stuff about low-level TCP/IP due to too much experience with a vastly inferior high-level language [1]. [1] http://tinyurl.com/5nrkp Ed Suominen Registered Patent Agent Open-Source Software Author (yes, both...) Web Site: http://www.eepatents.com
Ed Suominen wrote:
It is certainly possible, just not with the current version of PB. In any modified version (go for it!), I think you would need to provide client identifying info with each burst of data, or limit "connections" to just one client at a time per port, to keep track of things.
The UDP pseudoconnection can be identified by (srcIP,srcPort,dstIP,dstPort), so one server port can serve everything as long as all the clients use different source IP addresses or ports. To modify a protocol from TCP to UDP, you need to consider the things TCP used to provide you with: - reliability (resending, acknowledgement) - segmentation (long messages that will not fit a packet) - bandwidth estimation (no point in sending at 100% rate, as the internet connection will never be that fast) - antispoof (to fake TCP, you really need to be able to receive packets sent to the IP address you are spoofing; UDP with no extra checks can be spoofed blind) etc. Quite often, it's just not worth it to drop TCP. Especially when the problem at hand is _not_ tightly interconnected clusters in a secure and managed LAN, but WAN connections with untrusted parties over an untrusted network without guaranteed performance.
participants (2)
-
Ed Suominen
-
Tommi Virtanen