You are on page 1of 10

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO.

1, JANUARY 2012

Scalability and consistency in Server Based Network Gaming


Ra ul Valencia

AbstractThis paper describes the capabilities of a Server based communication between two or many PS3 consoles as a way to efciently transfer data using the TCP/IP protocols with the hardware embedded (Ethernet Cable and Wireless 802.11G). Also, it coves the common problems arising with the inclusion of more systems in the same network in order to keep communication consistency as well as some performance efcacy under different scenarios where low and high data transfer is required in between systems, whilst just one active server socket is kept open. When low demand applications are running and as highly bandwidth consuming case both are presented, in order to estimate how many consoles could be brought into the same network without a hit on game accomplishment. Index TermsTCP/IP, UDP, PS3, Network, Ethernet, Wireless, Video Games, Sockets, Ethereal, Performance, A Bandwidth, IEEE 802.11G, Peer-To-Peer, Server, L TEX.

analyzed as the basic scenarios that commonly happen in a simple local network: Ethernet - Ethernet, Ethernet - Wireless, Wireless - Wireless, listing their advantages and disadvantages in bandwidth, reliability, operational distance, speed and number of supported devices without lacking of performance in the data transmission. mds January 30, 2012

I. I NTRODUCTION LAYSTATION 3 (PS3) systems are computer machines designed by Sony Computer Entertainment to serve as a video game console as well as a multimedia center, capable of displaying various media content from standard to full denition (video, images), as well as stay connected to a network using the standard stack protocols TCP/IP, resulting in a continuously communicated device not only in a local scope, also internet is considered as a content provider (PlayStation Network, HTML Browser or DLNA servers, among others). Using the wireless dongle installed, the PS3 is capable to exchange information with other network devices using the IEEE 802.11 B/G protocols to transfer information over-the-air without the requirement of any cable (as ethernet does), while keeping an acceptable data rate of 54 Mbit/s to Fig. 1. Data Rate Comparison, in MB/Sec stream information between systems. Taking into account this fact, the communication As it is possible to identify, the speeds offered performance between PS3 - PS3 systems will be by the Gigabit Ethernet are more advanced than those offered by its wireless counterparts, when a School of Computing Science, Newcastle University, Newcastle typical real world throughput of 40 Mbits/sec is Upon Tyne, NE1 7RU, UK. reached in a wired position, the standard 802.11g r.h.valencia-tenorio@ncl.ac.uk

II. BACKGROUND AND R ELATED W ORK Since its release in 2006, the PS3 has included an Ethernet and WiFi module in every model sold to the public (40GB, 60GB, 120GB, Slim), this enables to the console capabilities of interconnection to local networks and Internet using any of those two mediums. Featuring a Gigabit Ethernet and a 802.11 b/g WiFi, each perform different according to varying circumstances, although the cable version is more reliable when transferring huge amounts of information as the graph below shows [1]:

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

is only capable of transferring 3 Mbits/sec. Even new computers to the network, this drives to delays, if the network works over the previous standard, transfer losses and bottlenecks, translating these 10/100 version, the improvement is noticeable, ap- issues into a Loss of Network Integrity. proximately 10Mbits/sec. These are few common tasks that can take place in order to improve the reliability of a network environment: [2]: Balance network trafc by distributing client connections across multiple network adapters; so that every set of computers will count as a different subnet and then allowing the maximum data transfer in between its terminals Use adapters with the highest bandwidth available for best performance. Instead of connecting PS3 systems to a switch that only manages Ethernet 100, use any capable of Gigabit connections. High rates of interruptions from network adapters can reduce performance. Remove unused network adapters to reduce overhead, as result, just unplugging terminals that do not transfer any relevant information Fig. 2. Example of Systems in the same Subnet will improve stability because information travels through less nodes. Considering a Server Based Network architecture as the image above, with all the devices within the III. C ASE S TUDY same subnet and exclusively using the infrastructure to the test purposes, a limit of systems connected After reviewing the most common improvements via wireless is reached with just 11 simultaneously, that could be made to a network, it is possible to when using an ethernet cable to interconnect them start talking about the implementation of a socket easily can be extended to at least 20 units. These client and server into PS3 systems using the Sonys numbers comes from the following theoretical ofcial SDK for Visual Studio 2009. calculation: The Sony PS3 SDK states that the XMB O.S. fully complains with the Berkeley sockets [3], which were originated with the 4.2BSD Unix operating TABLE I T HEORETICAL NUMBER OF T ERMINALS COMMUNICATING system (released in 1983) as an API. This applicaSIMULTANEOUSLY tion programming interface implementation forms Connection Maximum Typical Low Number the basics of what is known today as the Internet Type Data transfer Charge Transfer of Terminals Protocol Suite (TCP/IP).
Ethernet 100 Ethernet Gigabit Wireless 802.11G 100Mbits/s 1Gbits/s 54Mbit/s 5Mbit/s 5Mbit/s 5Mbit/s 20 200 11

