[glugot] Minutes of the meeting #2

  • From: Joe Steeve <joe_steeve@xxxxxxx>
  • To: glugot@xxxxxxxxxxxxx
  • Date: Tue, 13 Jan 2004 20:06:54 +0530 (IST)

It took me sometime to finish up with this minutes. I've enclosed it
here. I wrote it in a hurry. So please bear with typing errors
:S. I've created the aligning to 70 columns which should look good
with most the email-service providers, if it dosent look good er.,
dont blame me blame your email service providerr :(

Please post errors in the minutes to me or to the list so that they
can be discussed.


"Software is like sex; Its better when it is free"
                                 -- Linus Torvalds
visit : http://www.joesteeve.tk/

-- Start of MOM --

                    (GNU/Linux User Group Of TCE)
                        Minutes of meeting #2

Date    : 10-01-2004
Time    : 16:45 to 17:45

Venue   : Z0 Hall,
          CSE Department,
          TCE, Madurai - 624015

Speaker : I. Amalan Joe Steeve ( I ME CSE )

Topic   : `Networking and GNU/Linux -- Administration & Configuring



A `computer  network' is a collection of  computers connected together
by some  physical medium. These computers communicate  with each other
by  emitting signals  on  the  medium. They  follow  some agreed  upon
protocol  in   doing  this.  There  are  different   levels  of  these
protocols.  TCP/IP  is  one   such  protocol  which  is  very  popular
today. The  Internet is driven by  TCP/IP. TCP/IP is the  child of the
`DARPA' (Defence  Advanced Research Projects  Agency). Novell promoted
SPX/IPX. IBM  promoted SNA. Xerox  promoted a protocol suite  of their
own. Today., TCP/IP has become a standard among computer networks. The
Linux kernel has a very  flexible support for networking. A major part
of the  kernel code is for networking.  Linux supports TCP/IP,SPX/IPX,
etc.. The Linux kernel can perform the best on TCP/IP based networks. 

IP Addressing:

In a  TCP/IP network, each  computer is known  by an IP number.  An IP
number  is  a 32-bit  number  denoted in  a  form  called the  `dotted
notation'. When two program  on different machines want to communicate
via the  network, they do so  by sending messages to  each other. They
address each other using a ip-address and port-no pair. The ip-address
identifies a  machine on  the netork. A  port-no identifies  a program
running  on  the  machine.  Server  programs usually  listen  on  some
predefined port.  (Eg.  SMTP  servers listen on  port number  25.  POP
servers listen on port number 110. HTTP servers (web server) listen on
port number  80.) The  port number  range 0 to  1000 are  reserved for
standard protocols and services. On  any UNIX, for a program to listen
on one of these ports, it should be run as `super-user'. 

The `Internet  Engineering Task  Force' (IETF) moniters  and maintains
the  technical details  of  the Internet  and  TCP/IP standards.  When
TCP/IP was  introduced, the IETF  identified the need to  classify the
IP-Address space and introduced  a addressing scheme called `classful'
addressing.  In this  scheme, the  IP-Address space  was  divided into
four classes.  The class in which  an ip-number belongs  can be easily
identified by examining its first  few bits. The classifying scheme is
explained below:

0xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx --> Class A
10xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx --> Class B
110xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx --> Class C
1110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx --> Class D
    x --> Either a `0' or a `1'

The Internet is comprised of many small networks. Hence its called the
`INTER NETwork'. In  order to make the addressing  more simpler a need
arised to  consider a part of the  ip-address as a network  id and the
rest  as the  host  id. Along  with  this conventions  were chosen  to
address a full  network and to address the  current network (explained
later in  this text). Now a problem  arose as to how  many bits should
comprise  of the  `network-id'  and how  many  bits should  be as  the
`host-id'.  Different   organisations  needed  different   lengths  of
`host-id'  and   `network-id's  depending  upon  the   size  of  their
networks. In order  to cater the needs of  various establishments, the
IETF proposed the `classful' addressing scheme. Where the initial bits
of the ip-address was used  to determine the bit-length of the host-id
and the network-id part of the ip-address. 

In a class A network, the first bit  is `0'. The rest of the 7 bits of
the  first byte comprises  of the  `network-id' and  the rest  3 bytes
comprises of the  `host-id'. In class B, the first  two bits were `10'
and the next 14 bits was used  as the network-id. The last 2 bytes was
used as the `host-id'. In class  C, the first three bits is `110'. The
next 21 bits are  the `network-id' and the last 1 byte  is used as the
host-id. Class D  is a special case. It is  used for multicasting. The
first four  bits is  `1110' and rest  of the  28 bits correspond  to a
group of machines. This is summarised in the following diagram. 

class A := 0xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
           |net-id|        host-id           |

class B := 10xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
           |    net-id     |    host-id      |

class C := 110xxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
           |         net-id         |host-id |

class D := 1110xxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
           |       multicast address         |

When  the  Internet was  commercialised,  a  lot  of Internet  Service
Providers sprouted up and a  new scheme came up called the `classless'
addressing.   This   scheme   removed   the  hassles   of   `classful'
addressing. The ip-number always carried along with it a integer which
specified the number of bits which are the `network-id' and the number
of bits that are the  `host-id'. A new routing called `Classless Inter
Domain  Routing'   (CIDR)  came  up.   This  is  the   currently  used
scheme.  Organisations  use  `classful'  addressing in  their  private
networks, but the public  networks are addressed using the `classless'
addressing scheme.   In classless addressing, an  ip-address is always
accompanied by a net-mask or an integer. It is denoted as follows. 

      ip-number= a.b.c.d
      net-mask =

This means that the first 8 bits of the ip-number is used as a network
id and  the rest of  them are used  as the host-id. Netmasks  are also
used in the `classful' addressing scheme to specify subnets. 

Networking in Linux:

The hardware  component which  connects a computer  to the  network is
called   the   interface.   There   are   a   variety  of   interfaces
available.  The  most  commonly  used  device in  LANs  are  `Ethernet
controllers'.  In the case of  connection to other networks modems are
used. These modems  can either be a regular telephone  modem or a ISDN
modem  or leased  line modem  or anything  else. These  interfaces are
exported as a device file  in the `/dev' directory by any conventional
UNIX. But  Linux dosent export this  as a file.  Instead these devices
are initialised  and maintained internally. They can  be configured by
userland software.  This adds  flexibility to use  the kernel  for any
networking purpose. 

Internally the interfaces are  named depending on their type. Ethernet
controllers are named as eth[0...n]. PPP interfaces (modems) are named
as ppp[0...n].  When the  kernel finds a  Ethernet device,  the kernel
initializes the corresponding device. In the case of ppp devices, user
software  should create  the link  and  then inform  the kernel  about
it. This way the user gets to makeup a ppp link to an ISP or any other
network at his/her own wish. 

Each  of these  interfaces  can  hold more  than  on ip-address.  This
feature  is helpful  in  cases where  a  machine acts  as the  gateway
between logical subnets on the same physical network. In this case the
devices are named as follows. 

        eth0 --> first interface 
        eth0:1 --> second interface
        eth0:2 --> third interface ( and so on )

The command to assign an ip-address to an interface is;

    #ifconfig eth0 netmask up

The above command  assigns `' to eth0 and  sets the netmask
as `'.  Now the kernel assumes the  broadcast address and
the   network    address   as   `'    and   `'
respectively.  To  shutdown an  interface,  the  following command  is
    #ifconfig eth0 down

The  ifconfig is  a tool  used to  control various  parameters  of the
interface. `ifconfig' stands for `interface config'. 

Name resolver:

On the Internet, it would be difficult to remember the ip-addresses of
the needed web-sites. Hence, the individual computers on a network are
given a name and are referred using this name. In this case., a method
is needed to convert these  human readable names to ip-addresses. This
is the  work of the  resolver code of  the Linux kernel.  The resolver
code  can either  look  into a  locally  available configuration  file
(/etc/hosts.conf) for a `hostname'  to `ip-address' mapping, or it can
request another server called the `nameserver' or `DNS server' to give
the ip-address for the required hostname. 

The `/etc/host.conf'  file controls how  the resolver should  go about
resolving  a given hostname.  It specifies  where the  resolver should
look first, either  the local file or the server.  The following is an
example `/etc/host.conf'. 
        # These are comment lines
        # /etc/host.conf
        order hosts,bind
        multi on

In  the   above  case,  the   resolver  code  first  looks   into  the
`/etc/host.conf' file to find a match for a particular hostname. If it
dosent find  one, then it requests  an external server  to provide the
ip-address for the required hostname. 

The `/etc/resolve.conf' defines the addresses of the nameservers. When
the resolver code decides to  query a external server about a hostname
it consults this file to find the list of `nameservers' it can query. 

TCP/IP  standard defines  `'  as the  loopback interface.  It
means  the current  machine. This  address  is used  for checking  and
debugging.  This is  often called  the  loopback device.  This can  be
configured   like  anyother  interface.   The  kernel   handles  these
interfaces  specially.  (i.e.)  packets  to  this  interface  are  not
broadcasted  on the  network but  are  subjected to  all the  protocol
layers like any other packet. The loopback interface can be configured
using the following commands. 

      #ifconfig lo
      #route add -host lo

The second command `route' adds  a route in the kernel's routing table
about how to reach this interface. Routes are needed in the case where
multiple  networks are  interconnected  (like in  the Internet).  When
setting up  a ppp link with a  ISP or some other  computer, the `pppd'
(PPP software) assigns  the route of all the packets  as the other end
of the ppp-link. When configuring a `network-router' the administrator
should set  up the routing  tables accordingly. However  discussion of
routing is out of the scope of this text. 

Other config files:

A few other configuration files are worth discussion. These are mostly
defined automatically by the installer scripts. 

`/etc/services'  -> This  file  describes the  different services  and
their respective port numbers. 

`/etc/protocols'  -> This  file  describes the  various protocols  and
their respective numeric ids. 

`/etc/hosts.allow' ->  A listing of hosts and  the respective services
they are allowed to access. 

`/etc/hosts.deny' ->  A listing of  hosts and the  respective services
they are denied from accessing. 

It is highly  recomended that the user check these  files to make sure
what he/she allows and denies on his box. 


I've tried  my best to  keep this text  as simple as  possible. Please
notify errors in this text directly  to the author. If it is a subject
of  discussion,  you are  free  to start  a  thread  of discussion  on

-- EoF --

Other related posts:

  • » [glugot] Minutes of the meeting #2