Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/nebupook/public_html/include.database.php on line 2
NebuPookins.net - NP-Complete - IP Masquerading
 

Deprecated: Function ereg_replace() is deprecated in /home/nebupook/public_html/include.parse.php on line 32

Deprecated: Function ereg_replace() is deprecated in /home/nebupook/public_html/include.parse.php on line 33
IP Masquerading
[Computer]

When you connect to the Internet, you're using a technology called "IP" which stands for "Internet Protocol". The way IP works is that computers are directly connected to other computers, and every computer has something called an "IP address". IP addresseses are like postal addresses in the sense that they specify a source destination for messages. IP addresses are usually written as a group of 4 numbers seperated by periods, like 92.72.229.107. When a computer wants to send a message to another computer, it creates something called a "packet" which basically contains the from-address, the to-address, and the data that should actually be sent. In this regard, it actually works a lot like the traditional postal service.

Not every computer is directly connected to every other computer. For example, when my mom connects to the Internet, she connects via her phone line to some computer owned by Bell Sympatico. Meanwhile, my Internet Service Provider (ISP) is called "IGS" or Internet Gateway Services, and so my computer connects to a machine owned by IGS. Since my moms computer is not directly connected to my computer, how is it possible that she can send me MSN messages?

The computers actually do some routing along the way. Let's say my moms IP address is 69.251.165.63 and my IP address is 201.174.141.235. When my mom sends me an MSN message, her computer constructs a packet that looks something like "From: 69.251.165.63 To: 201.174.141.235 Protocol: MSN Content: How do I burn a DVD?" And this packet gets sent to the only computer she's connected to: the Bell Sympatico computer. This machine by Bell Sympatico looks at the "To" address and sees that it starts with 201.174. It looks in its records and sees that all 201.174 addresses are owned by IGS, so it sends it to the IGS computer. The IGS computer receives it, and then looks at the "To" address again, and since it's directly connected to my computer, it can send the message directly to me. This is sort of like how when you mail an international letter, say from Canada to Australia, the Canadian post office doesn't care about how the Australian mail system works. They just see the destination is Australia, so they hand it to the Australian postal service. The Canadian service does not, for example, directly deliver the message to the Australian address.

Okay, so that was the first simple approximation. Unfortunately, in real life, IP addresses are a lot more complicated. There are only around 4 billion distinct IP addresses available, and we're quickly running out. Remember that every computer is supposed to have its own IP address. But think if you work in a big company, you'll realize that a single company can have anywhere from five, to five thousand or even more computers all connected to the Internet at the same time. Even some home users who are computer enthusiasts (such as my friends and I), might have five computers just for themselves! If you have a cellphone that connects to the Internet, that cellphone is supposed to have its own IP address as well. So there's a lot more computers than there are people, and there's more than 4 billion people.

So how is it possible that the Internet can still function despite the fact that we don't have enough IP addresses? It's a trick called IP Masquerading. Basically, if you own multiple computers, you form a Local Arean Network (LAN) connecting all of your computers together, and then use a single computer as a gateway to the Internet. For example, let's say I own five computers. One of them is my gateway, and so it has the IGS IP address: 201.174.141.235. So far this gateway computer can talk to all the other computers on the Internet, and all the other computers on the Internet can talk to this computer, but my four other computers can't connect to the Internet.

Well, my gateway then masquerades as the entire rest of the Internet to my four computers. Here's how it works: The four other computers are given arbitrary IP addresses like 192.168.0.2, 192.168.0.3, 192.168.0.4 and 192.168.0.5. The Gateway reserves 192.168.0.1 for itself. Now let's say my computer at 192.168.0.3 wants to send a message to my mom. It'll craft a packet like "From: 192.168.0.3 To: 69.251.165.63 Protocol: MSN Content: Do you have Nero installed?" And it sends this packet on the LAN. My other computers ignore the message, because it's addressed to 69.251.165.63, which doesn't match their addresses. However, my gateway computer will respond with "Give it here. I know how to route it." So the gateway computer takes this packet, and then modifies it. The new packet looks like "From: 201.174.141.235 To: 69.251.165.63 Protocol: MSN Content: Do you have Nero installed?" and then sends it to the IGS computer. Notice how the gateway computer sneakily changed the "from" address to its own IP address.

