• Ei tuloksia

Object- Object -request brokers on request brokers on the servers

N/A
N/A
Info
Lataa
Protected

Academic year: 2022

Jaa "Object- Object -request brokers on request brokers on the servers"

Copied!
10
0
0

Kokoteksti

(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

‹

‹ MASSIVEMASSIVE

™™ different interaction media: graphics, audio and textdifferent interaction media: graphics, audio and text

™

™ awareness-awareness-based filtering: each entity expresses a focus and nimbus for eabased 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 reliable each object can specify whether a particular event requires a reliable 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 operationsensures that all application instances look as if all operationshave 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 taskscollaboration on closely coupled, highly synchronized tasks

™™ the interaction stream has critical messages (especially the last one) which are the interaction stream has critical messages (especially the last 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

(2)

Networked Demos and Games Networked Demos and Games

‹‹

SGI Flight SGI Flight

™

™ 3D aeroplane simulator demo3D aeroplane simulator demofor Siliconfor SiliconGraphics workstation, Graphics workstation, 19831983–– 8484

~

~serialserialcable between two workstationscable between two workstations

~~Ethernet networkEthernet network

~

~users could see each other’s planes, but no users could see each other’s planes, but no interactioninteraction

‹‹

SGI Dogfight SGI Dogfight

™

™ modification of Flightmodification of Flight, 1985, 1985

™™interaction by shootinginteraction by shooting

™

™ packets were transmitted at frame rate → cloggedpackets were transmitted at frame rate → cloggedthe networkthe network

™™limited uplimited upto ten playersto 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 popularextremely popular

™™created a gamut of variantscreated a gamut of variants

‹‹

Flooded LANs with packets Flooded LANs with packets at frame rate

at frame rate

(3)

Networked Games: ‘First Generation’

Networked Games: ‘First Generation’

‹‹

Peer- Peer -to to- -peer architectures peer architectures

™

™ each participating computer is an equal to every othereach participating computer is an equal to every other

™™inputs and outputs are synchronizedinputs and outputs are synchronized

™

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

‹

‹

Advantages: Advantages:

™™determinism ensures that each player has the same virtual environmentdeterminism ensures that each player has the same virtual environment

™

™ relatively simple to implementrelatively simple to implement

‹

‹

Problems: Problems:

™™persistency: players cannot join and leave the game at willpersistency: players cannot join and leave the game at will

™

™ scalability: network traffic explodes with more playersscalability: network traffic explodes with more players

™™reliability: coping with communication failuresreliability: coping with communication failures

™

™ security: too easy to cheatsecurity: too easy to cheat

Networked Games: ‘Second Generation’

Networked Games: ‘Second Generation’

‹‹

Client- Client -server architectures server architectures

™™one computer (a server) keeps the game state and makes decisionsone computer (a server) keeps the game state and makes decisionson on updates

updates

™

™ clients convey players’ input and display the appropriate outputclients convey players’ input and display the appropriate outputbut 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 playerssupports more players

™

™ allows persistent virtual worldsallows persistent virtual worlds

‹

‹

Problems: Problems:

™

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

server gets overburdened?

™

™ security: server authority abuse, client authority abusesecurity: server authority abuse, client authority abuse

(4)

Networked Games: ‘Third Generation’

Networked Games: ‘Third Generation’

‹‹

Client- Client -server architecture with prediction algorithms server architecture with prediction algorithms

™

™ clients use dead reckoningclients use dead reckoning

‹

‹

Advantages: Advantages:

™™reduces the network traffic furtherreduces the network traffic further

™

™ copes with higher latencies and packet delivery failurescopes with higher latencies and packet delivery failures

‹

‹

Problems: Problems:

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

conflicts as they arise?

™

™ security: packet interception, look-security: packet interception, look-ahead cheatingahead cheating

Networked Games: ‘Fourth Generation’

Networked Games: ‘Fourth Generation’

‹‹

Generalized client- Generalized client -server architecture server architecture

™™the game state is stored in a serverthe 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 reducedtraffic between the server and the clients is reduced

™™clients can response more promptlyclients 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?

(5)

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 QuakeQuakeagainst against virtual monsters

virtual monsters

‹‹componentscomponents

™

™ head mounted displayhead mounted display

™™ mobile computer mobile computer

™

™ head trackerhead tracker

™™ GPS system GPS system

Massive Multiplayer Online Games Massive Multiplayer Online Games

NN//AA

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 20012001

Sierra Studios Sierra Studios Dark Age of

Dark Age of Camelot Camelot

N N//AA

19991999 Microsoft

Microsoft Asheron’s Call

Asheron’s Call

430,000 430,000 19991999

Sony Entertainment Sony Entertainment EverQuest

EverQuest

250,000 250,000 19971997

Origin Systems Origin Systems Ultima Online

Ultima Online

Subscribers Released

Publisher Name

(6)

§3 Networking

§3 Networking

‹‹

Data transfer Data transfer

™

™ latencylatency

™™bandwidthbandwidth

™

™ reliabilityreliability

™™protocolprotocol

‹‹

Internet protocols Internet protocols

™

™ TCP, UDPTCP, UDP

™™unicast, broadcast, multicastunicast, broadcast, multicast

‹‹

Communication architectures Communication architectures

™

™ peer-peer-toto--peerpeer

™™client-client-serverserver

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

‹‹

Network latency Network latency

™™network delaynetwork 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

™

™ one ofone ofthe biggest challenges:the biggest challenges:

~

~impacts directly the realism of the impacts directly the realism of the NVE experience

NVE experience

~~we we cannotcannotmuchmuchto reduce itto reduce it

™™originsorigins

~~speedspeed--ofof--light delaylight delay

~

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

~

~the networkthe networkitself, routersitself, routers

(7)

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

‹‹

Network bandwidth Network bandwidth

™

™ the rate at whichthe rate at whichthe 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: thedropping: thedata does not arrivedata does not arrive

~

~corruption: thecorruption: thecontent 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 other

™

™

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 behaviour error behaviour

~

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

goes wrong

(8)

Network Communication Network Communication

Bandwidth Bandwidth

Protocol Protocol Latency

Latency

Reliability Reliability

The BSD Sockets Architecture The BSD Sockets Architecture

‹

‹ AAsocket 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 assuch as

™

™ protocolprotocol

™

™ destination host and portdestination host and port

™™ source host and portsource host and port

BSD = Berkeley Software DistributionBSD = Berkeley Software Distribution

Ports Ports Sockets Sockets

Application 2 Application 2

Application 1 Application 1

TCP TCP UDP UDP

protocolsprotocolsOther Other

Internet Protocol Internet Protocol

Application B Application B

Application A Application A

TCPTCP UDPUDP protocolsprotocolsOther Other

(9)

Sockets in Java Sockets in Java

‹

‹ Networking related classes are in the package java.netNetworking related classes are in the package java.net

‹

‹ IP addresses are handled with the InetAddressIP addresses are handled with the InetAddressclassclass

™™ Creation (note: no constructor):Creation (note: no constructor):

InetAddress

InetAddress addressaddress = InetAddress= InetAddress.getByName(.getByName(addressaddress););

™

™ Parameter addressParameter address

~

~in DNS formatin DNS format(("staff.cs.utu.fi""staff.cs.utu.fi"))

~

~as an IP numberas an IP number("139.232.75.8"("139.232.75.8") )

~

~nullnull(= (= "localhost""localhost"= = ""127.0.0.1"127.0.0.1"))

‹

‹ Port numbers 1–Port numbers 1–1024 are reserved1024 are reserved

‹‹ Socket types:Socket types:

™™ ServerSocket: handles connection requests directed to a given portServerSocket: handles connection requests directed to a given port

™

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

Socket Example: The Code Socket Example: The Code

Server Server

ServerSocket ServerSocket s = s =

new

new ServerSocketServerSocket(PORT);(PORT);

trytry {{ Socket

Socket socket = s.accept();socket = s.accept();

trytry {{ //

// Use the socket.Use the socket.

} } catchcatch ((IOExceptionIOException e) {e) { // Transfer failed.

// Transfer failed.

}} finallyfinally {{

socket.close();

socket.close();

} } }

} catchcatch ((IOExceptionIOException e) {e) { // Connection failed.

// Connection failed.

}

} finallyfinally {{ s.close();

s.close();

} }

Client Client

try try {{

Socket

Socket socket = socket = newnew Socket

Socket(address, PORT);(address, PORT);

trytry {{

// Use the socket.

// Use the socket.

} catch} catch ((IOExceptionIOException e) {e) { // Transfer failed.

// Transfer failed.

} finally} finally {{

socket.close();

socket.close();

} } }

} catchcatch ((IOExceptionIOException e) {e) { // Connection failed.

// Connection failed.

} }

(10)

Socket Example: What Happens Socket Example: What Happens

‹‹ Server creates ServerSocketServer creates ServerSocket which begins to listen to the given which begins to listen to the given portport

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

‹‹ Client creates SocketClient creates Socketwith the with the server’s address and the port number server’s address and the port number of the server socket

of 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 SocketSocketto any to any available portavailable port

‹

‹ Server socket sends the port number Server socket sends the port number of the new socket to the client of 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 acceptIn the server, the acceptmethod method returns the new socket.

returns the new socket.

server server

portport

client client

connection connection request

request

server server

portport

client client

connection connection port

port portport

Using Streams with Sockets Using Streams with Sockets

‹‹

Input stream: Input stream:

BufferedReader

BufferedReader in = in = new

new BufferedReader BufferedReader( (

new new InputStreamReader( InputStreamReader ( socket.getInputStream() socket.getInputStream())); ));

‹

‹

Output stream: Output stream:

PrintWriter

PrintWriter out = out =

new new PrintWriter PrintWriter( (new new BufferedWriter BufferedWriter( ( new

new OutputStreamWriter( OutputStreamWriter ( socket.getOutputStream()

socket.getOutputStream())), )), true true); );

‹‹

Reading and writing as normal: Reading and writing as normal:

™

™ out.println("foo"); out.println("foo");

™™StringString s = in.readLine(); s = in.readLine();

‹‹

Streams use TCP, which is reliable but slow Streams use TCP, which is reliable but slow

Viittaukset

LIITTYVÄT TIEDOSTOT

Docker engine is a client-server application which first creates server side Docker daemon process to host images, containers, storage volumes and networks, and then allows users

Tornin värähtelyt ovat kasvaneet jäätyneessä tilanteessa sekä ominaistaajuudella että 1P- taajuudella erittäin voimakkaiksi 1P muutos aiheutunee roottorin massaepätasapainosta,

The new European Border and Coast Guard com- prises the European Border and Coast Guard Agency, namely Frontex, and all the national border control authorities in the member

The US and the European Union feature in multiple roles. Both are identified as responsible for “creating a chronic seat of instability in Eu- rope and in the immediate vicinity

Indeed, while strongly criticized by human rights organizations, the refugee deal with Turkey is seen by member states as one of the EU’s main foreign poli- cy achievements of

However, the pros- pect of endless violence and civilian sufering with an inept and corrupt Kabul government prolonging the futile fight with external support could have been

We try to assign servers to clients using the following protocol: Each client sends a request to a random server.. A server that receives at most two service requests, accepts

An information network address is attached to each code in an object naming server (ONS) located in a predefined address on the Internet. If the standardisation of the product