Hypergrid

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 18: Line 18:
 
In the hypergrid model, we consider the 2D map of the virtual world as the equivalent of a web page. As such, a VW hyperlink is simply a region on that map.  
 
In the hypergrid model, we consider the 2D map of the virtual world as the equivalent of a web page. As such, a VW hyperlink is simply a region on that map.  
  
The current walled-garden model of opensim-based virtual worlds already supports this concept of hyperlink. When you teleport from one region to another via the map, chances are you are migrating your agent into a different opensim server. This migration is a glorified "agent transfer" that also exists, in rudimentary form, on the web when hypertext links are followed. The walled-garden model, however, imposes one very strong restriction on these hyperlinks: the entire map of regions is controlled by a central server known as the grid server, whose job is to provide a uniform view of the world to all of its regions.
+
The default model of opensim-based virtual worlds already supports this concept of hyperlink. When you teleport from one region to another via the map, chances are you are migrating your agent into a different opensim server. This migration is a glorified "agent transfer" that also exists, in rudimentary form, on the web when hypertext links are followed. The default model, however, imposes one very strong restriction on these hyperlinks: the entire map of regions is controlled by a central server known as the grid server, whose job is to provide a uniform view of the world to all of its regions.
  
 
The hypergrid removes this constraint by allowing individual opensim instances to add "neighbors" to their local map. As such, the hypergrid moves the control of the map down from the grid server to individual opensim instances (although hyperlinks can also be served by grid servers if grid admins so wish). In doing so, the world becomes a lot more interesting and varied. The map that you see in one opensim instance may be completely different from the map that you see after you teleport via an hyperlink. As an opensim administrator, you are free to define what other opensims you want to see on your map.
 
The hypergrid removes this constraint by allowing individual opensim instances to add "neighbors" to their local map. As such, the hypergrid moves the control of the map down from the grid server to individual opensim instances (although hyperlinks can also be served by grid servers if grid admins so wish). In doing so, the world becomes a lot more interesting and varied. The map that you see in one opensim instance may be completely different from the map that you see after you teleport via an hyperlink. As an opensim administrator, you are free to define what other opensims you want to see on your map.

Revision as of 17:59, 14 November 2008

Contents

The OpenSim Hypergrid

What is the hypergrid?

The hypergrid is an extension to opensim that allows you to link your opensim to other opensims on the internet, and that supports seamless agent transfers among those opensims. It can be used both in standalone mode and in grid mode. The hypergrid is effectively supporting the emergence of a Web of virtual worlds.

The basic idea for the hypergrid is that region/grid administrations can place hyperlinks on their map to hypergrided regions run by others. Once those hyperlinks are established, users interact with those regions in exactly the same way as they interact with local regions. Specifically, users can choose to teleport there. Once the user reaches the region behind the hyperlink, she is automatically interacting with a different virtual world without having to logout from the world where she came from, and while still having access to her inventory.

The hypergrid is currently a GForge project. Technically, it's implemented as a thin layer on top of the OpenSim core facilities. It's very easy to install, and it is 100% compatible with the standard OpenSim distribution.

Virtual World Hyperlinks

A Virtual World Hyperlink

We're all familiar with hypertext links on the Web. But what is a virtual world hyperlink?

In the hypergrid model, we consider the 2D map of the virtual world as the equivalent of a web page. As such, a VW hyperlink is simply a region on that map.

The default model of opensim-based virtual worlds already supports this concept of hyperlink. When you teleport from one region to another via the map, chances are you are migrating your agent into a different opensim server. This migration is a glorified "agent transfer" that also exists, in rudimentary form, on the web when hypertext links are followed. The default model, however, imposes one very strong restriction on these hyperlinks: the entire map of regions is controlled by a central server known as the grid server, whose job is to provide a uniform view of the world to all of its regions.

The hypergrid removes this constraint by allowing individual opensim instances to add "neighbors" to their local map. As such, the hypergrid moves the control of the map down from the grid server to individual opensim instances (although hyperlinks can also be served by grid servers if grid admins so wish). In doing so, the world becomes a lot more interesting and varied. The map that you see in one opensim instance may be completely different from the map that you see after you teleport via an hyperlink. As an opensim administrator, you are free to define what other opensims you want to see on your map.

