Archive for the ‘programming’ Category

Atmospheric reentry simulation in Javascript

Sunday, June 14th, 2009

The following is the altitude of a reentry vehicle, on its decent through the atmosphere.
What makes this interesting is the way of execution: notice the browser window? The entire simulation is running in javascript, using my javascript classes jVector and jMatrix. The plot is done in jPlot2D (pre-release), utilizing RaphaelJS.

The mathematics comes from this source.

Posted in Physics, eScience, programming | Comments Off

Principal Component Analysis

Sunday, March 15th, 2009

Fundamental networking

Friday, October 21st, 2005

Motivation
From time to time, I get questions regarding networks and I happily answer
because I think it’s an exciting topic but I just found the inspiration to write a
small article about the most fundamental networking topics – let’s call it a primer
to “How the Internet works” a relaxed walk-through of how you can connect, download
and read this on your PC.

The hierarchy

modelBefore
we can start we need some very basic terminology. You need to know that when we talk
about networks, there are different levels on top of each other, and we always put
a reference to where in this hierarchy we are. The full model is called OSI,
and is build of seven layers, but for our purpose a model with three layers
will do. 

Software is what goes on in the programs you use to
access the network (your brower, e-mail client, online game, etc…)

Communication here we got the controlling programming behind
the networks, this is not hardware, but rather: network protocols, routing protocols
and other elements that control and guide your network traffic along to the right
place.

Hardware this is the real (physical) part of the network
(network adapters, cables, antennas, etc..)

Because this is a very idealized model, there is a lot in between the three
groups, and they have a tendency to overlap, where does some software on your computer
stop being controlling the data and start being a web browser? or when does the circuits
stop and the program take control? there is no strict line between, but we are
not going to dwell in the details so let’s continue!

The hardware

You might think that it’s a simple way from your home computer out to the servers
on the Internet? Think again! If you have a broadband connection at home the likelihood
of you passing through three networking devices before the signal leaves your House
is very great. And it doesn’t stop there… Let’s start by looking at a PC.

Not that long ago there where several likely way that your local computer might be
hooked to the net, (a serial or parallel connection to a modem, USB and other ways).
The possibilities hasn’t changed a lot, but it is now normal to have a home network
where your local computers are connected, and then further from this network you might
have a connection to your ISP. So inside your computer resides a network adapter,
most likely a type called Ethernet (Ether was a substance that was
believed to be conduction light up until the start of the twentieth century). Ethernet
is a standard of how network hardware behaves, and in the normal part of the world
(the world where supercomputers and large banks don’t count) this is the predominant
standard. (others like Token-ring and different higher dimensional devices exists
but doesn’t account for any real market share). You might have a networkadaptor with
a cable connection, the speeds are one of these: 10, 100, 1000 Mbit/s or
perhaps you use a laptop or otherwise wireless connection, speeds range from 11mbit/s
to 108 mbit/s (last time I checked) as you might tell the speeds determines how much
data pr. second you can transmit and receive. Alright your computer need to be connected
to something.

To connect different PC’s on a local network, we use either a hub or a switch. Both
comes with some amount of ports, but they handle the connections to the PC’s very
different. A hub might support 100Mbit/s connections and have say eight ports, if
you connect a computer to each of these you will share the bandwidth of 100Mbit/s
between the eight computers, and hence you cannot make two 100Mbit/s connections between
four machines. On top of that, because of the sharing principle, there is a good chance
that the computers might talk at the same time, and like for us humans, when more
the one opens there mouth, we can’t hear all that’s being said, and some information
is lost. This is called collisions. Try to imagine small packets of data traveling
along the network, when two computers send a packet at the same time they collide
and are lost. Because of the communication layer the connection is controlled and
the packets are just retransmitted, but it can drain the bandwidth on a larger network
very easy if you have a hub-based network.
Instead of Hubs most uses switches today, they treat each port as sort of a individual
network, and it controls what port that should connect to what. That way we can avoid
collisions because each PC is only talking on the part of the network that leads to
the receiver of the packet. Inside a switch there is an internal bandwidth much greater
then each of the ports, since if it only had ex. 100Mbit/s internal bandwidth the
different PC’s connected to it would still have to share it, so instead you would
have perhaps ~2Gbit/s or more depending on the amount of ports on the device.

So now we have our local network in place, we have network adapters in each computer,
and they are cabled to a switch, great!
(We might add that for wireless computers, a access-point acts like a hub, and with
should tell that hubs, access-points and switches naturally can all be connected to
each other, to expand the network).

Connecting the local network to the Internet (continued…)