dropdown menu

NETWORK - BASICS, PROTOCOLS

Basics - Protocols, Subnetting

TERMS:

host                    A computer attached to the network.
local host              The computer at which the user is working.
foreign or remote host  Any other computer in the network
server                  A host that contains the information to be accessed, it makes its resources available for other machines
client                  A host requesting services or data from another computer
internet                Heterogeneous networks connected together
port                    A port identifies the application on the host
socket                  A socket is a combination of IP Address, Protocol and Port Number
                        <protocol, source-address, local-port, destination address, destination-port>

loopback interface      it allows a client and serever on the same host to comm. with each other (127.0.0.1)
network address         IP address with all host address bits set to 0.
                        (This type of address is used in the routing table as the network destination address.)
broadcast address       IP address with all host address bits set to 1

Node                    In networks, a processing location. A node can be a computer or some other device, such as a printer.
                        Every node has a unique network address (often called as MAC address).
Domain                  It is a group of systems under the same administrative control

LAN

Local Area Networks are networks in a close geographical area:
    -Token-Ring (4 or 16 Mb/sec)
    -Ethernet (10 100 or 1000 Mb/sec)
    -FDDI (fiber optics) (100 Mb/sec)


TCP/IP LAYERING:

APPLICATION            It is a user process cooperating with another process on the same or a different host.
(e.g. HTTP)            FTP, HTTP, DNS, TELNET, SMTP, NFS ...

TRANSPORT              It provides for the end-to-end delivery of data. It is basically an interface for the application layer to IP.
(datagram, segment)    It uses ports. TCP (connection-oriented), UDP (connectionless)
(e.g. TCP protocol)

INTERNET               IP addressing, handles the routing of packets, packet fragmentation and reassembly
(packet)(e.g. inet0, en0)IPv4, ICMP, ARP

NETWORK ADAPTER        It is the connection to the actual network hardware.
(frame)(e.g. ent0)     Ethernet (en),IEE802.3 (et) Token-Ring (tr) ...

PHYSICAL               Responsible for specifying electrical, mechanical characteristics of the communication.
(e.g. copper)          RJ45, copper, Fibre ...


INTERNET ADDRESSING:

IP ADRESS CLASS    FORMAT        ADDRESS RANGE                        BITS
A                N.H.H.H        1.0.0.0-127.0.0.0                  0...............................
B                N.N.H.H        128.0.0.0-191.255.0.0              10..............................
C                N.N.N.H        192.0.0.0-223.255.255.0            110.............................


Class A, B and C addressses also provide address ranges that are useful to define a private network. A private network can have the followong address ranges:

A    10.0.0.0-10.255.255.255
B    172.16.0.0-172.31.255.255
C    192.168.0.0-192.168.255.255



PROTOCOLS:


ARP (Address Resolution Protocol)
ARP is responsible for converting IP addresses into physical machine addresses. It uses the broadcast facility to discover the hardware (physical) address. The broadcast is received by all hosts on the network but only one will recognize its own IP address and respond with an address resolution reply. All other hosts on the network discard the packet.

ARP maintains a table of mappings between IP logical addresses and network-specific physical addresses for network types where a single interface has multiple possible destination. When data is to be sent to the network, the destination hardware address is determined from the ARP table. If your host does not have the destination hardware addres in the ARP table, ARP on your system is used to obtain the address by broadcasting a request to the network.


ICMP (Internet Control Message Protocol)
ICMP is used to report errors in IP datagram processing. The most common use of ICMP is the PING command which sends out an ICMP echo request expecting an ICMP echo reply from the destination host.


UDP (User Datagram Protocol)
It is a transport protocol without flow control or error recovery. It simply for sending or receiving IP datagrams, using ports to direct the datagarams. UDP and IP do not provide any reliability, so it is up to the application program to provide for flow control and error recovery.
Applications which are using UDP: Domain Name Server (DNS), Remote Prosedure Call (RPC), used by Network File System (NFS)


TCP (Transmission Control Protocol)
TCP transfers a contiguous stream of bytes through the network. TCP assigns a sequence number to each byte transmitted and expects a positive acknowledgement from the receiving TCP. If the acknowledgement is not received within a timeout interval, the data is retransmitted. (FTP, TELNET, SMTP)


