1 Networking Foundations and IP Addressing
Learn how devices communicate across networks, how Ethernet and layered protocols carry traffic, how to plan IPv4 and IPv6 addressing, and how to configure and verify basic Cisco devices.
Networks and their devices
A computer network connects devices so they can exchange data and share services. End devices, also called hosts, generate or receive network traffic. A covers a limited area, such as an office, while a connects networks across larger distances.
Switches connect devices within a , and routers forward packets between IP networks. A interface commonly serves as the for hosts on its subnet. Network communication follows agreed rules called protocols, which define matters such as message format, addressing, delivery, and error handling.
, switching, and packet forwarding
is a common technology for wired LANs. At the physical layer, a link carries bits over copper or fiber. At the data-link layer, organizes data into frames containing source and destination MAC addresses, a type/length field, a payload, and a frame check sequence used to detect transmission errors.
A identifies a network interface at Layer 2. switches learn source MAC addresses and the ports where they were received, building a table. When the destination MAC is known, a switch forwards the frame toward the corresponding port. If the destination is unknown, the switch floods the frame within the same VLAN, except through the port on which it arrived. Broadcast frames are also flooded within the VLAN. A does not forward Layer 2 broadcasts between IP networks by default.
At each routed hop, the removes the incoming frame, forwards the IP packet, and places it in a new frame for the next link. MAC addresses are therefore generally hop-by-hop, while the IP source and destination addresses usually remain end-to-end unless a feature such as NAT changes them.
Layered network models and encapsulation
Layered models organize network functions and help troubleshoot faults. The seven-layer OSI model is a reference framework; real protocol suites do not always map perfectly to it. The four-layer /IP model is commonly used to describe Internet protocols.
The OSI layers and examples are:
Application (Layer 7): Network services used by applications, such as HTTP, DNS, and DHCP.
Presentation (Layer 6): Data representation, encryption, and compression, including character encoding and TLS functions.
Session (Layer 5): Establishes and manages communication sessions, including session control.
Transport (Layer 4): End-to-end process communication and ports; examples include and .
Network (Layer 3): Logical addressing and routing; examples include IPv4, , and ICMP.
Data Link (Layer 2): Local-link framing and MAC addressing; examples include and 802.1Q.
Physical (Layer 1): Signals and transmission media, such as copper, fiber, and radio.
/IP groups these functions into application, transport, internet, and link layers. Broadly, OSI Layers 5–7 map to /IP application; Layer 4 maps to transport; Layer 3 maps to internet; and Layers 1–2 map to link.
As data moves down the protocol stack, each layer adds control information. Application data becomes a segment or datagram, then an IP packet, then a link-layer frame, and finally signals on the medium. The receiver reverses this process.
Choosing between and
provides a connection-oriented byte stream with sequencing, acknowledgments, retransmission, and flow and congestion control. has less protocol overhead and does not itself guarantee delivery, ordering, or duplicate protection. Applications choose the transport that fits their needs: reliable file transfer commonly uses , while some real-time or query/response applications use .
IPv4 addresses and subnet structure
An is 32 bits and is conventionally written as four decimal octets, such as 192.168.10.77. A or subnet mask identifies how many leading bits describe the network; for example, /24 is equivalent to 255.255.255.0. Together, an address and prefix identify a subnet.
The network address has all host bits set to zero. In conventional IPv4 subnets, the broadcast address has all host bits set to one, and other addresses are available to hosts. For a conventional subnet with host bits, the number of usable host addresses is . This calculation has exceptions for special prefix lengths such as /31 point-to-point links and /32 host routes.
For 192.168.10.77/24, the subnet is 192.168.10.0/24. Its conventional broadcast address is 192.168.10.255, and the usual host range is 192.168.10.1 through 192.168.10.254.
Private IPv4 addresses are intended for use within private networks and are not globally unique. The reserved blocks are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Private hosts commonly reach the public Internet through a gateway performing , but NAT is not what makes an address private.
Subnetting and address allocation
Use this ordered method to solve subnetting problems:
Convert the prefix into the number of network bits and host bits. The host-bit count is .
Find the subnet mask and the subnet increment, or block size, in the octet where the mask is neither
255nor0.Use the block size to locate the address’s subnet boundary and determine the network and broadcast addresses.
Count the available host addresses and check whether the subnet meets the requirement.
For example, divide 192.168.10.0/24 into /26 subnets. The /26 mask is 255.255.255.192; the block size in the last octet is . The four subnets begin at .0, .64, .128, and .192. For 192.168.10.77/26, the network is 192.168.10.64, the broadcast is 192.168.10.127, and the conventional usable range is .65–.126, containing 62 addresses.
uses different prefix lengths within an address block. Allocate appropriately sized subnets to avoid wasting addresses, and ensure that subnet ranges do not overlap.
addressing and configuration
uses 128-bit addresses written as eight groups of hexadecimal digits separated by colons. Leading zeroes in a group may be omitted, and one consecutive run of zero groups may be compressed with ::—only once per address. For example, 2001:0db8:0000:0000:0000:0000:0000:0012 can be written as 2001:db8::12. The block 2001:db8::/32 is reserved for documentation examples.
address types include:
Global unicast: Globally routable unicast addresses.
Unique local: Intended for local communications, generally within an organization; the range is
fc00::/7.Link-local: Used on a local link and not routed; addresses use the
fe80::/10prefix.Multicast: Identifies a group of interfaces. does not use broadcast; multicast performs group-delivery functions.
Anycast: The same address is assigned to multiple interfaces, and routing delivers traffic to one of them, typically the nearest by routing metrics.
A /64 prefix is common for an , but depends on network design and purpose. A host may obtain configuration through , DHCPv6, or manual configuration. interfaces use link-local addresses for essential local-link functions, and a host can often communicate with neighbors on its link even before receiving a global unicast address.
Host configuration and delivery
A host typically needs an IP address, a prefix or subnet mask, and a . DNS server information is needed to resolve host names to addresses. Hosts use the address and prefix to decide whether a destination is on the local subnet. For a local destination, the host resolves the destination’s link-layer address and sends directly. For a remote destination, it sends the frame to the ’s while the IP packet remains addressed to the remote host.
Useful verification commands include ipconfig /all on Windows and ip address and ip route on Linux. Exact commands vary by operating-system version and configuration method.
Basic Cisco device configuration
Cisco IOS and IOS XE use command modes. The > prompt is user EXEC mode; # is privileged EXEC mode; (config)# is global configuration mode; and (config-if)# is interface configuration mode. Use enable to enter privileged EXEC mode, configure terminal to enter global configuration, and end to return to privileged EXEC mode. Interface names vary by device model.
This example configures a interface for a lab and saves the running configuration:
For , configure an address on the interface. A that must forward packets between interfaces also needs unicast routing enabled:
A Layer 2 switch is managed through a , not by assigning a management IP address to a physical access port. This example configures an SVI and its :
The SVI must be operational for management connectivity. On many switches, this also depends on the VLAN existing and having an active port. Use show ip interface brief, show interface brief, show running-config, and show interfaces to verify configuration and interface status.
For remote management, prefer SSH over Telnet and use strong, unique credentials. A basic enable secret protects privileged EXEC access, but it does not replace a complete management-plane security configuration.