Part I · Lecture Note · GIT 749616
GIT 749616 Lecture Note
Nov 16, 2026 · @UbonAbasi Anietie-Joseph · CCENT Study Guide, Chapters 1–3
C0 Course Overview
These notes cover the first three chapters of the CCENT Study Guide: how networks are built (Chapter 1), how Ethernet moves data and which cables to use (Chapter 2), and how TCP/IP works (Chapter 3). Together they answer one question: how does data travel from one host to another, and what does each device and protocol do along the way?
Learning objectives. By the end of Chapter 3 you should be able to:
- Explain the purpose of hubs, bridges, switches and routers, and which ones create collision or broadcast domain boundaries.
- Describe the layers of the OSI and DoD (TCP/IP) models and the protocols at each.
- Explain how Ethernet uses CSMA/CD, MAC addresses and frames, and how data is encapsulated.
- Choose the correct cable (straight-through, crossover, rolled) for a given connection.
- Describe the common TCP/IP application, transport and network-layer protocols, and the difference between TCP and UDP.
- Distinguish public from private IPv4 addresses and describe the address classes.
C1 Chapter 1 · Internetworking
Chapter 1 shows how a network grows from a few hosts on a hub into an internetwork of switches and routers, then introduces the OSI model that describes how it all communicates.
1.1 Building a network: devices and domains
Two terms drive everything in this chapter.
- Collision domain: a segment where only one device can transmit at a time; if two transmit at once, their frames collide.
- Broadcast domain: the set of devices that receive a broadcast sent by any one of them.
| Device | Layer | Collision domains | Broadcast domains |
| Hub | 1 (Physical) | One shared by all ports | One |
| Switch / bridge | 2 (Data Link) | One per port | One (by default) |
| Router | 3 (Network) | One per interface | One per interface |
- Hub: an outdated device that simply joins wires together. When one host transmits, every other host must stop and listen, so all ports share one collision domain.
- Switch: segments the network so each port is its own collision domain. In the lecture’s words, this means “a lot less yelling”. A switch forwards frames using MAC addresses, which is why a host on another port does not hear John’s frames to the Internet.
- Router: connects separate networks into an internetwork. It breaks up broadcast domains (every LAN interface is its own) and collision domains, and also provides WAN services.
- A modern network is typically built entirely of switches, with routers linking the LANs.
1.2 The OSI reference model
The OSI model splits communication into seven layers, grouped by function.
| Group | Layers | Role |
| Upper layers | 7 Application, 6 Presentation, 5 Session | Interface with the user and application |
| Middle layers | 4 Transport, 3 Network | Reliable communication and routing to a remote network |
| Bottom layers | 2 Data Link, 1 Physical | Communication on the local network |
1.3 Reliable, connection-oriented sessions
The Transport layer can provide reliable delivery. Before data flows, both hosts’ applications tell their operating systems that a connection is about to start, and the two hosts set up a session. Reliability then relies on three mechanisms:
- Flow control: the receiver controls how fast the sender transmits so it is not overwhelmed.
- Windowing: the window size is the number of segments a sender may transmit before it must wait for an acknowledgment. With a window of 1, the sender waits for an acknowledgment after every segment; with a window of 3, it sends three before waiting.
- Acknowledgments: if the sender transmits segments 1, 2 and 3, the receiver acknowledges them by requesting segment 4, the one it expects next.
1.4 Layer 2 and Layer 3 devices
- Network layer (routers): a router keeps a routing table and uses it to choose the best path to a remote network. Each router LAN interface is a broadcast domain.
- Data Link layer (switches): this layer uses the Ethernet and IEEE specifications and addresses hosts by hardware (MAC) address.
Exam essentials: know which devices break up collision and broadcast domains, the three OSI layer groups, and how windowing and acknowledgments provide reliability.— Chapter 1, Exam Essentials
C2 Chapter 2 · Ethernet Networking and Data Encapsulation
Chapter 2 explains how Ethernet controls access to the wire, how hosts are addressed, which cable connects which devices, and how data is wrapped as it moves down the layers.
2.1 Collision and broadcast domains
- Legacy design: a single collision domain, where only one host can transmit at a time.
- Modern design: switches give each port its own collision domain.
- Routers create the broadcast domain boundary.
2.2 CSMA/CD
Ethernet uses Carrier Sense Multiple Access with Collision Detection. Before transmitting, a host checks for a digital signal on the wire. If the wire is clear, it transmits; if a collision occurs, the hosts stop, wait a random time and try again.
- Half duplex: a device can send or receive, not both at once. This is what hosts on a hub use, and CSMA/CD applies.
- Full duplex: a device sends and receives at the same time, with no collisions. This needs a switch port dedicated to one host, which is why hubs should be avoided.
2.3 Ethernet addressing and frames
- MAC address: a 48-bit hardware address written as 12 hexadecimal digits. The first half identifies the manufacturer (the OUI) and the second half is a unique number assigned by that manufacturer.
- Frame: stations pass data to each other in a MAC frame. It carries a CRC for error detection. Remember: this detects errors, it does not correct them.
2.4 Ethernet cabling
The most common cable today is Category 5 Enhanced UTP (unshielded twisted pair) with RJ45 connectors. You need to know three types.
| Cable | Wiring | Connects |
| Straight-through | Pin 1 to 1, 2 to 2, up to pin 8 | Unlike devices: host to switch, host to hub, router to switch |
| Crossover | Pins 1 to 3 and 2 to 6 (gigabit also adds 4 to 7 and 5 to 8) | Like devices: switch to switch, host to host, router to host |
| Rolled | Pins reversed end to end | Host serial port to a console port, for configuration |
- Gigabit crossover: the same 1-to-3 and 2-to-6 crossing, plus 4 to 7 and 5 to 8.
- Rolled cable: cut one connector off a straight-through cable, flip it over and attach a new connector.
- Console settings: bit rate 9600, data bits 8, parity none, flow control none (stop bits 1).
- Cisco 2960 switch: has two console ports, an RJ45 and a newer mini type-B USB. The USB port takes priority if both are connected, and it supports speeds up to 115,200 Kbps, useful for Xmodem IOS updates.
2.5 Data encapsulation
As user data moves down the layers, each layer adds control information (a header, and at Layer 2 a trailer) to form a protocol data unit (PDU).
| Layer | PDU |
| Application, Presentation, Session | Data |
| Transport | Segment (UDP: datagram) |
| Network | Packet |
| Data Link | Frame |
| Physical | Bits |
The receiving host reverses the process, stripping each header as data moves up the layers (de-encapsulation).
Exam essentials: pick the right cable for any pair of devices, describe CSMA/CD and the half/full duplex difference, and name each layer’s PDU.— Chapter 2, Exam Essentials
C3 Chapter 3 · Introduction to TCP/IP
Chapter 3 covers the TCP/IP suite: its model, the protocols at each layer, and the headers and address types that make routing work.
3.1 The DoD model and the OSI model
The Department of Defense (DoD) model has four layers and is similar in concept to the seven-layer OSI model.
| DoD layer | OSI layers | Example protocols |
| Process/Application | Application, Presentation, Session | Telnet, SSH, FTP, TFTP, SNMP, HTTP, NTP, DNS, DHCP |
| Host-to-Host | Transport | TCP, UDP |
| Internet | Network | IP, ICMP, ARP |
| Network Access | Data Link, Physical | Ethernet and other LAN/WAN technologies |
3.2 Application layer protocols
| Protocol | Purpose |
| Telnet | One of the first Internet standards (1969). Terminal emulation to a remote device; data is sent unencrypted. |
| SSH | Secure Shell. Like Telnet, but the client sends data encrypted. |
| FTP | File transfer with access to directories and files, including moving between directories. |
| TFTP | Simplified file transfer. No directory browsing, so it can only send and receive files. |
| SNMP | Collects and manipulates network information. A network management station (NMS) polls devices at fixed or random intervals and asks them for information. |
| HTTP | Hypertext Transfer Protocol. Makes web pages possible; the browser interprets a URL (web address). |
| NTP | Network Time Protocol. Synchronizes devices so all computers on the network agree on the time. |
| DNS | Domain Name Service. Resolves hostnames such as www.cisco.com to IP addresses. Pinging a hostname returns the address DNS resolved. |
| DHCP | Assigns IP addresses automatically. The client process has four steps, remembered as DORA: Discover, Offer, Request, Acknowledge. |
3.3 Host-to-Host layer: TCP and UDP
- TCP: connection-oriented and reliable. Its header carries fields for sequencing, acknowledgments and windowing, which adds overhead.
- UDP: connectionless and lean. Its header has no windowing and no acknowledgments, so it is faster but unreliable. It suits applications that tolerate loss or provide their own checks.
3.4 Internet layer protocols
- IP: the IP header holds what IP needs every time user data is sent to a remote network, such as source and destination addresses. IP uses routing to deliver packets.
- ICMP: carries error and control messages. For example, a remote router sends an ICMP error message back to the sending host when a destination is unreachable. Ping uses ICMP.
- ARP: resolves an IP address to an Ethernet (MAC) address. A host sends a local broadcast asking who owns an IP address, and the owner replies with its MAC address.
3.5 IP address classes
IPv4 addresses are grouped into classes by the value of the first octet. The slides summarize the three classes used to address hosts.
| Class | First octet | Default mask | Use |
| A | 1 to 126 | 255.0.0.0 | Very large networks |
| B | 128 to 191 | 255.255.0.0 | Medium networks |
| C | 192 to 223 | 255.255.255.0 | Small networks |
Private (RFC 1918) addresses are not routed on the Internet and need NAT to reach it:
- 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
Public addresses are all other routable addresses, assigned by Internet registries and unique worldwide.
Exam essentials: match each protocol to its layer and purpose, remember DORA, contrast TCP with UDP, and recognize private address ranges.— Chapter 3, Exam Essentials
The three chapters are one story. Chapter 1 gives you the cast — hubs, switches and routers — and the two domains they carve up. Chapter 2 shows those switches at work: Ethernet frames, MAC addresses and CSMA/CD on the wire, with every layer wrapping data into its PDU. Chapter 3 lifts the view to TCP/IP: the DoD model’s protocols ride the frames of Chapter 2 across the internetworks of Chapter 1. When you can narrate one packet’s journey — data, segment, packet, frame, bits, and back up again — through switch and router to a remote host, you own the whole note.
R Key Terms and Review Questions
| Term | Meaning |
| Collision domain | Segment where simultaneous transmissions collide |
| Broadcast domain | Devices that receive each other’s broadcasts |
| CSMA/CD | Ethernet method: listen before sending, detect collisions, retry |
| MAC address | 48-bit hardware address of a network interface |
| PDU | Data plus control information at a given layer |
| Windowing | Number of segments sent before an acknowledgment is required |
| UTP | Unshielded twisted pair copper cable |
| TCP / UDP | Reliable connection-oriented / lean connectionless transport |
| ARP | Resolves IP addresses to MAC addresses |
| DORA | DHCP steps: Discover, Offer, Request, Acknowledge |
Q Review questions
- Which devices break up collision domains, and which break up broadcast domains?
- List the three OSI layer groups and what each does.
- A window size of 3 is configured. How many segments can be sent before an acknowledgment is needed?
- Which cable connects a switch to a switch? A host to a switch? A PC to a router console port?
- Why is CRC described as error detection rather than error correction?
- Name the PDU at each of the Transport, Network and Data Link layers.
- What is the difference between Telnet and SSH? Between FTP and TFTP?
- Which protocol resolves a hostname to an IP address, and which resolves an IP address to a MAC address?
- Why does UDP have less overhead than TCP?
- Which address ranges are private for Classes A, B and C?
As set in class, read the Exam Essentials sections, then work through the written labs and review questions in the textbook and review the answers together.— Closing instruction
Part II · Detailed Lecture Note · GIT 313
GIT 313 · Computer Networking
Topics: Network devices, transmission modes, network domains, OSI model, MAC addresses, IPv4 addressing, IP classes and subnet calculations.
01 Introduction to Computer Networks
A computer network is a collection of two or more computing devices connected through wired or wireless communication links so that they can exchange data and share resources. Resources may include files, printers, applications, storage and internet access.
1.1 Basic networking terms
- Node: Any device connected to a network, such as a computer, printer, phone or server.
- Link: The communication path connecting devices. It may use copper cable, fibre-optic cable or radio waves.
- Protocol: A set of rules that controls how devices format, transmit, receive and interpret data. Examples include Ethernet, IP, TCP and HTTP.
- Packet: A formatted unit of data carried across a packet-switched network.
- Bandwidth: The maximum data-carrying capacity of a link, commonly measured in bits per second (bps).
- Topology: The physical or logical arrangement of network devices and links, such as star, bus, ring or mesh.
1.2 Common network types
| Type | Meaning | Example |
| PAN | Personal Area Network; covers a very short range around an individual. | Phone connected to wireless earbuds by Bluetooth. |
| LAN | Local Area Network; covers a limited area such as a room, office or campus building. | A computer laboratory network. |
| MAN | Metropolitan Area Network; connects networks across a town or city. | A city-wide institutional network. |
| WAN | Wide Area Network; covers large geographical areas and connects distant LANs. | The Internet. |
02 Network Devices: Hub, Switch and Router
2.1 Hub
A hub is a basic networking device used to connect multiple Ethernet devices in a local area network. It operates at Layer 1 (the Physical Layer) of the OSI model.
- When a hub receives a signal on one port, it repeats the signal out through all its other ports.
- It does not examine MAC addresses or decide which port contains the destination device.
- All connected devices share the available bandwidth.
- A hub creates one collision domain and normally one broadcast domain.
- Because traffic is repeated to every port, devices may receive traffic that was not intended for them.
Example: If Computer A sends a frame to Computer B through a hub, the hub repeats the signal to Computers B, C and D. The intended recipient accepts the frame; the others discard it.
2.2 Switch
A switch connects devices in a LAN and forwards Ethernet frames intelligently using MAC addresses. A typical Layer 2 switch operates at the Data Link Layer of the OSI model.
- It learns source MAC addresses and associates each address with the port on which it was received.
- It stores these associations in a MAC address table (also called a forwarding table or CAM table).
- When it knows the destination MAC address, it forwards the frame only through the relevant port.
- If the destination is unknown, it generally floods the frame within the same VLAN, except through the port on which it arrived.
- Each switch port is its own collision domain. A normal switch keeps devices in the same VLAN within one broadcast domain.
- Switches support simultaneous communication more efficiently than hubs. Full-duplex Ethernet eliminates collisions on a link.
How a switch learns MAC addresses
- A frame enters a switch port from a connected device.
- The switch reads the source MAC address in the Ethernet frame.
- It records the source MAC address and the incoming port in its MAC table.
- It checks the destination MAC address.
- If the destination is known, it forwards the frame to the mapped port; if unknown, it floods it within the VLAN.
2.3 Router
A router connects two or more different IP networks and forwards packets between them using IP addresses. A traditional router operates at Layer 3 (the Network Layer) of the OSI model.
- It examines the destination IP address in a packet.
- It uses a routing table to select the next hop or outgoing interface.
- It separates broadcast domains: routers do not normally forward Layer 2 broadcasts between interfaces.
- It can connect a home LAN to an Internet Service Provider (ISP).
- Many home routers combine routing, Ethernet switching, wireless access point and firewall functions in one device.
2.4 Comparison of hub, switch and router
| Feature | Hub | Layer 2 Switch | Router |
| OSI layer | Layer 1 – Physical | Layer 2 – Data Link | Layer 3 – Network |
| Main address used | None | MAC address | IP address |
| Forwarding behaviour | Repeats signal to other ports | Forwards frames using MAC table | Routes packets using routing table |
| Collision domains | One shared domain | One per switch port | One per interface/network segment, depending on medium |
| Broadcast domains | Normally one | One per VLAN | Separates broadcast domains |
| Typical purpose | Basic physical connection | Connect devices within a LAN | Connect different IP networks |
Important note: A multilayer (Layer 3) switch can also perform routing. The table describes the common basic forms of these devices.
03 Modes of Data Transmission
Transmission mode describes the direction in which information can travel between two communicating devices.
3.1 Simplex
Simplex communication allows data to travel in only one direction. One device sends and the other receives; the roles do not reverse over that communication channel.
Examples: A traditional television broadcast (station to viewer), a one-way public-address announcement, and a basic keyboard-to-computer data path.
3.2 Half-duplex
Half-duplex communication allows data to travel in both directions, but not at the same time. Devices take turns transmitting.
Examples: Walkie-talkies and older shared Ethernet arrangements. A user presses the talk button to transmit, while the other person listens; they then swap roles.
3.3 Full-duplex
Full-duplex communication allows both devices to transmit and receive at the same time.
Examples: A normal telephone conversation and modern switched Ethernet links operating in full-duplex mode.
| Mode | Direction | Both ends simultaneously? | Example |
| Simplex | One direction only | No | TV broadcast |
| Half-duplex | Both directions, one at a time | No | Walkie-talkie |
| Full-duplex | Both directions | Yes | Telephone call; full-duplex switched Ethernet |
Memory aid: Simplex = one-way; half-duplex = two-way but take turns; full-duplex = two-way at the same time.— Section 3, memory aid
04 Network Domains
A network domain, in this topic, describes the part of a network within which a particular type of Layer 2 event or traffic is shared. The two important domains are collision domains and broadcast domains.
4.1 Collision domain
A collision domain is a network segment in which frames transmitted at the same time could interfere with one another (collide). This is mainly relevant to shared, half-duplex Ethernet.
- A hub places all its connected devices in one collision domain.
- A switch separates collision domains: each switch port is a separate collision domain.
- Full-duplex switched Ethernet does not have Ethernet collisions on the link because sending and receiving occur on separate channels.
4.2 Broadcast domain
A broadcast domain is the group of devices that receive a Layer 2 broadcast frame sent within that network segment or VLAN.
- A hub does not separate broadcast domains.
- A basic Layer 2 switch forwards broadcasts to the other ports in the same VLAN, so those ports belong to the same broadcast domain.
- A router separates broadcast domains. A broadcast received on one routed interface is not normally forwarded to another interface.
- VLANs can divide a switched network into multiple separate broadcast domains.
4.3 Quick example
Suppose four computers are connected to one hub. They share one collision domain and one broadcast domain. If the four computers are connected to four ports of a basic switch in the same VLAN, there are four collision domains but one broadcast domain. If the switch is configured with two VLANs, there are two broadcast domains; each switch port remains its own collision domain.
| Device / arrangement | Collision domains | Broadcast domains |
| One hub with several devices | 1 shared | 1 |
| Four devices on four ports of one Layer 2 switch, same VLAN | 4 | 1 |
| Four devices on a switch split across two VLANs | 4 | 2 |
| Two LANs connected through a router | Separate per LAN/interface segment | 2 separate domains |
05 The OSI Reference Model
The Open Systems Interconnection (OSI) model is a seven-layer reference framework used to explain how data moves from an application on one device to an application on another device. Each layer has specific responsibilities and provides services to the layer above it.
| Layer | Name | Main functions | Examples / devices |
| 7 | Application | Provides network services directly to user applications; supports services such as web, email and file transfer. | HTTP/HTTPS, DNS, SMTP; applications |
| 6 | Presentation | Translates data formats, handles character encoding, compression and encryption/decryption where applicable. | Data formatting, JPEG, UTF-8, encryption concepts |
| 5 | Session | Establishes, manages and terminates communication sessions; coordinates dialog and recovery checkpoints. | Session control |
| 4 | Transport | Provides end-to-end process communication; segmentation, reassembly, reliability, flow control and port numbers. | TCP, UDP |
| 3 | Network | Provides logical addressing and routing between networks; selects paths for packets. | IP, routers, Layer 3 switches |
| 2 | Data Link | Frames data, uses MAC addresses, controls access to the local link and detects some transmission errors. | Ethernet, Wi-Fi MAC; switches, bridges |
| 1 | Physical | Transmits raw bits as electrical, optical or radio signals; defines media, connectors and signalling. | Cables, connectors, repeaters, hubs |
5.1 Explaining the layers from bottom to top
Layer 1 – Physical. Moves raw bits (0s and 1s) over a physical or wireless medium. It defines signal levels, timing, connectors, pin layouts and data rates. A traditional hub and repeater work at this layer.
Layer 2 – Data Link. Organises bits into frames for delivery over a local link. Ethernet uses MAC addresses at this layer. Switches and bridges commonly operate here.
Layer 3 – Network. Moves packets between different networks using logical addresses. IP addressing and routing belong here. Routers commonly operate at this layer.
Layer 4 – Transport. Provides communication between applications running on different hosts. TCP provides reliable, ordered delivery; UDP provides connectionless datagrams with lower protocol overhead.
Layer 5 – Session. Coordinates the start, maintenance and end of communication sessions. In real-world TCP/IP systems, session functions are often implemented within application protocols or libraries rather than as a separate layer.
Layer 6 – Presentation. Makes sure data is represented in a usable format. It may translate formats, encode text, compress information or provide encryption-related functions.
Layer 7 – Application. Provides network capabilities used by software, such as web browsing, email and name resolution. It is not simply the same thing as the user application itself.
5.2 Where do hub, switch and router fall in the OSI model?
| Device | Usual OSI layer | Reason |
| Hub | Layer 1 – Physical | Repeats signals/bits; does not inspect frames or addresses. |
| Layer 2 switch | Layer 2 – Data Link | Reads Ethernet frames and forwards using MAC addresses. |
| Router | Layer 3 – Network | Reads IP packets and forwards them between networks. |
| Layer 3 switch | Layer 3 – Network (also Layer 2 functions) | Can switch frames and route IP packets. |
5.3 Encapsulation and decapsulation
When data is sent, each lower layer adds its own control information. This is called encapsulation. A simplified sequence is: application data → transport segment/datagram → network packet → data-link frame → bits. At the receiving device, the process is reversed and is called decapsulation.
Remember: TCP commonly uses the term segment; UDP uses datagram; IP uses packet; Ethernet uses frame; the Physical Layer sends bits.— Section 5.3
06 MAC Addresses
A Media Access Control (MAC) address is a link-layer identifier associated with a network interface. Ethernet uses MAC addresses to deliver frames within a local network.
6.1 Format and size
- A standard Ethernet MAC address is 48 bits (6 bytes) long.
- It is usually written as six pairs of hexadecimal digits, for example: 00:1A:2B:3C:4D:5E.
- Each hexadecimal digit represents 4 bits; therefore 12 hexadecimal digits represent 48 bits.
- The first 24 bits are commonly the Organizationally Unique Identifier (OUI), identifying the block assigned to a manufacturer or organisation.
- The remaining 24 bits identify an interface within that assigned block, subject to the address-allocation scheme.
6.2 Converting a MAC address from hexadecimal to binary
Example: 3A:7F:10:2B:00:C4. Convert each hexadecimal digit into its 4-bit binary equivalent.
| Hex digit | Binary | Hex digit | Binary |
| 3 | 0011 | A | 1010 |
| 7 | 0111 | F | 1111 |
| 1 | 0001 | 2 | 0010 |
| B | 1011 | 0 | 0000 |
| 0 | 0000 | C | 1100 |
| C | 1100 | 4 | 0100 |
The full binary address is 00111010:01111111:00010000:00101011:00000000:11000100. There is no decimal conversion needed to identify the MAC address; hexadecimal is simply a compact way to write its 48 bits.
6.3 Unicast, multicast and broadcast MAC addresses
- Unicast: Identifies one network interface. A frame is intended for one destination.
- Multicast: Identifies a group of interfaces that have joined or are interested in a group.
- Broadcast: FF:FF:FF:FF:FF:FF. The frame is intended for all devices in the local Layer 2 broadcast domain.
6.4 How a device uses a MAC address
On an Ethernet LAN, a sender places the destination MAC address in the frame header. A switch examines this address to decide which port should receive the frame. MAC addresses are used for local-link delivery; routers use IP addresses to move packets between networks. A device may have different MAC addresses for different network interfaces.
A MAC address is not the same as an IP address. A MAC address identifies an interface at the data-link level, while an IP address is a logical address used for communication across IP networks. MAC addresses can also be changed or spoofed in software, so they should not be treated as permanent proof of a device’s identity.
07 IP Addresses and IPv4 Structure
An Internet Protocol (IP) address is a logical address assigned to a network interface so that it can communicate using IP. Routers use destination IP addresses to forward packets between networks.
7.1 IPv4 format
- IPv4 is 32 bits long (4 bytes).
- It is written as four decimal octets separated by dots, for example 192.168.1.10.
- Each octet contains 8 bits and ranges from 0 to 255.
- Each octet is converted from binary using place values 128, 64, 32, 16, 8, 4, 2 and 1.
7.2 Converting a decimal octet to binary
Example: Convert 192 to binary. 192 = 128 + 64, so the 8-bit binary value is 11000000.
Example: Convert 10 to binary. 10 = 8 + 2, so the 8-bit binary value is 00001010.
Therefore, 192.168.1.10 in binary is 11000000.10101000.00000001.00001010.
7.3 Converting binary to decimal
Example: 10101100 = 128 + 32 + 8 + 4 = 172. Example: 00000101 = 4 + 1 = 5. Convert each 8-bit octet separately to obtain the dotted-decimal IPv4 address.
7.4 Network portion and host portion
An IPv4 address is divided into a network portion and a host portion. The subnet mask or prefix length tells a device which bits identify the network and which bits identify an individual interface within that network.
Example: 192.168.1.25/24 has a 24-bit network prefix. The first 24 bits identify the network (192.168.1.0), while the final 8 bits identify the host. Its subnet mask is 255.255.255.0.
08 Types of IP Addresses
8.1 IPv4 and IPv6
| Type | Size | Representation | Example |
| IPv4 | 32 bits | Four decimal octets | 192.168.1.10 |
| IPv6 | 128 bits | Hexadecimal groups separated by colons | 2001:db8::1 |
IPv6 was developed to provide a vastly larger address space and other improvements. This note focuses on IPv4 calculations because the traditional class system and common introductory subnetting exercises use IPv4.
8.2 Public and private IPv4 addresses
A public IP address is globally routable on the Internet. A private IP address is reserved for use inside private networks and is not routed across the public Internet. A home router commonly uses private addresses inside the home and a public address on its Internet-facing connection.
| Private range (CIDR) | Address range |
| 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 |
| 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 |
| 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 |
8.3 Static and dynamic IP addresses
- Static IP: An address configured to remain the same unless an administrator changes it. It is useful for servers, printers and network equipment that need a predictable address.
- Dynamic IP: An address assigned automatically, commonly by DHCP (Dynamic Host Configuration Protocol), for a lease period. It reduces manual configuration.
8.4 Other important IPv4 address categories
- Loopback: 127.0.0.0/8; 127.0.0.1 is commonly used by a computer to test its own TCP/IP stack.
- Link-local/APIPA: 169.254.0.0/16; often self-assigned when DHCP configuration fails on a link.
- Limited broadcast: 255.255.255.255; used to reach hosts on the local network segment.
- Network address: The address with all host bits set to 0; identifies the subnet and is not assigned to a normal host in conventional IPv4 subnetting.
- Directed broadcast: The address with all host bits set to 1 for a particular subnet; forwarding is commonly disabled by routers for security.
09 IPv4 Address Classes
In the traditional classful IPv4 system, addresses were divided into Classes A, B, C, D and E based on the value of the first octet. Modern networks use Classless Inter-Domain Routing (CIDR), but class ranges are still taught as foundational networking knowledge.
| Class | First-octet range | Default mask | Default prefix | Traditional use |
| A | 1–126* | 255.0.0.0 | /8 | Very large networks |
| B | 128–191 | 255.255.0.0 | /16 | Medium-sized networks |
| C | 192–223 | 255.255.255.0 | /24 | Small networks |
| D | 224–239 | Not applicable | Not applicable | Multicast |
| E | 240–255 | Not applicable | Not applicable | Reserved/experimental |
*The range 127.0.0.0/8 is reserved for loopback, and 0.0.0.0 has special meaning. Thus ordinary Class A network numbers are commonly described as 1–126.
9.1 Examples of each class
- Class A: 25.10.2.3 – first octet 25 is within 1–126.
- Class B: 150.20.5.8 – first octet 150 is within 128–191.
- Class C: 200.10.1.5 – first octet 200 is within 192–223.
- Class D: 230.1.1.1 – first octet 230 is within 224–239; used for multicast.
- Class E: 245.1.1.1 – first octet 245 is within 240–255; reserved/experimental.
9.2 Default classful host capacity
For the traditional default masks, the number of host bits is 24 in Class A, 16 in Class B and 8 in Class C. The usual number of assignable host addresses per default network is 2h − 2, where h is the number of host bits.
| Class | Host bits (h) | Addresses per default network | Usable host addresses |
| A | 24 | 224 = 16,777,216 | 16,777,214 |
| B | 16 | 216 = 65,536 | 65,534 |
| C | 8 | 28 = 256 | 254 |
The subtraction of 2 excludes the network address and the directed broadcast address in ordinary subnetting. Special-purpose and point-to-point cases can have different rules.
10 Subnet Masks and IP Address Calculations
10.1 What is a subnet mask?
A subnet mask is a 32-bit value that identifies the network bits and host bits in an IPv4 address. In binary, network bits are 1s and host bits are 0s. For example, 255.255.255.0 is 11111111.11111111.11111111.00000000, which is /24.
10.2 CIDR notation
CIDR notation writes the number of network bits after a slash. For example, /24 means 24 network bits and 8 host bits. /26 means 26 network bits and 6 host bits.
| Prefix | Subnet mask | Host bits | Usable hosts per subnet* |
| /8 | 255.0.0.0 | 24 | 16,777,214 |
| /16 | 255.255.0.0 | 16 | 65,534 |
| /24 | 255.255.255.0 | 8 | 254 |
| /25 | 255.255.255.128 | 7 | 126 |
| /26 | 255.255.255.192 | 6 | 62 |
| /27 | 255.255.255.224 | 5 | 30 |
| /28 | 255.255.255.240 | 4 | 14 |
| /29 | 255.255.255.248 | 3 | 6 |
| /30 | 255.255.255.252 | 2 | 2 |
*For ordinary IPv4 subnets, usable hosts = 2h − 2. Very small special-purpose subnets, such as /31 point-to-point links, have special rules.
10.3 Core subnetting formulas
- Number of addresses in a subnet = 2h, where h = number of host bits.
- Usable host addresses (ordinary subnet) = 2h − 2.
- Number of borrowed bits = new prefix − original prefix.
- Number of equal-sized subnets created = 2b, where b = number of borrowed host bits.
- Block size in an octet = 256 − the subnet-mask value in the changing octet.
10.4 How to find the network address
- Write down the IP address and subnet mask (or prefix).
- Identify the network bits and host bits from the mask.
- Perform a bitwise AND between the IP address and subnet mask. In binary, 1 AND 1 gives 1; all other combinations give 0.
- The result is the network address.
Quick rule for common masks: if the mask is /24, the first three octets are the network portion and the last octet is the host portion. Set the host portion to zero to find the network address.
10.5 How to find the broadcast address
The directed broadcast address is found by setting all host bits to 1 while keeping the network bits unchanged. In an ordinary subnet, it is the last address in the subnet.
10.6 How to find the usable host range
For an ordinary subnet, the first usable host is the network address plus 1, and the last usable host is the broadcast address minus 1.
10.7 Finding the block size
When the subnet mask changes within an octet, subtract that mask octet from 256. Example: for 255.255.255.192, the changing octet is 192, so the block size is 256 − 192 = 64. Subnet boundaries in the last octet are 0, 64, 128 and 192.
11 Worked Examples
E1 Identify the class
Question: Identify the class of 172.20.14.8.
Solution: Look at the first octet, 172. The Class B range is 128–191. Therefore, 172.20.14.8 is Class B in the traditional classful system.
E2 Convert IPv4 decimal to binary
Question: Convert 192.168.1.10 to binary.
Solution: 192 = 11000000; 168 = 10101000; 1 = 00000001; 10 = 00001010. Answer: 11000000.10101000.00000001.00001010.
E3 Find network, broadcast and host range for /24
Question: Given 192.168.1.25/24, find the subnet mask, network address, broadcast address and usable host range.
| Item | Answer |
| Subnet mask | 255.255.255.0 |
| Network address | 192.168.1.0 |
| Broadcast address | 192.168.1.255 |
| First usable host | 192.168.1.1 |
| Last usable host | 192.168.1.254 |
| Usable hosts | 28 − 2 = 254 |
E4 Find subnet details for /26
Question: Given 192.168.1.70/26, find the subnet mask, network address, broadcast address and usable range.
Step 1: /26 means 26 network bits and 6 host bits. The mask is 255.255.255.192.
Step 2: Block size = 256 − 192 = 64. The last-octet subnet boundaries are 0, 64, 128 and 192.
Step 3: The host value 70 falls between 64 and 127. Therefore, the network address is 192.168.1.64 and the broadcast address is 192.168.1.127.
| Item | Answer |
| Subnet mask | 255.255.255.192 |
| Network address | 192.168.1.64 |
| Broadcast address | 192.168.1.127 |
| First usable host | 192.168.1.65 |
| Last usable host | 192.168.1.126 |
| Usable hosts | 26 − 2 = 62 |
E5 Divide a /24 network into /26 subnets
Question: How many /26 subnets can be created from 192.168.5.0/24, and what are their network addresses?
Solution: Borrowed bits = 26 − 24 = 2. Number of subnets = 22 = 4. The /26 block size is 64.
| Subnet | Network address | Usable host range | Broadcast address |
| 1 | 192.168.5.0 | 192.168.5.1 – 192.168.5.62 | 192.168.5.63 |
| 2 | 192.168.5.64 | 192.168.5.65 – 192.168.5.126 | 192.168.5.127 |
| 3 | 192.168.5.128 | 192.168.5.129 – 192.168.5.190 | 192.168.5.191 |
| 4 | 192.168.5.192 | 192.168.5.193 – 192.168.5.254 | 192.168.5.255 |
E6 Calculate the number of hosts
Question: How many usable host addresses are available in a /27 subnet?
Solution: Host bits = 32 − 27 = 5. Total addresses = 25 = 32. Usable hosts = 32 − 2 = 30.
E7 Convert a MAC address to binary
Question: Convert 0A:1B:2C:3D:4E:5F into binary.
Solution: Convert each hexadecimal digit into four bits: 0=0000, A=1010, 1=0001, B=1011, 2=0010, C=1100, 3=0011, D=1101, 4=0100, E=1110, 5=0101, F=1111.
Answer: 00001010:00011011:00101100:00111101:01001110:01011111.
12 Quick Comparison Tables
12.1 MAC address versus IP address
| Feature | MAC address | IP address |
| Purpose | Local link/interface identification | Logical addressing and routing |
| OSI association | Layer 2 | Layer 3 |
| Common version/length | Ethernet MAC: 48 bits | IPv4: 32 bits; IPv6: 128 bits |
| Written format | 00:1A:2B:3C:4D:5E | 192.168.1.10 |
| Used by | Switches for local frame forwarding | Routers for packet forwarding |
| Can change? | Can be changed/spoofed in software | Can be static or dynamically assigned |
12.2 Hub versus switch versus router – exam summary
Hub: Layer 1; repeats signals; does not use MAC or IP addresses to make forwarding decisions; one shared collision domain.
Switch: commonly Layer 2; learns MAC addresses; forwards frames; each port is a separate collision domain; each VLAN is a separate broadcast domain.
Router: commonly Layer 3; uses IP addresses and a routing table; connects different networks; separates broadcast domains.
12.3 Simplex versus duplex
Simplex is one-way. Half-duplex is two-way but only one side transmits at a time. Full-duplex is two-way simultaneously.
13 Revision Questions
- Define a computer network and state four benefits of networking.
- Explain the functions of a hub, switch and router.
- State the OSI layer at which a hub, a Layer 2 switch and a router normally operate.
- Differentiate between simplex, half-duplex and full-duplex communication, giving one example of each.
- Define collision domain and broadcast domain.
- How many collision and broadcast domains are created when five computers are connected to one hub?
- How many collision domains are created when five computers are connected to five ports of a Layer 2 switch in the same VLAN?
- List the seven OSI layers in the correct order and explain the function of each.
- Define a MAC address and state its length.
- Convert 2F:10:AB:00:01:FF from hexadecimal to binary.
- Define an IPv4 address and state its length.
- Differentiate between public and private IP addresses.
- State the traditional IPv4 address classes and their first-octet ranges.
- Identify the class of 10.2.3.4, 172.16.5.1, 192.168.10.2 and 230.1.1.1.
- Find the subnet mask, network address, broadcast address and usable host range for 10.1.2.35/24.
- How many usable host addresses are available in a /28 subnet?
- Find the block size for subnet mask 255.255.255.224.
- Divide 192.168.10.0/24 into /26 subnets and list the network addresses.
14 Glossary and Important Exam Notes
G Glossary
| Term | Meaning |
| Broadcast | A one-to-all transmission within a broadcast domain. |
| Collision | Interference when two devices transmit simultaneously on a shared half-duplex medium. |
| DHCP | Protocol that automatically assigns IP configuration to devices. |
| Ethernet frame | Layer 2 data unit used by Ethernet. |
| Gateway | A device or address through which traffic leaves a local network; a default gateway is commonly a router interface. |
| MAC table | A switch table mapping learned MAC addresses to switch ports and VLANs. |
| Packet | The Layer 3 data unit; an IP packet. |
| Subnet | A logical subdivision of an IP network. |
| Subnet mask | A 32-bit value identifying network and host bits in IPv4. |
| VLAN | A Virtual LAN; a logical Layer 2 network that creates a separate broadcast domain. |
! Important exam notes
- Do not confuse a collision domain with a broadcast domain. A switch separates collision domains by port, while a router separates broadcast domains.
- Do not say that a normal Layer 2 switch routes using IP addresses. Its normal forwarding decision is based on destination MAC addresses.
- Do not say a hub sends a frame only to the intended computer. A hub repeats the signal to all other ports.
- Remember that the OSI model is a reference model. Real TCP/IP implementations do not always map perfectly to seven separate software layers.
- Classful addressing is historical. Modern IPv4 networks use CIDR prefixes such as /24, /26 and /30.
- For ordinary IPv4 subnet questions, identify the network address and broadcast address before writing the usable host range.