Skip to content
Sahithyan's S3
1
Sahithyan's S3 — Data Communication and Networking

Internet Protocol

TCP/IP protocols operate the internet. Freely available and developed independent of any specific computer hardware or operating system. Independent from specific physical network hardware. Uniquely address any other device in the entire network.

IP defines how to address devices on a network. It assigns a unique IP address to each device, allowing them to communicate with each other.

There are 2 version of IP.

  • IPv4
  • IPv6

IPv4 uses 32 bits. Composed of 4 octets. Each octet is represented by a decimal number between 0 and 255. For example, an IP address might be written as 192.168.0.1.

IPv6 uses 128 bits. Composed of 8 groups of 16 bits. Each group is represented by a hexadecimal number between 0 and FFFF. For example, an IP address might be written as 2001:0db8:85a3:0000:0000:8a2e:0370:7334.

For this module, whenever IP is mentioned, it refers to IPv4.

Short for Internet Assigned Numbers Authority. A department under ICANN, Internet Corporation for Assigned Names and Numbers. Responsible for assigning IP addresses and other network-related resources.

Reserved for private networks. Globally non-routable. Not unique. Only unique within a private network.

ClassCIDR NotationNetwork AddressBroadcast Address
Class A10.0.0.0/810.0.0.010.255.255.255
Class B172.16.0.0/12172.16.0.0172.31.255.255
Class C192.168.0.0/16192.168.0.0192.168.255.255

An Private IP address is considered non-routable. Addresses within these classes are only unique within a given private network.

All addresses outside these classes are considered public.

Short for subnetworks. Devices within a subnet can communicate with each other directly without the need for a router.

Used to divide a network into smaller networks.

First address of the subnet. Can be assigned to a device, but not recommended as a best practice.

192.168.12.0

Last address of the subnet. Cannot be assigned to a device. If assigned, the network communication will malfunction.

192.168.12.255

Network admin hardcodes the IP address into the device’s configuration.

In UNIX, /etc/rc.config is used to configure network settings.

The device gets the IP address from a server using Dynamic Host Configuration Protocol. When connecting to an ISP, the device receives an IP address from the ISP’s DHCP server.

IANA assigns IP blocks to Regional Internet Registries. RIRs manage a pool of IP addresses and assigns to ISPs in specific regions.

Example: APNIC is the RIR for Asia Pacific region.

A technique used to map private IP addresses to public IP addresses. It allows multiple devices on a private network to share a single public IP address. NAT is commonly used in home networks and small businesses.

Mapping from private IP addresses to public IP addresses is handled by NAT servers. They maintain a table of outgoing connections and incoming connections.

IPv4 address space is not enough for universally unique IP addresses. There are more people in the world than there are IPv4 addresses. This problem is solved by using private IP addresses for all hosts under a network. They share one or few public IP addresses to access the outside world.

Short for Dynamic Host Configuration Protocol. Used to automatically assign IP addresses and other network configuration parameters to devices on a network. Operates at the network layer. Essential for managing IP addresses in large networks.

Short for Address Resolution Protocol. Used to map an IP address to a physical address (MAC address). Operates at the data link layer. Requried for communication between devices on the same network segment.

A broadcast frame is sent to all devices on the network segment to request the MAC address corresponding to a given IP address. The frame contains the source IP address, destination IP address, and the source MAC address. Relevant host responds with its MAC address. The source IP address is included, so that the receiver can also update its ARP table.

Used to determine the best path for data packets to travel between different networks.

Examples:

  • Border Gateway Protocol (BGP)
    Used to exchange routing information between autonomous systems (large networks or collections of networks). BGP helps ensure data can find its way across complex, interconnected networks by determining the most efficient routes.
  • Open Shortest Path First (OSPF)
    Used within a single autonomous system. Uses a link-state routing algorithm to quickly adapt to changes in the network and find the shortest path for data packets.
  • Routing Information Protocol (RIP)
    One of the oldest routing protocols. Uses a distance-vector algorithm to determine the best route based on the number of hops between source and destination. Simple. Less efficient for large or complex networks.

Short for Internet Control Message Protocol. Used by network devices, like routers, to send error messages and operational information. Operates at the network layer. Used for diagnostics and troubleshooting.

Common uses:

  • Echo Request and Echo Reply
    Used by the ping command to test connectivity between devices.
  • Destination Unreachable
    Informs the sender that a packet could not be delivered.
  • Time Exceeded
    Indicates that a packet has been discarded because it took too long to reach its destination (often used in traceroute).

For example, when a packet cannot reach its destination, ICMP can notify the sender of the issue.