Networking


NETWORKS OF NETWORKS CALLED INTERNET. 
The progenitor of the modern Internet was a network called ARPANET (The Advanced Research Project Agency Network) that was established in 1969 by DARPA (Defense Advanced Research Projects Agency), the R&D of U.S.A DoD. The ARPANET eventually become the NSFNET (National Science Foundation Network) backbone, which connected supercomputer sites and regional networks. 

In mid-1980s, the Internet consisted of the original ARPANET sites and a handful of universities, but when the students in universities heavily uses the Internet would collapse. Van Jacobson a researcher in Lawrence Berkeley Lab come up with an algorithms called TCP/IP. TCP/IP now in the world most commonly used with LINUX/UNIX, Mac, Windows and most other operating systems. It is also the native language of the Internet. 

Tim Berners-Lee is a British Computer Scientist invented the World Wide Web (WWW) in 1993. He implemented the first successful communication between a Hypertext Transfer Protocol (HTTP) client and server

NSFNET was turned off in 1994 and today's backbone Internet is a collection of private networks owned by ISPs (Internet Service Provider) that interconnect at many.

The development of Internet has always been a cooperative and open effort. Some important organization which involve in this process are:
  • ICANN (Internet Corporation for Assigned Names and Numbers).
  • ISOC (Internet Society), is a membership organization that represents internet users.
  • IETF (Internet Engineering Task Force), oversees the development and standardization of the technical aspects of the Internet by help of RFC (Request for Comment). It is an open forum. 
TCP/IP
It is a protocol suite designed to work smoothly together. It starts with 3 identification HOSTNAME, IPADDRESS, MAC ID. It includes several components:
  • TCP (Transmission Control Protocol) and UDP (User Diagram Protocol), delivers data to specific applications on the destination machine.
  • IP (Internet Protocol), routes data packets from one machine to another.
  • ICMP (Internet Control Message Protocol), provides error messages, routing assistance and debugging.
  • ARP (Address Resolution Protocol), translates IP address to hardware addresses.
  • RARP (Reverse ARP), translates hardware address to IP address.
OSI Layer
TCP/IP is designed around the layering scheme;

IPv4
Internet Protocol version 4 is the fourth version in the development of the Internet Protocol (IP) and the first version of the protocol to be widely deployed. It is one of the core protocols of standards-based Internet working methods of the Internet, and routes most traffic in the Internet.

IPv4 uses 32-bit addresses, which limits the address space to 4294967296 (232) addresses.

In this three range of addresses are reserved for use in private network. These ranges are not routable outside of private network.  
  •  10.0.0.0–10.255.255.255           Class A
  • 172.16.0.0–172.31.255.255        Class B
  • 192.168.0.0–192.168.255.255     Class C 
IPv6
An Internet Protocol Version 6 address is a numerical label that is used to identify a network interface of a computer or other network node participating in an IPv6 computer network. An IPv6 address consists of 128 bits.

Ports
IP addresses identify machines, or more precisely, network interfaces on a machine. TCP and UDP extend IP addresses with a concept known as port. A port is a 16 bit number that supplements an IP address to specify a particular communication channel.

Port
Description
1
TCP Port Service Multiplexer (TCPMUX)
5
Remote Job Entry (RJE)
7
ECHO
18
Message Send Protocol (MSP)
20
FTP -- Data
21
FTP -- Control
22
SSH Remote Login Protocol
23
Telnet
25
Simple Mail Transfer Protocol (SMTP)
29
MSG ICP
37
Time
42
Host Name Server (Nameserv)
43
WhoIs
49
Login Host Protocol (Login)
53
Domain Name System (DNS)
69
Trivial File Transfer Protocol (TFTP)
70
Gopher Services
79
Finger
80
HTTP
103
X.400 Standard
108
SNA Gateway Access Server
109
POP2
110
POP3
115
Simple File Transfer Protocol (SFTP)
118
SQL Services
119
Newsgroup (NNTP)
137
NetBIOS Name Service
139
NetBIOS Datagram Service
143
Interim Mail Access Protocol (IMAP)
150
NetBIOS Session Service
156
SQL Server
161
SNMP
179
Border Gateway Protocol (BGP)
190
Gateway Access Control Protocol (GACP)
194
Internet Relay Chat (IRC)
197
Directory Location Service (DLS)
389
Lightweight Directory Access Protocol (LDAP)
396
Novell Netware over IP
443
HTTPS
444
Simple Network Paging Protocol (SNPP)
445
Microsoft-DS
458
Apple QuickTime
546
DHCP Client
547
DHCP Server
563
SNEWS
569
MSN
1080
Socks

To allow hosts that uses private address to connect to the Internet, the border router uses a system called NAT (Network Address Translation). NAT intercepts packets addressed with private IP address and rewrite source addresses, using a real public IP address. It also maintains a table of the mappings it has made between internal and external address/source, port pairs so that NAT can be performed in reverse when answering packets arrive from the Internet.

Routing
Routing is the process of directing a packet through the maze of networks that stand between its source and its destination. Routing information is stored in a table in the kernel. Each table entry has several parameters.

Examine a PC routing table
#netstat -rn
Kernel IP routing table
Destination      Gateway         Genmask            Flags     MSS Window    irtt Iface
0.0.0.0             192.168.1.1     0.0.0.0               UG         0 0                     0 eth0
192.168.1.0     0.0.0.0            255.255.255.0    U            0 0                     0 eth0

 

Examine a PC interfaces
# ifconfig
eth0    Link encap:Ethernet  HWaddr 44:37:e6:2e:40:f7 
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4637:e6ff:fe2e:40f7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20011 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18953 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15619014 (14.8 MiB)  TX bytes:5518026 (5.2 MiB)
          Interrupt:17

lo       Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:680 (680.0 B)  TX bytes:680 (680.0 B) 


Configure Network Interface.
ifconfig enables or disables a network interface, set IP address and subnet mask and set various other options and parameters. 

#ifconfig eth0 192.168.1.21 netmask 255.255.255.0
it will configure the NIC, but it's temporary. On shutdown it will flush out.
#ifconfig {eth0} up To enable the NIC.
#ifconfig (eth0} down To disable the NIC.

To permanently assign a IP address to NIC, edit /etc/network/interfaces
#nano /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

 

Change the entries
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

address 192.168.1.21
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1

For Virtual ethernet
auto lo
iface lo inet loopback

auto eth0:1
iface eth0 inet static

address 192.168.1.51
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1

Restart the Service.
#etc/init.d/networking restart
ifconfig understands many other options, consult man pages for the final word on particular systems.

Network Configuration Files.

/etc/hostname Hostname.
/etc/network/interfaces IP address, net mask, default route.

/etc/hosts file is the oldest and simplest way to map names to IP addresses. Each line start with an IP address and continues with the various symbolic names by which that address id known.

#nano /etc/hosts
127.0.0.1        localhost
127.0.1.1        debian
192.168.1.23   growwithlinux.blogspot.in
it contains only local mappings.

Configuring auto negotiation.
The NIC may support 1,10 or even 100Gb/s in both half duplex and full duplex modes. Most equipment defaults to auto negotiation mode, in which both the NIC and its upstream connection try to guess what the other want to use. High packet loss rates are a common artifact of failed auto negotiation.
#mii-tool -v eth0
eth0: negotiated 100baseTx-FD flow-control, link ok
 product info: vendor 00:50:43, model 11 rev 1
 basic mode:   autonegotiation enabled
 basic status: autonegotiation complete, link ok
 capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
 advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
 link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control


To lock this interface to 100 Mb/s full duplex
#mii-tool -force=100baseTx-FD etho 

No comments:

Post a Comment