Networking Basics with Linux

Linux networking is based on TCP/IP protocol stack. TCP/IP refers to a large group of protocols which makes the communicate possible among large number of computers all over the world.  As a matter of fact, every computer which is connected via TCP/IP protocol is called host and a host can be a server, a client, a router or a firewall etc. Internet is so popular now that we can not live without it. Lot of critical business activities are dependent on Internet now and that is possible because of TCP/IP.

 
Note: The word Internet has two different meaning - (1). The lowercase refers to the technology and (2). The uppercase refers to the world wide network interconnecting computers all over the world.

IP ADDRESS:
IP stands for Internet protocol. It is a 32-bit number assigned to every computer on the network. This acts as a logical name for that computer. This is very essential to have a IP number assigned to each host of the network before it could communicate to other peer. It is written as, for example,  192.168.1.1 or 10.10.10.1 etc. The IP addresses are grouped to form class as shown below -

Table: IP Address Class
---------------------------------------------------------------------------------------------------------
Class           Initial Byte          Initial Bit Value          Network Address          Local Address
---------------------------------------------------------------------------------------------------------
A                0 - 127             0                            7 bits                            24 bits
B                128 - 191         10                           14 bits                          16 bits
C                192 - 223         110                         21 bits                          8 bits
D                224 - 239         1110                       ---                                ---
E                240 - 255          1111                      ---                                 ---
----------------------------------------------------------------------------------------------------------
 
SPECIAL IP ADDRESSES
1. Loopback IP address: 127.0.0.1
2. Private IP address: 192.168.1.1 - 192.168.1.254
3. Meaning of 255.255.255.255 : This is when all the bits are 1 and broadcast a message to every host in the local network
4. Meaning of 0.0.0.0 : This denotes the current host on the local network.

PORT NUMBER
IP address is used to locate a computer but what about locating a application running on that computer. That's when Port Number comes in. Port number does that job of locating a specific application running on that computer. For example, if your computer is receiving an e-mail, it automatically goes to your e-mail reader application such as Outlook. This happens because the incoming message comes with port number for e-mail along with the IP of your computer and it is automatically forwarded to outlook because of the port number it is carrying. This happens because of the fact that whenever a message is sent from one computer to another, return IP address and return port are included in that message.


DOMAIN NAME SYSTEM (DNS)
DNS is used to look up computer names to find out their IP addresses. Initially, names and addresses used to be stored manually on the computer itself in text file. This is still a common practice for small network but as the network grows beyond certain computers, it starts getting to be a problem in maintaining the addresses on all computers. This is when the usefulness of DNS system comes in - one computer automatically maintains the lists of all computers and other computers refer to it to look up IP addresses.

ROUTING
Routing means moving a message from one computer to another using 32-bit IP address. The computers responsible for doing so maintain routing tables. The routing tables are consulted every time a message is received to determine where the message should be sent next.

 
FILES
1. /etc/protocols : This file is important for TCP/IP communications and defines the set of low-level protocols.
 
2. /etc/services : This file stores the port number and their respective services. When a computer receives a message from Internet, the message is routed to its respective program based on the port number stored in this file.
 
3. /etc/hosts : This file keeps the IP address and corresponding host names.

4. /etc/hosts.allow : This grants access to only a specific list of hosts in this file
 
5. /etc/hosts.deny : This denies access to specific list of hosts in this file.


UTILITIES FOR MONITORING NETWORK
Following utilities are useful in collecting information about the condition of the network -
1. arp : it stands for Address Resolution Protocol and provides address resolution.

2. host :  This is used to look up host names and return information about them.

3. ifconfig : It display the currently active network configuration and also to configure it.

4. netstat : It displays information about all the sockets on a local host.

5. nslookup : This queries a DNS server for the IP address of a host name.

6. ping : This is used to check the connectivity between two hosts.

7. route : This is used to view routing table and modify the table entries.

8. tcpdump : This monitors a TCP/IP connection and displays information from incoming and outgoing packet headers.

9. traceroute : This lists each host in the path from a host to remote host.

10. usernet : This is used to control the network interface under X.

No comments:

Post a Comment

Commonly Used Abbreviations Used Daily

Although, we tend to use short form of long words in daily life but there are many abbreviations which we don't remember. Below is the l...