Thursday, May 8, 2014

Network Basics

TCP/IP

Most computer networks today including the Internet use TCP/IP.  An IP address uniquely identifies each computer on a TCP/IP network.  You may have noticed that your home computer has an IP address that is not exactly unique.  This is because all computers that are connected to your home router make up your own "private" network.  Since your network is private, no computers from outside your network will be communicating directly with your computer.  Therefore all private networks use IP addresses in the 192.168.x.x range.

What you think of as your home router or modem is actually a combination of things.

It is a modem.  A modem is responsible for converting the communications into a form that can be sent over telephone or cable wires.

It is a router.  The router routes packets of data to the computers they are bound for.

It is a gateway.  A gateway connects one network to another.  A residential gateway typically employees something called Network Address Translation or NAT.  In fact, you will often see your router referred to as a NAT device.  The gateway is the only piece of hardware on your home network that has a "real" IP address accessible from the internet.  NAT maps this IP address to the private IP address given to your PC.  It is generally true that if you have a NAT device between you and the internet, then your computer cannot accept requests from outside the NAT device (i.e. the internet).  However, you can configure your gateway to use something called "Port Forwarding" where you tell the gateway to forward requests to a particular port on the gateway to a port on your PC.

EndPoints, Sockets, Ports

These three terms mean essentially the same thing.  When a client program on one computer wants to communicate with a server program on another computer, the client program needs to know two things:

  1. IP address of the computer the server program resides on.
  2. The number of the port that the server program is "listening" on.
Together, these two things are called an endpoint, socket, or just port.

DNS

Since IP addresses are hard to remember, they came up with the Domain Name System.  This is simply a registry that relates a name with an IP address.  When you type www.google.com into your browser, the router actually looks up what the IP address is for that name using what is called a DNS server.  The DNS server is typically provided to you by the ISP.  However, you can change this to whatever you want.  Open DNS for example.


Firewalls

A firewall simply acts as a barrier between your computer and the network (either private or the internet).  Technically, your gateway is acting as a firewall, since by default it doesn't allow any incoming connections directly to your computer.  Windows ships with Windows Firewall and is turned on by default.  You can configure rules to allow or disallow programs from using specific ports on your computer.

No comments:

Post a Comment