IP Addressing and Internetworking

A progressive guide to how IP addressing, local delivery, routing, forwarding, translation, and DNS work together to connect independent networks and locate services.

The role of IP in internetworking

IP provides the common network-layer system that lets independently operated networks communicate as one internetwork. An IP packet carries a source address, a destination address, and a lifetime-limiting field: uses Time to Live (TTL), while uses Hop Limit.

IP is connectionless and best-effort. It delivers packets when possible, but it does not itself guarantee delivery, ordering, or duplicate suppression. Higher-layer protocols such as TCP may provide those guarantees.

Keep these roles distinct:

  • An IP address identifies a network-layer interface or endpoint.

  • A route describes how to reach a range of IP addresses.

  • A router forwards packets between networks according to routing information.

  • A host sends or receives packets and may also forward packets when configured as a router.

Takeaway: IP supplies addressing and internetwork , while other protocols may supply reliability and application-level behavior.

addresses and network boundaries

addresses are 32-bit values written as four decimal octets, such as 192.0.2.37. Each octet ranges from 0 through 255. An address is interpreted together with a prefix length, for example 192.0.2.37/24.

The /24 prefix means that the first 24 bits identify the network and the remaining 8 bits identify positions within that network. Its traditional mask is 255.255.255.0.

For the prefix 192.0.2.0/24:

  • The network address is 192.0.2.0.

  • The usual usable host range is 192.0.2.1 through 192.0.2.254.

  • The broadcast address is 192.0.2.255.

A traditional reserves the all-zero host portion for the network identifier and the all-one host portion for broadcast. Therefore, a /24 contains 256 address values and ordinarily has 254 usable host addresses. Special-purpose prefixes and point-to-point configurations can follow different rules.

Private space includes:

  • 10.0.0.0/8 for large private networks.

  • 172.16.0.0/12 for enterprise networks.

  • 192.168.0.0/16 for home and small-office networks.

Private addresses are not globally unique and should not be routed across the public Internet. A gateway may translate them into public addresses when internal hosts access external services.

Takeaway: An address is meaningful together with its prefix; the prefix separates the network portion from the host portion.

Subnetting, prefixes, and aggregation

A divides an IP network into smaller logical networks. Subnetting borrows host bits to create additional network bits. This can isolate departments, reduce broadcast traffic, organize routing, and support different security policies.

Suppose 192.168.10.0/24 is divided into /26 subnets. Borrowing 2 host bits creates four subnets:

  • 192.168.10.0/26, covering .0 through .63, with broadcast .63.

  • 192.168.10.64/26, covering .64 through .127, with broadcast .127.

  • 192.168.10.128/26, covering .128 through .191, with broadcast .191.

  • 192.168.10.192/26, covering .192 through .255, with broadcast .255.

Each /26 contains 64 address values and ordinarily supports 62 usable host addresses.

writes a network as network-address/prefix-length. The prefix length tells a router which leading bits must match. also permits route aggregation: adjacent smaller networks can sometimes be represented by one larger prefix when their addresses align correctly. Aggregation reduces the number of route entries that other routers need to store.

Takeaway: Subnetting creates smaller networks locally, while aggregation summarizes multiple networks for more scalable routing.

addressing and address types

uses 128-bit addresses written as eight groups of hexadecimal digits separated by colons. A full example is 2001:db8:1234:0000:0000:0000:0000:0042.

notation can be shortened in two ways:

  1. Leading zeros in a hexadecimal group may be omitted.

  2. One consecutive sequence of zero groups may be replaced by ::.

The full example can therefore be written as 2001:db8:1234::42. The :: notation may appear only once because using it more than once would make the number of omitted groups ambiguous.

addresses are assigned to interfaces, not necessarily to entire devices. One interface may have multiple addresses. The principal address types are:

  • Unicast: identifies one interface.

  • Anycast: identifies a set of interfaces, with delivery to one member, normally the closest according to routing metrics.

  • Multicast: identifies a set of interfaces, with delivery to group members.

does not use broadcast addresses. Multicast provides the group-delivery functions that broadcast commonly provides. A common uses a /64 prefix, such as 2001:db8:100:20::/64.

Takeaway: expands the address space, uses flexible text compression, and replaces broadcast with multicast-based group delivery.

Local delivery with ARP and Neighbor Discovery

An IP address identifies a network-layer endpoint, but delivery on a local network also needs a link-layer address such as an Ethernet MAC address. Address resolution connects these layers for the next local hop.

For , the performs this mapping. If a host needs to send to 192.168.1.20 and does not know the corresponding MAC address, it broadcasts an ARP request. The device that owns the address replies with its MAC address, and the sender temporarily stores the result in an ARP cache.

ARP is local-link resolution. A host normally does not ARP for a remote Internet destination. Instead, it resolves the MAC address of its default gateway and sends the IP packet to that router.

uses through ICMPv6 rather than ARP. ND supports address resolution, router discovery, prefix discovery, duplicate-address detection, and neighbor reachability detection. It uses multicast-based Neighbor Solicitation and Neighbor Advertisement messages.

Takeaway: Address resolution finds the link-layer destination for the next hop, not necessarily for the final IP destination.

Routing tables and

A lists destination prefixes and instructions for reaching them. A typical entry includes a destination prefix, next hop, outgoing interface, metric or preference, and route source.