IP (Internet Protocol)
The IP is the layer that hides the underlying physical network bay creating a virtual network view. It contains addressing information and some control information that enables packets to be routed. IP routing is an important function of the IP layer. The IP routing mechanism only considers the IP network address part of destination IP addresses. Each host keeps an IP routing table. IP also fragments large size data and reassembles on the receiving side.

The difference between TCP and IP is, that TCP is responsible for the data delivery of a packet and IP is responsible for the logical addressing. In other words, IP obtains the address and TCP guarantees delivery of data to that address.

----------
           
SUBNETTING:
Subnetting is dividing a single network into multiple logical networks (subnets). A subnet address is created by borrowing bits from the host field and designating them as the subnet field. (So we need to know it is a Class A, B or C IP adress.) With subnetting, one address may be known to the Internet and internally the packets are distributed to the correct network.

Subnet mask (or Net mask)
The subnet mask tells the system what the subnet partitioning scheme is. A bit set to 1 in the subnet mask indicates that bit position is part of the network address portion of the IP address.

When a host sends a message to a destination, the system must determine whether the destination is on the same network or it must be reached through a gateway. The system compares the destination address to the host address using the subnet mask.

Example:
Class B address:172.16.0.0-->N.N.H.H.
We want 6 subnets, so we need to borrow 3 bits (2*2*2) from the host field.

|NETWORK ID............||HOST ID...........|
10101100    00010000    00000000    00000000        <-IP address
172        16                 0        0           

|SUBNETWORK ID............||HOST ID........|
11111111    11111111    11100000    00000000        <-Subnet mask
255        255              224        0           


172        16                32        0
10101100    00010000    00100000    00000000        <-1st subnet

172        16                32        1
10101100    00010000    00100000    00000001        <-1st host in this subnet

172        16                63        255
10101100    00010000    00111111    11111111        <-subnet broadcast



172        16                64        0
10101100    00010000    01000000    00000000        <-2nd subnet

172        16                64        1
10101100    00010000    01000000    00000001        <-1st host in this subnet

172        16                95        255
10101100    00010000    01011111    11111111        <-subnet broadcast


PORTS AND SOCKETS:


In this example, the source host is communicating through a dynamically assigned port, 1064, and the destination host is contacted through port 21. However, since they are using different IP addresses, the connection is unique.

This unique connection is called a socket. A socket is composed of four components: the source address, the source local port, the destination address, and the destination port. A socket is also referred to as a communication endpoint

/etc/services         defines the port for a socket and the protocols used for networking services (after modification: refresh -s inetd)
/etc/inetd.conf       the inetd daemon checks all of the ports specified in the /etc/inetd.conf file for incoming requests
/etc/hosts            host names and their IP addresses are mapped here


TCP/IP COMMUNICATION

The advantage of dividing the network communication process into layers is that each layer can assume responsibility for different aspects of the communication process. From the user's point of view, one application is communicating with another application. Logically, however, each layer communicates with the corresponding layer on the remote host.


The communication task is to exchange data between two applications. The systems on which the applications are running can be on the same LAN or on opposite sides of the world. The TCP/IP communication process remains the same.

When data leaves the source application, the TCP adds header information for the TCP at the destination. This identifies the destination program and includes checksums to ensure data integrity and sequence numbers so that packets are reassembled in the correct order

An IP datagram is the basic unit of information passed across the network. It contains the source and destination address along with the data from the transport layer. The IP is responsible for routing this datagram to the destination network

The network interface layer packages the data for transmission across the physical media. This is called a frame. The size and format of a frame varies among different types of networks.

A datagram can be larger than the maximum frame size for a particular type of network. These datagrams are fragmented by the network interface into multiple frames. Each frame is sent, and the receiving network interface reassembles the frames before passing the datagram to the IP layer on the destination host

The IP layer on the destination host begins the process of removing the header for that layer. It removes the header, checks for accuracy, and passes the datagram to the next layer.

At the final stage, the TCP or UDP receives the datagram from the IP layer and sends it to the appropriate port on the destination application. This completes the communication process.


2 comments:

Anonymous said...

Nice work

Revan said...

Great information.