The table I exposes the optimal charge that can be made to a network using a Ethernet 100 infrastructure, so having 20 devices connected transferring exactly 5Mbit per second would keep the entire system in stability with optimal package transfer and no conicts in communication. However, when the Wireless 802.11G technology is used, the number of terminals is reduced to just 11. When adding

A. Common Functions In order to be able to implement both, clients and servers using sockets with the Ofcial SCE SDK is required to have common structures that are going to be used seamlessly. First lets dene a header and an implementation le called NetworkSockets, these classes are going to have the references to other headers as the constants used by the sockets.
# i n c l u d e < s y s / s y s t i m e . h> # i n c l u d e < s y s / t i m e . h> # i n c l u d e < c t y p e . h>

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

Two static variables are used to dene the number of structs our implementation is going to be able to attend and an array of characters that will contain the buffer size, which was previously dened. The other functions will help to manage nodes, connecListing 1. Header Files for NetworkSockets.h tions, packages and information sending. Lastly, two Here are the list of the les we need to link in functions that will include the core implementation order to have an initial framework that provide the of socket Server and Client. constants, denitions, variables, sockets, datagrams and networking loops. For example, the rst two header libraries provide those required functions for B. Client implementation on PS3 time measuring. The sys headers are an abstracThe easiest way to start is with the client side, tion layer about the PS3 O.S. for character trans- dened as machines that creates a socket, then formation, sockets, time specs and process commu- interconnect to an specic direction, port and with nication respectively. Deserve special mention the a xed protocol (TCP or UDP), just then, it is postools.h and getopt.h, which are two headers that sible to start sending stream packages. The function implements common UNIX-like network functions loadClient() will execute the required commands like ifcong especially designed for the PS3. that enable communication.
typedef struct f d l i s t { int s ; int flags ; int total len ; } FD LIST ; # d e f i n e TCP PORT ( 2 0 0 0 ) # d e f i n e BUF SIZE ( 1 2 8 1 0 2 4 ) # d e f i n e IN USE 0 x01 Listing 2. Constants for NetworkSockets.h void { int int ret loadClient () sid ; ret ; = cellSysmoduleLoadModule (CELL SYSMODULE NET) ;

# include # include # include # include # include # include # include # include # include # include # include # include # include

< s y s / t y p e s . h> < s y s / s o c k e t . h> < s y s / s e l e c t . h> < s y s / p r o c e s s . h> < c e l l / s y s m o d u l e . h> < n e t i n e t / i n . h> < n e t e x / i f c t l . h> < n e t e x / e r r n o . h> < n e t e x / n e t . h> < a r p a / i n e t . h> < n e t d b . h> t o o l s . h getopt . h

( FD LIST f d s t a t i c void p r i n t ( system time void l o a d S e r v e r ( ) void l o a d C l i e n t ( ) Listing 3.

list , int s ) ; throughput t time0 , i n t l e n ) ; ; ;

General Functions for NetworkSockets.h

