Architect theme

Architect is a theme for GitHub Pages.

View project on GitHub

Networking Basics

Network Definition:
Any time two or more hosts are connected and can communicate, you have a network.

1. Hosts and Traffic:

  • Host: Host is any device which sends or receive data traffic over a network. While often a computer, it can also include other networked devices like smartphones, tablets, and IoT (Internet of Things) devices.
  • Client: Client is a host that initiates requests for services from another device on the network.
  • Server: Server is a computer designed to respond to requests from clients. It “serves” the requested data or services to the user.
  • Traffic: It refers to the data that is transmitted between devices on a network. This can include anything from web pages and emails to video streams and sensor data from IoT devices.

image

2. IP Address (Internet Protocol Address):

An IP address is a unique numerical identifier assigned to every device connected to a computer network that uses the Internet Protocol for communication.

  • Protocol: Protocol is a set of rules governing how data is formatted, transmitted, and received between devices.
  • Properties:
    • Unique: Each device on a network must have a unique IP address.
    • Universal: IP addresses are a globally recognized standard for network communication.
  • Types:
    • Public IP Address: Used on the internet, these addresses are globally unique and routable.
    • Private IP Address: Used within private networks (e.g., home or school networks), these addresses are not directly routable on the internet.
  • Dynamic Nature: IP address can change over time, especially for devices on dynamic IP assignments. However, its fundamental properties (uniqueness and universality) remain constant.

3. IPv4 (Internet Protocol Version 4):

IPv4 is the fourth version of the Internet Protocol.

  • Length: 32 bits long.
  • Address Space: Can theoretically support $2^{32}$ unique addresses.
  • Notation: Represented in dotted-decimal format, consisting of four octets (groups of 8 bits) separated by dots. Each octet can range from 0 to 255.
    • Example: 192.168.1.1

Address Structure:

  • Network ID (Prefix): Defines the network segment to which the device belongs. This part is common for all devices within the same network.
  • Host ID (Suffix): Uniquely identifies a specific device (host) within that network segment.

Example: An international phone number where the country code represent network and the phone number represents the “host.”

4. IPv6 (Internet Protocol Version 6)

IPv6 is the latest version of the Internet Protocol, designed to address the limitations of IPv4, primarily the exhaustion of available addresses.

  • Length: 128 bits long.
  • Address Space: Can support a vastly larger number of addresses, approximately $2^{128}$.
  • Notation: Represented in hexadecimal, often with colons separating groups of 16 bits.

5. Classful Addressing (IPv4)

It is used to categorizing IP addresses into different classes based on the range of their first octet. There are five classes: A, B, C, D, and E.

Class Starting Bits IP Range Length of Network (Bits) Reseved bits Number of Networks Number of Hosts Default Subnet Mask Purpose
A 0 0 - 126 8 First $2^{7}$ = 128 $2^{24}$ = 16 million 255.0.0.0 Very large organizations. exp: Indian railways
B 10 128 – 191 16 First 2 $2^{14}$ $2^{16}$ 255.255.0.0 Medium-sized organizations
C 110 192 – 223 24 First 3 $2^{21}$ $2^{8}$ = 256 255.255.255.0 Small networks (like LANs)
D 1110 224 – 239 N/A (Multicast) N/A N/A N/A N/A Multicast groups
E 1111 240– 255 Reserved N/A N/A N/A N/A Experimental or research use only

Note: As the prefix (network ID) increases, the number of available host IDs decreases

6. Broadcast vs. Multicast vs. Unicast

Parameters Unicast Broadcast Multicast
Basics There is only one receiver and one sender. There are multiple receivers and one sender. There are multiple receivers and multiple senders.
Meaning and Definition Unicast is used to transfer data from a single sender to a single recipient. Broadcast sends data from one sender to all devices on a network. Multicast sends data from one or more senders to a selected group of receivers.
Mapping One-to-one type of communication. One-to-many type of communication. Many-to-many type of communication.
Uses Used for direct communication like web browsing, emails, etc. Used in TV/radio networks, ARP, DHCP discovery, etc. Used in stock exchanges, live video streaming, multimedia delivery.

7. Subnetting:

  • Dividing a large network into smaller, more manageable sub-networks. It helps to utilize the network bandwidth in more intelligent way.
  • Bandwidth: Capacity of network; data transmission rate (e.g., Mbps). Should be maximum.
  • Latency: Delay in data transmission. Should be minimum.

  • Host Bits: Denoted by ‘0’s in subnet mask.
  • Network IP: First IP of a subnet (cannot be assigned to host).
  • Broadcast IP: Last IP of a subnet (cannot be assigned to host).

Some other small concepts:

MAC (Media Access Control Address)

  • Nature: A unique, 12-character hexadecimal (alphanumeric) attribute used to identify individual electronic devices on a network.
  • Distinction from IP Address:
    • MAC Address: Identifies the physical location of a device within a local network. It’s like your permanent home address. The manufacturer provides it.
    • IP Address: Signifies the device’s global or internet-accessible identity. It’s more like a temporary vacation rental address, changing depending on your network connection.

DNS (Domain Name System):

It is a naming system for computers, service etc connected to the Internet or a private network. It translates domain names (www.google.com) into machine-readable IP addresses (172.217.160.142).

Default Gateway:

Its a device (typically a router) that acts as a pathway for data to leave a local network and reach other networks, including the internet.

CIDR (Classless Inter-Domain Routing):

  • Modern method for IP allocation and routing, replacing classful addressing with more flexible network sizing (e.g., /24).

Types of Cables

  • Twisted Pair:
    • Types: Shielded (STP) and Unshielded (UTP).
    • Use: LANs (Ethernet).
  • Coaxial:
    • Use: TV networks, older computer networks.
  • Fiber-Optic:
    • Use: High-speed networks, long distances (most commonly used today).

Numericals:

For 205.150.65.0/26. Find:

  1. Subset mask
  2. Number of subsets
  3. Number of hosts
  4. Network IP
  5. Broadcast IP.

    Answer:

    Here /26 is CIDR Class: Class C.

  6. Subnet Mask: 255.255.255.192
    • In binary: 11111111.11111111.11111111.11000000
    • This means 26 bits are used for the network.
    • Convering 11000000 to decimal = $2^{7}$ + $2^{6}$ = 192
    • SO Subset mask is: 255.255.255.192
  7. Number of Subnets:
    • 26 network bits - 24 default network bits = 2 subnet bits
    • Number of subnets = $2^{\text{subnet bits}} = 2^2 = 4$
  8. Number of Hosts
    • Host ID Bits: 32 - 26 = 6
    • Number of hosts = $2^{\text{host bits}} - 2 = 2^6 - 2 = 64 - 2 = 62$
  9. Network IP:
    • Given IP AND (AND operation) Subset mask:
    • 205.105.65.0
  10. Broadcast IP:
    • As maximum number of hosts are 62:
    • 205.105.65.63