The IGS computer receives the packet, sees that it's addressed to a Sympatico user, and so sends it over to Sympatico. Sympatico receives the message and sends it to my mom. She types in her reply and her computer crafts the packet "From: 69.251.165.63 To: 201.174.141.235 Protocol: MSN Content: Yes." and sends it to the Sympatico computer. Sympatico sees that this is a IGS address and sends it to IGS. IGS then sends the packet to my gateway computer.

Now the gateway computer receives this packet, and it's not expecting it. So it goes through its records and sees that a few seconds ago, it had sent out an MSN message masquerading for 192.168.0.3. Ah, so it figures this must be the reply. So it modifies the packet again, so that it now reads: "From: 69.251.165.63 To: 192.168.0.3 Protocol: MSN Content: Yes." Notice that it has sneakily changed the address back to the "fake" internal IP address. It then puts this on the LAN, and my computer with address 192.168.0.3 grabs the message and displays it on the screen.

Okay, maybe that was a bit confusing, so here's my non-computer analogy: I'm at my office at work, and I want to send a package to my mom. My fictional company is big enough that we have our own built in internal courier system (basically a bunch of interns running around delivery packages). I write a message "Mom, please send me my lunch" and address it to "Mom, 83 My Home Address, Quebec, Canada" and set the return address to "Cubicle number 42." and give it to an intern.

The intern brings it to the central courier office, who examines the package, and sees that it's destined for an address external to the company. That's fine, they just have to call up FedEx to do the delivery for them, since their interns don't deliver outside the company. The FedEx guy arrives, and the courier guy hands over the package. The FedEx guy looks at the package and says "Uh, this return address says 'Cubicle number 42'." The courier guy says "Yeah, that's right." And the FedEx guy says "Well, I need a postal return address". The courier guy says "Oh, okay, well, it's 140 My Work Address, Quebec, Canada" So the FedEx guy crosses out the "Cubicle Number 42" part and writes "140 My Work Address, Quebec, Canada", and then goes off.

A few minutes later, the FedEx guy arrives at my house, and delivers the package to my mom. She opens it and sees the message. The FedEx guy asks if she has any reply, since the postage is already paid for the reply. So she makes a sandwhich and puts it in a box and gives it to the FedEx guy as the reply. She has to fill in the from address, where she writes "83 My Home Address, Quebec Canada", and she also has to fill in the destination address. Well, she has no idea what my work address is, but it's written on my package to her, so she just copies it over. It says "140 My Work Address, Quebec, Canada", so that's what she writes. The FedEx guy takes the package and heads out.

The FedEx guy arrives at "140 My Work Address", just like the package says, and hands it to the courrier guy. The courrier guy says "What the hell? I'm not expecting any packages." And the FedEx guy says "Not my problem." and leaves. The Courier guy then looks at the return address. It says "83 My Home Address, Quebec Canada". The Courrier guy says to himself "Hmm... this address looks familiar", so he goes through his records, and he sees that just a few minutes ago, a package was sent out to that exact same address. It seems that the person who sent out that package was in cubicle number 42. So the courrier guy crosses out the "140 My Work Address" part, and writes down "Cubicle Number 40" and hands it to an intern. Why'd he cross out the "140 My work Address" part? 'Cause the interns are idiots, and he didn't want to confuse them.

So I'm hard at work, saving the company millions of dollars, with a big "Do Not Disturb" sign posted on my cubicle when this intern comes in and shouts "yo whatup B" Distracted, I look up and see he has a package in his hand, address to Cubicle 42. He points to my screen and says "dude is dat da new msn live" I ignore him and grab the package and open it up to find a delicious sandwich. "yo man wats ur screen name ill add u".

Okay, so end of analogy. That's IP masquerading in a nutshell.

 
Deprecated: Function ereg_replace() is deprecated in /home/nebupook/public_html/include.parse.php on line 60

Deprecated: Function ereg_replace() is deprecated in /home/nebupook/public_html/include.parse.php on line 61
E-mail this story to a friend.
, , , , ...

You must be logged in to post comments.

Sites linking to this post: