BrickNet (contd) BrickNet (contd) Other Academic Projects Other - - PDF document

bricknet cont d bricknet cont d other academic projects
SMART_READER_LITE
LIVE PREVIEW

BrickNet (contd) BrickNet (contd) Other Academic Projects Other - - PDF document

Special Course on Networked Virtual January 29, 2004 Environments BrickNet (contd) BrickNet (contd) Other Academic Projects Other Academic Projects Object Object- -request brokers on request brokers on MASSIVE MASSIVE


slide-1
SLIDE 1

Special Course on Networked Virtual Environments January 29, 2004 Jouni Smed 1

BrickNet BrickNet (cont’d) (cont’d)

  • Object

Object-

  • request brokers on

request brokers on the servers the servers

  • Aimed for collaborative

Aimed for collaborative design environments design environments

  • each node is responsible for

each node is responsible for its part of design and for its part of design and for sharing that information sharing that information

  • Also, networked games,

Also, networked games, groupware groupware systems, systems, concurrent engineering concurrent engineering systems, and other systems, and other asynchronous, network asynchronous, network-

  • based graphics environments

based graphics environments

S1 S1 S3 S3 S2 S2 Server Server Communication Communication

Other Academic Projects Other Academic Projects

  • MASSIVE

MASSIVE

  • different interaction media: graphics, audio and text

different interaction media: graphics, audio and text

  • awareness

awareness-

  • based filtering: each entity expresses a focus and nimbus for ea

based filtering: each entity expresses a focus and nimbus for each ch medium medium

  • Distributed Worlds Transfer and Communication Protocol (DWTP)

Distributed Worlds Transfer and Communication Protocol (DWTP)

  • each object can specify whether a particular event requires a re

each object can specify whether a particular event requires a reliable liable distribution and what is the event’s maximum update frequency distribution and what is the event’s maximum update frequency

  • Real

Real-

  • Time Transport Protocol (RTP/I)

Time Transport Protocol (RTP/I)

  • ensures that all application instances look as if all operations

ensures that all application instances look as if all operations have been have been executed in the same order executed in the same order

  • Synchronous Collaboration Transport Protocol (SCTP)

Synchronous Collaboration Transport Protocol (SCTP)

  • collaboration on closely coupled, highly synchronized tasks

collaboration on closely coupled, highly synchronized tasks

  • the interaction stream has critical messages (especially the las

the interaction stream has critical messages (especially the last one) which are t one) which are sent reliably, while the rest are sent by best effort transport sent reliably, while the rest are sent by best effort transport

Networked Demos and Games Networked Demos and Games

  • SGI

SGI Flight Flight

  • 3D aeroplane simulator demo

3D aeroplane simulator demo for Silicon for Silicon Graphics workstation, Graphics workstation, 1983 1983– – 84 84

  • serial

serial cable between two workstations cable between two workstations

  • Ethernet network

Ethernet network

  • users could see each other’s planes, but no

users could see each other’s planes, but no interaction interaction

  • SGI

SGI Dogfight Dogfight

  • modification of

modification of Flight Flight, 1985 , 1985

  • interaction by shooting

interaction by shooting

  • packets were transmitted at frame

packets were transmitted at frame rate → clogged rate → clogged the network the network

  • limited up

limited up to ten players to ten players

Networked Networked Games: Games: Doom Doom

  • id Software, 1993

id Software, 1993

  • First

First-

  • person

person shooter shooter (FPS) (FPS) for PCs for PCs

  • Part of the game was

Part of the game was released as shareware released as shareware in in 1993 1993

  • extremely popular

extremely popular

  • created a gamut of variants

created a gamut of variants

  • Flooded LANs with packets

Flooded LANs with packets at frame rate at frame rate

Networked Games: ‘First Generation’ Networked Games: ‘First Generation’

  • Peer

Peer-

  • to

to-

  • peer architectures

peer architectures

  • each participating computer is an equal to every other

each participating computer is an equal to every other

  • inputs and outputs are synchronized

inputs and outputs are synchronized

  • each computer executes the same code on the same set of data

each computer executes the same code on the same set of data

  • Advantages:

Advantages:

  • determinism ensures that each player has the same virtual enviro

determinism ensures that each player has the same virtual environment nment

  • relatively simple to implement

relatively simple to implement

  • Problems:

Problems:

  • persistency: players cannot join and leave the game at will

persistency: players cannot join and leave the game at will

  • scalability: network traffic explodes with more players

scalability: network traffic explodes with more players

  • reliability: coping with communication failures

reliability: coping with communication failures

  • security: too easy to cheat

security: too easy to cheat

Networked Games: ‘Second Generation’ Networked Games: ‘Second Generation’

  • Client

Client-

  • server architectures

server architectures

  • ne computer (a server) keeps the game state and makes decisions
  • ne computer (a server) keeps the game state and makes decisions on
  • n

updates updates

  • clients convey players’ input and display the appropriate output

clients convey players’ input and display the appropriate output but do but do not inlude (much) game logic not inlude (much) game logic

  • Advantages:

Advantages:

  • generates less network traffic

generates less network traffic

  • supports more players

supports more players

  • allows persistent virtual worlds

allows persistent virtual worlds

  • Problems:

Problems:

  • responsiveness: what if the connection to the server is slow or

responsiveness: what if the connection to the server is slow or the the server gets overburdened? server gets overburdened?

  • security: server authority abuse, client authority abuse

security: server authority abuse, client authority abuse

slide-2
SLIDE 2

Special Course on Networked Virtual Environments January 29, 2004 Jouni Smed 2

Networked Games: ‘Third Generation’ Networked Games: ‘Third Generation’

  • Client

Client-

  • server architecture with prediction algorithms

server architecture with prediction algorithms

  • clients use dead reckoning

clients use dead reckoning

  • Advantages:

Advantages:

  • reduces the network traffic further

reduces the network traffic further

  • copes with higher latencies and packet delivery failures

copes with higher latencies and packet delivery failures

  • Problems:

Problems:

  • consistency: if there is no unequivocal game state,

consistency: if there is no unequivocal game state, how to solve how to solve conflicts as they arise? conflicts as they arise?

  • security: packet interception, look

security: packet interception, look-

  • ahead cheating

ahead cheating

Networked Games: ‘Fourth Generation’ Networked Games: ‘Fourth Generation’

  • Generalized client

Generalized client-

  • server architecture

server architecture

  • the game state is stored in a server

the game state is stored in a server

  • clients maintain a subset of the game state locally to reduce

clients maintain a subset of the game state locally to reduce communication communication

  • Advantages:

Advantages:

  • traffic between the server and the clients is reduced

traffic between the server and the clients is reduced

  • clients can response more promptly

clients can response more promptly

  • Problems:

Problems:

  • boundaries: what data is kept locally in the client?

boundaries: what data is kept locally in the client?

  • updating: does the subset of game state change over time?

updating: does the subset of game state change over time?

  • consistency: how to solve conflicts as they occur?

consistency: how to solve conflicts as they occur?

Networked Games: Networked Games: ARQuake ARQuake

  • School of Computer and

School of Computer and Information Science, University of Information Science, University of South Australia South Australia

  • augmented reality version of

augmented reality version of Quake Quake: walk around in the real : walk around in the real world and play world and play Quake Quake against against virtual monsters virtual monsters

  • components

components

  • head mounted display

head mounted display

  • mobile computer

mobile computer

  • head tracker

head tracker

  • GPS system

GPS system

Massive Multiplayer Online Games Massive Multiplayer Online Games

N N/

/A

A

2003 2003 LucasArts LucasArts Star Wars Galaxies Star Wars Galaxies 97,000 97,000 2002 2002 Electronic Arts Electronic Arts Sims Online Sims Online 250,000 250,000 2001 2001 Sierra Studios Sierra Studios Dark Age of Dark Age of Camelot Camelot

N N/

/A

A

1999 1999 Microsoft Microsoft Asheron’s Call Asheron’s Call 430,000 430,000 1999 1999 Sony Entertainment Sony Entertainment EverQuest EverQuest 250,000 250,000 1997 1997 Origin Systems Origin Systems Ultima Online Ultima Online Subscribers Released Publisher Name

source: source: ht t p: / / www. m m

  • r pg. com

ht t p: / / www. m m

  • r pg. com

§3 Networking §3 Networking

  • Data transfer

Data transfer

  • latency

latency

  • bandwidth

bandwidth

  • reliability

reliability

  • protocol

protocol

  • Internet protocols

Internet protocols

  • TCP, UDP

TCP, UDP

  • unicast, broadcast, multicast

unicast, broadcast, multicast

  • Communication architectures

