Summer Budget Travel Tips from Gadling

Under The Grid - Other causes of lag

Under the grid!Welcome to the second installment of "Under The Grid", looking at the mechanics underneath Second Life. Last week, we spoke about simulator load, when simulators started lagging and what information there was available to help the average resident diagnose the causes of simulator-based lag.

This week, we're going to look at where other kinds of lag come from, what causes them and what practical things you can do to try to minimize it.

Packets
Data packets are used to communicate between one computer and another

First thing is that Second Life, like all Internet applications, operates in a series of packets. A packet is a block of bytes with information about where it is coming from, where it is going, and some actual data. From one perspective you can think of a packet as a sort of digital envelope. It is handed from one sorting office to another until it gets to you, then the software running on your computer opens it up and reads the message inside. At any moment there may be dozens or hundreds of packets moving between your computer and other computers on the Internet. It all depends on how much your software has to say to other software.

Packets also get lost. They can be mangled, misrouted, received in the wrong order or just dropped onto the metaphorical floor, never to be seen again. Some software numbers every packet and is insistent on getting it all in the right order before proceeding. Others (like audio streams) are okay with out-of-order packets, or missing ones -- if that happens, you'll hear a slight pop or moment of static, or a fraction of a second of silence. Streaming protocols are generally designed around the fact that our ears and brains are more tolerant of this than having several-second pauses randomly littered through the playback.

It can be a hard life if you're a packet, short and fraught with dangers.

A series of tubes"The Internet is not something you just dump something on. It's not a truck. It's a series of tubes."
-- Senator Ted Stevens.

Take a moment to have a good chuckle at this now larger-than-life quote. Got that out of your system? Good. Senator Stevens was right. It's a very baby-talk way of putting it, unfortunately. Network Engineers use the term 'pipes' these days, and yes, the Internet is a series of pipes for all practical purposes.

No, really. A series of pipes (if you're the sort of person who organizes digging trenches and laying cables, then you call them bearers, if you're the sort of person who hooks them up and tests them and runs packets through them you call them pipes. Faced with this ferociously technical jargon, how can we not laugh at the word tubes?)

Each pipe carries so many bytes per second. Each packet is a variable number of bytes in size. Think of each pipe as a telegraph operator with a stack of messages on her desk. She taps away in Morse code to the next station, at whatever rate she can go. If telegrams pile up faster than she can send them, there are delays. Of course the receiving operator might get momentarily interrupted, spill his coffee, break a pencil, and accidentally mangle a message. Or miss enough of one that he drops a note on his own pile saying "Message 38 missed resend stop" Eventually his message will get back to the first operator and she'll try to resend the message. Welcome to the joys of oversimplification.

Packet Loss

The feeder for each pipe has storage for a limited number of packets. If it's got space for a thousand, then once a thousand pile up, the excess are ignored. Each packet is sent in the order it was received (well, usually -- things can go wrong with that)

That's one cause of packet loss. A full pipe. You start taking pot luck as to which packets make it through, and it's all about microsecond timing. Just think about rolling dice for it, if your lucky number comes up, you make it through. If you don't, someone else's packet snuck in ahead.

Another is simple overload. The computers at each end of each pipe need to be able to take time to receive and process each packet. If they are doing something else (accessing the disk, being hammered on by apes, or running other software) they may not be ready within the few microseconds they need to be to catch every packet. A few get lost, but there are always plenty more.

Likewise if your computer is busy doing other things (p2p file-sharing, recording a movie, playing a movie, defragmenting your hard-drive, or -- just say -- rendering complex 3d graphics representing a virtual world) then it might not have all the time it needs to pick up every packet, and will drop some.

Wait. Where does Second Life come into this?

Down the tube?Second Life sends packets to your computer. There are about 10-30 pipes in between you and the grid servers, depending on where you're located. The amount of time it takes to traverse that length is called latency or ping time. More latency means things are just that little bit less responsive. You also don't know what the capacity of each pipe is, or how busy it might be right now.

Also, packet loss is generally pretty nasty. It causes all sorts of weird side-effects. 'Rubber-banding' is one, where your avatar is walking or flying a short distance and suddenly snaps back or objects do that during editing. Slow rezzing of textures (or not rezzing at all). Avatars that are invisible except for their attachments. Being Ruthed (suddenly changing to the default female shape) or seeing someone else as Ruthed. All sorts of odd things like this are caused by packet-loss.

More is not necessarily better
Maximum bandwidth slider

Most people compensate by turning up the maximum bandwidth slider in their network. Ouch. Very much the wrong thing to do. Turning the slider up increases the load at all points along the way, increasing the amount of packets flowing in each pipe, and the workload of each computer involved. This is your basic drinking out of the firehose scenario, you can't swallow fast enough, so you turn the tap on harder. Confusingly also, not every lost packet shows up as a lost packet.

The trick is to make the packets easier to handle and catch, not harder. Turning that slider down too far though, will give you mushy and uncertain performance. Generally, keep it between 270 and 500. Even if you've got a fat Internet connection (like mine), a shabby computer (like mine) will not keep up with high-bandwidth rates, especially if it's bogged down trying to render lots of graphics at the same time.

Summary

So, a busy PC will slow you down, close applications that are doing things in the background (disk defragmenting, or file-sharing applications), and ones that send and receive a lot of data-packets (file-sharing applications are a strong culprit for this too), turn your graphical settings down somewhat and keep your Maximum Bandwidth slider at sane settings, and Second Life actually runs pretty smoothly much of the time, even if you're on the other side of the world, with a lousy PC.

by Tateru NinoMost of the lag that isn't simulator-based we can do something about. Most of us, when faced with the reality of it, do exactly the wrong things in response, because we don't understand what's happening underneath.

Reader Comments

(Page 1)

Add your comments

Please keep your comments relevant to this blog entry. Email addresses are never displayed, but they are required to confirm your comments.

When you enter your name and email address, you'll be sent a link to confirm your comment, and a password. To leave another comment, just use that password.

To create a live link, simply type the URL (including http://) or email address and we will make it a live link for you. You can put up to 3 URLs in your comments. Line breaks and paragraphs are automatically converted — no need to use <p> or <br> tags.

New Users

Current Users

General
Arts and Culture (70)
Gridbugs (207)
Live Performance (17)
Machinima (72)
MMO Watch (33)
Op/Ed (53)
Podcasts (21)
SL Blogs (9)
Teaching (57)
Teen Grid (13)
Updates (158)
Events (347)
How-To (52)
News (771)
SL Insider Business (27)
Stories (264)
Comics (18)
Mixed Reality (434)
Linden Lab (356)
Odds and Ends (916)
Just Askin' (96)
Objects
Building (96)
Clothing (38)
Gadgets (71)
Graphic Design (27)
LSL (24)
Economics
Accounts (80)
Business (446)
Linden Dollars (316)
Making Money (79)
Residents
Resident Snapshot (58)
Interviews (125)
Newbies (45)
Places
Great Builds (90)
Educational (115)
Entertainment (110)
Exploration (110)
Shopping (113)

RSS NEWSFEEDS

RESOURCES

Powered by Blogsmith

Other Weblogs Inc. Network blogs you might be interested in: