# Data Networking/Fall 2013/Group11
## The Folks

   * Saurabh Bindoo
   * Shashishekhar B Manjunatha
   * Avinash Ronanki
   * Sumedh Saurav

## Motivation

Eager to learn how the real things work in the current scenario.The project is like building our own network and working on that. This exposes us to various things that happen in today's networking world. By this project we get an hand on on network different protocols, Linux and various real time problems which we come across. It also help us to deal with a situation, work as a team and various skills has been learnt

## Understanding the Protocol
#### DHCP

Dynamic Host Configuration Protocol (DHCP) is a standardized networking protocol used on Internet Protocol version 4 (IP4) and IPv6 networks to dynamically configure IP addresses, Default DNS server, Subnet Mask and Default gateway that is needed for Internet communication. DHCP allows computers and other devices to receive an IP address automatically from a central DHCP server, reducing the need for a network admin or a user from doing it manually.
DHCP is a four step process for a host to acquire an IP address.
* DHCP Server Discovery: Once the host enters the network it sends a DHCP discover message with a UDP packet to port 67. This IP datagram is broadcasted on IP address of 255.255.255.255 with a source IP as 0.0.0.0
* DHCP Server Offer: The DHCP server on receiving the DHCP discover message responds to cliet with DHCP offer message on the broadcast address. It sends the proposed IP address for the client, the network mask and IP address lease time.
* DHCP request: The DHCP client will chose one of the IP sent by DHCP server and responds to client with DHCP request message echoing back the the confgiuration parameters
* DHCP ACK: The server responds to the DHCP request message with a DHCP ACK message, confirming the requested parameters.
Once the client receives the DHCP ACK, the interaction is complete and client uses the IP for the lease duration.

#### DNS

DNS stands for Domain Name Server is the hierarchial distubution of naming systems for the servers and services distrubed through out the Network. DNS is a protocol within a set of standards for computers to exchange data on the networks known as the TCP/IP protocol. DNS is used for translating the domain names to IP address of the URL.• The browser extracts the hostname group11.lan from the URL and passes the hostname to the client side of the DNS
* The DNS client sends the DNS query along with the hostname to the Local DNS server
* Local DNS server forwards the query to the Root DNS server. The root dns server takes note of lan suffix and responds with the set of IP addresses of Top Level DNS server responsible for .lan
* The local DNS server then resends the query to Top level DNS servers take note of group11.lan suffix and responds with the IP addresses of authoritative DNS servers for group11.lan namely dn1.group11.lan.
* Then Local DNS server sends the query to dn1.group11 which responds to the IP address dn1.group11.lan.
* The server then responds with Authrative DNS entry with the actual IP of group11.lan and the browser forwards the request to the webserver.

#### BACKUP

The primary purpose is to recover data after its loss, be it by data deletion or corruption. Data loss can be a common experience of computer users. The secondary purpose of backups is to recover data from an earlier time, according to a user-defined data retention policy, typically configured within a backup application for how long copies of data are required. In telecom for example the data is stored for a duration of 3 to 6 months based on the operator and later archived and put into disk arrays. The data is generally a backup of DB servers which is stored and retrieved from SAN disks interconnected using SAN switches. The data that has crossed some given condition is archived into an array disk.
* Archiving the required files. The Archiving format can any of the available open source or propriety software’s .
* Establishing a secure communication between the systems exchanging the data for the purpose of backup. SSH service i.e. SCP is used for the file transfer.
* The host running the process of taking the files and archiving requires the basic environment set. The environment is basically TCL, expect and SCP.
* The remote host where the data is to be placed is requires the SSH service to be enabled. The service is enabled by downloading the package openssh-server
* Run the backup process in the system where the files are present. The backup process will automatically archive the files into a zip and place the files in the backup system. This backup process runs periodically of given duration

## The Requirements

The project emphasizes on the network elements which we have studied in Data Networking. It requires us to build a private network in the company and experience the things which happen and understanding various protocols. It also needs to learn lot of commands in Linix

## Steps to perform the setup / installation
#### DNS Server Setup

* Assign a static IP to the DNS servers
* Assign a host name to the doamin
* Assign forwarders i.e the IP's of DNS servers which can resolve the domain names or Ip addresses
* Assign the files for forward lookup zone(resolves domain names to IP addresses) and reverse lookup zone(resolves IP address to domain names). Can setup a master/slave configuration. Default is always a master
* In the forward lookup zone file assign all the required domain names as name servers,authoritative servers and cannonical name records
* In the reverse lookup zone file assign all the required domain names as name servers,authoritative servers and cannonical name records pointed to a domain name.
* save the files
* restart the services related to networking

#### Back UP operation Setup

* Install the package openshh-server in the system where the backup file is to be placed.
* Install packages "tcl" and "expect" in the machine where the backup has to be taken
* Install the package "zip" in the machine where the back up has to be taken
* In the srcFile.txt enter the fields for the placeZipFile-plaace the zip file in the respective directory,fileToBeZipped- the respective directory or file to be zipped,scpPort,scpUserName,scpIpAddress,scpLocationinServer- the location where the zip file has to be placed,scpPassword and schedulePeriod- schedule time to take the backup; given in seconds
* A tcl script is written than automates the process of taking a backup from any system irrespective of the platform.
* Run the file backUpJob.tcl script from the shell promt/terminal
* The backup happens for every period mentioned in the srcFile.txt field "schedulePeriod".
* Check the backup file in the remote machine where the backup is taken. It should show and the zip file as well as the time when it is put.

#### DHCP Server Setup

* The DHCP server package "isc-dhcp-server" is installed on the client
* For setting up DHCP we need to configure mainly the two files "isc-dhcp-server" and "dhcpd.conf" file. In isc-dhcp-server file we need to mention on which interface the DHCP server should server the DHCP requests. In our case we use eth0 as default interface and mention the same in the Interfaces.
* We now edit the dhcpd.conf file. In this file we mention the configuration of the address and other information needed by the client to connect to the network. We specify the subnet, netmask, domain name, default lease time, maximum lease time and range of IP which has to be distributed to the clients.
* After these settings we restart the DHCP server
After these changes whenever we connect to the network the DHCP server assigns the IP to the clients which joins the same network.

#### WebServer Setup

Apache server is downloaded to ubuntu and a web page is deployed in the server. The service is up and running to port 80. Currently no testing has been done with respect to network. The same setup has been tested with http://localhost:80/project/
Also apache tomcat 7(application server) was initially used as a web server. The setup involved setting up the java envirnment jre 6.0 in the OS and adding all the necessary libraries and programs to the envirnment. Both the servers run on java platform and it becomes necessary to set up the envirnment for it if the installation is not through yum or atp-get.The package was downloaded from http://tomcat.apache.org/download-70.cgi. The setup was testing by successfully running in the localhost and a static IP assigned to the ethernet interface card(wired).

#### Firewall Setup

Tried to Install Iptables on the Ubuntu. Was working Fine when i tried to black the IP address ( Tested with respected to 1 IP address) Will be doing the regression Testing Tomorrow. Will Updates with the commands along with the setup once successful with the regression Testing .

## Testing

We connected all the modules using a router(configured as switch). All the systems were connected using a Lan cable. DNS testing was done using dig command on the client. nslookup resolved to IP in the system. On the client the uRL https://group11.lan was accessed and it resolved to webpage was delivered in the client
DHCP was tested by checking the IP address assigned to the client on connecting the network.
Webserver was tested by accessing the link on the client machine
Backup was scheduled to run every day and its is visible on the server where the backup file has to be located
Test Tools
* nslookup
* dig
* named-checkzone
* host -l

## Future Prospects

High performance systems can be uses to increase the performance of the network which has a better response time
A router can be used and VLAN can be configured to increase the security and different DMZ can be created Expansion : Many more functionalities can be added along with the present set up. Instead of web server an application server can be used. Wiht a application server comes an additional complexity of placing frameworks, connection with DB locally and remotely. Also repostories like SVN can be used to store the data- can be software or any other documentation. LDAP and user roles can be achieved as to who gets access and the permissions to a device or an application. A ticketing system can be added that can automatically send emails in case an event is triggered. The event can be system generated or user generated.
Growth : New modules can be added based on functionality and purpose
Improvements : New versions of the packages could be available in future that may resolve certain bugs that could be present. The set up may not full proof as the packages and softwares are open source. Propriety softwares and support can enhance the usgage in a enterprise.

## Issues Faced

DHCP: While setting up DHCP we came across the errors in DHCP configuration file. After setting up all the parameters and restarting the DHCP server the server failed to start. On checking the system logs we came to know that the DHCP server was configured to used the network address. So the range of IP we used were different from the network the DHCP server was. On changing the interfaces file we were able to fix the issue. DNS: After configuration of DNS of the first time and checking all the named-checkzone file all worked. The dig and nslookup didn’t give any results although all the files are correct in the the files. Restating Ubuntu resolved the issue.

## Citations

http://www.technicalinfo.net/papers/Pharming.html
http://www.ietf.org/rfc/rfc1035.txt
https://google.com
https://help.ubuntu.com/community/
http://askubuntu.com/
Data Networking Text book by Kurose