Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Absolute basics in networking (TCP/IP) -- Hosting 101

Status
Not open for further replies.
Joined
Oct 14, 2009
Messages
5,493
Reaction score
2,299
Anyone that is not knowledgeable in basic networking should watch this:




Basically the most important thing to know (covered in the video) if you're trying to run any type of server (whether it be a PW server, web server, VoIP server, FTP server, DNS server, DHCP server, etc...) is the utmost basics of TCP/IP.

The first and most important thing in basic networking is actually subnetting, or the subnet. Now just like in the video I am not going to get involved in complex subnetting, but without basic subnetting knowledge and configuration you wouldn't be able to properly configure IP addresses or servers.

In short, and for lack of a better explanation: this (subnetting) tells your computer if it is going to send a request or information to another computer within your local area network (LAN), or on an external network (WAN or "the internet").

We'll start with the most common (home network) subnet of 255.255.255.0

Here is where the IP address comes into relevancy. The subnet of 255.255.255.0 says that any computer that has the same number where the 255's are as an IP address, is on the local network (LAN). Any computer, even if physically connected to the same local network, that has a different number where any of the 255's are as an IP address will be assumed to be external IP addresses.

this all assumes that you're using a router (or other networking equipment such as hubs, switches, etc...)[that YOU are YOUR "network administrator"], if your PC is DIRECTLY connected to 'the internet' via a modem WITHOUT a router you DO NOT want to change any of these settings (as you are NOT the network admin of your ISP, and you WILL lose your internet connection)!

Some Examples:

ON the same network:
IP- 192.168.2.44
SUBNET- 255.255.255.0

IP- 192.168.2.43
SUBNET- 255.255.255.0

~~~~~~~~~~~~~~~~~~~~~~~~~
NOT on the same network:
IP- 192.168.2.44
SUBNET- 255.255.255.0

IP- 192.168.1.45
SUBNET- 255.255.255.0

~~~~~~~~~~~~~~~~~~~~~~~~~
ON the same network:
IP- 192.168.0.99
SUBNET- 255.255.255.0

IP- 192.168.0.51
SUBNET- 255.255.255.0
~~~~~~~~~~~~~~~~~~~~~~~~~
NOT on the same network:
IP- 192.168.0.51
SUBNET- 255.255.255.0

IP- 192.168.1.17
SUBNET- 255.255.255.0


Now, to expand on that slightly (hopefully you 'keep up'), some more examples:


ON the same network:
IP- 192.168.2.44
SUBNET- 255.255.0.0

IP- 192.168.10.43
SUBNET- 255.255.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~
NOT on the same network:
IP- 192.168.2.44
SUBNET- 255.255.0.0

IP- 168.192.2.45
SUBNET- 255.255.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~
ON the same network:
IP- 192.168.100.99
SUBNET- 255.255.0.0

IP- 192.168.0.51
SUBNET- 255.255.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~
NOT on the same network:
IP- 192.168.1.51
SUBNET- 255.255.0.0

IP- 129.186.1.17
SUBNET- 255.255.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~
ON the same network:
IP- 10.0.10.99
SUBNET- 255.255.0.0

IP- 10.0.0.51
SUBNET- 255.255.0.0
~~~~~~~~~~~~~~~~~~~~~~~~~
NOT on the same network:
IP- 192.168.1.51
SUBNET- 255.255.0.0

IP- 172.16.1.17
SUBNET- 255.255.0.0


So, in order for multiple machines to 'see' each other in your network they need to be operating within the same network (or 'sub-network'). Which for a home network is most commonly 255.255.255.0 (MAYBE 255.255.0.0). There are a few limitations with concern to IP addresses, the main two to pay attention to are: 1) that no two machines can share a duplicate IP address within a network. 2) you cannot 'assign' the IP address 127.0.0.1 to any machine as 127.0.0.1 is a loopback for testing purposes [you cannot assign any IP that begins with 127.0.0.X as 127.0.0.anything is always loopback].

So, we have now covered the two first most important aspects of basic TCP/IP networking 101. SubNet and IP Address. This is all the information you should need to get any type of 'server' or 'host' working on a local scale. Of course this knowledge alone will do you no good if you don't have the proper physical equipment! One physical PC would be adequate (not ideal), just for testing purposes (provided it is powerful enough to run a virtual machine) [like VMware or VBox]. One thing to keep in mind about a virtual machine, is that the goal is to 'pretend' it's a different physical machine than the one it is running on, so treat it as though it is, especially when configuring the network for it. More ideally would be to physically have at least 2 computers, and some form of networking connector (ie: a router, hub, switch, 2 NICs and a crossover cable, etc...).