Usage Scenarios

The following are natural usage scenarios. There isn't a clear separation between these scenarios, there's a large overlap between them. This is also not an exhaustive list. The purpose of these descriptions is to give you some starting ideas for how to use the hypergrid in practice. Please feel free to add other interesting scenarios to this list.

TopoA.jpg

Personal Worlds

This first scenario pertains to standalone opensims. Normally, standalones are completely disconnected from the internet. However, when run in hypergrid mode, standalones become network-able. As such, you can run your own world in your own computer, and link your world to whoever you want. For example, you can link to your friends' hypergrided opensims and to hypergrid gateways in open grids such as OSGrid.

The great thing about this scenario is that all of your assets are stored on your computer, and not on somebody else's server. You can back them up using ordinary backend tools. The not so great thing about this scenario is that all of your assets are stored on your computer! If your disk goes berserk, you loose them. (so make sure you make external backups regularly)

TopoB.jpg

Communities

This second scenario is about communities, broadly construed. The idea here is that a group of people come together to support a small community grid, i.e. a common world where shared activities take place. But at the same time, the members of the community maintain their own standalone worlds. The standalones link to the community grid, and the community grid may link back to the individual members' worlds and other places of interest.

The members' identities are probably the identities they have on their standalones, and their assets are also probably stored there. The assets present in the community regions, however, are stored on the grid asset server.

TopoC.jpg

Grid Public Regions

Walled-gardens are here to stay, and they serve many useful purposes. There is a hybrid mode for the hypergrid that some walled-garden grid operators may be interested in supporting. In this hybrid mode, most opensim instances on the grid run in normal, wall-garden mode, so no foreign visitors are allowed there - technically it is impossible to reach them. However, a few opensim instances on that grid can run in hypergrid mode, so that foreign visitors are allowed. This way, there is a gateway for grid-local users and arbitrary visitors to meet. This is also a good strategy for attracting new users to the grid, since random users are able to visit those gateway regions without having to sign up for an account upfront.

This hybrid mode is very similar to what happens on the web. For example, anyone can visit Facebook's public pages without having to sign up for a Facebook account. However, only Facebook users can go further inside.

TopoD.jpg

Level Games

The normal version of OpenSim enforces a common map for all the regions on a grid. The hypergrid removes that constraint. As such, it becomes easy to design VW games where the world looks different depending of where the player is.

Security Concerns

There is a wide-spread assumption that open grids such as OSGrid and new forms of grids such as the hypergrid are inherently insecure, and that it will be impossible to develop a "goods-based" economy on top of them; only walled-gardens can be secured. This is both true and false. While it is true with the current state of things, open grids, whatever their form, can be made as secure as the web. The first step towards that is to define exactly what the security threats are, and how they affect (or not) open and closed grids. So, let's spell them out, and face them head-on. This will help put our feet on the ground so that we start developing appropriate solutions.

Malicious Clients

CopyBots

Everyone knows about the infamous CopyBot. Using libraries such as LibSL (now known as OpenMetaverse) it is possible to develop clients for opensim servers that do unorthodox things such as bypassing the permissions system to copy people's assets. Bots written by griefers can do lots of other nasty things.

Malicious bots are a problem for all opensim administrators, including walled-garden grids. They can be prevented, to a certain extent, by exo-technical solutions such as Terms of Service and real-world lawsuits. Technically speaking, the only way to keep intruders out is to run opensim inside a firewall, pretty much like all other pieces of client/server software out there. If that's an acceptable solution for your case, you should do it.

Unfortunately firewalls also keep the public out, and most opensim operators, even the ones running walled-garden grids, want to reach out to the public. In this case, opensim operators may develop additional technical obstacles for bots, similar to those we see on the Web. For example, make sure agents are being run by real people by giving them a human-challenge during the login/TP process, etc.

Every obstacle to malicious clients lowers the risk of an intruder attack. However keep this in mind: no matter how many obstacles one builds, a sufficiently skilled and motivated attacker will be able to overcome them to penetrate opensims connected to the public internet. This affects hypergrid nodes as much as walled-garden grids. In fact, it's more pervasive than that: it affects all servers (opensim, web, etc.) connected to the public internet. Fighting malicious intruders is a fact of a connected world. Fortunately, those attacks don't happen very often, or the Web would have been dead by now.