Communication architectures

  • peer

peer-

  • to

to-

  • peer

peer

  • client

client-

  • server

server

Fundamentals of Data Transfer 1 (3) Fundamentals of Data Transfer 1 (3)

  • Network latency

Network latency

  • network delay

network delay

  • the amount of time required to transfer

the amount of time required to transfer a bit of data from one point to another a bit of data from one point to another

  • ne
  • ne of
  • f the biggest challenges:

the biggest challenges:

  • impacts directly the realism of the

impacts directly the realism of the NVE experience NVE experience

  • we

we cannot cannot much much to reduce it to reduce it

  • rigins
  • rigins
  • speed

speed-

  • of
  • f-
  • light delay

light delay

  • endpoint computers, network

endpoint computers, network hardware, operating systems hardware, operating systems

  • the network

the network itself, routers itself, routers

slide-3
SLIDE 3

Special Course on Networked Virtual Environments January 29, 2004 Jouni Smed 3

Fundamentals of Data Transfer 2 (3) Fundamentals of Data Transfer 2 (3)

  • Network bandwidth

Network bandwidth

  • the rate

the rate at which at which the network can the network can deliver data to the destination host deliver data to the destination host (bits per second, (bits per second, bps) bps)

  • Network reliability

Network reliability

  • a measure of how much data is lost by

a measure of how much data is lost by the network during the journey from the network during the journey from source to destination host source to destination host

  • types of data loss:

types of data loss:

  • dropping: the

dropping: the data does not arrive data does not arrive

  • corruption: the

corruption: the content has been content has been changed changed

Fundamentals of Data Transfer 3 (3) Fundamentals of Data Transfer 3 (3)

  • Network protocol

Network protocol

  • a

a set of rules that two set of rules that two applications use to communicate applications use to communicate with each with each other

  • ther
  • packet formats

packet formats

  • understanding what the other

understanding what the other endpoint is saying endpoint is saying

  • packet semantics

packet semantics

  • what the recipient can

what the recipient can assume assume when it receives a packet when it receives a packet

  • error

error behaviour behaviour

  • what to do

what to do if (when) if (when) something something goes wrong goes wrong

Network Communication Network Communication

Bandwidth Bandwidth Protocol Protocol Latency Latency Reliability Reliability

The BSD Sockets Architecture The BSD Sockets Architecture

  • A

A socket is a software socket is a software representation of the endpoint to a representation of the endpoint to a communication channel communication channel

  • Reliable/unreliable

Reliable/unreliable communication, single/multiple communication, single/multiple destinations, etc. destinations, etc.

  • Includes several pieces of

Includes several pieces of information, information, such as such as

  • protocol

protocol

  • destination host and port

destination host and port

  • source host and port

source host and port BSD = Berkeley Software Distribution BSD = Berkeley Software Distribution Ports Ports Sockets Sockets

Application 2 Application 2 Application 1 Application 1 TCP TCP UDP UDP

Other Other protocols protocols

Internet Protocol Internet Protocol

Application B Application B Application A Application A TCP TCP UDP UDP

Other Other protocols protocols

Internet Protocol Internet Protocol

Sockets in Java Sockets in Java

  • Networking related classes are in the package

Networking related classes are in the package j ava. net j ava. net

  • IP addresses are handled with the

IP addresses are handled with the I net Addr ess I net Addr ess class class

  • Creation (note: no constructor):

Creation (note: no constructor): I net Addr ess I net Addr ess addr ess addr ess = = I net Addr ess I net Addr ess. get ByNam e( . get ByNam e( address address) ; ) ;

  • Parameter

Parameter address address

  • in DNS format

in DNS format ( (" st af f . cs. ut u. f i " " st af f . cs. ut u. f i " ) )

  • as an IP number

as an IP number ( (" 139. 232. 75. 8" " 139. 232. 75. 8" ) )

  • nul l

