User Tools

Site Tools


cs498gd:networking

Game Networking


Networking Basics

  • Networking: shifting bits from point A to point B
  • Internet Protocol (IP) - Network layer
  • User Datagram Protocol (UDP) - Transport layer
    • Uses IP for addressing and routing
    • Divides the bits of a packet into groups and sends them in several successive packets
  • Transmission Control Protocol (TCP) - Transport layer
    • Guarantees reliable delivery in the order in which the packets were sent
    • Uses IP for addressing and routing; hence better known as TCP/IP
  • Socket - An endpoint in the IP protocol for sending and receiving data between networked computers
  • Packet - A block of data sent over the network
    • transmits the identities of the sending and receiving stations, error-control information, and a payload (data or messages)

ip_packet.jpg

  • Port - Where information goes into or out of a networked computer

Network Design (Topologies)

  • Most common: client-server

  • Other designs:
    • Which one of these comes closest to a P2P (peer-to-peer) model?

Networking in Java

A Simple Networked Game Example

    • SimpleGameServer.java is a standalone server meant to be compiled and run separately.
    • PlayerClient.java is currently set to connect to HOST=10.1.13.147 (cslin13.monmouth.edu).
      • If you run SimpleGameServer on a computer other than cslin13, you'll need to change what HOST is set to in PlayerClient.java.

A Game Server

  • Manage multiple players
  • Have some capacity
    • routine must exist to determine whether server is full
  • Add and remove players
  • Send data to one or multiple players
  • Process players' inputs

A Game Client

  • Connect to game server
  • Read and process data from server
  • Send data to server (for it to process)
  • Render the content

Diagnostic Tools

  • Netcat - The network “Swiss-army knife;” reads and writes data across TCP or UDP network connections
  • Wireshark - For sniffing and analyzing packets
  • nmap - Network mapper; determines open ports and server software installed on a machine

cs498gd/networking.txt · Last modified: 2013/11/15 20:25 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki