Vi t Virtual Environments: l E i t Networking Basics g Anthony Steed Anthony Steed Department of Computer Science Department of Computer Science University College London http://www.cs.ucl.ac.uk/teaching/VE
Introduction • Networks at the heart of networked VR • Many network protocols are out there M t k t l t th – TCP, UDP, multicast, RTP, etc – Choice based on needs C • Programming networking in XVR 2
Network properties • Latency (Round Trip Time) • Jitter Jitt • Bandwidth (Capacity) • Loss (Congestion, Reliability) 3
Internet Protocol - IP FTP SMTP DNS SNMP Application TCP UDP Transport Transport ICMP Internet Protocol IP IGMP G Data Link ARP/RARP Ethernet FDDI Ethernet, FDDI 4
Protocols: UDP Protocols: UDP • Connectionless – No state is maintained No state is maintained – No setup time – Light-weight Light weight Postal Service Postal Service • No Quality of Service – No guarantee delivery – No order delivery
TCP • Connection Oriented – State is maintained at routers – State is maintained at routers – Setup Handshake – Heavy-weight Heavy weight • Quality of Service – FIFO delivery – FIFO delivery – Flow Control – Error Recovery Error Recovery • Mechanisms – Timers Acknowledgements etc Timers, Acknowledgements, etc 6
7 Multicast WAN Broadcast WAN Multicast: Overview Multicast: Overview Unicast WAN
Multicast: Model Multicast: Model • UDP class D address – No physical meaning • Multicast is free on LANs M lti t i f LAN • An address defines a logical group • A sender is oblivious to receivers • Join/Leave operations Join/Leave operations • Tree Based Routing 8
Socket • End-point for communication • Network connections based on sockets N t k ti b d k t • Socket identified by – Host address – numeric or name – Port number • 0-1023 : well known services (e.g. http traffic on 80) • 1024-49151: registered ports (less well known) • 49152-65536: private applications or dynamic use 49152 65536: private applications or dynamic use 9
Socket communication Client Listener Needs to create a socket to connect to listening sockets t li t i k t Needs to create a socket N d t t k t to listen to incoming connection requests 10
The Client/Server logic Server Client C Create socket for listening t k t f li t i Create socket for incoming connections connecting to Server Listen Request connection Accept and create thread Send/Receive Send/Receive message message 11
XVR functions Server Client N tC NetCreateChannelTCP( ) t Ch lTCP( ) NetAcceptTCP ( ) NetConnectTCP( ) Accept and create thread NetSendToTCP() / NetSendToTCP() / NetReceiveFromTCP() NetReceiveFromTCP() 12
Recommend
More recommend