i f ( r e t < 0) { p r i n t f ( cellSysmoduleLoadModule ( ) f a i l e d (%d ) \ n , r e t ) ; return ; } ret = sys net initialize network () ; i f ( r e t < 0) { printf ( sys net initialize network () f a i l e d (%d ) \ n , r e t ) ; return ; } sid = if up () ; i f ( sid < 0) { p r i n t f ( If UP ( ) f a i l e d (%d ) \ n , s i d ) ; return ; } Listing 4. LoadClient() in NetworkSockets.cpp

The struct will aid to organize the listening nodes that are enabled in the implementation, where s is an integer that keeps track of the connection status all the time; ags are the enabled signals that optimize the communication and total len established the package length that has been sent or received. Later on, three dene statements set the port to use, the package buffer size and the communication ring to use.
s t a t i c FD LIST g f d l i s t [ FD SETSIZE ] ; s t a t i c char g b u f [ BUF SIZE ] ; s t a t i c void a d d n o d e t o l i s t ( FD LIST f d l i s t , i n t s ) ; s t a t i c void remove node from list ( FD LIST f d l i s t , i n t s ) ; s t a t i c void c l o s e c o n n e c t i o n ( FD LIST f d l i s t , i n t s ) ; static int get total len ptr

Initially two integer variables will guide the rst few steps of network initialization. The if statement number one will verify that our program was

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