Web Clients

CopyBots are the most well-known bots for opensim-based virtual worlds, but these virtual worlds are also susceptible to attacks by regular web clients. With the current state of things, it is actually easier to copy assets with a web-based client than with a libsl-based one. The weakness is that asset servers are connected to the public internet, and the protocol for interacting with them is public.

OpenSim has some minimal guards in place to fence against these kinds of attacks. Specifically, when the inventory server receives a request for an item, it checks the session identifier of the requester. Web clients aren't logged in, so they are refused service. I don't want to expand much more on this, so not to make life easy for attackers, but let's just say that opensim has the necessary mechanisms in place to fence off web-based attackers.

Malicious Hosts

Actively Malicious Hosts

The new security threat introduced by openness, one that does not exist in closed grids, is the possibility of a user to visit a region that is running malicious code. In the current state of opensim, a malicious host can do serious damage to the user's assets. Let's see how.

Assume you have your assets in your hypergrided-standalone opensim, and you go visit another opensim that happens to be running malicious code. Here is a non-exhaustive list of vulnerabilities that you are exposed to:

  • The host has your session id, so it can request your inventory items on your behalf and store copies in its local asset server. To add insult to injury, a malicious host could simply wipe out your inventory after having copied it.
  • Even if the malicious host doesn't access your items by itself, every time you access items in your inventory while you are in that region, those items are cached in the region's local cache, and can be stored persistently by the malicious host.

Malicious hosts can do a lot more damage, but those two are enough to illustrate this new kind of vulnerability affecting open grids. Note that this affects all open grids, i.e. those where arbitrary people can plug-in their opensims, and not just the hypergrid.

Fortunately, there is a family of simple solutions to this problem that can be summarized as "protecting you from yourself." That proposal is described here.

Piracy

A second new security threat affecting open grids is one pertaining to commerce of virtual goods. Suppose you put something out for sale on your hypergrided opensim. A foreign user comes and buys it. What that really means is that that user will physically get a copy of the assets moved to his/her asset server, which is different from your asset server. The permissions will be whatever you define them to be, and using the regular VW client, that user can only do what you defined he/she should could do with the object, as usual. However, if the user has direct backend access to the asset and inventory servers, that person can simply modify the permissions on his/her copy. This is commonly known as piracy.

This situation is the kernel of the belief that open grids are hopeless for a virtual-goods economy. DRM discussion aside, maybe they are hopeless. But then, everyone thought the web was hopeless for selling music, and look at the success of iTunes in spite of all the piracy that still exists out there. Who will be the equivalent of iTunes for virtual hair, skin and clothes?

Hypergrid Implementation

HypergridImplementation.jpg

(Click on the image to enlarge)

The image on the left shows the fairly complete class diagram of the hypergrid implementation, and how it uses the OpenSim framework. A brief description of the classes is below.

OpenSimNode: this class extends OpenSim, so that it can redefine a couple of things. The first thing it redefines is the construction code for communications, so that the hypergrid classes (HGCommunicationsStandalone and HGCommunicationsGridMode) are instantiated instead of the default ones. The second thing it redefines is the creation of scenes, so that HGScene and HGSceneCommunicationServices are instantiated instead of the default ones.

HGScene: this class overrides the TeleportClientHome method. The only reason to do that is to avoid a lookup/store of user information on the user database. Foreigner users have no entries in the local user database, they're only in the cache.

HGSceneCommunicationService overrides the RequestTeleportToLocation method. The new method is almost an identical copy of the base method, but the region handle that is given to certain method calls inside is switched in some cases. (The trick with region handles is explained below.)

HGScene.Inventory: this is a partial class of HGScene, just like what happens in the OpenSim framework. This part of HGScene overrides some inventory-scene interaction methods, so that assets are fetched/posted from/to the user's asset server. Once that extra fetching/posting is done, these methods simply pass the ball to the base methods.

HGAssetMapper: this class manages the fetching and posting of assets between foreign regions where the user is and the user's asset server.