Here is a good 'drill' you could run:
setup two PCs - A) & B) [physical or "virtual", whatever]

set up for PC
A)
IP Address - 10.0.0.100
Subnet - 255.255.255.0

B)
IP Address - 10.0.0.200
Subnet - 255.255.255.0

Of course since you just learned about SubNet and IP's feel free to configure those to match your already existing home network if you like ;)

Now install a web server on PC A), if you don't have your own this one would be really easy to use for this test:
windows -
linux -

Once you have installed and started ('opened') the web server on PC A), open a web browser from PC B). In a web browser on PC B) type 10.0.0.100 (or the corresponding IP address that you set PC A) to) in the address / URL bar and depress enter/return.

If you have done everything correctly you should get some result (a web page being displayed, other than an error). If you do receive an error from PC B), open a web browser from PC A) and type in 127.0.0.1, if nothing happens and/or you still get the same error that you did on PC B), means you did not succeed in starting the webserver (start/re-start, or seek instruction on the web server software if necessary). If your browser on PC A) successfully displays a web page when you enter 127.0.0.1, that means you have done something wrong in your network configuration! (and back to square one for you :p)

If you passed that drill, congratulations, you are now capable of running just about any type of server you desire, only dependent on your knowledge of the necessary configurations for each individual server software you are trying to run/host.

Now, we've covered Subnet's and IP Addresses for local hosting purposes, how about hosting to the whole world :D

Note: DO NOT CONTINUE TO READ - unless you have succeeded in getting your server to work on the local scale. Getting your server to work locally would be the hardest part (to a novice), once you have a server working locally it is almost a cakewalk to get it hosted ('seen') 'on the internet' (considering you have the proper equipment)!

Ok, the rest of this guide/tutorial presume that you DO have the following equipment:
-A PC, that is your designated SERVER
-A Router
-An INTERNET CONNECTION !

Moving right along, there are different methods one could achieve getting their server 'online'. I would have to say that this method would be the most simplex to start out with. Obviously if you're looking to get any type of 'server' 'online' you have a PC(SERVER), and an internet connection. Now I understand you may or may not have a router, but I am going to say that it is absolutely necessary because otherwise you'd have to make the choice between having your SERVER online, or your everyday user PC online (or worse and have to switch them constantly, manually). I say that because there is no way anyone should use an everyday user PC also as a server, for any 'service' as this will greatly hinder the performance of any kind of server, and anyone connecting to it! Even though you'll be using a router, you also have to take into consideration your internet connection speed, and your usage of the connection on your 'personal PC'. Keep in mind that while you are asleep, not home, or otherwise not really utilizing your connection, people connecting to your "SERVER" are (most likely) receiving good "SERVICE"! But now imagine this: (on your every day user PC) in the background you're downloading a new music album from iTunes (don't look at me, I don't use iTunes either, just mentioning something of clear legal nature), while streaming a HD movie from NetFlix, while playing your favorite MMO - not to mention you're on TeamSpeak or Vent, you're also seeding/hosting a torrent of something you just created. Now, do you think anyone connected to your "SERVER" is getting good "SERVICE"??? Clearly not as good as when your connection isn't so bogged, unless you happen to have a super-man connection, and depending on what your connection is, they may not be able to connect at all if you're using up all your bandwidth (sadly enough I've used up all my bandwidth on several occasions when I had ADSL service)! But anywhoot, enough of my rant; we will presume that you are setting up a small time server, primarily intended for use mainly by close personal friends (or an otherwise small number of people, especially simultaneously) so machine and bandwidth shouldn't be too much of a concern. Just remember that you can always expand in the future to professional hosting services if your needs dictate such measures.

It's rather simple to set up, once you know it works locally. For whatever machine is going to be your "SERVER", make sure to use a static IP (manual configuration), for this you may have to consult instructions specific to your operating system. You just want to make sure NOT to use "automatic" "dynamic" or "DHCP". Of course, you need to make sure this configuration coincides with any configuration of any server software that may be necessary as well (matching IP's etc...).