able to establish a link with the network interfaces in the PS3, either WiFi or ethernet. The if statement number two will certify that any of the interfaces are able to communicate outside the localhost network. The if statement number three will enable the interface using a command with a UNIX avor (ifcong).
c o n s t char h o s t n a m e = 1 0 . 6 6 . 6 5 . 1 2 8 ; i n t p o r t = 2000; i n t d a t a s i z e = 1024; struct sockaddr in sin ; int s ; char b u f = g b u f ; s t r u c t h o s t e n t hp ; u n s i g n e d i n t temp ; system time t time0 = 0; int i ; i f ( d a t a s i z e > BUF SIZE ) { p r i n t f ( d a t a s i z e t o o l a r g e \n ) ; return ; } Listing 5. Host variables in NetworkSockets.cpp

} s i n . s i n f a m i l y = hp> h a d d r t y p e ; memcpy(& s i n . s i n a d d r , hp>h a d d r , hp> h l e n g t h ) ; } sin . sin port = htons ( port ) ; p r i n t f ( c o n n e c t t o %s :%d . . . \ n , inet ntoa ( sin . sin addr ) , port ) ; s = s o c k e t ( AF INET , SOCK STREAM, 0 ) ; i f ( s < 0) { p r i n t f ( s o c k e t ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; g o t o end ; } sin . sin port = htons ( port ) ; p r i n t f ( c o n n e c t t o %s :%d . . . \ n , inet ntoa ( sin . sin addr ) , port ) ; Listing 6. Initialization in NetworkSockets.cpp

The variables initialized before are descriptive enough with its name. The IP address is set where the service is provided, the communication port, the size of each datagram, a struct containing the socket information. The variable s will help to keep track of any errors that occurs during the socket creation; buf is the array containing the information to be sent; hp is another container that will record the activities by the host; temp will receive any errors with the resolution of the hostname; i will loop throughout the buffer and time0 will take the system hour so that the program is able to print it to the terminal.
i f ( d a t a s i z e > BUF SIZE ) { p r i n t f ( d a t a s i z e t o o l a r g e \n ) ; return ; } i f ( ( u n s i g n e d i n t ) 1 ! = ( temp = i n e t a d d r ( h o s t n a m e ) ) ) { s i n . s i n f a m i l y = AF INET ; s i n . s i n a d d r . s a d d r = temp ; } else { i f (NULL == ( hp = g e t h o s t b y n a m e ( h o s t n a m e ) ) ) { p r i n t f ( unknown h o s t %s , %d \ n , hostname , s y s n e t h e r r n o ) ; g o t o end ;

Here most of the initialization conditions take place, rst it is certied that the buffer size is not bigger than the constant set previously. Then try to create a socket with the IP set in the hostname, if successfully created, then the address family INET for Internet socket is set into sin with the ags returned into the temp variable. Also if the rst try has any problem, then the function getHostByName is called, setting the family and the address as it was done before. In case neither function works, then the execution is cut off. The second part now actually creates the socket that will serve as medium to communicate with the server, with the address family and mainly with streams (or UTP), whereas also here could be set the constant SOCK DGRAM to set the connection under UDP, more details could be found in the appendix A.
r e t = c o n n e c t ( s , ( s t r u c t s o c k a d d r )&s i n , sizeof ( sin ) ) ; i f ( r e t < 0) { p r i n t f ( c o n n e c t ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; goto t e r m i n a t e ; } p r i n t f ( c o n n e c t ok %s :%d \ n , inet ntoa ( sin . sin addr ) , port ) ; time0 = sys time get system time ( ) ; f o r ( i = 0 ; i < d a t a s i z e ; i ++) { b u f [ i ] = ( char ) r a n d ( ) ; } r e t = s e n d ( s , buf , d a t a s i z e , 0 ) ; i f ( r e t < 0) {

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

p r i n t f ( s e n d f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; goto t e r m i n a t e ; } p r i n t t h r o u g h p u t ( time0 , d a t a s i z e ) ; Listing 7. Connection in NetworkSockets.cpp

void { int int ret

loadServer () sid ; ret ; = cellSysmoduleLoadModule (CELL SYSMODULE NET) ;

After this, an attempt to connect using the function of the same name, along with its ags, creates a socket with the size of the struct used for; of course, if any problem occurs, the execution is terminated; once the association has been achieved, the package information is prepared (particularly for this case just a set of random numbers) and transmuted using the function which takes the ag once again, the pointer to the data, how long the data is and any other specication if special treatment is required. Once everything has happened as expected, then the time that took place the package creation and dispatch is printed to the terminal along with the bits per second used to send the buffer.
terminate : i f ( s h u t d o w n ( s , SHUT RDWR) < 0 ) { p r i n t f ( t c p c l i e n t : shutdown ( ) f a i l e d ( e r r n o=%d ) \ n , s y s n e t e r r n o ) ; } i f ( s o c k e t c l o s e ( s ) < 0) { printf ( tcp client : socketclose () failed ( e r r n o=%d ) \ n , s y s n e t e r r n o ) ; } end : if down ( s i d ) ; sys net finalize network () ; cellSysmoduleUnloadModule (CELL SYSMODULE NET) ; return ; } Listing 8. Ending in NetworkSockets.cpp

i f ( r e t < 0) { p r i n t f ( cellSysmoduleLoadModule ( ) f a i l e d (%d ) \ n , r e t ) ; return ; } ret = sys net initialize network () ; i f ( r e t < 0) { printf ( sys net initialize network () f a i l e d (%d ) \ n , r e t ) ; return ; } sid = if up () ; i f ( sid < 0) { p r i n t f ( If UP ( ) f a i l e d (%d ) \ n , s i d ) ; return ; } Listing 9. LoadServer() in NetworkSockets.cpp

As the client example, here it is obligatory to initialize the network interfaces and rest assured that the system is connected to another set of computers or router, as a reminder, both parts of the PS3 are used, at least ethernet or WiFi.
struct sockaddr in sin ; FD LIST f d l i s t = g f d l i s t ; FD LIST p ; fd set fds ; struct timeval tv ; i n t s , ns ; int len ; char b u f = g b u f ; system time t time0 = 0; int ptotal len ; int i ; s = s o c k e t ( AF INET , SOCK STREAM, 0 ) ; i f ( s < 0) { p r i n t f ( s o c k e t ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; g o t o end ; } Listing 10. Host variables in NetworkSockets.cpp

The last set of functions closes the connection, nishes the socket, turn down the interface used to communicate (either ethernet or wireless), wrap up any network system call and unload the module for network functions. C. Server implementation on PS3 The client side has been covered, now the other side of the coin is going to be explained, what happens on the server when it is receiving connections and petitions. Here it is shown a simple example that initially behaves quite close as the client does, just with few differences.

Nothing has changed drastically yet, an struct to organize the socket, two list pointers, one to the max number of listening connections and another to the current one; the time interval that keeps track of response time, verication integers, two pointer, one to the buffer and another to the package length.

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

Finally a socket is created and verify it was done successfully.


memset (& s i n , 0 , s i z e o f ( s i n ) ) ; s i n . s i n f a m i l y = AF INET ; s i n . s i n p o r t = h t o n s ( TCP PORT ) ; p r i n t f ( t c p s e r v e r : l i s t e n i n g p o r t %d \ n , htons ( sin . sin port ) ) ; i f ( b i n d ( s , ( s t r u c t s o c k a d d r )&s i n , s i z e o f ( sin ) ) < 0) { p r i n t f ( b i n d ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; goto t e r m i n a t i o n ; } i f ( l i s t e n ( s , 5) < 0) { p r i n t f ( l i s t e n ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; goto t e r m i n a t i o n ; } memset ( f d l i s t , 0 , s i z e o f ( f d l i s t ) FD SETSIZE ) ; add node to list ( fd list , s ) ; Listing 11. Initialization in NetworkSockets.cpp

{ p r i n t f ( The s o c k e t s e l e c t i o n h a s n o t worked ) ; goto again ; } i f ( r e t < 0) { p r i n t f ( s o c k e t s e l e c t ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; f o r ( i = 0 ; i < FD SETSIZE ; i ++) { i f ( FD ISSET ( f d l i s t [ i ] . s , &f d s ) ) { close connection ( fd list , fd list [ i ]. s) ; goto again ; } } goto t e r m i n a t i o n ; } Listing 12. Service Broadcast in NetworkSockets.cpp

Here the socket is initialized with 0 bits in the whole structure, then the type of family to be used is set, whereas any of those values: AF INET, AF INET6, AF UNIX or AF UNSPEC, as result the rst one species that IPv4 is how the transmission will take effect. After the port is modied using the special function htons which converts from an unsigned int to host TCP/IP network byte order (which is big-endian). Just after, the call bind assigns the address specied to by the socket sin, so that listen marks the socket referred to by s as a passive socket, that is, as a socket that will be used to receive incoming connection requests using another call to accept, with a 5 as the backlog argument dening the maximum length to which the queue of pending connections for sin may grow. The last two lines clear the ags struct FD LIST to zero bites and then the socket s is associated to the list.
again : FD ZERO(& f d s ) ; f o r ( i = 0 ; i < FD SETSIZE ; i ++) { i f ( f d l i s t [ i ] . f l a g s & IN USE ) { FD SET ( f d l i s t [ i ] . s , &f d s ) ; } } tv . tv sec = 8; tv . tv usec = 0; r e t = s o c k e t s e l e c t ( FD SETSIZE , &f d s , NULL, NULL, &t v ) ; i f ( r e t == 0 )

Here it starts setting the struct fds to zero so that it is possible to iterate throughout the list size of FD SETSIZE constant that is 1024, in order to nd those available services and which are in use. Once found, the struct fd list is set with the ags detected. In order to keep track of the time taken between request, the delay tv sec is set to 8 milliseconds and the difference to 0. Then another request is red to test the connection to the service detected in the structure fds with the outcome of no connection or error, being the rst a return value of 0 if no active response was detected and the second a complete fail in networking that tigers the connectivity capabilities down unless another service is found.
for ( i = 0 , p = f d l i s t ; i < FD SETSIZE ; i ++ , p ++) { i f ( ( p> f l a g s & IN USE ) && FD ISSET ( p>s , &f d s ) ) { i f ( p>s == s ) { len = sizeof ( sin ) ; i f ( ( ns = a c c e p t ( s , ( s t r u c t s o c k a d d r )&s i n , ( s o c k l e n t )&l e n ) ) < 0 ) { p r i n t f ( accept () failed ( e r r n o=%d ) \ n , sys net errno ) ; goto t e r m i n a t i o n ; } p r i n t f ( c o n n e c t e d from %s :%d \ n , inet ntoa ( sin . sin addr ) , ntohs ( sin . sin port ) ) ; a d d n o d e t o l i s t ( f d l i s t , ns ) ; continue ;

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

} ptotal len = get total len ptr ( f d l i s t , p>s ) ; i f ( p t o t a l l e n <= 0 ) { time0 = sys time get system time ( ) ; } r e t = r e c v ( p>s , buf , BUF SIZE , 0 ) ; i f ( r e t == 0 ) { p r i n t t h r o u g h p u t ( time0 , p t o t a l l e n ) ; c l o s e c o n n e c t i o n ( f d l i s t , p>s ) ; continue ; } i f ( r e t < 0) { p r i n t f ( recv ( ) f a i l e d ( e r r n o=%d ) \ n , sys net errno ) ; c l o s e c o n n e c t i o n ( f d l i s t , p>s ) ; continue ; } p t o t a l l e n += r e t ; i f ( ! s t r n c m p ( q u i t , buf , 4 ) ) { goto t e r m i n a t i o n ; } } } goto again ; Listing 13. Package Reception in NetworkSockets.cpp

i f ( ( p> f l a g s & IN USE ) && p>s ! = s ) { i f ( s h u t d o w n ( p>s , SHUT RDWR) < 0 ) { p r i n t f ( shutdown ( ) f a i l e d ( e r r n o=%d ) \ n , s y s n e t e r r n o ) ; } i f ( s o c k e t c l o s e ( p>s ) < 0 ) { printf ( socketclose () failed ( e r r n o=%d ) \ n , sys net errno ) ; } } } Listing 14. Termination in NetworkSockets.cpp

This section accomplishes the task of turning off the connections, shutdown any socket that was opened during execution within the list of 1024 different services listened within the server. Any problem would be cached and displayed to the terminal.
i f ( s h u t d o w n ( s , SHUT RDWR) < 0 ) { p r i n t f ( t c p s e r v e r : shutdown ( ) f a i l e d ( e r r n o=%d ) \ n , s y s n e t e r r n o ) ; } i f ( s o c k e t c l o s e ( s ) < 0) { printf ( tcp server : socketclose () failed ( e r r n o=%d ) \ n , s y s n e t e r r n o ) ; } end : if down ( s i d ) ; sys net finalize network () ; cellSysmoduleUnloadModule (CELL SYSMODULE NET) ; } Listing 15. Shut Down in NetworkSockets.cpp

This is the main section of the server, being the one that handles the actual package reception and active connection status. First a loop goes through the list of available services detected in the previous block, checking for the actual ags, if it is in use and whether the socket could be associated with that service, if so the package reception establishes a bind between those two interfaces, where the function call accept is ready to listen to the conguration socket. Another verication steps run with the accepted connection, the ag length for the fd list current socket. After that a call to the reception function is executed, so the system writes into the buffer the information sent by the client. If the result is 0 or greater, the details of the package request are printed out to the console, in the other hand, if any negative value is set, then a problem occurred during the connection and the link must be turned off. The last condition says that if the buffer receives a command quit then all the networking must be terminated.
termination : p r i n t f ( c l o s e tcp s e r v e r !\ n ) ; f o r ( p = f d l i s t , i = 0 ; i < FD SETSIZE ; p ++ , i ++) {

As the inverse of the process of raising up the networking capabilities, here the same process is taken of with the opposite purpose; rst shutting down any open socket, then closing them and lastly nalizing any interface and module of the network section. With the code explained before, it is possible to establish communication between two or more PS3 systems as with any other Berkeley sockets standard compliance, as could be any computer, terminal or mobile device does as well. As result and since the software of the TCP/IP protocol reside within the operating system, each implementation will vary according to the operating system characteristics and requirements.

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

IV. C ONCLUSION After analyzed the PS3 capabilities of networking and programming, it is possible to conclude that even when it is old hardware (ve years at the time of this writing), it still has a lot of potential to offer, only as a single entity or into a grid of many systems interconnected via ethernet cable or wi module as well. Although the processing power embedded into the Cell Processor can archive many Gigaops (operations per second), when dealing with typical server requests and inter connection operations that capability is caped by the amount of RAM memory that the system has by default. Whereas the graphics memory is not directly accessible and the time it requires to commit certain read/write operations is not as efcient as the main memory is, so it is possible to only deal with certain amount of connections when considering only 256MB of memory. Nonetheless many researches around the world has used the power offered by the PS3 to archive computability only capable by Super Computers [9], dealing with a distributed system and managed by a specialized server that has big amounts of memory (such RAM and ROM) to store and manipulate all the calculations done in other PS3 systems connected to the same network. A PPENDIX A TCP/IP S TACK Transmission Control Protocol/Internet Protocol as named after TCP/IP is a model framework which serves as the main rules of communication for Internet so that computers are able to send messages, information and any kind of data. It was created in the 70s by the Defense Advanced Research Projects Agency (DARPA), an ofce of the United States of America. It was an evolution from the The Advanced Research Projects Agency Network. Into the TCP/IP framework are described a bunch of common design guidelines and implementations of certain networking protocols, that once stablished, allows computers to communicate over a medium (commonly wired or wireless). As stated before, TCP/IP provides end-to-end connectivity indicating how data should be formatted, addressed, transmitted, routed and received at the destination.

Protocols exist for a variety of different types of communication services between computers. TCP/IP has four abstraction layers as dened in RFC 1122 [5]. The TCP/IP model and related protocols are maintained by the Internet Engineering Task Force (IETF). TCP/IP was planned since its beginning to accomplish as a major goal the capacity to keep alive the network, in other words, be able to survive loss of subnet hardware, with existing conversations not being broken down. As consequence, connections remain intact as long as the source and destination machines are functioning, even if some of the machines or transmission lines in between are suddenly cut off operation. Furthermore, TCP/IP is constructed in such a exible way that applications with divergent requirements were envisioned, ranging from transferring les to real-time speech transmission. After the architecture was designed, the result could be described as a packet-switching network based on a connectionless internetwork layer, which contains many different levels that execute an specic task to unpack each segment of data into a readable stream of information from one end to another. The following image shows the structure of each stage in the TCP/IP stack [6]:

Fig. 3.

Layers into the TCP/IP Stack

A. Host-To-Network Layer The TCP/IP reference model does not really describe much about what happens here, except to point out that the host has to connect to the network using some protocol so it can send IP packets to it. This protocol is not dened and varies from host to host and network to network.

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

B. Network Layer Also known as the internet layer, which is the linchpin that holds the whole architecture together. Its job is to allow hosts to inject packets into any network and have them travel independently to the destination (potentially on a different network). They may even arrive in a different order than they were sent, in which case it is the job of higher layers to rearrange them, if in-order delivery is desired. C. Transport Layer Designed to allow peer entities on the source and destination hosts to carry on a conversation. Two end-to-end transport protocols have been dened here. Transmission Control Protocol (TCP), is a reliable connection-oriented protocol that provides a byte stream originating on one machine to be delivered without error on any other machine in the internet. It fragments the incoming byte stream into discrete messages and passes each one on to the internet layer. User Datagram Protocol (UDP), is an unreliable, connectionless protocol for applications that do not want TCPs sequencing or ow control and wish to provide their own. D. Application Layer Here are contained all the higher-level protocols: Virtual Terminal (TELNET), File Transfer (FTP), Web Pages Fetch (HTTP) or Electronic Mail (SMTP) among others. A PPENDIX B PACKAGE A NALYSIS In a network of many computers, it is required to read the packages that travel through each node, so it is important to know how to read each package that sits on the ethernet cable so that it could measure more precisely the time, bandwidth and response of the devices inside. A classical packet format into a physical ethernet cable [7] is generally composed as follow:

FCS) are padded to 64 bytes, which means that if theres less than 64-(10+8) = 46 bytes of user data, extra padding data is added to the packet. But it is necessary to consider that the minimum Ethernet packet size is commonly mentioned at 64 bytes, which is including the FCS. For example, if a proprietary layer protocol implementation has to know exactly how much user data is in the packet, and expects the length of the Ethernet packet to indicate the amount of user data, it will not behave correctly with padded packets. An Ethernet host is addressed by its Ethernet MAC address, a 6 byte number usually displayed in hexadecimal as FF:EE:DD:11:22:AA:99. The rst three bytes of the address are assigned to a specic vendor or organization, commonly referred as an Organizationally Unique Identier (OUI). A destination MAC address of FF:FF:FF:FF:FF:FF indicates a Broadcast, meaning the packet is sent from one host to any other on that network. A destination MAC address where the low-order bit of the rst byte is set indicates a Multicast, meaning the packet is sent from one host to all hosts on the network interested in packets sent to that MAC address. With the type/length eld, if it has a value 1,500 or lower then it is a length eld, therefore it is followed by an 802.2 header [8], otherwise it is a type eld and followed by the data for the upper layer protocol. Note that when the length/type eld is used as a length eld the length value specied does not include the length of any padding bytes. So then, the contents information is embedded into the User data, which is decomposed as required in upper layers (Transport and Application layers as seen before). Also is worth saying that the ethernet protocol uses a Cyclic Redundancy Check (CRC) algorithm to detect transmission errors. The Frame Check Sequence eld is lled (using a CRC) by the sending host. If the receiving host detects a wrong CRC, it will discard that packet, and asking to be resend (TCP) or not (UDP).

ACKNOWLEDGMENT Special thanks to the Doctor G. Morgan and G. Ushaw for their publications and lectures. Also Fig. 4. Typical TCP/IP Packet great gratitude to R. Davison in his support in the Ethernet packets with less than the minimum 64 graphics module as well for the PS3 development bytes for an Ethernet packet (Header + User Data + frameworks.

SCALABILITY AND CONSISTENCY IN SERVER BASED NETWORK GAMING, VOL. 1, NO. 1, JANUARY 2012

10

R EFERENCES
[1] Apple Insider, Exploring Time Capsule: Theorical Speed vs Practical throughtput, http://www.appleinsider.com/ [2] Microsoft TechNet, Resolving Network Bottlenecks,http://technet.microsoft.com/en-us/library/cc938651.aspx [3] Wikipedia, Berkeley sockets, http://en.wikipedia.org/wiki/Berkeley sockets [4] Buttari, Alfredo, A Rough Guide to Scientic Computing On the PlayStation 3, Technical Report UT-CS-07-595 Version 1.0. Innovative Computing Laboratory University of Tennessee, Knoxville. May 11, 2007. A [5] H. Kopka and P. W. Daly, A Guide to L TEX, 3rd ed. Harlow, England: Addison-Wesley, 1999. [6] Network Working Group, Requirements for Internet Hosts Communication Layers, Internet Engineering Task Force, October 1989. [7] Tanenbaum, Andrew, Computer Networks, 4th ed. Pearson Education, EUA, 2003 [8] Wireshark Wiki, Ethernet (IEEE 802.3), http://wiki.wireshark.org/Ethernet [9] American National Standard (ANSI), IEEE Std 802.2, Standard for Information Technology, 1998 Edition.

Horacio Valencia Tenorio Is a student Raul at Newcastle University, where he studies a Master in Computing Game Engineering. He has worked as a Mobile Developer and Consultant in many companies back in M exico. He has a degree in Computer Systems Engineering awarded by the National Polytechnic Institute from the M exico City. His interest are programming, mobile development and computer architecture. r.h.valencia-tenorio@ncl.ac.uk

You might also like