Connecting Servers :

TCP/IP Basics:

TCP (Transmission Control Protocol) / IP (internet protocol) is a huge network and is a collection of protocols like TCP, IP, UDP (User Datagram protocol) and underlying ethernets. Protocol means a set of rules by which network devices can interact with each other. Here, network is established with the collection of nodes, called Host. Each and every host in the network has a unique name given to it called hostname. It has corresponding IP address as well, which is used by the other devices to communicate with it. 

IP Address and Host:

IP addresses are given to host by the ISP (Internet Service Provider) to uniquely identify it in TCP/IP network. This number is unique throughout the world. IP address is expressed as dotted 4 decimal numbers each containing an octet (8 binary digits) so all total it is 32 bit numbers in binary format. 

For example: if IP address - then converting 4 dotted decimal numbers into binary-

192 - 11000000, 168 - 10101000, 0 - 00000000, 5 - 10100000 so 32 bit dotted number would be 


This IP address is having 2 parts, first 3 octets represents the network address and the last octet represents host address as - - Network address - Host address

As the IP address is little complicated and difficult to remember, we can use host name to connect to network. But issue here is, network software understands only 32 bit numbers (IP). To solve this issue, translating program linked to the application called Resolver which translates the given hostname to its corresponding IP address.

Host name can be simple host name or Fully Qualified Domain Name (FQDN), where "websitebuilder" is the host name, "godaddy" is the subdomain and "com" is the domain. We use FQDN addressing when connecting to any host on Internet. Resolver look into the DNS (Domain Name System) database to find the corresponding IP address for the connecting host in this case.

How TCP/IP works:

  • It uses Packet Switching system where, there is no dedicated link or connection (like telephone network) between senders and receivers. This is the reason that internet voice calls are little slower than the telephone calls.
  • Here the sending data is broken into small chunks called packets.
  • Each packet is provided with the header which contains sequence number and checksum. These are the numbers determining the information in the packet.
  • Packets are put into the envelops and senders as well as receivers addresses are written into these envelops. These are sent over the huge network.
  • They come across the routers everywhere along its way to the huge network.
  • Routers are intelligent devices which checks the envelop address then it decides the shortest  route  to its destination.
  • The packets must be assembled in correct order after reaching to its destination so check sum is calculated to place the packet in correct order.
  • If checksum doesn't match then the packet is considered as corrupt and it is sent again over the network.
  • when all the packets are receiver in correct order and assembled, the headers are discarded and data is converted to their original form. 

Cracking IT Interview