WikiGalaxy

Personalize

IP Addressing

IPv4 Addressing

IPv4 addresses are 32-bit numeric addresses written as four decimal numbers separated by dots. For example, 192.168.0.1 is an IPv4 address.

IPv6 Addressing

IPv6 addresses are 128-bit alphanumeric addresses written in hexadecimal and separated by colons. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334 is an IPv6 address.

Subnetting

Subnetting is the process of dividing a network into smaller subnetworks, which helps reduce congestion and improve security.

Public vs Private IP

Public IP addresses are used on the internet, while private IP addresses are used within a local network. Private IPs cannot be accessed directly from the internet.


      // Example of IPv4 address representation
      String ipv4Address = "192.168.1.1";
      
      // Example of IPv6 address representation
      String ipv6Address = "2001:0db8:85a3:0000:0000:8a2e:0370:7334";
    

CIDR Notation

CIDR notation is a method for allocating IP addresses and IP routing. It uses a suffix to indicate the number of bits in the subnet mask, such as /24.

NAT (Network Address Translation)

NAT is a method used to remap one IP address space into another by modifying network address information in packet headers.

Console Output:

IPv4 Example: 192.168.1.1

IPv6 Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

MAC Addressing

Definition

A MAC address is a unique identifier assigned to a network interface controller for use as a network address in communications within a network segment.

Format

MAC addresses are 48-bit identifiers usually represented as six groups of two hexadecimal digits, separated by colons or hyphens, e.g., 00:1A:2B:3C:4D:5E.


      // Example of MAC address representation
      String macAddress = "00:1A:2B:3C:4D:5E";
    

Use in Networking

MAC addresses are used for identifying devices on a network at the data link layer. They are crucial for network protocols like Ethernet and Wi-Fi.

Console Output:

MAC Example: 00:1A:2B:3C:4D:5E

Network Classes

Class A

Class A addresses range from 1.0.0.0 to 126.0.0.0. They are used for large networks with many hosts.

Class B

Class B addresses range from 128.0.0.0 to 191.255.0.0. They are used for medium-sized networks.

Class C

Class C addresses range from 192.0.0.0 to 223.255.255.0. They are used for small networks.


      // Example of Class A IP address
      String classAAddress = "10.0.0.1";
      
      // Example of Class B IP address
      String classBAddress = "172.16.0.1";
      
      // Example of Class C IP address
      String classCAddress = "192.168.1.1";
    

Class D and E

Class D is used for multicast, while Class E is reserved for future use. These classes are not used for regular host communication.

Console Output:

Class A: 10.0.0.1

Class B: 172.16.0.1

Class C: 192.168.1.1

DHCP (Dynamic Host Configuration Protocol)

Definition

DHCP is a network management protocol used to automate the process of configuring devices on IP networks, enabling them to use network services.

How it Works

DHCP assigns IP addresses dynamically to devices on a network, allowing for easier management and conservation of IP addresses.


      // Example of DHCP configuration
      String dhcpServer = "192.168.0.1";
      int leaseTime = 3600; // Lease time in seconds
    

Benefits

DHCP simplifies the management of IP addresses by eliminating the need for manual configuration and reducing the risk of configuration errors.

Console Output:

DHCP Server: 192.168.0.1

Lease Time: 3600 seconds

DNS (Domain Name System)

Definition

DNS is a hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network.

Functionality

DNS translates human-friendly domain names to the numerical IP addresses needed for locating and identifying computer services and devices.


      // Example of DNS query
      String domainName = "example.com";
      String ipAddress = "93.184.216.34"; // Resolved IP address
    

DNS Records

DNS records are used to map domain names to IP addresses. Common types include A, AAAA, CNAME, MX, and TXT records.

Console Output:

Domain: example.com

IP Address: 93.184.216.34

ARP (Address Resolution Protocol)

Definition

ARP is a protocol used to map an IP address to a MAC address that is recognized in the local network.

Working Mechanism

When a device wants to communicate with another device on the same network, it uses ARP to find the MAC address associated with the IP address.


      // Example of ARP request
      String targetIpAddress = "192.168.1.10";
      String resolvedMacAddress = "00:1A:2B:3C:4D:5E"; // Resolved MAC address
    

ARP Table

An ARP table is a cache of IP-to-MAC address mappings maintained by each device on a local network to reduce ARP traffic.

Console Output:

Target IP: 192.168.1.10

Resolved MAC: 00:1A:2B:3C:4D:5E

NAT (Network Address Translation)

Definition

NAT is a method used to remap one IP address space into another by modifying the network address information in the IP header of packets while they are in transit across a traffic routing device.

Types of NAT

There are several types of NAT, including Static NAT, Dynamic NAT, and PAT (Port Address Translation).


      // Example of NAT configuration
      String publicIpAddress = "203.0.113.1";
      String privateIpAddress = "192.168.1.100";
    

Benefits

NAT helps conserve IP addresses and adds a layer of security by hiding internal IP addresses from the outside world.

Console Output:

Public IP: 203.0.113.1

Private IP: 192.168.1.100

VLAN (Virtual Local Area Network)

Definition

A VLAN is a custom network created from one or more existing LANs. It enables groups of devices from multiple networks to be combined into a single logical network.

Benefits

VLANs improve network performance, enhance security, and simplify network management by segmenting broadcast domains.


      // Example of VLAN configuration
      int vlanId = 10;
      String vlanName = "Sales";
    

VLAN Tagging

VLAN tagging allows multiple VLANs to be carried over a single network link, enabling devices to identify the VLAN to which the data belongs.

Console Output:

VLAN ID: 10

VLAN Name: Sales

logo of wikigalaxy

Newsletter

Subscribe to our newsletter for weekly updates and promotions.

Privacy Policy

 • 

Terms of Service

Copyright © WikiGalaxy 2025