Sunday, July 11, 2010

Basic Digital Electronics

Before entering to the detailed networking topics, it is always better to start with basics of digital electronics and digital communication.

The digital electronics as the name implies is electronics of digits or digital data, whatever the data you have is not matter in this case, may be it is voice, video, image, text anything that is manipulated as digits. The digital communication thus should be the communication between digital equipments in digital form of data.

The basics of digital electronics is the binary arithmetic and logic, the binary is base 2 number system in which the possible two digits are 1 and 0, which in turn implies to the two states of electric/electronic component i.e. ON and OFF.

The usual arithmetic like +(addition) , -(subtraction), *(multiply), /(division) are also possible with binary numbers too, in addition to that in binary system we have some logical operations like AND, OR, NOT, XOR etc, for our topic, it is having much importance than other for later discussions.

And the basics of the digital circuits is based on this operations, in the form of simple electronic circuits called digital logic gates which will output the result of these logical operations. And here the output of such great operations,

The AND, OR and XOR gates have two inputs while for NOT only one input and all are having one output. Remember that in digital logic the output 1 is true and 0 is false

AND
its output is true(1) only if both of its inputs are true, all other cases it result false(0)
OR
Its output is true if any or both of the inputs is true, result is false only if both inputs are false
XOR
Its output is true if exactly one of the two inputs is true, i.e. odd number of true(1)s
NOT
It just negates or complements the input, if the input is true output will be false and if input is false output will be true

When the AND, OR, XOR combined with NOT, the output of the gates will be the opposite of the AND, OR, XOR operations and the resulting gates are NAND, NOR, XNOR respectively. Here the NAND and NOR are called universal gates and any other logic gate can be constructed using combination of any of these two gates.

So keep the operations in mind and remember these are the operation behind any digital device, whether it is computer, mobile, DVD player anything, and in the communication equipments like routers, switches, and your digital TV receiver.

Saturday, July 10, 2010

Dynamic DNS Servers

Sometimes you will get blocked when you try to access remote systems using the IP address itself. May be sometimes you are to check your local web server is running, that you setup in your home and having a dynamic IP address, when you asked your friend to check your server is running properly, and he/she types the url like http://117.193.123.113/mysite/index.php, sometimes he will get blocked from accessing your server, even if you enabled NAT and all done properly.

It is always easy to remember a site name than IP address and also the IP address, if you are having a dynamic IP will change each time (not always) when you reset the modem based on availability of IP addresses. In such cases there are services that provide you the facility of dynamic DNS servers, where you can create your domain, i.e. a sub domain of the service provider's top level domain. You can set the sub domain to point to the IP address you have. You need to update the ip corresponding to the domain each time if it changed (usually if the modem resets).

Suppose the above case, you are having the ip 117.193.123.113 and you want to test your home ftp server then you can create a domain like myhomeftp.dyndns.com and you can set that point to your home PC that is assigned an ip 117.193.123.113 (set up NAT to share the same public ip between modem and PC, so that the service running on your PC will be available to the public).

There are many such providers offering you the dynamic DNS, and i used the same service from dyndns.com for test purpose and also for the company i worked for, to use the ftp server i setup for the company, that I explained in previous article, as it is a static ip no need to update the dns server frequently.

They provides a number of choices for you to select the top level domain, like dyndns.com or homeftp.net etc.

Friday, July 9, 2010

Remote Connect via SSH or Telnet

We can connect to a remote computer using telnet (port 23) or SSH (port 22) protocols based applications. Suppose the server running an ftp service, and the server is based on operating system ubuntu. When you install ubuntu server with default options, it will install the SSH service too, also if you want setup telnet server on ubuntu(if it is not already installed). Check it using the command telnet IP-Address/Name of the system, or if you are already on the terminal of the system running the service use the command telnet 127.0.0.1 (address for the local host). If it asks for the user id and password then is is working fine, else require new installation.

To install telnet follow the steps
  1. Install inetd super server using command sudo apt-get install netkit-inetd
  2. Install telnet using the command sudo apt-get install telnetd
  3. Restart the inetd service using command sudo /etc/init.d/inetd restart
  4. Now the server is ready and can access using the command telnet ip-address/computer-name, can test it from terminal using command telnet 127.0.0.1
  5. Now can use the terminal/command prompt as you work on your terminal itself
  6. Sometimes the telnet server will show you the available menu items that you can select to perform the tasks available(you have permission) to do, for e.g. if you telnet your modem from command prompt (for e.g. telnet 192.168.1.1), you can find a set of menu items you can select it to configure the modem
Telnet and SSH provide almost the same functionality but SSH is secure than telnet.

SSH
In most cases the ubuntu server will install the ssh server when you install ubuntu. If you want access the ssh since telnet is not secure, to access the system using ssh, you can use any ssh client programs like putty. Here is how can use putty to access the system via ssh
  1. Download putty and run it
  2. Enter the host name/computer name/ip address of the system you want connect to
  3. By default, the port address will be 22 and if you are not altered the default setting for ssh on your server leave as it is, otherwise change the port address as you set for the ssh server
  4. Then click open, if it is able to connect to the server via ssh will open the terminal and you can do anything with that server that you have permission to (or can access the programs that you have access to)

Thursday, July 8, 2010

Basic Networking Commands