nul l nul l nul l (= (= " l ocal host " " l ocal host " = = " " 127. 0. 0. 1"

  • 127. 0. 0. 1" )

)

  • Port numbers 1

Port numbers 1– –1024 are reserved 1024 are reserved

  • Socket types:

Socket types:

  • Ser ver Socket

Ser ver Socket : handles connection requests directed to a given port : handles connection requests directed to a given port

  • Socket

Socket : actual socket which handles the communication : actual socket which handles the communication

Socket Example: The Code Socket Example: The Code

Server Server

Ser ver Socket Ser ver Socket s = s = ne new ne new Ser ver Socket Ser ver Socket ( PO RT) ; ( PO RT) ; t r y t r y t r y t r y { { Socket Socket socket socket = s. accept ( ) ; = s. accept ( ) ; t r y t r y t r y t r y { { / / / / Use t he socket . Use t he socket . } } cat ch cat ch cat ch cat ch ( ( I O Except i on I O Except i on e) { e) { / / Tr ansf er f ai l ed. / / Tr ansf er f ai l ed. } } f i nal l y f i nal l y f i nal l y f i nal l y { { socket . cl ose( ) ; socket . cl ose( ) ; } } } } cat ch cat ch cat ch cat ch ( ( I O Except i on I O Except i on e) { e) { / / Connect i on f ai l ed. / / Connect i on f ai l ed. } } f i nal l y f i nal l y f i nal l y f i nal l y { {

  • s. cl ose( ) ;
  • s. cl ose( ) ;

} }

Client Client

t r y t r y t r y t r y { { Socket Socket socket = socket = new new new new Socket Socket ( addr ess, PO RT) ; ( addr ess, PO RT) ; t r t r y t r t r y { { / / Use t he socket . / / Use t he socket . } } cat ch cat ch cat ch cat ch ( ( I O Except i on I O Except i on e) { e) { / / Tr ansf er f ai l ed. / / Tr ansf er f ai l ed. } } f i nal l y f i nal l y f i nal l y f i nal l y { { socket . cl ose( ) ; socket . cl ose( ) ; } } } } cat ch cat ch cat ch cat ch ( ( I O Except i on I O Except i on e) { e) { / / Connect i on f ai l ed. / / Connect i on f ai l ed. } }

slide-4
SLIDE 4

Special Course on Networked Virtual Environments January 29, 2004 Jouni Smed 4

Socket Example: What Happens Socket Example: What Happens

  • Server creates

Server creates Ser ver Socket Ser ver Socket which begins to listen to the given which begins to listen to the given port port

  • The execution halts in the

The execution halts in the accept accept method call, until there is a method call, until there is a connection request connection request

  • Client creates

Client creates Socket Socket with the with the server’s address and the port number server’s address and the port number

  • f the server socket
  • f the server socket
  • Client’s socket sends a connection

Client’s socket sends a connection request request

  • Server socket answers the reqest by

Server socket answers the reqest by creating creating Socket Socket to to any any available port available port

  • Server socket sends the port number

Server socket sends the port number

  • f the new socket to the client
  • f the new socket to the client
  • Client’s socket connects to the new

Client’s socket connects to the new socket socket

  • In the client, the socket’s constructor

In the client, the socket’s constructor finishes finishes

  • In the server, the

In the server, the accept accept method method returns the new socket. returns the new socket.

server server

port port

client client

connection connection request request

server server

port port

client client

connection connection port port port port

Using Streams with Sockets Using Streams with Sockets

  • Input stream:

Input stream: Buf f er edReader Buf f er edReader i n = i n = new new new new Buf f er edReader Buf f er edReader ( ( new new new new I nput St r eam Reader I nput St r eam Reader ( ( socket . socket . get I nput St r ea get I nput St r eam ( ) m ( ) socket . socket . get I nput St r ea get I nput St r eam ( ) m ( ) ) ) ; ) ) ;

  • Output stream:

Output stream: Pr i nt W r i t er Pr i nt W r i t er

  • ut =
  • ut =

new new new new Pr i nt W r i t er Pr i nt W r i t er ( ( new new new new Buf f er edW r i t er Buf f er edW r i t er ( ( new new new new O ut put St r eam W r i t er O ut put St r eam W r i t er ( ( socket . socket . get O ut put St r e get O ut put St r eam ( ) am ( ) socket . socket . get O ut put St r e get O ut put St r eam ( ) am ( ) ) ) , ) ) , t r ue t r ue t r ue t r ue) ; ) ;

  • Reading and writing as normal:

Reading and writing as normal:

  • ut . pr i nt l n( " f oo" ) ;
  • ut . pr i nt l n( " f oo" ) ;
  • St r i ng

St r i ng s = i n. r eadLi ne( ) ; s = i n. r eadLi ne( ) ;

  • Streams use TCP, which is reliable but slow

Streams use TCP, which is reliable but slow