Technical Topics on Networking
IPv4 Addressing
IPv4 (Internet Protocol version 4) is the fourth version of the Internet Protocol (IP) and has
been widely used since its inception. It provides host-to-host communication across a
network and is the dominant protocol for internetworking.
Key aspects of IPv4 addressing:
1. **Address Format**: IPv4 addresses are 32-bit binary numbers, typically written as four
decimal numbers (octets) separated by dots. Each octet represents 8 bits (1 byte), and the
address is expressed as four decimal numbers in the range 0-255.
Example: 192.168.1.1
2. **Classful Addressing**: Originally, IPv4 addresses were categorized into classes (A, B, C,
D, and E) based on their leading bits and size.
- **Class A**: 0.0.0.0 to 127.255.255.255
- **Class B**: 128.0.0.0 to 191.255.255.255
- **Class C**: 192.0.0.0 to 223.255.255.255
- **Class D** (Multicast): 224.0.0.0 to 239.255.255.255
- **Class E** (Reserved): 240.0.0.0 to 255.255.255.255
3. **Subnetting**: The process of dividing an IP address into network and host portions,
enabling more efficient use of addresses. This is done using a subnet mask.
Example: A subnet mask of 255.255.255.0 (or /24 in CIDR notation) means the first 24
bits represent the network part, and the remaining 8 bits represent the host part.
4. **Private vs Public IPs**: Certain address ranges are reserved for private use within local
networks and are not routable on the internet:
- Class A: 10.0.0.0 to 10.255.255.255
- Class B: 172.16.0.0 to 172.31.255.255
- Class C: 192.168.0.0 to 192.168.255.255
5. **Broadcasting**: IPv4 supports broadcast communication, where a packet is sent to all
devices on a network.
6. **Address Exhaustion**: IPv4's limited address space has led to a shortage of available
addresses, which is one of the primary reasons for the development of IPv6.
7. **Network Address Translation (NAT)**: NAT is used to map multiple private IP
addresses to a single public IP address, allowing multiple devices to share a single public
address.
8. **Limitations**: IPv4 suffers from limited address space, inefficient address allocation,
and security vulnerabilities.
ICMP Protocol
ICMP (Internet Control Message Protocol) is used for sending control messages and
diagnostic information between network devices. It operates at the network layer and is
primarily used for error reporting and troubleshooting.
Key aspects of ICMP:
1. **Error Reporting**: ICMP is used to notify hosts about network errors. For example,
when a router cannot deliver a packet due to a network failure, it sends an ICMP error
message back to the sender.
2. **Ping**: The `ping` command uses ICMP Echo Request and Echo Reply messages to test
the reachability of a host and measure the round-trip time of packets.
3. **Destination Unreachable**: ICMP messages can inform the sender when the destination
is unreachable due to issues like network unreachable, host unreachable, or port
unreachable.
4. **Time Exceeded**: This message indicates that a packet has exceeded its time-to-live
(TTL) value, meaning it has been in transit too long and is discarded.
5. **Redirect Message**: Used by routers to inform hosts of a better route to a destination.
6. **Security Concerns**: ICMP is vulnerable to attacks like ICMP flooding (DoS attacks) and
ICMP redirection attacks, which may be used to redirect traffic to malicious destinations.
ARP and RARP Protocols
ARP (Address Resolution Protocol) and RARP (Reverse Address Resolution Protocol) are
used for resolving IP addresses to MAC addresses and vice versa.
**ARP (Address Resolution Protocol):**
1. **Purpose**: ARP is used to map an IP address (logical address) to a MAC address
(physical address) on a local network.
2. **How ARP Works**: A device sends an ARP request to the network to find the MAC
address associated with an IP address. The device with the matching IP address responds
with its MAC address.
3. **ARP Cache**: Devices store mappings of IP to MAC addresses in an ARP cache for faster
lookups.
4. **Types of ARP**:
- **Proxy ARP**: A router answers ARP requests on behalf of another device.
- **Gratuitous ARP**: A device sends an ARP request for its own IP address to detect IP
conflicts.
**RARP (Reverse Address Resolution Protocol):**
1. **Purpose**: RARP is used to map a MAC address to an IP address, often used by diskless
workstations.
2. **How RARP Works**: A device with a known MAC address sends a RARP request to get
an IP address. A RARP server responds with the corresponding IP address.
3. **Limitations of RARP**: RARP requires a dedicated RARP server and has been largely
replaced by DHCP (Dynamic Host Configuration Protocol), which offers more flexibility.
IPv6 Overview and Features
IPv6 (Internet Protocol version 6) is the successor to IPv4, designed to solve the address
exhaustion problem and improve scalability, security, and performance.
**Key Advantages of IPv6**:
1. **Larger Address Space**: IPv6 uses 128-bit addresses, which allows for an enormous
number of unique addresses, solving the address exhaustion issue of IPv4.
2. **Better Header Format**: IPv6 has a simplified header format that improves processing
efficiency by routers.
3. **Security**: IPv6 natively supports IPsec, providing encryption and data integrity.
4. **Support for Resource Allocation**: IPv6 supports features like flow labels to optimize
resource usage.
5. **New Options**: IPv6 introduces new extension headers that allow for greater flexibility
and customization of packet delivery.
6. **Allowing for Extension**: IPv6 supports future extensions and new features without
disrupting the protocol's operation.
**IPv6 Addressing**:
- **Address Length**: IPv6 addresses are 128 bits long and are typically written as eight
groups of four hexadecimal digits separated by colons.
Example: 8000:0000:0000:0000:0123:4567:89AB:CDEF
- **Address Types**:
- **Unicast**: For a single interface.
- **Anycast**: For a set of interfaces, with packets delivered to one of the interfaces.
- **Multicast**: For a set of interfaces, with packets delivered to all interfaces.
**IPv6 Header**:
The IPv6 header is fixed at 40 bytes and contains the following fields:
- **Version**: 4 bits for the protocol version (6 for IPv6).
- **Priority**: 4 bits for packet priority.
- **Flow Label**: 24 bits for data flow management.
- **Payload Length**: 16 bits for the payload length excluding the header.
- **Next Header**: 8 bits indicating the next header in the packet.
- **Hop Limit**: 8 bits for limiting the number of hops.
- **Source Address**: 128 bits for the source address.
- **Destination Address**: 128 bits for the destination address.