CS 4455 Lecture 24 - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CS 4455 Lecture 24

Description:

What Data to Send? Sending entire world state is usually too much. Can send just user actions ... Code disassembly. Packet replay. Packet replay attack: ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 22
Provided by: cds7
Category:

less

Transcript and Presenter's Notes

Title: CS 4455 Lecture 24


1
CS 4455 Lecture 24
  • Networks Latency and Prediction

2
What Data to Send?
  • Sending entire world state is usually too much
  • Can send just user actions
  • Simulation engine does the same thing at each
    client
  • Pseudo-random numbers from same seed

3
Sending User Actions--Problems
  • Any error in engine
  • Divergence in worlds
  • Small error can lead to big divergence
  • X-Wing vs Tie Fighter
  • Created a resynchronize protocol
  • Causes jumps
  • Wrote smoothing algorithm for resynchs
  • Sim City 2000 Network Edition
  • Send checksums for world state each turn

4
Prediction
  • Eg. Unreal
  • Waiting for user inputs is too slow
  • Client does prediction
  • Motion prediction
  • Server corrects things if client is wrong

5
Prediction Dead Reckoning
  • Eg. SIMNET (US Army Tank Simulator)
  • Each vehicle simulates own tank
  • Sends data every 5 seconds, updating
  • Position, Speed, Acceleration
  • Expected path
  • Prediction violation criteria
  • Receiver simulates own tank
  • AND simulates local copy of other tanks

6
Dead Recokoning
  • Receiver gets latest 5-second update
  • Updates own copy of other tanks
  • Predicts other tanks
  • Using prediction data
  • Until new data arrives
  • Each simulator also sends update
  • When own prediction violates own criteria
  • Assumes latencies lt 500ms

7
Dead Reckoning
Sim A
Sim B
Sim B
Sim A
As Predicted Path
As Predicted Path
Bs Predicted Path
Bs Predicted Path
Predict B
Predict A
Predict A
Predict B
Transmit new prediction every 5 seconds
B Exceeds prediction predict again and transmit
8
Dead Reckoning Requirements
  • Data structures for other entities
  • Model of entity behavior
  • Vehicle speed, acceleration range, turn radius
  • Responsiveness to commands
  • Situation parameters
  • Following a road
  • Precomputed path (NPCs)

9
Multiple Copies
  • Maintain 2 Data sets
  • Now
  • Accurate self
  • Predicted others
  • Zero latency for self
  • Ground Truth
  • Accurate everybody
  • Large latency for everybody
  • 200-500ms ago

10
Latency Issues
  • When latencies get high
  • Prediction gets worse and worse
  • Correcting prediction errors may cause visual
    jumps
  • Easy to notice!
  • If jumps are large enough
  • Temporarily interpolate between wrong prediction
    and the new correction

11
Prediction Interpolation
12
Token Ownership
  • Some games may allow distributed ownership
  • Ballistic simulation
  • Shooter fires bullet
  • Intended target receives the simulation
  • Sports - eg. Tennis
  • Player A hits ball
  • Player B gets simulation token
  • B simulates ball path from As racket

13
Trust
  • Never trust the client
  • Data on the users hard drive is insecure
  • Diablo utility to modify character data
  • Wrote patch to prevent hacking
  • Throws out your stuff if theres a time
    inconsistency
  • Daylight savings nuked my stuff!

14
Trust
  • Network communications are insecure
  • NetTrek communications are encrypted
  • NetTrek also requires blessed client
  • Servers have different policies on requiring a
    blessed client
  • Prevents cyborgs

15
Trust -- Checksums
  • First line of defense
  • Checksum of all packets
  • Include header in checksum!
  • Stops casual tampering
  • Hash function
  • Hard to compute source value from result
  • MD5

16
Checksums
  • Not immune to
  • Code disassembly
  • Packet replay
  • Packet replay attack
  • Capture a legal packet, and re-send it more
    frequently than allowed
  • Client can restrict send frequency
  • Server cannot reject high-frequency packets
  • Internet bunch-ups

17
Combating Replay
  • Each new packet client sends is different
  • Add a pseudo-random number to each packet
  • Not just sequence number!
  • Client Server match pseudo-random numbers
  • Random numbers
  • Seeds must match!
  • Dropped packets include sequence number!

18
Combating Replay
  • XOR each packet with a pseudo-random bit pattern
  • Make sure the bit patterns are in sync!
  • Based on previous synchronized pseudo-random
    numbers
  • Add junk Confuse length analysis

19
Reverse Engineering
  • Remove symbols
  • Put encryption code in with rest of network stuff
  • Compute magic numbers
  • At runtime
  • In server
  • Encrypt from the start!

20
Lists Of Servers
  • Denial of service
  • Send a packet saying Im a server
  • Fake the IP return address with a random IP
  • Server adds new server to list
  • Server may run out of memory storing hundreds of
    thousands of servers
  • Require a dialog

21
List of Servers
  • Require a dialog
  • Server-list server responds with
  • Password
  • Keepalive interval
  • Password must be given by attacker at the correct
    time
  • Works OK if client is not better connected!
Write a Comment
User Comments (0)
About PowerShow.com