{"id":1900,"date":"2023-10-23T13:02:16","date_gmt":"2023-10-23T08:02:16","guid":{"rendered":"https:\/\/afzalbadshah.com\/?p=1900"},"modified":"2025-10-15T12:27:47","modified_gmt":"2025-10-15T07:27:47","slug":"basics-of-internet-protocol-ip","status":"publish","type":"post","link":"https:\/\/afzalbadshah.com\/index.php\/2023\/10\/23\/basics-of-internet-protocol-ip\/","title":{"rendered":"Basics of Internet Protocol (IP) AND IP Addressing"},"content":{"rendered":"\n<p>The Internet Protocol (IP) is a fundamental set of rules and conventions that define how data is transmitted and routed over the Internet. It is the backbone of modern networking, ensuring that every piece of data finds its correct destination, whether between two computers in a local lab or between continents.<\/p>\n\n\n\n<p><a href=\"https:\/\/afzalbadshah.com\/index.php\/computer-networks\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Visit the detailed course on Computer Networks for more tutorials and visual explanations.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to the Internet Protocol (IP)<\/h2>\n\n\n\n<p>The Internet Protocol provides the addressing and routing system that connects billions of devices globally. It defines the structure of data packets, how these packets are addressed, and how they move from one device to another. Think of IP as the digital postal system. It adds sender and receiver addresses to every data packet and ensures that each packet reaches the right destination.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basics of the Internet Protocol (IP)<\/h2>\n\n\n\n<p>Here are some essential terminologies and concepts related to IP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Addressing<\/h3>\n\n\n\n<p>IP assigns a unique numerical address to each device connected to the Internet. These are called IP addresses, and they serve as the logical identity of a device.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example IPv4: <code>192.168.1.1<\/code><br>Example IPv6: <code>2001:0db8:85a3:0000:0000:8a2e:0370:7334<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses to support a vastly larger number of devices.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Packet Structure<\/h3>\n\n\n\n<p>Before transmission, data is divided into small packets. Each packet includes the source IP address, the destination IP address, and the actual data (payload). This helps routers and switches determine where to send each packet next.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example of packet components:<br><code>| Source: 192.168.1.10 | Destination: 172.217.0.46 | Data: &lt;content&gt; |<\/code><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Routing<\/h3>\n\n\n\n<p>Routers read the destination IP address in each packet and use routing tables to decide the best path for forwarding it. Packets may pass through multiple routers before reaching their final destination.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Version 4 (IPv4)<\/h3>\n\n\n\n<p>IPv4 has been the standard for decades, offering around 4.3 billion unique addresses. However, due to the massive growth of connected devices, the IPv4 pool is not able to address.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example IPv4 Address: <code>192.168.0.1<\/code><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Version 6 (IPv6)<\/h3>\n\n\n\n<p>IPv6 was introduced to overcome IPv4 limitations. It provides trillions of unique addresses, supports efficient routing, and ensures every IoT device can have a unique identifier.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example IPv6 Address: <code>2001:0db8:85a3::8a2e:0370:7334<\/code><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">End-to-End Connectivity<\/h3>\n\n\n\n<p>IP ensures that packets can travel from any source to any destination across multiple networks \u2014 a concept known as end-to-end communication. However, IP does not guarantee reliability; it simply forwards packets.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Stateless Protocol<\/h3>\n\n\n\n<p>IP is a stateless protocol. It treats each packet independently. If one packet fails to arrive, IP itself does not retry. Higher-layer protocols like TCP handle reliability and sequencing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Internet Governance<\/h3>\n\n\n\n<p>IP address allocation and management are overseen by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>IANA \u2013 Internet Assigned Numbers Authority<\/li>\n\n\n\n<li>RIRs \u2013 Regional Internet Registries<\/li>\n\n\n\n<li>LIRs \u2013 Local Internet Registries<\/li>\n<\/ul>\n\n\n\n<p>They ensure that IP addresses are unique and fairly distributed globally.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IP Addressing<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"640\" height=\"360\" src=\"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?resize=640%2C360&#038;ssl=1\" alt=\"\" class=\"wp-image-9935\" srcset=\"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?resize=1024%2C576&amp;ssl=1 1024w, https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?resize=1536%2C864&amp;ssl=1 1536w, https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?resize=480%2C270&amp;ssl=1 480w, https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Basics-of-IP-and-Addressing.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>One of IP\u2019s most important roles is addressing, assigning logical addresses to devices so that data can find its destination.<\/p>\n\n\n\n<p>Each IPv4 address consists of 32 bits, usually represented in dotted-decimal format and divided into four octets (8 bits each).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example IP Address: <code>192.168.112.100<\/code><br>Binary Form: <code>11000000.10101000.01110000.01100100<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>Each number between dots represents 8 bits (one octet).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Decimal<\/th><th>Binary<\/th><th>Bits<\/th><\/tr><\/thead><tbody><tr><td>192<\/td><td>11000000<\/td><td>8<\/td><\/tr><tr><td>168<\/td><td>10101000<\/td><td>8<\/td><\/tr><tr><td>112<\/td><td>01110000<\/td><td>8<\/td><\/tr><tr><td>100<\/td><td>01100100<\/td><td>8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Every time you connect to the Internet, your device receives one such logical address that uniquely identifies it within the global network.<\/p>\n<\/blockquote>\n\n\n\n<p>In short, IP addressing gives every device a digital \u201chouse number.\u201d Without it, routers wouldn\u2019t know where to send your packets.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Working of IP and IP Addressing<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Packetization<\/h3>\n\n\n\n<p>Before data travels across the Internet, it is divided into smaller packets. Each packet carries both the source and destination IP address.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example:<br><code>Source: 192.168.1.2 \u2192 Destination: 172.217.0.46<\/code><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Routing<\/h3>\n\n\n\n<p>Routers analyze each packet\u2019s destination IP address and choose the best next hop. They rely on routing tables and network topology information to make decisions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hop-by-Hop Routing<\/h3>\n\n\n\n<p>Packets often pass through several routers. Each router reads the destination IP, forwards the packet to the next router, and so on, until it reaches the destination.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">End-to-End Communication<\/h3>\n\n\n\n<p>Even though data may pass through many routers, the source and destination IPs remain the same throughout the journey. IP ensures that packets eventually reach the right host.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Stateless Behavior<\/h3>\n\n\n\n<p>Each packet travels independently. IP does not remember previous connections. That\u2019s why it\u2019s called a connectionless or stateless protocol.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Classes of IP Networks<\/h2>\n\n\n\n<p>Historically, IPv4 addresses were grouped into five classes (A to E) for different network sizes.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Class<\/th><th>Range (First Octet)<\/th><th>Default Mask<\/th><th>Use<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>A<\/td><td>1 \u2013 126<\/td><td>255.0.0.0<\/td><td>Large networks<\/td><td><code>10.0.0.1<\/code><\/td><\/tr><tr><td>B<\/td><td>128 \u2013 191<\/td><td>255.255.0.0<\/td><td>Medium networks<\/td><td><code>172.16.0.1<\/code><\/td><\/tr><tr><td>C<\/td><td>192 \u2013 223<\/td><td>255.255.255.0<\/td><td>Small networks<\/td><td><code>192.168.1.1<\/code><\/td><\/tr><tr><td>D<\/td><td>224 \u2013 239<\/td><td>\u2013<\/td><td>Multicast<\/td><td><code>224.0.0.1<\/code><\/td><\/tr><tr><td>E<\/td><td>240 \u2013 255<\/td><td>\u2013<\/td><td>Research<\/td><td><code>250.1.1.1<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example of private ranges:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Class A: <code>10.0.0.0\/8<\/code><\/li>\n\n\n\n<li>Class B: <code>172.16.0.0\/12<\/code><\/li>\n\n\n\n<li>Class C: <code>192.168.0.0\/16<\/code><\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<p>Modern networks now use Classless Inter-Domain Routing (CIDR), which allows flexible subnetting instead of fixed classes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IP Subnetting<\/h2>\n\n\n\n<p>Subnetting divides one large network into multiple smaller subnetworks for better organization and address utilization.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Structure of Subnetting<\/h3>\n\n\n\n<p>An IP address has two parts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Network part \u2192 identifies the network<\/li>\n\n\n\n<li>Host part \u2192 identifies a specific device<\/li>\n<\/ul>\n\n\n\n<p>The subnet mask defines how many bits belong to the network and host.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example:<br>IP: <code>192.168.10.0<\/code><br>Subnet Mask: <code>255.255.255.0<\/code> \u2192 <code>\/24<\/code> in CIDR notation<\/p>\n<\/blockquote>\n\n\n\n<p>This means 24 bits are for the network and 8 bits for the hosts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Subnetting Example (Class C)<\/h3>\n\n\n\n<p>Let\u2019s divide a Class C network into four subnets for different departments.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Base Network: <code>192.168.10.0\/24<\/code><\/p>\n<\/blockquote>\n\n\n\n<p>Departments: Computer Science (CS), IT, Software Engineering (SE), and Artificial Intelligence (AI).<\/p>\n\n\n\n<p><strong>Step 1 \u2013 Decide how many bits to borrow<\/strong><br>We need 4 subnets \u2192 <code>2\u00b2 = 4<\/code><br>So, we borrow 2 bits from the host portion.<br>New subnet mask = <code>255.255.255.192<\/code> \u2192 <code>\/26<\/code><\/p>\n\n\n\n<p><strong>Step 2 \u2013 Find the subnet increment<\/strong><br>Increment = 256 \u2013 192 = 64<\/p>\n\n\n\n<p><strong>Step 3 \u2013 List of Subnets<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Department<\/th><th>Network Address<\/th><th>First Host<\/th><th>Last Host<\/th><th>Broadcast<\/th><\/tr><\/thead><tbody><tr><td>CS<\/td><td>192.168.10.0<\/td><td>192.168.10.1<\/td><td>192.168.10.62<\/td><td>192.168.10.63<\/td><\/tr><tr><td>IT<\/td><td>192.168.10.64<\/td><td>192.168.10.65<\/td><td>192.168.10.126<\/td><td>192.168.10.127<\/td><\/tr><tr><td>SE<\/td><td>192.168.10.128<\/td><td>192.168.10.129<\/td><td>192.168.10.190<\/td><td>192.168.10.191<\/td><\/tr><tr><td>AI<\/td><td>192.168.10.192<\/td><td>192.168.10.193<\/td><td>192.168.10.254<\/td><td>192.168.10.255<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>By subnetting, we divided one large network into four smaller networks, each with 62 usable hosts. This structure improves efficiency, management, and security.<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Why Subnetting is Important<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Efficient use of IP addresses<\/li>\n\n\n\n<li>Reduced network congestion<\/li>\n\n\n\n<li>Better organization of departments<\/li>\n\n\n\n<li>Easier management and improved security<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">IP Supernetting<\/h2>\n\n\n\n<p>While subnetting divides a network into smaller parts, supernetting (or route aggregation) combines several smaller networks into a larger one. This helps Internet Service Providers (ISPs) and large organizations simplify routing tables and optimize address allocation.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Example: combining<br><code>192.168.10.0\/26<\/code>, <code>192.168.10.64\/26<\/code>, <code>192.168.10.128\/26<\/code>, and <code>192.168.10.192\/26<\/code><br>results in one supernet:<br><code>192.168.10.0\/24<\/code><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\">Benefits of Supernetting<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Reduces routing table entries<\/li>\n\n\n\n<li>Simplifies routing decisions<\/li>\n\n\n\n<li>Improves network efficiency<\/li>\n\n\n\n<li>Optimizes address space utilization<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Internet Protocol (IP) is a fundamental set of rules and conventions that define how data is transmitted and routed over the Internet. It is the backbone of modern networking, ensuring that every piece of data finds its correct destination, whether between two computers in a local lab or between continents. Visit the detailed course on Computer Networks for more tutorials and visual explanations. Introduction to the Internet Protocol (IP) The Internet Protocol provides the addressing and routing system that&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/afzalbadshah.com\/index.php\/2023\/10\/23\/basics-of-internet-protocol-ip\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4112,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[352,365],"tags":[391,390,368,367],"class_list":["post-1900","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-networks-courses-2","category-network-design-and-analysis","tag-internet-protocol","tag-ip","tag-network-analysis","tag-network-design"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2023\/10\/Week-04-IP-Addressing.pptx-jpg.webp?fit=1920%2C1080&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pf3emP-uE","jetpack-related-posts":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/1900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/comments?post=1900"}],"version-history":[{"count":20,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/1900\/revisions"}],"predecessor-version":[{"id":9954,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/1900\/revisions\/9954"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media\/4112"}],"wp:attachment":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media?parent=1900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/categories?post=1900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/tags?post=1900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}