Network in linux - TopLearnLinux

 

Networking:

    It is a connection between two or more machines to communicate with each other.

    The basic requirements for Networking are:

  • NIC (Network Interface Controller or Card)
  • Media
  • Topology
  • Protocol
  • IP Addresses

    NIC (Network Interface Controller or Card):

    A network interface controller (also known as a network interface card, network adapter, LAN adapter and by similar terms) is a computer hardware component that connects a computer to a computer network. Each NIC will be having a unique MAC addresses (Media Access Control address) to avoid conflicts between same NIC adapters. In Linux these NIC adapter is represented by the word “eth”. Example if there are two Ethernet adapters in the system then it will be denoted as eth0, eth1, etc.

    Media:

    Media is the medium via which two different computer’s NIC card will be connected. The best example for media is Cable. Example RJ 45, CAT 5 etc.

    Topology:

    Topology is the scheme or design in which the computers in the network will be connected to each other. Example for topology is Bus, Ring, star, mesh, tree topologies. The following pictures explain it better.

    Protocol:

    A network protocol defines rules and conventions for communication between network devices. Protocols for computer networking all generally use packet switching techniques to send and receive messages in the form of packets.

    Network protocols include mechanisms for devices to identify and make connections with each other, as well as formatting rules that specify how data is packaged into messages sent and received. Some protocols also support message acknowledgement and data compression designed for reliable and/or high-performance network communication. Hundreds of different computer network protocols have been developed each designed for specific purposes and environments.

    Example for Protocols are TCP/IP (Transmission Control Protocol), UDP (User Datagram Protocol), HTTP. The most widely and regularly used protocols for transferring data are TCP and UDP. Let’s analyze some basic differences between TCP/IP and UDP.

    TCP/IP UDP
    Transmission Control Protocol User Datagram Protocol
    It is connection Oriented Connectionless
    Reliable Non-Reliable
    TCP Acknowledgement will be sent/received No Acknowledgement for UDP
    Slow Communication Faster Communication
    Protocol Number for TCP is 6 Protocol Number for UDP is 17
    HTTP, FTP, SMTP uses TCP DNS, DHCP uses UDP

    IP ADDRESS:

    An IP address can be thought of as being similar to a phone number. Just as every person who communicates with a telephone is using a phone with a unique phone number, every computer that is on the Internet has a unique IP address. Not only on internet but within an organization every computer is assigned an IP address so that they can communicate with each other. Basically IP addressing is very deep concept. To understand the concept of IP address we need to understand some important aspect of IP Address which is

  • IP Address Classes
  • Subnet mask
  • Gateway

    IP Address Classes:

    The IP addresses are further broken down into classes. These classes are A, B, C, D, E and their possible ranges can be seen in Figure below.

    Class Start End Default Subnet Mask CIDR
    Class A 0.0.0.0 127.255.255.255 255.0.0.0 /8
    Class B 128.0.0.0 191.255.255.255 255.255.0.0 /16
    Class C 192.0.0.0 223.255.255.255 255.255.255.255 /24
    Class D (Multicast) 224.0.0.0 239.255.255.255
    Class E (Reserved) 240.0.0.0 255.255.255.255
  • Network in linux - TopLearnLinux

      Networking: It is a connection between two or more machines to communicate with each other. The basic requirements for Net...