HGInventoryService: this class is a hybrid between LocalInventoryService for standalone inventory access and OSG1SecureInventoryService for accessing inventory remotely. (It should probably delegate to OSG1SecureInventoryService, needs revising.)

HGCommunicationsStandalone and HGCommunicationsGridMode: these are very thin classes, similar to their counter-parts in the framework, whose sole purpose is to create a bunch of communication-related service classes.

The HGGridServices cluster: the two subclasses are wrappers for the OpenSim framework classes for which they hold references. The pattern for these methods is very similar: check if the region to talk to is an hyperlink; if it's not, simply delegate the work; if it is, push the work to the base class HGGridServices. HGGridServices, in turn, does the management of hyperlink regions, and defines two additional pieces of inter-region protocol:

  • region_uuid: for linking regions
  • expect_hg_user: similar to the existing expect_user interface, but with a lot more information about the user being passed around, especially all the user's servers (inventory, asset, home, etc.)

The IRegionModule collection of classes is mainly for allowing access to inventory and assets on standalones when the users are out and about. They use the exact same REST interface as the Grid Asset/Inventory servers.

Hyperlinks and Agent Transfers

When you establish a link between your opensim and another, the following process happens. A message is sent out to that other opensim requesting information about it; the required information includes the remoting port and the coordinates of that region on its local grid in the form of a region handle.

When an agent teleports through that hyperlink that information is used. First, before InformRegionOfChildAgent, the local opensim notifies the remote opensim of this foreign user via the "expect_hg_user" method. After that, the teleport process is exactly the same as the normal teleport process; the only difference is that the region handles are switched between the remote region's hyperlink position on the local grid and its actual position on its grid. Woosh! the viewer is tricked.

Installing and Running Hypergrid

Installing

  1. Checkout the hypergrid project: svn checkout http://forge.opensimulator.org/svn/hypergrid/trunk. Usually trunk is in a usable state. If it isn't, you can check the latest stable version from tags: svn checkout http://forge.opensimulator.org/svn/hypergrid/tags
  2. Read the README.txt file. It has important information about which version of opensim the hypergrid has been tested with. 'No guarantees of what will happen if you use the hypergrid extension with a different version of opensim'.
  3. Check out the version of opensim mentioned in the README file. Prebuild and build it as normal.
  4. Copy all the files under hypergrid/.../bin onto opensim/bin
  5. Make the following changes to your OpenSim.ini:
    • The map: WorldMapModule = "HGWorldMap" If you didn't have this setting in your original OpenSim.ini, make sure yo place it under the [Startup] section.
    • If you're running your opensim in grid mode, you're done. If you're running in standalone and you want it to be network-able, change all the [Network] server addresses to "http://<external_host_name>:<http_port>"
  6. Run opensim like this: [mono] OpenSim.exe -hypergrid=true. To make sure the hypergrid is running type this on your console: link-region. If you don't hear anything back, the hypergrid is not properly installed.

Linking regions

On the console, type for example:

link-region <Xloc> <Yloc> osl2.nac.uci.edu 9006 OSGrid Gateway

Use Xloc and Yloc that make sense to your world, i.e. close to your regions, but not adjacent.

Important Note

Due to a viewer bug, you can only TP between regions that are no more than 4096 cells apart in any dimension. What this means in practice is that if you want to link to OSGrid, you must have your own regions reachable from the (10,000; 10,000) point on the map, which is where OSGrid is centered. Place your regions somewhere in the 8,000s or the 12,000s.

Public Hypergrid Nodes

The following is a list of hypergrid-ready nodes that you can use for testing your installation and for linking your world. Please add your public node here if you wish to help build a web of opensims!

For the time being, and until the security concerns described above are addressed, we advise you to be careful about who you link to.


  • osl2.nac.uci.edu 9006

The "UCI Welcome" region connected to OSGrid. It is run by Diva (Crista Lopes) on a machine owned by the University of California, Irvine. You can link to it as a way to link to OSGrid.

  • ucigrid02.nacs.uci.edu 9000

A region in the UCI Grid. It is run by Diva (Crista Lopes) on a machine owned by the University of California, Irvine.

Personal tools
General
About This Wiki