Note: this spoiler is only for anyone NOT using a router:

The above step assumes you ARE using a router, if you are NOT using a router you WANT to use "automatic" "dynamic" or "DHCP" [unless otherwise directed by your ISP]. As this means your PC is directly connected to the modem (internet) and your server is already 'online'. The only information someone needs to connect is, your IP address, and possibly the port number of the service being offered. If you have any software firewalls you will need to open the specific ports needed for whatever services you are running before people will be able to connect. [ie: webserver :80, MySQL :3306, Tomcat :8080, PerfectWorld :29000] Since your PC is directly connected to the 'internet' your PC's IP address is your 'public' (WAN) IP address, so if you wanted to give such information out to people so that they can connect, simply locate your IP within your operating system, and pass it out along with the port number of the service you're offering if necessary. If you do not know how to obtain your current IP consult your operating system's manual, or navigate a web browser to (whatismyip.com)

Obviously you will want to make sure you server is configured properly if it's necessary (using your WAN network settings and ip, which remember can easily change if your ISP issues dynamic IP Addresses)[so think about how often you will have to run through and change your servers server programs configuration :x]! and even more obviously make sure the 'service' or 'program' is started

[end here]


Configure the subnet mask (most likely 255.255.255.0) if you have not already. You need to configure the 'default gateway' on the server machine (this would be the IP address of/to your router). You may also want to configure "DNS Server" to the same IP as your default gateway/router.

Once you have the server machine fully configured (if you had it working and fully functional locally, the only thing you should have to add/change config wise is the "default gateway" and "DNS Server") all you will need to do is configure the router.

Now log in to your router (consult the user manual if necessary [or the sticker physically on the bottom of the unit]). The only thing you will need to configure is PORT FORWARDING. Consult documentation if needed, and configure port forwarding for any and all services that you are offering -- "SERVING". Most common information and configuration necessary to set up the port forwarding in your router is as follows:

-NAME - this is more optional, and just so you know what it is for, within the routers configuration interface (when you look at it 5 years from now)
-PORT - in which to forward (80 for web server, 8080 for tomcat, 3306 for MySQL, 29000 for Perfect World, etc...)[please note that each individual port will need it's own separate configuration "slot" within the router, I do not know of any router where you can just put a massive list in one config "slot"].
-PORT ending - (if it has a port ending it has a port starting too) if you're hosting a service that doesn't utilize multiple (or changing) ports, just put in the same number for starting and ending port numbers (ie. 80 for web server, 8080 for tomcat, 3306 for MySQL, 29000 for Perfect World, etc...)
-Server IP / LAN Server - The IP Address of the server for the specific service for this specific port(s)

Now all you need to do is pass out your WAN (or 'public') IP Address, (and possibly port number to the service you're hosting) so people can connect (make sure your server is on). To discover your PUBLIC/WAN IP you will need to be logged into your router, and you should be able to find your PUBLIC/WAN IP somewhere within your routers configuration interface. If you are unable to locate your PUBLIC/WAN IP you can also navigate your favorite web browser to (whatismyip.com) Just remember that the IP's that any PC's have 'behind' your router are not WAN IP's, they are LAN IP's ;)

Alternatively you can subscribe to a service like no-ip, so you can distribute a "domain name" hostname instead of IP numbers. Also subscribing to such a service really comes in handy if your ISP issues dynamic IP's (meaning your WAN IP changes periodically). Many services like "no-ip" have software that will automatically log into their servers and update your WAN IP should it change. Even if you subscribe to a service that does not have this, it would be much more convenient to change your IP with them manually whenever it changes so that people and friends can continue to use the same YOURSERVERNAME.COM or YOURSERVER.ORG instead of having to pass out your new IP address to all of your users, who, until they get it will be unable to reach your server/services.

ps) if you are intrigued by the concept of subnetting or more advanced TCP/IP networking, you can read more here:

or even better, here:


Now for a close I will include my picture rendition of the network basics I covered in this Guide/Tut. Please excuse the crudity of the image as I have been working on this guide/tut and the pic and whatnot for almost 12 hours now! (& I'll be honest, I am really hoping to never hear/see another networking related question here again!)

A few things I would like to point out in my illustration (pretty much just re-iterations of the basics of networking):

-There is a key in the upper left corner, and as it states; GREEN stands for LAN IP Address,
YELLOW stands for WAN IP Address,
PURPLE stands for PORT NUMBER,
BLUE stands for a domain name/no-ip/dyndns/ddns.
All PCs in this illustration are using the subnet mask 255.255.255.0

-As you will see, STRUCTURE/HOUSE B has two PC's but no router, therefore one PC has NO INTERNET 'access' (Yes there are ways around this though, not really simplex, not as simple as picking up a hardware router; they're cheap enough ya' know)

-STRUCTURE/HOUSE B & C happen to have the same service provider (lets even stretch it to say they have the same service cabinet, because they live on the same block). Even though STRUCTURE/HOUSE B & C have the same service provider, and are connected at the same service cabinet, this DOES NOT MEAN that STRUCTURE/HOUSE B has "open" connectivity to any PC or machine in STRUCTURE/HOUSE C (it would not make any difference had STRUCTURE B had a router, or had STRUCTURE C NOT had a router either) or visa versa

-you will notice that because STRUCTURE/HOUSE B does not have a router set up, his PC that is connected directly to the internet, the IP Address on this PC is his WAN IP Address (24.99.48.119)

-if the PC connected to the internet in STRUCTURE B is not protected by 'something' it is pretty wide open to 'attack' or anything of a malicious intent from anyone who knows or discovers this 'guys' IP address (24.99.48.119) and is up to no good

-if anyone (STRUCTURE A, C or otherwise) attempts to connect to 24.99.48.119 (STRUCTURE B) WITHOUT any malicious intent (looking for a webserver) they will discover nothing, because this PC is not running any servers

-if anyone from STRUCTURE A, B or otherwise attempts to connect to 24.99.54.78:27010 (STRUCTURE C) looking for the counter strike server "friend" set up, they will not connect. Why? because "friend" forgot to forward port 27010 in his router, so even though he is sitting there with the server running waiting for friends and people to connect, until he discovers he forgot to open the port in his router he will be sitting there playing with himself for a long time!

-machine 192.168.1.10 in STRUCTURE A -CANNOT- communicate with machine 192.168.1.115 in STRUCTURE C (even if it shared the same cabinet like STRUCTURE B) without knowing the WAN IP of STRUCTURE C (24.99.54.78)

-machine 192.168.1.47 in STRUCTURE C can connect to 63.45.87.39:8767 (STRUCTURE A) so that they can talk on TeamSpeak VoIP

-so can machine 24.99.48.119 from STRUCTURE B

-it is known WHICH PC is running the TeamSpeak server within STRUCTURE A because of the port forwarding configurations in the router. So when an incoming connection request for :8767 comes in from the WAN (63.45.87.39) the ROUTER knows to *R O U T E* that connection to the PC on the LAN with the LAN IP of 192.168.1.10

-the person connecting from STRUCTURE C never knew that the TeamSpeak servers LAN IP is 192.168.1.10, but they sure had to know the WAN IP to connect to it (63.45.87.39:8767)

-I found out that my ISP provides a dynamic IP (STRUCTURE A) so I decided to register a free NO-IP so people could connect to my servers indefinitely ( ) and I even downloaded the software that keeps everything all up to date for me, so I don't have to manually do anything :D

-A week later my power goes out, so my IP resets/changes a little prematurely. It is no longer 63.45.87.39 now it is, 120.92.47.86

-Anyone in the world can still open a web browser and navigate to and see my website!

-Web browsers happen to know to look for web sites on port 80, without you even telling them

-Anyone in the world can also connect to my TeamSpeak server using -- provided they know that it is being operated on port :8767 (standard for TeamSpeak, but it is customizable for the server/host, and the individual client - so I could change it and clients would have to know what I change it to regardless of if they connect using my current WAN IP, or my 'domain name' / 'hostname'

-again, when there is an incoming connection request from the WAN for port :80, my ROUTER knows that the LAN PC running the web server is 192.168.1.51 because of port forwarding configurations. It can then properly *R O U T E* the inbound WAN connection request for port :80 to the proper server located at 192.168.1.51:80

Oh yea, and ALL IP's in the above example, and illustration: are completely random numbers I tossed together for the illustration -- FAKE --. Bear in mind I worked on all of this info, typing, proofreading, and making the illustration. As of now I have a full 12 hours in it all (somehow) and I hope I covered everything basic. There will not be an "advanced" guide coming out from me, that you can take an actual class for like I did :p If you are already 'advanced' and you take notice of something basic I missed, please feel free to contribute below :thumbup:

Oh yea, and if you STILL DON'T GET IT:
You REALLY need to learn how to use google, and youtube; I swear between google and youtube one could almost replace or substitute college !
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Apr 29, 2010
Messages
2,170
Reaction score
600
One correction: 127.0.0.* is loopback doesn't matter at all what the last digit is as long as its in the 0-255 range

Other then that I think a lot of people would tl;dr it but you did go pretty in depth
 
Joined
Oct 14, 2009
Messages
5,493
Reaction score
2,299
... Man! I really hate the jerk at 127.0.0.1 :lol: I wish I could hack him!

This is true, 127.0.0.* is loopback, but of course the only one you ever use or hear about is 127.0.0.1
“What about me?!?”
~ 127.0.0.2 on 127.0.0.1


and now one of my favorite lines.
 

Attachments

You must be registered for see attachments list
Experienced Elementalist
Joined
Oct 11, 2010
Messages
218
Reaction score
37
ROFL 343, cool pic! And awesome guide, I vote for sticky, though we're already crammed with them at the top I know :/
 
  • Like
Reactions: 343
Joined
Apr 29, 2010
Messages
2,170
Reaction score
600
... Man! I really hate the jerk at 127.0.0.1 :lol: I wish I could hack him!

This is true, 127.0.0.* is loopback, but of course the only one you ever use or hear about is 127.0.0.1


and now one of my favorite lines.

It is particularly useful for network bind testing (like in apache setting up different virtual servers on 127.0.0.1 127.0.0.12 etc)

Thank you (x3), I was just thinking about asking for sticky, but I am noticing my friend Drakaer is no longer a mod :O oO !!??!!??

I noticed that too...

Looks like this section is completely unmoterated again as I haven't seen the other two mods (who are globals) in here in forever
 
Last edited:
Joined
Oct 14, 2009
Messages
5,493
Reaction score
2,299
yea, sadly I would not be able to 'apply' or accept such a position myself, even if I wanted to. I am just not able to visit the site with the frequency needed to assume such a position. I only get to hit the forum erratically. One moth I may be on it almost every waking hour (while working on my private PW server) of every day, and one month I may not be able to visit even once :( [real life crap does take precedence over playing or working on my games or other computer stuff :\]
 
Joined
Oct 14, 2009
Messages
5,493
Reaction score
2,299
Well evill33t may be a 'global' moderator; but even he has not been on since 08/28/2010

as indicated by the "Last Activity: 28-08-10" on his profile...

TriumpH appears to be active and on as we speak. I will try to get him to sticky this ;)
 
Joined
Apr 11, 2010
Messages
931
Reaction score
407
Nice guide 343. It is really indepth. Hopefully this will aid people in setting up their network.

Anyway in regards to me not being around...

I resigned from being mod because I didnt have the time to check the forums as often, my hard drive died and my laptop battery also semi died. Im dont have the bandwidth to download anything. I didnt see much point in me remaining a mod if I didnt have the time, bandwidth or files to run a server or mess about with things.

I started a new job as a salesperson for an electronics store which has taken most of my time. I did manage to fix my hard drive issue so I have all my files back. Some how the adapter broke so the OS couldn't tell what device it was. I solved this by purchasing a hard drive docking station. My battery was pretty much dying instantly when I removed the AC cord. I switched back to Vista (Shudder) and now it seems to last 1h45mins. As far as bandwidth I'm still at my parents so cant download anything new to try out :(. I love to try Ronny's release :(

Maybe someone else can step up and give moderating a go?
 
Joined
Oct 14, 2009
Messages
5,493
Reaction score
2,299
that's what I'm doing -- if you look at my post history I've NEVER "bumped" until now -- I think it's ridiculous that someone just un-stickied this
so bump away until we get re-sticky :)

---------- Post added at 07:24 PM ---------- Previous post was at 07:22 PM ----------

I spent an entire night writing this up -- and not for nothing //facepalm

*stands on corner with a sign that reads* "RE STICKY"
 
PW Dev <3
Joined
Feb 28, 2011
Messages
722
Reaction score
117
yeah
we need to bump all the threads till we get it stickied or banned :p
 
Status
Not open for further replies.
Back
Top