A host commonly has:

  • A route for its directly connected .

  • A default route for destinations not otherwise known.

  • Additional routes for other internal networks.

For example, a host might use 192.168.1.0/24 through its local interface, 10.0.0.0/8 through gateway 192.168.1.1, and 0.0.0.0/0 through the same gateway. The default route is ::/0.

When several entries match a destination, selects the most specific route. Consider these entries:

  • 10.0.0.0/8 via Router A.

  • 10.20.0.0/16 via Router B.

  • 10.20.5.0/24 via Router C.

  • 0.0.0.0/0 via Router D.

A packet for 10.20.5.17 matches all four entries, but the /24 route is the longest match, so the packet goes to Router C. A packet for 10.30.1.4 matches the /8 route and the default route, so the /8 route is selected.

Takeaway: Broad routes provide general reachability, while more-specific routes override them for selected destinations.

Packet across routers

Routing determines which paths are available; is the per-packet action of sending a packet through the selected interface toward its destination.

A router generally performs these steps:

  1. It receives a link-layer frame.

  2. It removes the link-layer header and validates the IP packet.

  3. It checks whether the destination belongs to the router.

  4. If not, it searches the table using .

  5. It decrements TTL or Hop Limit.

  6. It determines the next-hop link-layer address through ARP or ND when necessary.

  7. It encapsulates the IP packet in a new link-layer frame.

  8. It transmits the frame through the selected interface.

During ordinary routed , the IP source and destination normally remain unchanged. The link-layer source and destination addresses change at every link because each hop uses a new local frame.

If no route exists, a router may discard the packet and may generate an ICMP error. If TTL or Hop Limit expires, the router discards the packet. Tools such as traceroute and tracert use expiration responses to infer the sequence of routers along a path.

Takeaway: Routing chooses a next hop from available paths; executes that choice one packet and one link at a time.

NAT and gateway address translation

changes IP address information as packets cross a gateway. The common use is translating private internal addresses into one or more public addresses.

Because many internal hosts may share one public address, the gateway also tracks transport-layer port numbers. This form is often called NAPT or PAT. For example, a gateway might maintain this mapping:

  • Internal host: 192.168.1.25:51514

  • Public mapping: 198.51.100.7:40001

  • Server: 203.0.113.80:443

When return traffic arrives at 198.51.100.7:40001, the gateway consults its translation state and delivers the traffic to 192.168.1.25:51514.

NAT can conserve public addresses and allow private networks to use overlapping address ranges. However, it changes the end-to-end addressing model, complicates protocols that carry IP addresses inside payloads, and can prevent unsolicited inbound connections unless an explicit mapping or rule exists.

NAT is not by itself a complete security boundary. Filtering rules and a properly configured firewall provide the access-control function. reduces the need for address-sharing NAT through its much larger address space, but networks still require appropriate traffic filtering and security controls.

Takeaway: NAT translates addresses and sometimes ports; it supports address conservation but should not be confused with firewall policy.

DNS and service location

The maps human-readable domain names to addresses and other information used to locate services. An application may request www.example.com, and DNS may return one or more relevant records.

Important record types include:

  • A: maps a name to an address.

  • AAAA: maps a name to an address.

  • CNAME: aliases one name to another name.

  • NS: identifies authoritative name servers for a domain.

  • MX: identifies mail servers.

  • SRV: identifies a service, protocol, port, and target host.

A simplified lookup works as follows:

  1. An application asks its local stub resolver for a name.

  2. The resolver checks its cache.

  3. If needed, it queries DNS infrastructure and follows delegations.

  4. An authoritative server returns an A, AAAA, or other relevant record.

  5. The application opens a connection to the returned address and port.

  6. IP routing forwards packets toward that address.

DNS is not routing. DNS supplies names and address information, while routing determines how packets reach those addresses. DNS can provide location indirection: a service can change server address, use multiple servers, or move between networks while clients continue using the same domain name.

Takeaway: DNS identifies where a service can be found; IP routing determines how packets get there.

Putting naming, addressing, and together

Consider a laptop at 192.168.1.25 connecting to https://www.example.com. The complete process separates naming, addressing, local delivery, route selection, , translation, and transport.

  1. The laptop asks DNS for an A or AAAA record for www.example.com.

  2. DNS returns one or more destination addresses.

  3. The laptop compares the destination with its local prefix.

  4. If the destination is remote, the laptop selects its default gateway, such as 192.168.1.1.

  5. The laptop uses ARP to learn the gateway's MAC address, or ND when using .

  6. It creates an IP packet and places it inside an Ethernet or Wi-Fi frame addressed to the gateway.

  7. The gateway consults its using .

  8. If the source is private , the gateway may perform NAT.

  9. Each router forwards the packet using its own table and next-hop resolution.

  10. The destination host receives the packet and responds; return traffic may follow a different path.

The responsibilities remain distinct:

  • DNS resolves names.

  • IP addressing identifies interfaces and networks.

  • ARP or ND resolves local next-hop link-layer addresses.

  • Routing tables select paths.

  • moves packets one hop at a time.

  • NAT may translate addresses at network boundaries.

  • TCP or UDP identifies application endpoints through port numbers.

Final takeaway: Internetworking scales because naming, addressing, local delivery, route selection, packet , and transport are separate functions that cooperate across independently operated networks.