Here is some basic commands used in networking world
  1. ping :- ping command is used to check the computer is active in the network(ping IP-address/Computer Name, eg:-ping 192.168.1.1 or ping mydesktop or ping google.com)
  2. ipconfig :- to find out the details regarding the active network connection i.e.associated ip address, physical address, subnet mask, default gateway etc (ipconfig/all)
  3. netstat :- to find out the different ports active on the system. It displays the port number and protocol(TCP/UDP), local address with port number (local address : port), foreign address(foreign address : port), state (Active or not i.e. connection established or wait), use the command like (netstat)
  4. tracert :- it trace the route to a particular computer, for e.g:- if you want find the route to google.com so that you can find whatever IP addresses are involved in accessing google website, or which routers are involved in routing your request to google.com at that particular time(tracert google.com), remember that the table may vary in different intervals of time, the table you got at the moment may/may not be same as the table you will get after few seconds

Remote Connect

Sometimes we will be required to configure a remote system, for e.g:- a technical support officer in India will be informed to configure the web server running in US data center, in such cases we will be required to use programs that help in remote connectivity.

For windows (Windows XP/ 2003 server) we have remote desktop connection, that help to connect to a remote windows desktop and we can configure it the same way as we configure our desktop machine.

For that follow the steps
  1. Remote desktop connection from Start->All programs->Accessories->Communications->Remote Desktop Connection.
  2. You will be prompted for the computer you want connect to, enter the IP address or the domain name of the computer you want connect to (eg:- 59.129.180.121 or myserver.com), if you are trying to connect to a system in the same local area network as yours then enter the system name
  3. Click Options and enter the user name and Password
  4. Click Connect
  5. Then if the details provided are all correct then you will be connected to the remote dektop and you can work on it as the same way as you work with yours
  6. Also verify that you have checked the Allow remote assistance invitations to be sent from this computer (Select Start-> Control Panel -> System -> Remote)
At the server side you must setup the system so that it is ready to accept remote desktop connectivity, for that you want do is that
  1. Select System from Start->Control Panel
  2. Select the Remote tab
  3. Check Allow users to connect remotely to this computer
  4. Click Apply
  5. Also you can select the users who can be permitted to access the computer remotely by selecting the Select remote users
  6. Select Windows Firewall from Control panel
  7. Select the exceptions tab
  8. Check the Remote desktop and click OK
Also check at the server side that you have enabled NAT (is explained in the previous article)

Wednesday, July 7, 2010

Setup NAT for Public Access

Whatever service installed on a server will be available to the local network inside the organization only if the NAT(Network Address Translation) on modem is not properly set. This is how I Setup NAT on my UTI StarCom Modem provided by BSNL with their broadband (netone) connection.

  1. From terminal/command prompt typed the command ipconfig/all and pressed enter key
  2. Found the Default Gateway address from the list(e.g:- Default Gateway : 192.168.1.1)
  3. Opened the web browser Mozilla Firefox/Internet explorer/Google Chrome/Any other
  4. Typed the URL http://192.168.1.1 in the address bar and pressed enter (replace the default gateway address if required)
  5. It prompted for the user id and password, entered it and pressed enter again
  6. Selected Advanced setup->NAT from the left navigation menu
  7. There are two options DMZ host and virtual servers, selected DMZ host and and typed the IP address of the system running the ftp/web/other service(e.g:-192.168.1.100)
  8. Clicked Save/Apply button and then restarted my modem (not always required)
  9. I checked my PC running the service for its IP address, for that I used the command ipconfig/all again from command propmt, it displayed my IP address as 192.168.1.4
  10. Then I changed my IP to 192.168.1.100 by selecting My Network Places->View Network Connections->Local area connection->Properties->Internet Protocol(TCP/IP)->Properties->Use the following IP Address
  11. Entered the IP 192.168.1.100 and subnet mask 255.255.255.0 and default gateway to 192.168.1.1, the same gateway address i got in step 2, clicked OK/Apply
  12. The same gateway address is entered as Preferred DNS server
  13. Now the service is available to the public

Friday, July 2, 2010

FTP Server on Windows XP

Today want a talk about how did I setup an FTP server on my windows XP. For this I used Filezilla server. First I donwloaded the Filezilla server and installed on my Windows XP based desktop PC. Then I edited the settings for the Filezilla server, for that I opened the server interface and changed the welcome message and added a group and few users to it. The steps are noted as below,

  1. Downloaded and installed filezilla on my desktop PC named desktop
  2. Opened the admin interface clicked OK after entering the server address (127.0.0.1 by default) , port and admin password
  3. Selected the menu Edit->Settings
  4. From the left tree view selected General settings->Welcome message
  5. Changed the custom welcome message and clicked OK
  6. Then selected menu Edit->Groups
  7. On the right of the window clicked Add, then Entered the group Name "ftp users" and clicked OK
  8. Created a folder named ftp on the D- drive
  9. Clicked shared folders on left and clicked the add button on left side
  10. Selected the folder d:\ftp, set the permissions (read/write/execute etc) and clicked OK
  11. Selected menu Edit->Users
  12. Clicked Add on right side and added user "ftp user" and selected the group he belongs to, i.e "ftp users"
  13. Set the password for the user
  14. Selected shared folders on left side and added the folder d:\ftp and set the permissions for the folder
  15. Clicked Ok
  16. Finally on Start->Control panel select windows firewall and select Advanced tab and select the Connection you are using (eg:- Local area connection-LAN), and click settings and then check the FTP server in the list showing the services running on your computer the click OK twice
  17. Test the ftp server from other computer on the network using the url ftp://desktop, if you are using filezilla client enter the desktop as host and enter userid and password click quick connect
Download filezilla server and client programs from http://filezilla-project.org/