INITIALIZING SECURITY GRID
LOADING PORTALINITIALIZING SECURITY GRID
LOADING PORTALA structured networking course for cybersecurity beginners: ten professional study-note parts followed by a 50-question final MCQ exam. Pass mark: 75%.
Part 1 covers the foundation of networking that a cybersecurity analyst needs before working with logs, packets, firewalls, SIEM alerts or incident-response data.
Definition of Computer Network
A computer network is a collection of two or more computers and other devices connected together to communicate, exchange data, and share resources such as files, printers, applications, and internet connections.
Examples:
- Computers connected in a college computer laboratory.
- Smartphones connected to Wi-Fi.
- Computers sharing files in an office.
- Bank branches connected to a central server.
Objectives of Computer Networking
- Resource Sharing: Sharing printers, storage devices, software, and internet connections.
- Data Sharing: Exchanging files, documents, images, and other information.
- Communication: Supporting email, messaging, video conferencing, and voice calls.
- Cost Reduction: Sharing hardware and software reduces overall expenses.
- Centralized Management: Administrators can manage users, data, and security from a central location.
- Reliability: Backup systems and alternative network paths can improve availability.
- Scalability: New devices can be added as an organization grows.
- Remote Access: Users can access authorized resources from different locations.
Advantages of Computer Networks
- Fast communication and data transfer.
- Easy sharing of files and resources.
- Centralized storage and backup.
- Improved teamwork and collaboration.
- Reduced hardware and operational costs.
- Access to online services and cloud applications.
Disadvantages of Computer Networks
- Initial installation and maintenance costs.
- Security threats such as hacking and malware.
- Viruses can spread between connected systems.
- Network failures can interrupt communication.
- Requires technical knowledge for administration.
- Privacy risks if access controls are weak.
- COMPONENTS OF A COMPUTER NETWORK
A computer network consists of hardware, software, communication channels, and protocols.
1. Sender: The device that sends data, such as a computer or smartphone.
2. Receiver: The device that receives the transmitted data.
3. Message: The information being transmitted, such as text, images, audio, or video.
4. Transmission Medium: The path through which data travels. It can be wired or wireless.
5. Network Interface Card (NIC): A hardware component that connects a device to a network.
6. Networking Devices: Devices such as switches, routers, modems, access points, and repeaters.
7. Network Software: Software used to manage network communication and resources.
8. Protocols: Rules that define how devices communicate. Examples include TCP/IP, HTTP, HTTPS, DNS, and DHCP.
9. Network Address: An address used to identify a device or interface on a network. Examples include IP addresses and MAC addresses.
- TYPES OF COMPUTER NETWORKS
1. PAN — Personal Area Network
A Personal Area Network (PAN) connects devices around an individual over a short distance.
Examples:
- A smartphone connected to wireless earbuds using Bluetooth.
- A laptop connected to a mobile hotspot.
- A smartwatch connected to a phone.
Characteristics:
- Covers a very small area.
- Usually connects personal devices.
- Can use Bluetooth, USB, or Wi-Fi.
2. LAN — Local Area Network
A Local Area Network (LAN) connects devices within a limited geographical area, such as a room, office, school, or building.
Examples:
- A college computer laboratory.
- An office network.
- A home Wi-Fi network.
Characteristics:
- Usually provides high-speed communication.
- Commonly owned and managed by one person or organization.
- Can use Ethernet cables or Wi-Fi.
- Supports file, printer, and internet sharing.
3. WLAN — Wireless Local Area Network
A Wireless Local Area Network (WLAN) connects devices within a local area using wireless communication, generally Wi-Fi.
Examples:
- Home Wi-Fi.
- Wi-Fi in a college library.
- Wireless connectivity in a café.
Characteristics:
- Reduces the need for network cables.
- Allows users to move within the coverage area.
- Requires suitable wireless equipment.
- May experience interference and security risks.
4. CAN — Campus Area Network
A Campus Area Network (CAN) connects multiple LANs across a campus or a group of nearby buildings.
Examples:
- A university connecting its library, laboratories, offices, and hostels.
- A corporate campus connecting several buildings.
Characteristics:
- Covers a larger area than a typical LAN.
- Often uses high-speed fiber-optic links.
- Commonly managed by a single organization.
5. MAN — Metropolitan Area Network
A Metropolitan Area Network (MAN) connects networks across a city or metropolitan region.
Examples:
- Connecting offices located across a city.
- A city-wide institutional network.
Characteristics:
- Covers a larger area than a LAN.
- May use fiber-optic infrastructure.
- Can be operated by a service provider or organization.
6. WAN — Wide Area Network
A Wide Area Network (WAN) connects networks over large geographical areas, such as different cities, countries, or continents.
Examples:
- A company connecting offices in multiple countries.
- A bank connecting branches across India.
- The Internet.
Characteristics:
- Covers large geographical distances.
- Often relies on telecommunications infrastructure.
- May have higher latency than a local network.
- Requires routing between different networks.
Comparison of Network Types
PAN: Personal devices; very small area.
LAN: Home, office, or laboratory; limited area.
WLAN: Wireless LAN; limited area without requiring cables for every device.
CAN: Multiple buildings on a campus; campus-wide area.
MAN: A city or metropolitan region.
WAN: Multiple cities, countries, or continents; very large area.
Important Note: The Internet is the largest and most widely used interconnected system of networks, commonly described as a global network of networks.
- NETWORK TOPOLOGIES
Definition of Network Topology
Network topology refers to the physical or logical arrangement of devices and connections in a computer network.
1. Bus Topology
In a bus topology, all devices connect to a common main cable called the backbone.
Characteristics:
- Simple and inexpensive for small setups.
- Requires less cable than some other topologies.
- Failure of the backbone can disrupt the entire network.
- Performance may degrade as traffic increases.
- Traditional bus networks use terminators at both ends of the backbone.
2. Star Topology
In a star topology, all devices connect to a central device, usually a switch or hub.
Characteristics:
- Easy to install and manage.
- A single cable failure generally affects only one device.
- Easy to add or remove devices.
- Requires more cable than a basic bus topology.
- Failure of the central switch can disconnect all devices attached to it.
Example: Most modern wired Ethernet LANs use a physical star arrangement.
3. Ring Topology
In a ring topology, devices are connected in a circular arrangement.
Characteristics:
- Each device connects to neighboring devices in a ring.
- Data may travel around the ring in one or both directions, depending on the design.
- A link or device failure can disrupt a simple ring.
- Some ring systems use mechanisms to provide fault tolerance.
4. Mesh Topology
In a mesh topology, devices are connected through multiple links.
Types:
- Full Mesh: Every device connects directly to every other device.
- Partial Mesh: Only selected devices have multiple direct connections.
Characteristics:
- Offers multiple possible communication paths.
- Can provide high reliability and redundancy.
- Requires more cables, ports, and configuration.
- Is often more expensive than simpler topologies.
For a full mesh with n devices, the number of direct links is:
Number of links = n(n − 1) / 2
Example: For 5 devices, the number of links is 5 × 4 / 2 = 10.
5. Tree Topology
A tree topology arranges devices and network segments hierarchically, similar to the branches of a tree.
Characteristics:
- Suitable for larger networks.
- Supports hierarchical expansion.
- Makes network organization easier.
- Failure of an important upper-level link can affect multiple downstream devices.
6. Hybrid Topology
A hybrid topology combines two or more topology types.
Example: A college may use star topology inside each laboratory and connect different buildings using a backbone network.
Characteristics:
- Flexible and scalable.
- Can be designed according to organizational needs.
- May be complex and costly to maintain.
- NETWORKING DEVICES
1. Network Interface Card (NIC)
A Network Interface Card (NIC) is a hardware component that allows a computer or other device to communicate over a network.
Types:
- Wired Ethernet NIC.
- Wireless network adapter.
Functions:
- Provides network connectivity.
- Sends and receives network frames.
- Commonly has a unique MAC address assigned to its interface.
- Connects a device to Ethernet or Wi-Fi networks.
2. Repeater
A repeater receives a signal and regenerates it to extend the distance over which it can travel.
Functions:
- Extends the reach of a communication link.
- Helps overcome signal attenuation.
- Does not normally make forwarding decisions based on IP addresses.
A repeater is generally associated with OSI Layer 1 — Physical Layer.
3. Hub
A hub is a basic networking device that connects multiple Ethernet devices and repeats incoming signals to its other ports.
Functions:
- Connects devices in a shared network segment.
- Sends incoming signals to all other ports.
- Does not learn MAC addresses.
- Does not selectively forward frames.
Characteristics:
- Operates at OSI Layer 1 — Physical Layer.
- All connected devices share the available bandwidth.
- Can create unnecessary traffic and collisions in traditional half-duplex Ethernet.
- Has largely been replaced by switches.
4. Bridge
A bridge connects and filters traffic between LAN segments.
Functions:
- Learns MAC addresses.
- Forwards or filters Ethernet frames based on destination MAC addresses.
- Helps divide collision domains in traditional Ethernet networks.
A traditional transparent bridge operates at OSI Layer 2 — Data Link Layer.
5. Switch
A network switch connects devices within a LAN and forwards Ethernet frames to the appropriate port using MAC address information.
Functions:
- Learns source MAC addresses from incoming frames.
- Builds a MAC address table.
- Forwards known unicast frames toward the destination port.
- Floods certain frames, such as broadcasts and unknown unicasts, within the applicable VLAN.
- Reduces unnecessary traffic compared with a hub.
Characteristics:
- A traditional Layer 2 switch operates at the Data Link Layer.
- Each switch port creates a separate collision domain.
- Full-duplex switched Ethernet normally avoids Ethernet collisions.
- VLANs can separate logical broadcast domains.
- Layer 3 switches can also route traffic between networks or VLANs.
Example: Connecting computers in a college laboratory.
6. Router
A router connects different IP networks and forwards packets between them.
Functions:
- Examines destination IP addresses.
- Uses a routing table to choose a suitable next hop or outgoing interface.
- Connects a LAN to other networks, including the Internet.
- May support NAT, firewall rules, VPNs, and DHCP, depending on the device.
Characteristics:
- Routing operates at OSI Layer 3 — Network Layer.
- Routers separate IP networks and generally separate broadcast domains.
- A router uses routes that may be configured statically or learned dynamically.
Example: A home router connecting a home network to an Internet service provider.
7. Gateway
A gateway provides an entry or exit point between networks. The term can also refer to a device or software that translates between different protocols or systems.
In an ordinary IP network, the default gateway is usually the router address a device uses to send traffic to destinations outside its local subnet.
Functions:
- Connects networks.
- Provides a path toward external networks.
- May translate protocols or data formats in specialized systems.
Important: In everyday IP networking, the default gateway is usually a router, but the terms gateway and router are not universally interchangeable.
8. Modem
A modem is a device that modulates and demodulates signals, or performs the corresponding signaling functions required by a particular access technology.
Functions:
- Provides connectivity through supported access technologies.
- Converts or processes signals according to the access system.
- Connects a customer network to an Internet service provider's access network.
Examples:
- Cable modem.
- DSL modem.
- Cellular modem.
Note: Fiber connections often use an Optical Network Terminal (ONT), which performs optical-to-electrical conversion and other access functions rather than acting like a traditional telephone-line modem.
9. Wireless Access Point (AP)
A wireless access point allows Wi-Fi devices to connect to a wired LAN through wireless communication.
Functions:
- Provides wireless connectivity.
- Advertises one or more wireless network names (SSIDs).
- Bridges Wi-Fi clients to the LAN.
- May support wireless security and roaming features.
Example: Access points installed across a college campus.
Difference between a router and an access point:
- A router forwards traffic between IP networks.
- An access point provides wireless access to a network.
- A home Wi-Fi router often combines routing, switching, and access-point functions in one device.
10. Firewall
A firewall monitors and controls network traffic according to security rules.
Functions:
- Allows or blocks traffic based on configured policies.
- Helps prevent unauthorized access.
- Can filter traffic by addresses, ports, protocols, connection state, or application information.
- May support logging, VPNs, and intrusion-prevention features.
Types:
- Hardware firewall.
- Software firewall.
- Network firewall.
- Host-based firewall.
- Stateful firewall.
- Next-generation firewall.
A firewall is a security control and is not limited to a single OSI layer.
11. Proxy Server
A proxy server acts as an intermediary between a client and another server.
Functions:
- Forwards requests on behalf of clients.
- May cache frequently accessed content.
- Can support content filtering and access control.
- Can hide the client's direct address from the destination in some architectures.
Types:
- Forward proxy.
- Reverse proxy.
12. Load Balancer
A load balancer distributes requests or connections among multiple servers.
Functions:
- Improves scalability.
- Helps distribute workload.
- Can improve availability.
- May perform health checks and stop sending traffic to unhealthy servers.
13. Optical Network Terminal (ONT)
An ONT is commonly used in fiber-to-the-home or fiber-to-the-building installations.
Functions:
- Terminates the optical access connection.
- Converts optical signals into electrical interfaces for customer equipment.
- Provides Ethernet or other supported interfaces to a router or local network.
- DIFFERENCE BETWEEN HUB, SWITCH, AND ROUTER
Hub
- Main purpose: Repeats signals between connected ports.
- Typical OSI layer: Layer 1.
- Forwarding decision: No MAC or IP-based selection.
- Traffic behavior: Repeats signals to other ports.
- Network separation: Does not create separate IP networks.
Switch
- Main purpose: Connects devices within a LAN.
- Typical OSI layer: Layer 2.
- Forwarding decision: MAC address table.
- Traffic behavior: Forwards frames according to destination MAC information.
- Network separation: VLANs can create separate broadcast domains.
Router
- Main purpose: Connects different IP networks.
- Typical OSI layer: Layer 3.
- Forwarding decision: Routing table and destination IP.
- Traffic behavior: Forwards packets between networks.
- Network separation: Separates IP networks and normally separates broadcast domains.
- OSI MODEL
Definition
The Open Systems Interconnection (OSI) model is a conceptual framework that divides network communication into seven layers.
It helps explain how data travels from one application to another across a network.
Layer 7 — Application Layer
Purpose: Provides network services to applications.
Examples:
- HTTP and HTTPS.
- DNS.
- SMTP.
- FTP.
Layer 6 — Presentation Layer
Purpose: Represents data in a suitable format and may handle translation, encryption, and compression.
Examples of functions:
- Character encoding.
- Data format conversion.
- Encryption and decryption concepts.
Layer 5 — Session Layer
Purpose: Manages communication sessions between applications.
Functions:
- Establishing sessions.
- Maintaining dialog.
- Coordinating session termination.
Layer 4 — Transport Layer
Purpose: Provides end-to-end transport between application processes.
Protocols:
- TCP.
- UDP.
Functions:
- Segmentation and reassembly.
- Port addressing.
- Reliability and retransmission with TCP.
- Flow control and congestion control with TCP.
Layer 3 — Network Layer
Purpose: Delivers packets between different networks.
Examples:
- IPv4.
- IPv6.
- Routing.
Device:
- Router.
Address:
- IP address.
Layer 2 — Data Link Layer
Purpose: Transfers frames over a local link.
Functions:
- MAC addressing.
- Frame delivery.
- Error detection using mechanisms such as Ethernet FCS.
Devices:
- Switch.
- Bridge.
Address:
- MAC address.
Layer 1 — Physical Layer
Purpose: Transmits raw bits through the physical medium.
Examples:
- Electrical signals.
- Optical signals.
- Radio signals.
- Cables and connectors.
Devices:
- Repeater.
- Hub.
Easy Way to Remember the OSI Layers
From Layer 7 to Layer 1:
Application, Presentation, Session, Transport, Network, Data Link, Physical.
Mnemonic: All People Seem To Need Data Processing.
- TCP/IP MODEL
The TCP/IP model describes the protocol architecture used for communication over the Internet and many private networks.
1. Application Layer
- Provides services to user applications.
- Examples: HTTP, HTTPS, DNS, SMTP, DHCP.
2. Transport Layer
- Provides communication between application processes.
- Examples: TCP and UDP.
3. Internet Layer
- Handles IP addressing and packet routing between networks.
- Examples: IPv4 and IPv6.
- ICMP supports network-control and diagnostic messaging.
4. Network Access or Link Layer
- Handles communication over the local network medium.
- Examples: Ethernet and Wi-Fi.
OSI and TCP/IP Comparison
OSI Application + Presentation + Session = TCP/IP Application.
OSI Transport = TCP/IP Transport.
OSI Network = TCP/IP Internet.
OSI Data Link + Physical = TCP/IP Network Access/Link.
Important: The OSI model has seven layers, while the common TCP/IP model has four layers. Some textbooks use a five-layer teaching model by separating the physical and data-link functions.
- IP ADDRESSING
Definition of IP Address
An Internet Protocol (IP) address is a logical address used to identify a network interface and help deliver packets across IP networks.
There are two main versions: IPv4 and IPv6.
IPv4 Address
An IPv4 address is 32 bits long and is commonly written as four decimal octets separated by dots.
Example: 192.168.1.10
Each octet has a value from 0 to 255.
IPv6 Address
An IPv6 address is 128 bits long and is written in hexadecimal groups separated by colons.
Example: 2001:db8::10
IPv6 provides a much larger address space than IPv4.
Public IP Address
A public IP address is globally usable for routing on the Internet, subject to network configuration and provider policies.
Private IPv4 Addresses
The following IPv4 ranges are reserved for private networks:
- 10.0.0.0 to 10.255.255.255
- 172.16.0.0 to 172.31.255.255
- 192.168.0.0 to 192.168.255.255
Private addresses are commonly used in homes, colleges, and offices. They are not directly routed across the public Internet.
Static IP Address
A static IP address is configured to remain fixed unless an administrator or network configuration changes it.
Common uses:
- Servers.
- Network infrastructure.
- Devices that require predictable addressing.
Dynamic IP Address
A dynamic IP address is assigned automatically, commonly using DHCP.
Advantages:
- Reduces manual configuration.
- Simplifies management.
- Helps reuse address pools.
Loopback Address
The IPv4 loopback address is 127.0.0.1. It refers to the local host.
IPv6 loopback is ::1.
APIPA / IPv4 Link-Local Address
When a Windows device cannot obtain an IPv4 address from DHCP, it may assign itself an address in the 169.254.0.0/16 range.
This can permit limited communication on the local link but does not normally provide Internet access.
- SUBNET MASK AND SUBNETTING
Definition of Subnet Mask
A subnet mask identifies which bits of an IPv4 address represent the network portion and which bits represent the host portion.
Example:
- IP address: 192.168.1.10
- Subnet mask: 255.255.255.0
- CIDR notation: /24
- Network address: 192.168.1.0
For a conventional IPv4 /24 subnet:
- Network address: 192.168.1.0
- Usable host addresses: 192.168.1.1 to 192.168.1.254
- Broadcast address: 192.168.1.255
Definition of Subnetting
Subnetting is the process of dividing an IP network into smaller logical networks.
Advantages of Subnetting
- Organizes devices into logical groups.
- Reduces broadcast traffic within each subnet.
- Supports network security and segmentation.
- Improves address allocation.
- Simplifies network administration.
Basic Subnetting Formula
For a conventional IPv4 subnet:
Number of host bits = 32 − prefix length.
Total addresses = 2^(number of host bits).
For most ordinary subnets, usable host addresses = total addresses − 2, because one address represents the network and one represents the broadcast.
Important exceptions exist, including /31 point-to-point links and /32 host routes.
Example: A /26 Subnet
A /26 prefix leaves 6 host bits.
Total addresses = 2^6 = 64.
For a conventional /26 subnet, usable hosts = 64 − 2 = 62.
The subnet mask is 255.255.255.192.
- MAC ADDRESS
Definition
A Media Access Control (MAC) address is a link-layer address used for communication on many local network technologies, including Ethernet and Wi-Fi.
Example: 00:1A:2B:3C:4D:5E
Characteristics:
- Common Ethernet MAC addresses are 48 bits long.
- They are usually written in hexadecimal.
- A network interface uses a MAC address for local-link frame delivery.
- MAC addresses can be changed or randomized by software in some situations.
- A router normally replaces the link-layer header when forwarding a packet to another network.
Difference Between IP Address and MAC Address
IP address:
- Logical network-layer address.
- Used for communication across IP networks.
- IPv4 is 32 bits; IPv6 is 128 bits.
- Used by routing decisions.
MAC address:
- Link-layer address.
- Used for local-link frame delivery.
- Common Ethernet MAC addresses are 48 bits.
- Used by Ethernet switches to forward frames.
- NETWORK PROTOCOLS
Definition of Network Protocol
A network protocol is a set of rules that governs communication between devices and applications.
1. TCP — Transmission Control Protocol
- Connection-oriented transport protocol.
- Provides reliable, ordered byte-stream delivery.
- Uses acknowledgements and retransmissions.
- Includes flow-control and congestion-control mechanisms.
- Commonly used by web applications, email, and file transfer.
2. UDP — User Datagram Protocol
- Connectionless transport protocol.
- Does not guarantee delivery, ordering, or retransmission.
- Has low protocol overhead.
- Commonly used in real-time applications, DNS queries, and many streaming or gaming systems.
3. IP — Internet Protocol
- Provides logical addressing and packet delivery across networks.
- Supports routing between networks.
- Includes IPv4 and IPv6.
4. HTTP — Hypertext Transfer Protocol
- Used for transferring web resources.
- Commonly uses TCP in HTTP/1.1 and HTTP/2.
- HTTP/3 uses QUIC over UDP.
5. HTTPS
- HTTP protected by TLS.
- Helps provide confidentiality, integrity, and server authentication.
- Commonly used for secure websites and web applications.
6. DNS — Domain Name System
- Translates domain names into information such as IP addresses.
- Example: Resolving a website's domain name to an IP address.
- Commonly uses UDP or TCP port 53.
- Encrypted variants include DNS over HTTPS and DNS over TLS.
7. DHCP — Dynamic Host Configuration Protocol
- Automatically provides network configuration to clients.
- May assign an IP address, subnet mask, default gateway, and DNS server addresses.
- Commonly uses UDP ports 67 and 68 for IPv4 DHCP.
8. FTP — File Transfer Protocol
- Transfers files between a client and a server.
- Traditional FTP does not encrypt its traffic.
- Secure alternatives include SFTP and FTPS, which are different protocols or protocol arrangements.
9. SMTP — Simple Mail Transfer Protocol
- Used to send and relay email.
- Commonly uses TCP port 25 for server-to-server relay and ports 587 or 465 for supported message-submission arrangements.
10. POP3 — Post Office Protocol Version 3
- Used by email clients to retrieve messages from a mail server.
- Common ports are 110 and 995 for POP3 over TLS.
11. IMAP — Internet Message Access Protocol
- Used to access and synchronize email stored on a server.
- Common ports are 143 and 993 for IMAP over TLS.
12. SSH — Secure Shell
- Provides secure remote login and command execution.
- Commonly uses TCP port 22.
13. ICMP — Internet Control Message Protocol
- Carries network-control and diagnostic messages.
- Used by tools such as ping.
- Does not use TCP or UDP port numbers.
- PORT NUMBERS
A port number identifies an application service or endpoint associated with transport-layer communication.
Common port numbers:
- FTP control: TCP 21.
- SSH: TCP 22.
- Telnet: TCP 23.
- SMTP relay: TCP 25.
- DNS: UDP/TCP 53.
- DHCP for IPv4: UDP 67 and 68.
- HTTP: TCP 80.
- POP3: TCP 110.
- IMAP: TCP 143.
- HTTPS: TCP 443; HTTP/3 uses QUIC over UDP 443 by default.
- RDP: TCP 3389 by default, with other transport options possible.
Important: Port numbers identify services at the transport layer. They are not the same as IP addresses or MAC addresses.
- TRANSMISSION MEDIA
Transmission media are the channels through which data travels from one device to another.
There are two main categories: guided and unguided media.
A. Guided / Wired Media
1. Twisted Pair Cable
A twisted-pair cable contains insulated copper wires twisted together to reduce electromagnetic interference and crosstalk.
Types:
- UTP: Unshielded Twisted Pair.
- STP: Shielded Twisted Pair.
Advantages:
- Affordable.
- Easy to install.
- Commonly used for Ethernet LANs.
Disadvantages:
- More susceptible to interference than suitable fiber links.
- Has distance limitations.
- Performance depends on cable category and installation quality.
2. Coaxial Cable
A coaxial cable contains a central conductor, insulation, shielding, and an outer protective layer.
Uses:
- Cable television.
- Cable Internet access.
- Certain radio-frequency systems.
Advantages:
- Good shielding.
- Suitable for specific broadband and RF applications.
Disadvantages:
- Less flexible than some twisted-pair cables.
- May be harder to install in certain environments.
3. Fiber-Optic Cable
Fiber-optic cable transmits data using light through glass or plastic fibers.
Types:
- Single-mode fiber.
- Multimode fiber.
Advantages:
- Supports high bandwidth.
- Suitable for long-distance communication.
- Resistant to electromagnetic interference.
- Can provide high-capacity backbone connections.
Disadvantages:
- Equipment and installation may be expensive.
- Some fiber types and connectors require careful handling.
- Repair and termination may require specialized tools.
B. Unguided / Wireless Media
1. Radio Waves
Used by Wi-Fi, Bluetooth, and many mobile communication systems.
2. Microwaves
Used in point-to-point wireless links, cellular systems, and satellite communication.
3. Infrared
Used for short-range communication and certain remote-control systems.
4. Satellite Communication
Uses satellites to relay signals over very large areas.
Advantages of wireless media:
- Mobility.
- Flexible installation.
- Reduced cabling requirements.
Disadvantages:
- Interference.
- Signal attenuation.
- Potentially greater exposure to unauthorized access if poorly secured.
- Performance can depend on distance, obstacles, and environmental conditions.
- ETHERNET
Definition
Ethernet is a family of wired networking technologies commonly used to connect devices in LANs.
Characteristics:
- Defined by IEEE 802.3 standards.
- Commonly uses twisted-pair or fiber-optic cabling.
- Uses MAC addresses for local-link delivery.
- Supports multiple link speeds, depending on equipment and cable type.
- Modern switched Ethernet typically operates in full-duplex mode.
Common Ethernet Components
- Ethernet NIC.
- Ethernet switch.
- Ethernet cable.
- RJ45-style modular connector for common twisted-pair Ethernet.
- Fiber-optic transceivers and connectors for fiber links.
Ethernet Cable Categories
Examples include Cat5e, Cat6, and Cat6a. Their supported speeds and distances depend on the category, installation, and Ethernet standard.
- WIRELESS NETWORKING AND WI-FI
Definition
Wi-Fi is a family of wireless LAN technologies based on IEEE 802.11 standards.
Important Concepts
SSID: The name used to identify a wireless network.
Access Point: The device that provides wireless access to a LAN.
Frequency Bands: Wi-Fi commonly uses 2.4 GHz, 5 GHz, and, in supported regions and equipment, 6 GHz.
Channel: A portion of the radio spectrum used for wireless communication.
Signal Strength: Indicates how strongly a device receives a wireless signal; stronger signal does not always guarantee better performance.
Wireless Security
- WPA2-Personal commonly uses a pre-shared key.
- WPA3 provides newer security improvements.
- Strong, unique Wi-Fi passwords help reduce unauthorized access.
- Guest networks can separate visitors from internal resources.
- WPS should be managed carefully according to the device's security options.
Advantages of Wi-Fi
- Mobility.
- Convenient access.
- Reduced need for cabling.
- Easy connectivity for mobile devices.
Disadvantages of Wi-Fi
- Radio interference.
- Signal weakening through walls and other obstacles.
- Shared wireless airtime.
- Security risks if authentication and encryption are weak.
- NETWORK ADDRESS TRANSLATION (NAT)
Definition
Network Address Translation (NAT) modifies IP address information as packets pass through a network device.
It is commonly used by home and office routers to allow multiple private IPv4 devices to share one public IPv4 address.
Types of NAT
1. Static NAT: Maps one internal address to a specific external address.
2. Dynamic NAT: Maps internal addresses to available addresses from an external address pool.
3. PAT / NAT Overload: Allows multiple internal devices to share an external address by tracking transport-layer port information.
Advantages:
- Conserves public IPv4 addresses.
- Allows private addressing inside a network.
- Can simplify certain network designs.
Limitations:
- Can complicate some inbound connections.
- May affect applications that depend on direct end-to-end connectivity.
- Is not a replacement for a firewall or complete security policy.
- CLIENT-SERVER AND PEER-TO-PEER NETWORKS
Client-Server Network
A client-server network uses servers to provide services or resources to client devices.
Examples:
- A web server providing web pages.
- A file server storing shared documents.
- A database server responding to application queries.
Advantages:
- Centralized management.
- Easier backup and access control.
- Suitable for larger organizations.
Disadvantages:
- Servers require maintenance.
- A critical server failure may interrupt services unless redundancy exists.
- May require additional infrastructure and administration.
Peer-to-Peer Network (P2P)
A peer-to-peer network allows devices to share resources directly without relying on a dedicated central server for every function.
Advantages:
- Simple for small groups.
- Lower initial cost.
- No dedicated server is necessarily required.
Disadvantages:
- Management can become difficult as the network grows.
- Backup and security policies may be inconsistent.
- Availability depends on participating devices.
- BANDWIDTH, THROUGHPUT, AND LATENCY
Bandwidth
Bandwidth describes the capacity of a communication link, often measured in bits per second.
Examples:
- Mbps: Megabits per second.
- Gbps: Gigabits per second.
Throughput
Throughput is the actual rate at which data is successfully transferred over a network.
Throughput may be lower than the link's nominal bandwidth because of congestion, protocol overhead, interference, retransmissions, and other factors.
Latency
Latency is the time required for data to travel from a source to a destination or for a response to return, depending on the measurement used.
It is commonly measured in milliseconds.
Jitter
Jitter refers to variation in packet delay.
Low latency and low jitter are especially important for voice calls, video conferencing, and interactive applications.
Packet Loss
Packet loss occurs when packets fail to reach their intended destination.
It can cause retransmissions, reduced performance, and interruptions in real-time applications.
- NETWORK SECURITY FUNDAMENTALS
Definition
Network security consists of policies, technologies, and practices used to protect network systems and data from unauthorized access, misuse, disruption, or modification.
Common Network Threats
1. Malware: Malicious software such as viruses, worms, and ransomware.
2. Phishing: Fraudulent messages designed to steal credentials or sensitive information.
3. Unauthorized Access: Accessing systems or resources without permission.
4. Denial-of-Service (DoS): Attempting to make a system or service unavailable by overwhelming or disrupting it.
5. Man-in-the-Middle Attack: Intercepting or potentially altering communication between parties.
6. Password Attacks: Attempts to guess, steal, or reuse credentials.
7. Spoofing: Falsifying identity or address information to deceive systems or users.
Network Security Measures
- Use strong, unique passwords.
- Enable multi-factor authentication where possible.
- Install updates and security patches.
- Use firewalls and suitable endpoint protection.
- Encrypt sensitive network traffic.
- Separate guest devices from sensitive internal systems.
- Apply the principle of least privilege.
- Maintain regular backups.
- Monitor logs and unusual traffic.
- Secure Wi-Fi using modern encryption.
- Train users to recognize phishing.
- COMMON NETWORK COMMANDS
1. ping
Purpose: Tests IP reachability and measures round-trip time using ICMP echo messages where supported.
Windows example:
ping 8.8.8.8
2. ipconfig
Purpose: Displays Windows IP configuration.
Example:
ipconfig
To display more detailed configuration:
ipconfig /all
3. ipconfig /release
Purpose: Releases a DHCP-assigned IPv4 lease on supported interfaces.
4. ipconfig /renew
Purpose: Requests renewed DHCP configuration.
5. ipconfig /flushdns
Purpose: Clears the Windows DNS client resolver cache.
6. tracert
Purpose: Shows the route taken by packets toward a destination using TTL-based probing.
Example:
tracert example.com
7. nslookup
Purpose: Queries DNS servers to obtain name-resolution information.
Example:
nslookup example.com
8. netstat
Purpose: Displays network connections and related statistics.
Example:
netstat -an
9. arp -a
Purpose: Displays the local ARP cache for IPv4 address-to-link-layer mappings.
10. hostname
Purpose: Displays the local computer's host name.
11. getmac
Purpose: Displays MAC addresses associated with local network adapters.
12. route print
Purpose: Displays the Windows routing table.
- BASIC NETWORK TROUBLESHOOTING
Network troubleshooting is the process of identifying and resolving network connectivity or performance problems.
Step 1: Check Physical Connections
- Ensure Ethernet cables are connected properly.
- Check link lights on network ports.
- Verify that the router and switch are powered on.
- Inspect damaged cables and connectors.
Step 2: Check Network Configuration
Run:
ipconfig /all
Verify:
- IP address.
- Subnet mask.
- Default gateway.
- DNS servers.
- DHCP status.
Step 3: Test the Local TCP/IP Stack
Run:
ping 127.0.0.1
This tests the IPv4 loopback path on the local system.
Step 4: Test the Local IP Address
Ping the computer's configured IP address when appropriate.
Step 5: Test the Default Gateway
Run:
ping <default-gateway-IP>
Replace the placeholder with the actual gateway address.
If this fails, check the local link, VLAN, addressing, and gateway availability. Note that some devices block ICMP, so a failed ping is not conclusive proof of failure.
Step 6: Test an External IP Address
For example:
ping 8.8.8.8
If the local network works but an external address does not, investigate routing, firewall rules, or Internet connectivity. ICMP may be blocked along the path.
Step 7: Test DNS Resolution
Run:
nslookup example.com
If external IP connectivity works but DNS resolution fails, check the configured DNS server and its reachability.
Step 8: Trace the Route
Run:
tracert example.com
This can help identify where responses stop along a path, although routers may suppress traceroute probes.
Step 9: Check Applications and Firewalls
- Verify the destination server is online.
- Confirm the correct service and port.
- Check proxy settings.
- Review firewall rules.
- Inspect application and network logs.
- INTRODUCTION TO CISCO PACKET TRACER
Definition
Cisco Packet Tracer is a network simulation tool used to design, configure, and test virtual networks.
Common Devices Available
- PCs and laptops.
- Switches.
- Routers.
- Servers.
- Wireless access points.
- Network cables and other network components.
Basic Tasks in Packet Tracer
Task 1: Connect Two Computers
- Add two PCs.
- Connect them using a suitable Ethernet cable.
- Assign IP addresses in the same subnet.
- Open the command prompt on one PC.
- Ping the other PC.
Example:
PC0: 192.168.1.1
PC1: 192.168.1.2
Subnet mask: 255.255.255.0
Command:
ping 192.168.1.2
Task 2: Create a LAN Using a Switch
- Add one switch.
- Add several PCs.
- Connect each PC to the switch.
- Assign unique IP addresses in the same subnet.
- Ping between the PCs.
Task 3: Connect Two Different Networks Using a Router
Example network 1:
192.168.1.0/24
Example network 2:
192.168.2.0/24
- Add a router and two switches.
- Connect each switch to a router interface.
- Assign the router interfaces addresses such as 192.168.1.1/24 and 192.168.2.1/24.
- Assign each PC an address in its corresponding subnet.
- Configure the appropriate default gateway on each PC.
- Ensure the router interfaces are enabled.
- Test connectivity between the networks.
Task 4: Configure a DHCP Server
- Add a server and connect it to the LAN.
- Configure a suitable static IP address on the server.
- Enable DHCP in the server's services configuration.
- Define the address pool, subnet mask, gateway, and DNS settings.
- Configure client PCs to obtain addresses automatically.
- Verify the assigned addresses.
Task 5: Observe Packet Flow
- Build a small network.
- Switch from Realtime to Simulation mode.
- Generate traffic, such as a ping.
- Use the simulation controls to inspect packet movement.
- Observe how switches and routers process traffic.
- IMPORTANT NETWORKING DEFINITIONS
Node: Any device or connection point participating in a network.
Host: A device that sends or receives network communication, such as a PC or server.
Server: A system that provides resources or services to other systems.
Client: A system or application that requests a service from a server.
Protocol: A set of rules governing communication.
Packet: A formatted unit of data carried by a network-layer protocol such as IP.
Frame: A data-link-layer unit used to transmit information over a local link.
Segment: Commonly refers to a TCP transport-layer unit; exact terminology can vary by protocol.
Bandwidth: The nominal capacity of a communication link.
Throughput: The actual achieved data-transfer rate.
Latency: The delay experienced by data during transmission.
Gateway: An entry or exit point between networks; in IP networking, commonly the router used to reach external subnets.
Firewall: A security system that filters network traffic according to rules.
DNS: The system that translates domain names into information such as IP addresses.
DHCP: A protocol that automatically provides network configuration to clients.
NAT: A technique for translating IP address information as packets pass through a device.
VPN: A Virtual Private Network that creates a protected logical connection over an underlying network.
VLAN: A Virtual LAN that logically separates Layer 2 network traffic.
SSID: The identifier or name associated with a Wi-Fi network.
MAC Address: A link-layer address used for local network delivery.
IP Address: A logical address used by the Internet Protocol.
- IMPORTANT DIFFERENCES FOR EXAMINATION
LAN vs WAN
LAN:
- Covers a limited geographical area.
- Commonly managed by one organization.
- Usually offers high-speed local communication.
WAN:
- Covers large geographical areas.
- Often uses service-provider infrastructure.
- Connects multiple LANs across long distances.
TCP vs UDP
TCP:
- Connection-oriented.
- Provides reliable, ordered byte-stream delivery.
- Uses acknowledgements and retransmissions.
- Suitable for applications that need reliable delivery.
UDP:
- Connectionless.
- Does not guarantee delivery or ordering.
- Has low protocol overhead.
- Useful for applications that prefer low latency or implement their own reliability mechanisms.
IPv4 vs IPv6
IPv4:
- 32-bit address.
- Usually written in dotted-decimal format.
- Example: 192.168.1.10.
IPv6:
- 128-bit address.
- Written in hexadecimal groups separated by colons.
- Example: 2001:db8::10.
Static vs Dynamic IP
Static:
- Intended to remain fixed.
- Useful for predictable addressing.
- Requires manual or reserved configuration.
Dynamic:
- Assigned automatically, commonly through DHCP.
- Simplifies administration.
- May change when a lease is renewed or network conditions change.
Switch vs Router
Switch:
- Primarily connects devices within a LAN.
- A Layer 2 switch forwards frames using MAC address information.
- VLANs can separate broadcast domains.
Router:
- Connects different IP networks.
- Forwards packets using IP routing information.
- Usually serves as the default gateway for a subnet.
Wired vs Wireless Networking
Wired:
- Uses physical cables.
- Often offers predictable performance and low interference.
- Requires cable installation.
Wireless:
- Uses radio communication.
- Supports mobility and flexible installation.
- Can be affected by interference, obstacles, and signal strength.
- IMPORTANT EXAM QUESTIONS
Short-Answer Questions
- Define computer networking.
- What is a LAN?
- What is a WAN?
- Define network topology.
- What is a NIC?
- What is a MAC address?
- Define an IP address.
- What is a subnet mask?
- What is a default gateway?
- Define a network protocol.
- What is a switch?
- What is a router?
- What is DNS?
- What is DHCP?
- Define bandwidth and latency.
- What is a firewall?
- What is NAT?
- What is a VLAN?
- What is Wi-Fi?
- What is Cisco Packet Tracer?
Long-Answer Questions
- Explain the types of computer networks with examples.
- Explain bus, star, ring, mesh, tree, and hybrid topologies.
- Describe the functions of a hub, switch, router, modem, bridge, and access point.
- Explain the seven layers of the OSI model.
- Explain the TCP/IP model and compare it with the OSI model.
- Explain IPv4, IPv6, private IP addresses, and public IP addresses.
- Describe wired and wireless transmission media.
- Explain TCP, UDP, HTTP, HTTPS, DNS, and DHCP.
- Explain common network security threats and preventive measures.
- Describe basic network troubleshooting commands.
- Explain the differences between LAN and WAN.
- Explain subnetting and solve a basic subnetting problem.
- Describe the operation of a client-server network.
- Explain how to build a basic network using Cisco Packet Tracer.
FINAL REVISION SUMMARY
- A computer network connects devices for communication and resource sharing.
- PAN, LAN, WLAN, CAN, MAN, and WAN describe networks with different scopes and purposes.
- Topology describes the physical or logical arrangement of network devices.
- A hub repeats signals, a switch forwards frames, and a router forwards packets between IP networks.
- The OSI model contains seven layers.
- The common TCP/IP model contains four layers.
- IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses.
- MAC addresses are used for local-link delivery; IP addresses support network-layer delivery.
- TCP provides reliable, ordered byte-stream delivery; UDP provides connectionless datagram delivery without guaranteed reliability.
- DNS resolves domain names, and DHCP provides network configuration automatically.
- Ethernet is widely used for wired LANs, while Wi-Fi provides wireless LAN connectivity.
- Firewalls, encryption, strong authentication, updates, and network segmentation help improve security.
- Commands such as ping, ipconfig, tracert, nslookup, and netstat help diagnose network problems.
- Cisco Packet Tracer helps students simulate, configure, and troubleshoot networks.
Part 2 explains the layered models used to reason about communication, troubleshooting and security events.
OSI & TCP/IP MODELS — DETAILED NOTES
- INTRODUCTION TO NETWORK MODELS
Definition of a Network Model
A network model is a conceptual framework that explains how computers and network devices communicate with each other. It divides network communication into different layers, with each layer performing specific functions.
Network models help us understand how data travels from one computer to another over a network.
Objectives of Network Models
- Standardization: Establishes common rules for network communication.
- Simplification: Divides complex networking processes into smaller tasks.
- Interoperability: Helps devices and software from different manufacturers communicate.
- Troubleshooting: Makes it easier to identify problems in specific layers.
- Modularity: Allows changes in one layer without necessarily redesigning the entire system.
- Protocol Organization: Groups networking protocols according to their functions.
There are two important networking models:
- OSI Model: Open Systems Interconnection Model.
- TCP/IP Model: Transmission Control Protocol/Internet Protocol Model.
- OSI MODEL
Definition of OSI Model
The OSI (Open Systems Interconnection) Model is a seven-layer conceptual model developed by the International Organization for Standardization (ISO) to describe how data communication occurs between networked systems.
It divides the communication process into seven layers, where each layer performs a specific function.
The Seven Layers of the OSI Model
Layer 7 — Application Layer
Layer 6 — Presentation Layer
Layer 5 — Session Layer
Layer 4 — Transport Layer
Layer 3 — Network Layer
Layer 2 — Data Link Layer
Layer 1 — Physical Layer
Mnemonic to Remember the Layers
From Layer 7 to Layer 1:
All People Seem To Need Data Processing.
Application, Presentation, Session, Transport, Network, Data Link, Physical.
From Layer 1 to Layer 7, one possible mnemonic is:
Please Do Not Throw Sausage Pizza Away.
Physical, Data Link, Network, Transport, Session, Presentation, Application.
- LAYER 7 — APPLICATION LAYER
Definition
The Application Layer is the topmost layer of the OSI model. It provides network services and interfaces that applications use to communicate over a network.
It allows applications to access services such as web browsing, email, file transfer, and name resolution.
Functions of the Application Layer
- Provides network services to applications.
- Supports web browsing.
- Supports email communication.
- Supports file transfers.
- Supports access to network resources.
- Helps applications communicate with remote servers.
Examples of Application-Layer Protocols
- HTTP: Hypertext Transfer Protocol, used to transfer web resources.
- HTTPS: HTTP protected using TLS.
- FTP: File Transfer Protocol, used for file transfer.
- SMTP: Simple Mail Transfer Protocol, used to send and relay email.
- DNS: Domain Name System, used to resolve domain names.
- DHCP: Dynamic Host Configuration Protocol, used to provide network configuration.
- SSH: Secure Shell, used for secure remote access.
Example
When a user opens a website in a browser, the browser uses application-layer protocols such as HTTP or HTTPS to request web resources.
Important Point
The Application Layer does not mean the entire application itself. It represents the network services and protocols through which applications communicate.
- LAYER 6 — PRESENTATION LAYER
Definition
The Presentation Layer is the sixth layer of the OSI model. It deals with the representation and format of data exchanged between systems.
It helps ensure that the receiving system can interpret data in an appropriate format.
Functions of the Presentation Layer
- Data Translation: Converts data between different representations or formats.
- Encryption and Decryption: Represents the security-related functions associated with protecting data.
- Compression and Decompression: Reduces data size to improve efficiency.
- Character Encoding: Supports character representations such as ASCII and Unicode.
- Data Formatting: Helps systems interpret structured data consistently.
Examples
- Converting character encodings.
- Representing image formats such as JPEG or PNG.
- Compressing data before transmission.
- Encrypting information before it is sent.
Example
A system may convert data into a standard character encoding so that another system can interpret it correctly.
Important Point
The Presentation Layer is a conceptual OSI layer. In real-world TCP/IP networks, presentation functions are commonly implemented within applications, libraries, and security protocols rather than as a separate network layer.
- LAYER 5 — SESSION LAYER
Definition
The Session Layer is the fifth layer of the OSI model. It manages communication sessions between applications on different systems.
A session is an organized interaction between two communicating applications.
Functions of the Session Layer
- Session Establishment: Helps establish a communication session.
- Session Maintenance: Coordinates ongoing communication.
- Session Termination: Helps close a session when communication ends.
- Dialog Control: Coordinates how communicating systems exchange information.
- Synchronization: May establish checkpoints that help communication resume after an interruption.
Example
A software application may maintain a logical session while a user works with a remote service.
Important Point
In practical TCP/IP networking, session-management functions are usually handled by application protocols or libraries. The TCP/IP model does not define a separate Session Layer.
- LAYER 4 — TRANSPORT LAYER
Definition
The Transport Layer provides communication between application processes running on different hosts.
It is responsible for functions such as segmentation, reassembly, port addressing, and, depending on the protocol, reliability and flow control.
Functions of the Transport Layer
- Segmentation: Divides application data into manageable units for transmission.
- Reassembly: Reconstructs the transmitted data at the receiving end.
- Port Addressing: Identifies application endpoints using port numbers.
- Reliability: Provides mechanisms for reliable delivery when the protocol supports them.
- Flow Control: Helps prevent a sender from overwhelming a receiver.
- Error Recovery: Protocols such as TCP can detect missing data and retransmit it.
- Multiplexing: Allows multiple applications to communicate through the same network interface.
Important Transport-Layer Protocols
1. TCP — Transmission Control Protocol
- Connection-oriented.
- Provides reliable, ordered byte-stream delivery.
- Uses acknowledgements and retransmissions.
- Provides flow control and congestion control.
- Commonly used by web applications, email, and file transfers.
2. UDP — User Datagram Protocol
- Connectionless.
- Sends datagrams without guaranteeing delivery or ordering.
- Has relatively low protocol overhead.
- Commonly used for DNS queries, real-time communication, and online gaming.
Example
When downloading a file using TCP, missing data can be retransmitted to help ensure that the complete byte stream is received correctly.
Important Point
TCP and UDP use port numbers to identify application endpoints. Common examples include TCP port 443 for HTTPS over HTTP/1.1 or HTTP/2 and UDP port 53 for many DNS queries.
- LAYER 3 — NETWORK LAYER
Definition
The Network Layer is the third layer of the OSI model. It is responsible for logical addressing and delivering packets between different networks.
Functions of the Network Layer
- Logical Addressing: Uses IP addresses to identify network interfaces.
- Routing: Determines suitable paths toward destination networks.
- Packet Forwarding: Moves packets toward their destinations.
- Internetworking: Enables communication across multiple interconnected networks.
- Fragmentation: IPv4 routers may fragment packets under certain conditions; IPv6 routers do not fragment packets.
- Path Selection: Routing protocols and routing tables help determine where packets should go.
Important Protocols
- IPv4: Internet Protocol version 4.
- IPv6: Internet Protocol version 6.
- ICMP: Internet Control Message Protocol, used for control and diagnostic messages.
- IPsec: A suite of protocols that can protect IP communications.
Device Associated with the Network Layer
Router: A router forwards IP packets between networks using routing information.
Address Used
IP Address
Example: 192.168.1.10
Example
Suppose a computer in one college network sends data to a server on another network. The router forwards the IP packets toward the destination network.
Important Point
The Network Layer is responsible for routing between IP networks, while the Data Link Layer handles delivery across an individual link.
- LAYER 2 — DATA LINK LAYER
Definition
The Data Link Layer is the second layer of the OSI model. It provides communication over a local network link and organizes data into frames.
Functions of the Data Link Layer
- Framing: Organizes data into frames.
- MAC Addressing: Uses link-layer addresses for local delivery on technologies such as Ethernet.
- Media Access Control: Coordinates access to the shared communication medium where necessary.
- Error Detection: Can detect transmission errors using mechanisms such as the Ethernet Frame Check Sequence.
- Frame Forwarding: Switches forward frames based on MAC address information.
- Link Management: Supports link-specific communication functions.
Two Common Sublayers
1. LLC — Logical Link Control
Provides logical link-control functions in the IEEE 802 architecture.
2. MAC — Media Access Control
Handles media-access functions and MAC addressing.
Devices Associated with the Data Link Layer
- Ethernet switches.
- Bridges.
- Network interfaces operating at Layer 2.
Address Used
MAC Address
Example: 00:1A:2B:3C:4D:5E
Example
When one computer sends an Ethernet frame to another computer on the same LAN, the switch uses the destination MAC address to decide where to forward the frame.
Important Point
An Ethernet switch typically forwards frames based on MAC address information, whereas a router forwards IP packets between networks.
- LAYER 1 — PHYSICAL LAYER
Definition
The Physical Layer is the first and lowest layer of the OSI model. It deals with transmitting raw bits through a physical or wireless medium.
Functions of the Physical Layer
- Transmits bits as electrical, optical, or radio signals.
- Defines physical connectors and interfaces.
- Specifies relevant signaling characteristics.
- Defines transmission rates and physical link characteristics.
- Supports synchronization of transmitted bits.
- Defines aspects of the transmission medium and physical connections.
Examples of Physical Media
- Twisted-pair Ethernet cable.
- Coaxial cable.
- Fiber-optic cable.
- Radio waves used by Wi-Fi.
Devices Commonly Associated with the Physical Layer
- Repeaters.
- Traditional Ethernet hubs.
- Physical cabling and connectors.
- Some physical-layer transceivers.
Example
When a computer transmits Ethernet data over copper cable, the physical layer represents the bits through electrical signaling on the cable.
Important Point
The Physical Layer deals with signal transmission, while the Data Link Layer organizes those bits into frames.
- DATA ENCAPSULATION AND DECAPSULATION
Definition of Encapsulation
Encapsulation is the process of adding protocol information to data as it moves down the networking layers before transmission.
Each layer may add its own header and, in some cases, a trailer.
Encapsulation Process
- Application Layer: Creates application data.
- Transport Layer: Adds transport information, such as TCP or UDP headers.
- Network Layer: Adds an IP header.
- Data Link Layer: Adds a frame header and usually a trailer.
- Physical Layer: Transmits the bits over the communication medium.
Typical Data Units
Application Layer: Data.
Transport Layer: TCP segment or UDP datagram.
Network Layer: IP packet.
Data Link Layer: Frame.
Physical Layer: Bits.
Definition of Decapsulation
Decapsulation is the reverse process. The receiving device examines and removes the relevant protocol headers and trailers as data moves up the layers.
Decapsulation Process
- Physical Layer receives the transmitted signals and reconstructs bits.
- Data Link Layer processes the frame and checks link-layer information.
- Network Layer processes the IP packet.
- Transport Layer processes the TCP segment or UDP datagram.
- Application protocols deliver the data to the appropriate application.
Example
When a user opens a website, a request is prepared by the application, encapsulated by the networking layers, transmitted through the network, and decapsulated at the receiving server.
- TCP/IP MODEL
Definition of TCP/IP Model
The TCP/IP Model is a networking architecture that describes the protocols and functions used for communication across the Internet and many private networks.
TCP/IP stands for Transmission Control Protocol/Internet Protocol.
It is the practical foundation of Internet communication.
Four Layers of the TCP/IP Model
- Application Layer.
- Transport Layer.
- Internet Layer.
- Network Access or Link Layer.
Some textbooks use a five-layer model by separating the Link Layer into Data Link and Physical Layers.
- TCP/IP APPLICATION LAYER
Definition
The Application Layer is the topmost layer of the common four-layer TCP/IP model. It provides the protocols and services used by network applications.
It combines the functions associated with the Application, Presentation, and Session layers of the OSI model.
Functions
- Provides services for network applications.
- Supports web communication.
- Supports email communication.
- Supports file transfer.
- Supports domain-name resolution.
- Supports remote administration.
- May implement data formatting, encryption, and session management through applications and libraries.
Important Protocols
- HTTP: Transfers web resources.
- HTTPS: Protects HTTP using TLS.
- DNS: Resolves domain names.
- DHCP: Provides network configuration.
- SMTP: Sends and relays email.
- FTP: Transfers files.
- SSH: Provides secure remote access.
- IMAP: Accesses and synchronizes email.
- POP3: Retrieves email.
Example
When a user visits a website, the browser uses HTTP or HTTPS to communicate with the web server.
- TCP/IP TRANSPORT LAYER
Definition
The Transport Layer provides communication between applications running on different hosts.
Functions
- Process-to-process communication.
- Port addressing.
- Segmentation and reassembly where applicable.
- Reliable data delivery when supported by the protocol.
- Flow control and congestion control in TCP.
- Multiplexing communication among applications.
Main Protocols
TCP
- Reliable and ordered byte-stream delivery.
- Connection-oriented.
- Uses acknowledgements and retransmissions.
- Commonly used by applications requiring reliable transfer.
UDP
- Connectionless datagram delivery.
- Does not guarantee delivery or ordering.
- Has relatively low overhead.
- Often used where low latency or application-specific control is important.
Example
A computer may use TCP to download a document and UDP to send certain real-time media traffic.
- TCP/IP INTERNET LAYER
Definition
The Internet Layer handles logical addressing and the movement of packets between interconnected networks.
It corresponds broadly to the Network Layer of the OSI model.
Functions
- IP addressing.
- Routing between networks.
- Packet forwarding.
- Delivery toward remote destinations.
- Network-control messaging.
Protocols
- IPv4: Provides 32-bit IP addressing.
- IPv6: Provides 128-bit IP addressing.
- ICMP: Provides network-control and diagnostic messages.
- IPsec: Provides security mechanisms for IP traffic.
Example
When a laptop communicates with a remote web server, IP addresses help routers forward packets across different networks.
- TCP/IP NETWORK ACCESS OR LINK LAYER
Definition
The Network Access Layer, also called the Link Layer in common TCP/IP descriptions, handles communication over the local network medium.
In the four-layer TCP/IP model, it broadly combines the functions of the OSI Data Link and Physical layers.
Functions
- Transfers data across a local network link.
- Uses link-layer framing where applicable.
- Uses MAC addressing on technologies such as Ethernet and Wi-Fi.
- Handles physical or wireless transmission.
- Supports media-access mechanisms where required.
Examples of Technologies
- Ethernet.
- Wi-Fi.
- Point-to-point data links.
- Fiber-optic Ethernet links.
Example
When a laptop sends data through Wi-Fi to a local wireless access point, the link-layer and physical functions support transmission over the wireless connection.
- DIFFERENCE BETWEEN OSI AND TCP/IP MODELS
1. Number of Layers
OSI Model: Seven layers.
TCP/IP Model: Commonly four layers.
2. Developer and Origin
OSI Model: Developed as an international standardization framework associated with ISO.
TCP/IP Model: Developed from the Internet protocol architecture and research supported by the U.S. Department of Defense and Internet research communities.
3. Main Purpose
OSI Model: Provides a conceptual framework for understanding network communication.
TCP/IP Model: Describes the protocol architecture used by the Internet and many real-world networks.
4. Layer Structure
OSI Model: Application, Presentation, Session, Transport, Network, Data Link, Physical.
TCP/IP Model: Application, Transport, Internet, Network Access/Link.
5. Session and Presentation Layers
OSI Model: Defines separate Session and Presentation layers.
TCP/IP Model: Includes their practical functions within the Application Layer and supporting software.
6. Protocol Dependence
OSI Model: Primarily a general reference model.
TCP/IP Model: Closely associated with protocols such as IP, TCP, UDP, HTTP, and DNS.
7. Usage
OSI Model: Commonly used for learning, design, and troubleshooting.
TCP/IP Model: Commonly used to explain and implement Internet communication.
8. Network Layer
OSI Model: Calls this the Network Layer.
TCP/IP Model: Calls the corresponding layer the Internet Layer.
9. Data Link and Physical Layers
OSI Model: Defines them as separate layers.
TCP/IP Model: Commonly combines them into the Network Access or Link Layer.
10. Practical Importance
OSI Model: Helps explain the responsibilities of different networking functions.
TCP/IP Model: Explains how Internet protocols work together to enable communication.
- OSI AND TCP/IP LAYER MAPPING
OSI Layer 7 — Application
Corresponding TCP/IP layer: Application.
OSI Layer 6 — Presentation
Corresponding TCP/IP layer: Application.
OSI Layer 5 — Session
Corresponding TCP/IP layer: Application.
OSI Layer 4 — Transport
Corresponding TCP/IP layer: Transport.
OSI Layer 3 — Network
Corresponding TCP/IP layer: Internet.
OSI Layer 2 — Data Link
Corresponding TCP/IP layer: Network Access/Link.
OSI Layer 1 — Physical
Corresponding TCP/IP layer: Network Access/Link.
Easy Mapping Rule
The top three OSI layers map to the TCP/IP Application Layer.
The OSI Transport Layer maps to the TCP/IP Transport Layer.
The OSI Network Layer maps to the TCP/IP Internet Layer.
The bottom two OSI layers map to the TCP/IP Network Access/Link Layer.
- IMPORTANT NETWORKING DEVICES AND THEIR LAYERS
Hub
- Commonly associated with OSI Layer 1.
- Repeats incoming signals to other ports.
- Does not selectively forward Ethernet frames.
Repeater
- OSI Layer 1.
- Regenerates or repeats signals to extend a link.
Bridge
- OSI Layer 2.
- Forwards or filters frames using MAC address information.
Switch
- A traditional Ethernet switch operates at OSI Layer 2.
- Forwards frames using MAC address information.
- A Layer 3 switch can also route packets.
Router
- OSI Layer 3 for IP routing.
- Forwards packets between IP networks.
Firewall
- Can operate at multiple layers, depending on its features.
- Filters network traffic according to security rules.
Wireless Access Point
- Bridges wireless clients to a LAN.
- Uses both link-layer and physical-layer functions.
Important Note
Networking devices can implement functions across multiple layers. The layer assignments above describe their common or primary roles, not every feature they may support.
- PRACTICAL EXAMPLE: HOW DATA TRAVELS THROUGH NETWORK LAYERS
Suppose a student opens a website on a college computer.
Step 1: Application Layer
The browser creates an HTTP or HTTPS request for the web server.
Step 2: Transport Layer
The request is carried by TCP for HTTP/1.1 or HTTP/2, or by QUIC over UDP for HTTP/3.
Step 3: Internet Layer
IP adds source and destination IP address information to the packet.
Step 4: Network Access Layer
The computer prepares a frame for the local network and transmits the bits through Ethernet or Wi-Fi.
Step 5: Local Network
A switch or wireless access point forwards the frame toward the appropriate next hop.
Step 6: Router
The router examines the destination IP address and forwards the packet toward the next network.
Step 7: Destination Server
The receiving server processes the packet and delivers the data to the appropriate application.
Step 8: Response
The server sends a response back through the network, and the receiving computer processes it through the networking layers.
Important: At each router, the link-layer frame is normally replaced for the next link, while the IP packet is forwarded toward its destination, subject to routing, NAT, tunneling, and other network functions.
- TROUBLESHOOTING USING THE OSI MODEL
The OSI model can help identify network problems systematically.
Layer 1 — Physical
Possible problems:
- Damaged cables.
- Unplugged connectors.
- No power.
- Weak wireless signal.
- Failed physical interfaces.
Checks:
- Inspect cables and connectors.
- Check link lights.
- Confirm the device is powered on.
- Check wireless signal strength.
Layer 2 — Data Link
Possible problems:
- Incorrect VLAN assignment.
- Switch port configuration errors.
- MAC-learning issues.
- Wireless association problems.
Checks:
- Verify switch port status.
- Check VLAN configuration.
- Inspect MAC address tables.
- Confirm that the device is connected to the correct LAN.
Layer 3 — Network
Possible problems:
- Incorrect IP address.
- Incorrect subnet mask.
- Wrong default gateway.
- Missing routes.
- Duplicate IP addresses.
Checks:
- Use ipconfig on Windows.
- Check the routing table.
- Ping the local gateway.
- Verify addressing and subnet configuration.
Layer 4 — Transport
Possible problems:
- Blocked TCP or UDP ports.
- Services not listening.
- Connection timeouts.
- Firewall rules blocking traffic.
Checks:
- Verify the service is running.
- Check firewall policies.
- Test the relevant port using an appropriate diagnostic tool.
Layers 5–7 — Session, Presentation, Application
Possible problems:
- Authentication failures.
- Invalid application data.
- TLS certificate errors.
- DNS resolution issues.
- Application server failures.
- Incorrect application settings.
Checks:
- Inspect application logs.
- Verify DNS resolution.
- Check certificates and authentication.
- Confirm that the service is operating correctly.
Example
If a computer is connected to Wi-Fi but cannot open a website:
- Check the wireless connection.
- Verify the IP address and default gateway.
- Test connectivity to the gateway.
- Test external IP connectivity.
- Check DNS resolution.
- Check the browser, firewall, and website service.
A failed ping alone does not always prove that a device or network is unavailable because ICMP traffic may be blocked.
- IMPORTANT EXAM QUESTIONS
Short-Answer Questions
- What is a network model?
- What is the OSI model?
- How many layers are present in the OSI model?
- Expand OSI.
- Expand TCP/IP.
- What is the function of the Application Layer?
- What is the purpose of the Presentation Layer?
- What is the Session Layer?
- What is the function of the Transport Layer?
- What is the function of the Network Layer?
- What is the purpose of the Data Link Layer?
- What is the function of the Physical Layer?
- What is encapsulation?
- What is decapsulation?
- What is the TCP/IP model?
- Name the four layers of the TCP/IP model.
- Which OSI layer is associated with routing?
- Which OSI layer is associated with MAC addressing?
- What is the difference between TCP and UDP?
- How do the OSI and TCP/IP models differ?
Long-Answer Questions
- Explain the OSI model and describe all seven layers in detail.
- Explain the TCP/IP model and its four layers.
- Compare the OSI model and the TCP/IP model.
- Explain encapsulation and decapsulation with an example.
- Describe the functions and protocols of the Transport Layer.
- Explain the functions of the Network Layer and Data Link Layer.
- Explain the mapping between the OSI and TCP/IP models.
- Describe how data travels from a sender to a receiver using the OSI model.
- Explain how the OSI model can be used for network troubleshooting.
- Describe the roles of switches, routers, and hubs in the networking layers.
- QUICK REVISION NOTES
OSI Model
- Seven-layer reference model.
- Application: Network services for applications.
- Presentation: Data representation, translation, and related functions.
- Session: Session management and coordination.
- Transport: Process-to-process communication.
- Network: Logical addressing and routing.
- Data Link: Framing and local-link delivery.
- Physical: Signal transmission and raw bits.
TCP/IP Model
- Commonly uses four layers.
- Application: HTTP, HTTPS, DNS, SMTP, DHCP, SSH.
- Transport: TCP and UDP.
- Internet: IPv4, IPv6, ICMP.
- Network Access/Link: Ethernet, Wi-Fi, and link-level transmission.
Main Differences
- OSI has seven layers; the common TCP/IP model has four.
- OSI is primarily a reference model.
- TCP/IP describes the architecture and protocols used by the Internet.
- OSI separates Session and Presentation; TCP/IP groups their functions into the Application Layer.
- OSI separates Data Link and Physical; TCP/IP commonly groups them into Network Access/Link.
Data Units
- Application: Data.
- Transport: TCP segment or UDP datagram.
- Network: IP packet.
- Data Link: Frame.
- Physical: Bits.
Important Addresses
- Application identification: Protocol-specific information.
- Transport: Port numbers.
- Network: IP addresses.
- Data Link: MAC addresses.
- Physical: Signals and bit transmission.
Final Exam Tip
For a long-answer question about the OSI model, write the definition, draw or list the seven layers in the correct order, explain each layer's functions, mention suitable protocols or devices, and finish with an example of encapsulation. For the TCP/IP model, explain its four layers and then compare them with the OSI layers.
Part 3 develops IPv4/IPv6 addressing skills used in routing, firewall rules, asset identification and SOC investigations.
IP ADDRESSING, SUBNETTING & VLSM — DETAILED NOTES
- INTRODUCTION TO IP ADDRESSING
Definition of IP Address
An IP Address (Internet Protocol Address) is a logical address assigned to a network interface so that devices can communicate over an IP network.
IP addresses help identify network interfaces and enable routers to forward packets toward their destinations.
Example:
192.168.1.10
This is an example of an IPv4 address.
Functions of an IP Address
- Identification: Identifies a network interface within an IP network.
- Location: Indicates the network to which the interface belongs.
- Routing: Helps routers forward packets toward the destination.
- Communication: Enables devices on different networks to exchange data.
- Network Management: Supports address planning and network organization.
Types of IP Addresses
There are two major IP versions:
- IPv4: Internet Protocol version 4.
- IPv6: Internet Protocol version 6.
- IPV4 ADDRESSING
Definition
IPv4 (Internet Protocol version 4) is an IP addressing system that uses 32 bits to represent an address.
An IPv4 address is commonly written as four decimal numbers separated by dots. Each number is called an octet.
Example:
192.168.1.10
Binary representation:
11000000.10101000.00000001.00001010
Important Facts
- Total length: 32 bits.
- Number of octets: 4.
- Bits per octet: 8.
- Minimum octet value: 0.
- Maximum octet value: 255.
- Number of possible IPv4 bit patterns: 2³² = 4,294,967,296.
Not all IPv4 addresses are available for ordinary host assignment because some ranges have special purposes.
IPv4 Address Structure
An IPv4 address has two logical parts:
- Network Portion: Identifies the IP network.
- Host Portion: Identifies an interface within that network.
The subnet mask or prefix length determines which bits belong to the network portion and which bits belong to the host portion.
Example:
IP address: 192.168.1.10
Subnet mask: 255.255.255.0
Prefix: /24
Network address: 192.168.1.0
Host portion: The final 8 bits.
- IPV6 ADDRESSING
Definition
IPv6 (Internet Protocol version 6) is an IP addressing system that uses 128 bits.
It was developed partly to address the limitations of IPv4 address availability.
Example:
2001:db8:1234:0000:0000:0000:0000:0010
It can be shortened to:
2001:db8:1234::10
Important Facts
- Total length: 128 bits.
- Written using hexadecimal digits.
- Uses colons to separate groups.
- Provides a vastly larger address space than IPv4.
- Supports features such as stateless address autoconfiguration.
- Does not use broadcast addressing; multicast and anycast serve related communication purposes.
IPv4 vs IPv6
IPv4:
- 32-bit addresses.
- Dotted-decimal notation.
- Example: 192.168.1.10.
IPv6:
- 128-bit addresses.
- Colon-separated hexadecimal notation.
- Example: 2001:db8::10.
- TYPES OF IPV4 ADDRESSES
1. Public IP Address
A public IP address is globally routable on the Internet, subject to routing policies and configuration.
Uses:
- Hosting publicly reachable servers.
- Internet-facing services.
- Identifying an Internet-facing network endpoint.
2. Private IP Address
A private IP address is used within private networks and is not routed directly across the public Internet.
The three private IPv4 ranges defined by RFC 1918 are:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
Examples:
- 10.1.1.10
- 172.16.5.20
- 192.168.1.10
3. Static IP Address
A static IP address is configured to remain fixed unless an administrator or network configuration changes it.
Common uses:
- Servers.
- Routers.
- Network printers.
- Infrastructure devices.
4. Dynamic IP Address
A dynamic IP address is assigned automatically, commonly through DHCP.
Advantages:
- Reduces manual configuration.
- Simplifies network administration.
- Allows addresses to be reused from a pool.
5. Loopback Address
The IPv4 loopback range is 127.0.0.0/8.
The most commonly used loopback address is:
127.0.0.1
It refers to the local host.
The IPv6 loopback address is ::1.
6. Link-Local Address
IPv4 link-local addresses use the range:
169.254.0.0/16
A device may automatically select a link-local address if DHCP configuration fails.
These addresses generally support communication on the local link but do not normally provide Internet connectivity.
7. Broadcast Address
An IPv4 broadcast address allows a packet to be sent to all hosts on a particular broadcast network.
Example for 192.168.1.0/24:
192.168.1.255
IPv6 does not use broadcast addresses.
- CLASSFUL IP ADDRESSING
Definition
Classful addressing is an older IPv4 addressing method that divided addresses into classes based on their leading bits and default network boundaries.
Modern networks generally use CIDR (Classless Inter-Domain Routing) instead.
Class A
- Historical first-octet range: 1–126 for ordinary unicast class A networks.
- Default mask: 255.0.0.0.
- Default prefix: /8.
- Intended for very large networks in the historical classful system.
The address range 127.0.0.0/8 is reserved for loopback.
Class B
- Historical first-octet range: 128–191.
- Default mask: 255.255.0.0.
- Default prefix: /16.
- Intended for medium-sized networks in the historical classful system.
Class C
- Historical first-octet range: 192–223.
- Default mask: 255.255.255.0.
- Default prefix: /24.
- Intended for smaller networks in the historical classful system.
Class D
- Address range: 224–239.
- Used for IPv4 multicast.
Class E
- Address range: 240–255.
- Reserved for special or experimental purposes, with specific exceptions for special-use addresses.
Important Note
Classful addressing is mainly useful for historical study and examinations. Modern IP network design uses CIDR prefixes such as /20, /24, and /27.
- SUBNET MASK
Definition
A subnet mask is a 32-bit value that identifies the network and host portions of an IPv4 address.
Bits set to 1 represent the network prefix, while bits set to 0 represent the host portion.
Common Subnet Masks
Prefix /8:
255.0.0.0
Prefix /16:
255.255.0.0
Prefix /24:
255.255.255.0
Prefix /25:
255.255.255.128
Prefix /26:
255.255.255.192
Prefix /27:
255.255.255.224
Prefix /28:
255.255.255.240
Prefix /29:
255.255.255.248
Prefix /30:
255.255.255.252
Example
IP address: 192.168.1.25
Subnet mask: 255.255.255.0
CIDR prefix: /24
Network address: 192.168.1.0
Broadcast address: 192.168.1.255
Ordinary usable host range: 192.168.1.1–192.168.1.254.
- CIDR — CLASSLESS INTER-DOMAIN ROUTING
Definition
CIDR (Classless Inter-Domain Routing) is a method of representing IP networks using a prefix length rather than relying on fixed classful network boundaries.
Example:
192.168.1.0/24
Here, /24 means that the first 24 bits identify the network prefix.
The remaining 8 bits are available for host addressing within the IPv4 subnet.
Benefits of CIDR
- Supports flexible network sizes.
- Reduces address wastage.
- Supports route aggregation.
- Simplifies modern IP address allocation.
- Allows networks to be divided into appropriately sized subnets.
More Examples
192.168.1.0/24 — 256 total addresses.
192.168.1.0/25 — 128 total addresses.
192.168.1.0/26 — 64 total addresses.
192.168.1.0/27 — 32 total addresses.
192.168.1.0/28 — 16 total addresses.
192.168.1.0/29 — 8 total addresses.
192.168.1.0/30 — 4 total addresses.
These totals include network and broadcast addresses where the conventional IPv4 subnet rules apply.
- INTRODUCTION TO SUBNETTING
Definition
Subnetting is the process of dividing a larger IP network into multiple smaller logical networks called subnets.
It is performed by extending the network prefix and using some bits that previously belonged to the host portion.
Example
Suppose the original network is:
192.168.1.0/24
It can be divided into four /26 subnets:
- 192.168.1.0/26
- 192.168.1.64/26
- 192.168.1.128/26
- 192.168.1.192/26
Each subnet contains 64 total IPv4 addresses, usually providing 62 ordinary usable host addresses.
Advantages of Subnetting
- Efficient Address Usage: Allocates addresses according to network requirements.
- Reduced Broadcast Scope: Broadcast traffic is contained within the relevant subnet or VLAN.
- Improved Security: Different subnets can be separated using routing and firewall policies.
- Better Organization: Devices can be grouped by department, building, or function.
- Simplified Troubleshooting: Network problems can be isolated more easily.
- Improved Management: Address allocation and routing can be organized systematically.
- SUBNETTING FORMULAS
These formulas are essential for examinations.
1. Number of Host Bits
Host bits = 32 − prefix length.
Example:
For /26:
Host bits = 32 − 26 = 6.
2. Total Addresses per Conventional IPv4 Subnet
Total addresses = 2^(host bits).
Example:
For /26:
Total addresses = 2⁶ = 64.
3. Ordinary Usable Host Addresses
For most conventional IPv4 subnets:
Usable hosts = 2^(host bits) − 2.
Example:
For /26:
Usable hosts = 64 − 2 = 62.
The subtraction accounts for the network and broadcast addresses. Special cases include /31 point-to-point links and /32 host routes.
4. Number of Subnets Created
When subnetting a fixed parent network:
Number of subnets = 2^(borrowed bits).
Example:
Borrowing 2 bits creates:
2² = 4 subnets.
5. Borrowed Bits
Borrowed bits = New prefix − Original prefix.
Example:
Original prefix: /24
New prefix: /27
Borrowed bits = 27 − 24 = 3.
Number of equal-sized subnets within the /24 parent = 2³ = 8.
6. Block Size
For the subnet mask octet where the prefix boundary falls:
Block size = 256 − subnet mask value in that octet.
Example:
Subnet mask: 255.255.255.192
Block size = 256 − 192 = 64.
The subnet network addresses in the last octet begin at 0, 64, 128, and 192.
- POWERS OF TWO FOR SUBNETTING
Memorize the following values:
2¹ = 2
2² = 4
2³ = 8
2⁴ = 16
2⁵ = 32
2⁶ = 64
2⁷ = 128
2⁸ = 256
2⁹ = 512
2¹⁰ = 1024
These values help calculate subnet sizes, host capacity, and the number of subnets.
- SUBNETTING EXAMPLE 1 — DIVIDING A /24 NETWORK INTO FOUR SUBNETS
Question
Divide 192.168.1.0/24 into four equal-sized subnets. Find the subnet mask, network addresses, broadcast addresses, and usable host ranges.
Step 1: Identify the Original Prefix
Original network: 192.168.1.0/24
Original host bits = 32 − 24 = 8.
Step 2: Calculate Borrowed Bits
Four subnets are required.
2² = 4.
Borrow 2 host bits.
New prefix = /24 + 2 = /26.
Step 3: Calculate the Subnet Mask
/26 = 255.255.255.192.
Step 4: Calculate Addresses per Subnet
Host bits = 32 − 26 = 6.
Total addresses = 2⁶ = 64.
Ordinary usable hosts = 64 − 2 = 62.
Step 5: Calculate Block Size
Block size = 256 − 192 = 64.
The subnet addresses begin at 0, 64, 128, and 192.
Final Answer
Subnet 1:
- Network: 192.168.1.0/26
- First usable: 192.168.1.1
- Last usable: 192.168.1.62
- Broadcast: 192.168.1.63
Subnet 2:
- Network: 192.168.1.64/26
- First usable: 192.168.1.65
- Last usable: 192.168.1.126
- Broadcast: 192.168.1.127
Subnet 3:
- Network: 192.168.1.128/26
- First usable: 192.168.1.129
- Last usable: 192.168.1.190
- Broadcast: 192.168.1.191
Subnet 4:
- Network: 192.168.1.192/26
- First usable: 192.168.1.193
- Last usable: 192.168.1.254
- Broadcast: 192.168.1.255
Each subnet provides 62 ordinary usable IPv4 host addresses.
- SUBNETTING EXAMPLE 2 — FINDING THE SUBNET OF AN IP ADDRESS
Question
Find the network address, broadcast address, and usable host range for:
IP address: 192.168.10.77/26
Step 1: Find the Subnet Mask
/26 = 255.255.255.192.
Step 2: Calculate Block Size
Block size = 256 − 192 = 64.
Step 3: Identify the Correct Block
The last-octet subnet ranges are:
- 0–63
- 64–127
- 128–191
- 192–255
The address 192.168.10.77 falls within 64–127.
Final Answer
Network address: 192.168.10.64
Broadcast address: 192.168.10.127
First usable host: 192.168.10.65
Last usable host: 192.168.10.126
Total addresses: 64
Ordinary usable hosts: 62
- SUBNETTING EXAMPLE 3 — HOST REQUIREMENTS
Question
A network requires at least 50 usable IPv4 host addresses. Find the smallest suitable conventional subnet prefix.
Step 1: Calculate Required Host Bits
We need:
2^h − 2 ≥ 50.
For 5 host bits:
2⁵ − 2 = 30, which is insufficient.
For 6 host bits:
2⁶ − 2 = 62, which is sufficient.
Step 2: Calculate Prefix Length
Prefix = 32 − 6 = /26.
Final Answer
Required prefix: /26
Subnet mask: 255.255.255.192
Total addresses: 64
Ordinary usable hosts: 62
A /26 subnet is the smallest conventional IPv4 subnet that supports at least 50 ordinary usable host addresses.
- FIXED-LENGTH SUBNET MASKING (FLSM)
Definition
FLSM (Fixed-Length Subnet Masking) divides a network into subnets that all use the same prefix length.
Every subnet has the same total number of addresses and the same host capacity.
Example
Divide 192.168.2.0/24 into four equal subnets.
The result is four /26 subnets:
- 192.168.2.0/26
- 192.168.2.64/26
- 192.168.2.128/26
- 192.168.2.192/26
Each subnet has 64 total addresses and 62 ordinary usable hosts.
Advantages of FLSM
- Easy to calculate.
- Simple to configure.
- Predictable subnet sizes.
- Suitable when all subnets require similar capacity.
Disadvantages of FLSM
- Can waste IP addresses.
- Small departments may receive unnecessarily large subnets.
- Large departments may not receive enough addresses.
- Less flexible than VLSM.
- VLSM — VARIABLE LENGTH SUBNET MASKING
Definition
VLSM (Variable Length Subnet Masking) is a subnetting method that allows different subnets within a larger network to use different prefix lengths.
It allocates address blocks according to the number of hosts required by each subnet.
Example
An organization has the network:
192.168.10.0/24
It requires:
- Department A: 100 hosts.
- Department B: 50 hosts.
- Department C: 20 hosts.
- Department D: 10 hosts.
Using VLSM, the organization can assign a larger subnet to Department A and smaller subnets to the remaining departments.
Why Is VLSM Needed?
Different departments usually have different numbers of devices. Giving every department an equally large subnet can waste address space.
VLSM allows the network administrator to assign the smallest suitable subnet to each department.
Advantages of VLSM
- Efficient Address Utilization: Reduces unused addresses.
- Flexible Network Design: Supports different subnet sizes.
- Scalability: Makes it easier to accommodate varying network requirements.
- Reduced Waste: Small departments do not need unnecessarily large blocks.
- Hierarchical Addressing: Supports structured address allocation.
Disadvantages of VLSM
- Requires careful planning.
- Is more complex than FLSM.
- Requires accurate subnet-boundary calculations.
- Can lead to overlapping subnets if designed incorrectly.
- Routing protocols must support the appropriate classless routing information.
- VLSM FORMULAS AND RULES
Rule 1: Start with the Largest Host Requirement
Always allocate the largest subnet first, then move to smaller requirements.
Rule 2: Calculate Required Host Bits
Find the smallest integer h such that:
2^h − 2 ≥ required usable hosts.
Rule 3: Calculate the Prefix
Prefix length = 32 − h.
Rule 4: Calculate the Subnet Mask
Convert the prefix into its dotted-decimal subnet mask.
Rule 5: Calculate the Block Size
Use the relevant subnet mask octet:
Block size = 256 − mask value.
Rule 6: Allocate Contiguous, Non-Overlapping Blocks
Each new subnet must start on a valid boundary for its prefix.
Rule 7: Verify the Parent Network
Every subnet must fit completely within the original address block.
Rule 8: Check Usable Host Capacity
Ensure the number of usable host addresses meets the requirement.
- VLSM EXAMPLE — STEP-BY-STEP SOLUTION
Question
An organization receives the IPv4 network:
192.168.10.0/24
It needs four subnets:
- Department A: 100 hosts.
- Department B: 50 hosts.
- Department C: 20 hosts.
- Department D: 10 hosts.
Use VLSM to allocate the addresses efficiently.
Step 1: Sort Requirements from Largest to Smallest
Department A: 100 hosts.
Department B: 50 hosts.
Department C: 20 hosts.
Department D: 10 hosts.
Step 2: Calculate the Prefix for Each Department
Department A — 100 hosts:
2⁶ − 2 = 62, insufficient.
2⁷ − 2 = 126, sufficient.
Required prefix: 32 − 7 = /25.
Subnet mask: 255.255.255.128.
Department B — 50 hosts:
2⁵ − 2 = 30, insufficient.
2⁶ − 2 = 62, sufficient.
Required prefix: /26.
Subnet mask: 255.255.255.192.
Department C — 20 hosts:
2⁴ − 2 = 14, insufficient.
2⁵ − 2 = 30, sufficient.
Required prefix: /27.
Subnet mask: 255.255.255.224.
Department D — 10 hosts:
2³ − 2 = 6, insufficient.
2⁴ − 2 = 14, sufficient.
Required prefix: /28.
Subnet mask: 255.255.255.240.
Step 3: Allocate Subnets in Descending Size Order
Department A:
- Network: 192.168.10.0/25
- Subnet mask: 255.255.255.128
- First usable: 192.168.10.1
- Last usable: 192.168.10.126
- Broadcast: 192.168.10.127
- Total addresses: 128
- Usable hosts: 126
Department B:
- Network: 192.168.10.128/26
- Subnet mask: 255.255.255.192
- First usable: 192.168.10.129
- Last usable: 192.168.10.190
- Broadcast: 192.168.10.191
- Total addresses: 64
- Usable hosts: 62
Department C:
- Network: 192.168.10.192/27
- Subnet mask: 255.255.255.224
- First usable: 192.168.10.193
- Last usable: 192.168.10.222
- Broadcast: 192.168.10.223
- Total addresses: 32
- Usable hosts: 30
Department D:
- Network: 192.168.10.224/28
- Subnet mask: 255.255.255.240
- First usable: 192.168.10.225
- Last usable: 192.168.10.238
- Broadcast: 192.168.10.239
- Total addresses: 16
- Usable hosts: 14
Step 4: Check Remaining Addresses
The last allocated subnet ends at:
192.168.10.239
The remaining range is:
192.168.10.240–192.168.10.255
This remaining block contains 16 addresses, which can form another /28 subnet if required.
Final VLSM Allocation Table
Department A: 192.168.10.0/25 — 126 usable hosts.
Department B: 192.168.10.128/26 — 62 usable hosts.
Department C: 192.168.10.192/27 — 30 usable hosts.
Department D: 192.168.10.224/28 — 14 usable hosts.
Remaining block: 192.168.10.240/28 — 14 usable hosts.
All allocations are within 192.168.10.0/24 and do not overlap.
- FLSM VS VLSM
FLSM — Fixed-Length Subnet Masking
- All subnets use the same prefix length.
- Every subnet has the same address capacity.
- Easier to calculate and administer.
- May waste addresses when subnet requirements differ.
- Suitable for networks with similar host requirements.
VLSM — Variable Length Subnet Masking
- Subnets can use different prefix lengths.
- Subnets have different address capacities.
- Requires more careful planning.
- Uses address space more efficiently.
- Suitable for organizations with different department sizes.
Main Difference
FLSM assigns equal-sized subnets, whereas VLSM assigns differently sized subnets based on the number of hosts required.
- ROUTE SUMMARIZATION AND CIDR
Definition of Route Summarization
Route summarization combines multiple contiguous IP networks into a single larger prefix when their addresses and alignment permit it.
It reduces the number of routes that routers need to maintain and advertise.
Example
These four /24 networks:
- 192.168.0.0/24
- 192.168.1.0/24
- 192.168.2.0/24
- 192.168.3.0/24
Can be summarized as:
192.168.0.0/22
This works because the four networks are contiguous and correctly aligned.
Benefits
- Reduces routing-table size.
- Simplifies routing information.
- Supports hierarchical network design.
- Can improve routing scalability.
Important Point
VLSM allows different subnet sizes, while route summarization combines suitable contiguous networks into a larger advertised prefix.
- PRACTICAL IP CONFIGURATION IN WINDOWS
Step 1: Open Command Prompt
Press Windows + R.
Type:
cmd
Press Enter.
Step 2: View IP Configuration
Run:
ipconfig
For detailed configuration, run:
ipconfig /all
Step 3: Identify the Important Values
- IPv4 address.
- Subnet mask.
- Default gateway.
- DNS server.
Step 4: Test the Local Network
Run:
ping 127.0.0.1
This tests the local IPv4 loopback path.
Step 5: Test the Default Gateway
Run:
ping 192.168.1.1
Replace the address with your actual default gateway.
Step 6: Check DNS Resolution
Run:
nslookup example.com
Step 7: Inspect the Route
Run:
route print
These commands help identify addressing and connectivity issues.
- PRACTICAL SUBNETTING IN CISCO PACKET TRACER
Objective
Create multiple subnets and verify communication between devices.
Example Network
Subnet A: 192.168.1.0/26
Subnet B: 192.168.1.64/26
Step 1: Add Network Devices
Add:
- One router.
- Two switches.
- Two PCs.
Step 2: Connect the Devices
Connect each PC to a switch and connect the switches to suitable router interfaces.
Step 3: Configure Router Interfaces
For the first subnet:
IP address: 192.168.1.1
Subnet mask: 255.255.255.192
For the second subnet:
IP address: 192.168.1.65
Subnet mask: 255.255.255.192
Use the appropriate router interfaces and enable them.
Step 4: Configure the PCs
PC0:
- IP address: 192.168.1.2
- Subnet mask: 255.255.255.192
- Default gateway: 192.168.1.1
PC1:
- IP address: 192.168.1.66
- Subnet mask: 255.255.255.192
- Default gateway: 192.168.1.65
Step 5: Test Connectivity
From PC0, run:
ping 192.168.1.66
If the router interfaces, cabling, and addressing are configured correctly, the devices should communicate through the router.
- COMMON SUBNETTING MISTAKES
- Forgetting to subtract the network and broadcast addresses for conventional IPv4 subnets.
- Calculating the wrong subnet mask.
- Using an incorrect block size.
- Allocating overlapping subnets.
- Assigning a network or broadcast address to an ordinary host.
- Using a prefix that cannot accommodate the required number of hosts.
- Forgetting to configure the correct default gateway.
- Allocating smaller VLSM blocks before larger ones without checking alignment.
- Placing a subnet outside its original parent network.
- Confusing the total number of addresses with the number of usable host addresses.
Important Exception
A /31 IPv4 prefix is commonly used on point-to-point links and can use both addresses as endpoint addresses. A /32 prefix identifies a single IPv4 address. Do not apply the ordinary minus-two host formula blindly to these special cases.
- IMPORTANT EXAM QUESTIONS
Short-Answer Questions
- Define IP addressing.
- What is IPv4?
- What is IPv6?
- What is a private IP address?
- What is a public IP address?
- Define a subnet mask.
- What is CIDR?
- Define subnetting.
- What is a network address?
- What is a broadcast address?
- Define VLSM.
- What is FLSM?
- What is route summarization?
- What is a default gateway?
- What is the difference between static and dynamic IP addressing?
Long-Answer Questions
- Explain IPv4 addressing and its structure.
- Compare IPv4 and IPv6.
- Explain classful and classless addressing.
- Explain subnetting with formulas and solved examples.
- Describe the advantages of subnetting.
- Explain FLSM and VLSM with examples.
- Solve a VLSM problem for multiple departments.
- Explain subnet masks and CIDR notation.
- Explain route summarization with an example.
- Describe the procedure for configuring IP addresses in Cisco Packet Tracer.
Numerical Practice Questions
- Divide 192.168.1.0/24 into four equal subnets.
- Find the network and broadcast addresses of 192.168.5.70/26.
- Find the smallest suitable prefix for 100 usable hosts.
- Find the number of usable hosts in a /27 subnet.
- Divide 10.0.0.0/24 into eight equal subnets.
- Use VLSM to allocate 192.168.20.0/24 for 100, 50, 25, and 10 hosts.
- Find the subnet mask and block size for /28.
- Find the network address of 172.16.10.130/25.
- QUICK REVISION SUMMARY
IP Addressing
- Identifies network interfaces logically.
- IPv4 uses 32 bits.
- IPv6 uses 128 bits.
- Private IPv4 ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
Subnet Mask
- Separates the network prefix from the host portion.
- /24 corresponds to 255.255.255.0.
- /26 corresponds to 255.255.255.192.
- /27 corresponds to 255.255.255.224.
- /28 corresponds to 255.255.255.240.
Subnetting Formulas
- Host bits = 32 − prefix.
- Total addresses = 2^(host bits).
- Conventional usable hosts = 2^(host bits) − 2.
- Number of equal subnets = 2^(borrowed bits).
- Block size = 256 − relevant mask octet.
FLSM
- Equal-sized subnets.
- Same prefix length.
- Simple but may waste addresses.
VLSM
- Different-sized subnets.
- Allocates addresses according to host requirements.
- More efficient but requires careful planning.
Essential Rule for VLSM
Calculate the required subnet sizes, allocate the largest subnet first, align every subnet to a valid boundary, and verify that all blocks fit within the original network without overlap.
Part 4 explains Layer 2 behavior and the security controls used to protect switched networks.
MAC, ARP, SWITCHING, VLANs & STP — DETAILED NOTES
1. MAC ADDRESS (MEDIA ACCESS CONTROL ADDRESS)
Definition:
A MAC address is a unique hardware address assigned to a network interface card (NIC) to identify a device on a local area network (LAN).
Key Features of a MAC Address:
- It operates mainly at the Data Link Layer (Layer 2) of the OSI model.
- It is generally 48 bits (6 bytes) long.
- It is represented in hexadecimal format.
- It is used to deliver Ethernet frames within a local network.
- It is usually assigned by the manufacturer, although software can sometimes change or spoof it.
Example of a MAC Address:
00:1A:2B:3C:4D:5E
Other common formats:
- 00-1A-2B-3C-4D-5E
- 001A.2B3C.4D5E
Structure of a MAC Address:
A standard 48-bit MAC address contains six hexadecimal octets.
- OUI (Organizationally Unique Identifier): The first 24 bits usually identify the manufacturer or organization assigned the address block.
- Device Identifier: The remaining 24 bits identify an interface within that assigned block.
Types of MAC Addresses:
- Unicast MAC Address: Identifies a single network interface.
- Multicast MAC Address: Identifies a group of network interfaces.
- Broadcast MAC Address: Used to send a frame to all devices in the local Layer 2 broadcast domain.
Broadcast MAC Address:
FF:FF:FF:FF:FF:FF
MAC Address vs IP Address:
- MAC Address: Used for local Layer 2 frame delivery.
- IP Address: Used for logical addressing and routing between networks.
- MAC Address: Usually associated with a network interface.
- IP Address: Can change when a device moves to another network or receives a new address.
- MAC Address: Operates at the Data Link Layer.
- IP Address: Operates at the Network Layer.
Important Note: MAC addresses are not guaranteed to be permanent or globally unique in practice. They can be randomized, locally administered, or spoofed.
2. ARP (ADDRESS RESOLUTION PROTOCOL)
Definition:
ARP is a protocol used in IPv4 networks to discover the MAC address associated with a known IPv4 address on the local network.
Purpose of ARP:
When a computer wants to send an Ethernet frame to another device on the local network, it needs the destination MAC address. If that address is not already in its ARP cache, the computer uses ARP to discover it.
How ARP Works:
Suppose:
- Computer A IPv4 address: 192.168.1.10
- Computer B IPv4 address: 192.168.1.20
- Computer B MAC address: AA:BB:CC:11:22:33
Step 1: Check ARP Cache
Computer A checks whether it already knows the MAC address for 192.168.1.20.
Step 2: ARP Request
If the entry is missing, Computer A broadcasts an ARP request asking which device owns 192.168.1.20.
Step 3: ARP Reply
Computer B recognizes its IPv4 address and replies with its MAC address. The reply is usually unicast to Computer A.
Step 4: Update ARP Cache
Computer A stores the IP-to-MAC mapping temporarily in its ARP cache.
Step 5: Send Data
Computer A can now send the Ethernet frame to Computer B's MAC address.
ARP Request Example:
"Who has 192.168.1.20? Tell 192.168.1.10."
ARP Reply Example:
"192.168.1.20 is at AA:BB:CC:11:22:33."
Important ARP Terms:
- ARP Cache: A temporary table of IPv4-to-MAC mappings.
- ARP Request: A broadcast message used to discover a MAC address.
- ARP Reply: A response containing the requested MAC address.
- Gratuitous ARP: An ARP announcement or request used to announce or check an IPv4-to-MAC mapping.
- Proxy ARP: A router or other device answers an ARP request on behalf of another host under certain configurations.
ARP When Communicating With a Remote Network:
If Computer A needs to send data to a destination on a different IP network, it generally resolves the MAC address of its default gateway, not the remote destination.
The IP packet retains the remote destination IP address, while the local Ethernet frame is addressed to the gateway's MAC address.
ARP Commands:
Windows:
- arp -a — Display the ARP cache.
- arp -d * — Attempt to delete cached ARP entries; administrative permissions may be required.
Cisco IOS:
- show ip arp — Display the IPv4 ARP table on supported routers or Layer 3 switches.
ARP Security Issue — ARP Spoofing:
ARP has no built-in authentication. An attacker may send false ARP messages to associate an incorrect MAC address with an IPv4 address.
Possible effects:
- Man-in-the-middle attacks
- Traffic interception
- Network disruption
Protection Methods:
- Dynamic ARP Inspection (DAI), where supported and properly configured
- DHCP snooping bindings
- Network access controls
- Static ARP entries in limited, carefully managed situations
Important: ARP is used with IPv4. IPv6 uses Neighbor Discovery Protocol (NDP) instead.
3. NETWORK SWITCHING
Definition:
Switching is the process of forwarding data frames between devices in a network based on MAC addresses.
A network switch primarily operates at Layer 2 (Data Link Layer). Layer 3 switches can also perform IP routing.
Purpose of Switching:
- Connect devices within a LAN
- Forward frames toward the correct destination
- Reduce unnecessary traffic sent to unrelated ports
- Improve network performance
- Support VLANs and other network features
How a Switch Works:
A switch learns which MAC addresses are reachable through its ports by examining the source MAC address of incoming frames.
Example:
- PC1 connects to Switch Port 1.
- PC2 connects to Switch Port 2.
- PC3 connects to Switch Port 3.
When PC1 sends a frame, the switch learns PC1's source MAC address on Port 1.
If the destination MAC address is known, the switch forwards the frame through the associated port, provided the frame is permitted by the VLAN and forwarding rules.
Four Basic Switching Operations:
- Learning: The switch learns the source MAC address and associates it with the incoming port and VLAN.
- Flooding: The switch forwards an unknown unicast frame out eligible ports in the same VLAN, except the incoming port.
- Forwarding: The switch sends a frame through the port associated with the destination MAC address.
- Filtering: The switch does not forward a frame to ports where it is unnecessary or not permitted.
MAC Address Table:
A MAC address table, also called a CAM table, stores information about learned MAC addresses and their associated switch ports and VLANs.
Example:
| MAC Address | VLAN | Switch Port |
| --- | --- | --- |
| AA:AA:AA:AA:AA:01 | 10 | Fa0/1 |
| BB:BB:BB:BB:BB:02 | 10 | Fa0/2 |
| CC:CC:CC:CC:CC:03 | 20 | Fa0/3 |
Important: Entries learned dynamically can age out if the switch does not see traffic from the corresponding MAC address for a configured period.
Collision Domains and Broadcast Domains:
- Each full-duplex switch port normally forms its own collision domain.
- A VLAN defines a separate Layer 2 broadcast domain.
- Routers and Layer 3 interfaces can route traffic between IP networks and VLANs when configured to do so.
Types of Switching Methods:
- Store-and-Forward Switching
- Receives the entire frame before forwarding it.
- Checks the frame's FCS (Frame Check Sequence) for errors.
- Can discard frames that fail the FCS check.
- Generally provides stronger error checking at the cost of some latency.
- Cut-Through Switching
- Begins forwarding after reading enough of the frame to identify the destination.
- Can reduce latency.
- May forward frames before the complete frame's FCS has been checked.
- Fragment-Free Switching
- A traditional cut-through variation that waits for the first 64 bytes before forwarding.
- Intended to filter out many collision fragments associated with older Ethernet environments.
Switch vs Hub:
- Hub: Repeats incoming signals to its other ports and does not learn MAC addresses.
- Switch: Learns MAC addresses and forwards frames selectively.
- Hub: Shared collision domain.
- Switch: Separate collision domains per port under normal switched Ethernet operation.
- Switch: Supports VLANs on managed models; a basic hub does not.
4. VLAN (VIRTUAL LOCAL AREA NETWORK)
Definition:
A VLAN is a logical grouping of network devices that creates a separate Layer 2 broadcast domain on a switched network.
VLANs allow devices to be grouped by department, function, or security requirements even when they are connected to different physical switch ports.
Why VLANs Are Used:
- Improve network organization
- Reduce the scope of broadcast traffic
- Separate departments or device types
- Support security policies
- Simplify moves and changes
- Create logical network boundaries without requiring separate physical switches for every group
Example of VLANs:
A company has three departments:
- HR Department — VLAN 10
- IT Department — VLAN 20
- Finance Department — VLAN 30
Devices in different VLANs are in different Layer 2 broadcast domains. They normally require a Layer 3 device to communicate with one another.
Types of VLANs:
- Default VLAN: On many Cisco switches, VLAN 1 is the default VLAN.
- Data VLAN: Carries ordinary user data traffic.
- Voice VLAN: Supports IP telephone traffic with appropriate switch and phone configuration.
- Management VLAN: Used to manage network devices.
- Native VLAN: On an IEEE 802.1Q trunk, the VLAN whose traffic is sent untagged by default, subject to configuration.
Access Port:
An access port normally carries traffic for one data VLAN. Frames sent to or received from an ordinary end device are generally untagged on that access link.
Example: A PC connected to an access port assigned to VLAN 10 belongs to VLAN 10.
Trunk Port:
A trunk port carries traffic for multiple VLANs between VLAN-aware network devices, such as switches.
Trunks commonly use IEEE 802.1Q tagging to identify the VLAN associated with each frame.
IEEE 802.1Q:
802.1Q adds a VLAN tag to an Ethernet frame. The tag includes a VLAN identifier field of 12 bits, allowing VLAN IDs from 0 to 4095; VLAN 0 and 4095 are reserved, so the normal usable VLAN ID range is 1–4094, subject to platform-specific restrictions.
VLAN Configuration in Cisco Packet Tracer:
Example: Create VLAN 10 named HR and VLAN 20 named IT.
enable
configure terminal
vlan 10
name HR
exit
vlan 20
name IT
exitAssign a Port to VLAN 10:
interface fastEthernet 0/1
switchport mode access
switchport access vlan 10
exitAssign a Port to VLAN 20:
interface fastEthernet 0/2
switchport mode access
switchport access vlan 20
exitConfigure a Trunk Port:
interface gigabitEthernet 0/1
switchport mode trunkOn platforms that support it, configure the allowed VLANs as needed:
switchport trunk allowed vlan 10,20Some older Packet Tracer switch models may require a trunk encapsulation command; many newer models support only 802.1Q and do not require that command.
Verify VLAN Configuration:
show vlan brief
show interfaces trunk
show running-configInter-VLAN Routing:
Devices in different VLANs cannot normally communicate directly at Layer 2. Communication between VLANs requires inter-VLAN routing.
Common methods include:
- Router-on-a-Stick: One physical router interface carries multiple VLANs over an 802.1Q trunk using subinterfaces.
- Layer 3 Switch: Switch virtual interfaces (SVIs) provide Layer 3 gateways for VLANs, with IP routing enabled.
Router-on-a-Stick Example:
Suppose:
- VLAN 10 uses network 192.168.10.0/24
- VLAN 20 uses network 192.168.20.0/24
Example router configuration, assuming the switch trunk connects to router interface G0/0:
enable
configure terminal
interface gigabitEthernet 0/0
no shutdown
exit
interface gigabitEthernet 0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
exit
interface gigabitEthernet 0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
exitHosts in VLAN 10 should use 192.168.10.1 as their default gateway. Hosts in VLAN 20 should use 192.168.20.1.
The switch port connected to the router must be configured as an appropriate trunk, and the router interface must match the actual device and interface names.
VLAN Troubleshooting:
If devices cannot communicate:
- Check the access port's VLAN assignment.
- Check that the correct VLAN exists on the switch.
- Check trunk status and allowed VLANs.
- Check IP addresses and subnet masks.
- Check default gateways for inter-VLAN communication.
- Check routing configuration and any access control lists.
- Check that links and interfaces are up.
5. STP (SPANNING TREE PROTOCOL)
Definition:
Spanning Tree Protocol (STP) is a Layer 2 protocol that prevents switching loops in Ethernet networks that contain redundant links.
Why STP Is Required:
Redundant links improve network availability, but Layer 2 loops can cause serious problems.
Ethernet frames generally have no Layer 2 hop-count field that automatically stops them from circulating indefinitely. Broadcast and unknown-unicast traffic can circulate repeatedly when a loop exists.
Problems Caused by Switching Loops:
- Broadcast Storm: Broadcast frames circulate repeatedly and can consume network bandwidth.
- MAC Address Table Instability: The same source MAC address may appear to move between switch ports.
- Duplicate Frames: Devices may receive repeated copies of frames.
- Network Congestion: Excessive traffic can make the network slow or unusable.
Purpose of STP:
STP logically blocks selected redundant paths so that the active Layer 2 topology is loop-free while retaining backup links that can be activated if the topology changes.
How STP Works:
STP exchanges special control frames called BPDUs (Bridge Protocol Data Units) between switches.
The switches use information in BPDUs to elect a root bridge and determine which ports should forward traffic and which should be blocked or placed into a non-forwarding state.
Important STP Terms:
- Root Bridge: The switch elected as the central reference point for the spanning-tree topology.
- Root Port: On each non-root switch, the port with the best path toward the root bridge.
- Designated Port: The port selected to forward traffic for a particular Layer 2 segment.
- Alternate Port: In Rapid Spanning Tree Protocol, a port providing an alternate path toward the root bridge.
- BPDU: A control frame used by spanning-tree protocols to exchange topology information.
- Path Cost: A value used to compare paths toward the root bridge. Lower total cost is preferred.
- Bridge ID (BID): A value used in root election, consisting of bridge priority information and a bridge MAC address, with extended system ID information in modern implementations.
STP Root Bridge Election:
The switch with the lowest Bridge ID becomes the root bridge.
The Bridge ID comparison is based first on the configured priority and system-ID information, then on the MAC address when the preceding values tie.
A lower numerical priority is preferred.
Example:
| Switch | Priority | MAC Address |
| --- | --- | --- |
| Switch A | 32768 | 00:00:00:00:00:0A |
| Switch B | 24576 | 00:00:00:00:00:0B |
| Switch C | 32768 | 00:00:00:00:00:0C |
Assuming these are the relevant values and there are no other differences in the extended system ID, Switch B wins the root election because its priority is lower.
Classic STP Port Roles:
- Root Port: Best path toward the root bridge on a non-root switch.
- Designated Port: Forwarding port selected for a segment.
- Non-Designated Port: A classic STP term for a port that is not selected to forward on a segment and therefore blocks to prevent a loop.
RSTP uses additional port roles, including Alternate and Backup.
Classic STP Port States (IEEE 802.1D):
- Blocking: Does not forward user data frames; listens for BPDUs.
- Listening: Participates in spanning-tree calculations without learning MAC addresses or forwarding user data.
- Learning: Learns MAC addresses but does not yet forward user data.
- Forwarding: Learns MAC addresses and forwards frames.
- Disabled: Administratively disabled or otherwise not participating in normal STP operation in classic descriptions.
Classic 802.1D STP commonly takes around 30–50 seconds to transition a newly enabled port to forwarding under default conditions, depending on the transition and topology.
RSTP (RAPID SPANNING TREE PROTOCOL):
RSTP, standardized as IEEE 802.1w and incorporated into later STP standards, improves convergence compared with classic STP.
RSTP uses port roles such as:
- Root
- Designated
- Alternate
- Backup
Its port states are:
- Discarding
- Learning
- Forwarding
RSTP can converge much faster when the topology and port configurations allow rapid transitions.
STP Variants:
- STP (802.1D): Classic Spanning Tree Protocol.
- RSTP (802.1w): Rapid Spanning Tree Protocol.
- PVST+: Cisco per-VLAN spanning-tree implementation based on classic STP behavior.
- Rapid PVST+: Cisco per-VLAN implementation using rapid spanning-tree behavior.
- MSTP (802.1s): Maps multiple VLANs to a smaller number of spanning-tree instances.
STP Configuration in Cisco Packet Tracer:
To view spanning-tree information:
show spanning-tree
show spanning-tree vlan 1To make a switch the preferred root for VLAN 10 on supported Cisco switches:
enable
configure terminal
spanning-tree vlan 10 root primaryAlternatively, configure a lower bridge priority directly:
spanning-tree vlan 10 priority 4096This priority value is valid on common Cisco implementations because the configurable priority uses increments of 4096. Confirm platform support and the active spanning-tree mode.
PortFast:
PortFast allows an eligible edge port to transition quickly to forwarding rather than waiting through the normal STP transition process.
It is generally intended for ports connected to end devices such as PCs and printers, not ordinary switch-to-switch links.
Example:
interface fastEthernet 0/1
spanning-tree portfastBPDU Guard:
BPDU Guard can disable or place an edge port into an error-disabled state if it receives a BPDU, depending on platform behavior and configuration. It helps protect the network from an unexpected switch connected to an edge port.
Example:
interface fastEthernet 0/1
spanning-tree bpduguard enableUse PortFast and BPDU Guard according to the network's edge-port design and platform documentation.
STP Troubleshooting:
- Use show spanning-tree to inspect root bridge and port roles.
- Confirm the intended root bridge has the desired priority.
- Check for unexpected blocked ports.
- Check whether a link failure caused spanning-tree recalculation.
- Check PortFast and BPDU Guard configuration on edge ports.
- Check for physical loops and incorrect switch connections.
- Do not remove STP merely to make all redundant links forward; doing so can cause a broadcast storm.
6. DIFFERENCE BETWEEN ARP, SWITCHING, VLANs AND STP
ARP:
Maps an IPv4 address to a MAC address on the local network.
Switching:
Forwards Ethernet frames using MAC address table information.
VLAN:
Separates a switched network into multiple Layer 2 broadcast domains.
STP:
Prevents Layer 2 loops by selecting a loop-free active topology.
Example of How They Work Together:
Suppose PC1 in VLAN 10 wants to communicate with PC2 in the same VLAN.
- PC1 checks whether it knows PC2's MAC address.
- If needed, PC1 uses ARP to resolve PC2's IPv4 address.
- The switch learns source MAC addresses and forwards the Ethernet frame within VLAN 10.
- STP ensures the switched topology does not have forwarding loops.
If PC1 needs to communicate with a host in VLAN 20, it normally sends the frame to its default gateway. A router or Layer 3 switch then routes the packet between the VLANs.
7. IMPORTANT CISCO IOS COMMANDS
Basic Switch Commands:
enable
configure terminal
show running-config
show interfaces status
show mac address-table
show mac address-table dynamicVLAN Commands:
show vlan brief
show interfaces trunk
show interfaces fastEthernet 0/1 switchportCreate and Assign a VLAN:
configure terminal
vlan 10
name HR
exit
interface fastEthernet 0/1
switchport mode access
switchport access vlan 10ARP Commands:
Windows:
arp -a
ipconfig
ping 192.168.1.1Cisco IOS:
show ip arpSTP Commands:
show spanning-tree
show spanning-tree summary
show spanning-tree vlan 10Save Cisco Switch Configuration:
copy running-config startup-config
8. IMPORTANT EXAM QUESTIONS AND ANSWERS
Q1. What is a MAC address?
A MAC address is a Layer 2 hardware address used to identify a network interface for communication on a local Ethernet network. A standard Ethernet MAC address is 48 bits long.
Q2. What is ARP?
ARP stands for Address Resolution Protocol. It discovers the MAC address associated with a known IPv4 address on the local network.
Q3. What is an ARP cache?
An ARP cache is a temporary table that stores IPv4-to-MAC address mappings to avoid repeating ARP resolution for every packet.
Q4. What is network switching?
Network switching is the process of forwarding Ethernet frames through a switch based on MAC address table information and the applicable VLAN and forwarding rules.
Q5. What is a CAM table?
A CAM table is a hardware-supported table used by a switch to look up learned MAC addresses and determine the appropriate outgoing port and VLAN.
Q6. What is a VLAN?
A VLAN is a logical Layer 2 network that separates devices into distinct broadcast domains on a switched infrastructure.
Q7. What is the difference between an access port and a trunk port?
An access port normally carries one data VLAN for an endpoint. A trunk port carries multiple VLANs between VLAN-aware devices, commonly using IEEE 802.1Q tags.
Q8. What is inter-VLAN routing?
Inter-VLAN routing is the process of routing IP traffic between devices belonging to different VLANs using a router or Layer 3 switch.
Q9. What is STP?
Spanning Tree Protocol is a Layer 2 protocol that prevents Ethernet switching loops by selecting a loop-free active topology.
Q10. What is a root bridge?
The root bridge is the switch with the lowest Bridge ID in a spanning-tree instance. Other switches calculate paths toward it.
Q11. What is a BPDU?
A BPDU, or Bridge Protocol Data Unit, is a control frame used by spanning-tree protocols to exchange topology information between switches.
Q12. What is PortFast?
PortFast is a feature that allows an eligible edge port to transition rapidly to forwarding. It should generally be used on end-device ports, not ordinary switch-to-switch links.
Q13. What is BPDU Guard?
BPDU Guard protects configured edge ports by disabling or error-disabling a port when an unexpected BPDU is received, according to platform behavior.
Q14. Why is STP important?
STP prevents broadcast storms, repeated frames, and MAC address table instability caused by Layer 2 switching loops.
Q15. What happens when a switch receives a frame with an unknown destination MAC address?
The switch generally floods the frame to eligible ports in the same VLAN, excluding the port on which the frame arrived.
9. QUICK REVISION
- MAC: Identifies a network interface at Layer 2.
- ARP: Resolves IPv4 addresses to MAC addresses on the local link.
- Switch: Forwards Ethernet frames using MAC address table information.
- CAM Table: Stores learned MAC-to-port associations.
- VLAN: Creates a separate Layer 2 broadcast domain.
- Access Port: Normally carries one data VLAN.
- Trunk Port: Carries multiple VLANs.
- 802.1Q: Standard VLAN tagging method.
- Inter-VLAN Routing: Enables communication between IP networks associated with different VLANs.
- STP: Prevents Layer 2 switching loops.
- Root Bridge: Switch with the lowest Bridge ID.
- BPDU: STP control frame.
- PortFast: Speeds up eligible edge-port transition to forwarding.
- BPDU Guard: Protects edge ports against unexpected BPDUs.
- RSTP: Faster-converging spanning-tree protocol.
- ARP Spoofing: An attack that uses false ARP messages to mislead devices about IPv4-to-MAC mappings.
END OF NOTES
Part 5 explains how routers choose paths and how routing behavior becomes security-relevant.
ROUTING & ROUTING PROTOCOLS — DETAILED NOTES
1. INTRODUCTION TO ROUTING
Definition:
Routing is the process of selecting a path for forwarding IP packets from a source network to a destination network using routers or Layer 3 switches.
Routing allows devices on different IP networks to communicate with each other.
Example:
Suppose a computer in Network A wants to communicate with a computer in Network B.
- Network A: 192.168.1.0/24
- Network B: 192.168.2.0/24
- Router interface connected to Network A: 192.168.1.1
- Router interface connected to Network B: 192.168.2.1
The router examines the destination IP address, checks its routing table, selects the best matching route, and forwards the packet toward Network B.
Main Functions of Routing:
- Select the best available path to a destination.
- Forward packets between different IP networks.
- Connect LANs and WANs.
- Find alternative paths when network topology changes, if suitable routes are available.
- Support communication between different subnets and VLANs.
- Help control traffic flow through routing policies and route selection.
Important Terms:
- Router: A Layer 3 device that forwards IP packets between networks.
- Routing Table: A table containing destination networks and information about how to reach them.
- Next Hop: The next router or gateway to which a packet should be forwarded.
- Metric: A numerical value used by a routing protocol to compare routes.
- Convergence: The process by which routers update their routing information after a topology change.
- Gateway: A device that forwards traffic toward another network; a default gateway is commonly used by end devices to reach remote networks.
2. HOW ROUTING WORKS
When a host sends data to another IP network, the following process generally occurs.
Step 1: Destination Check
The source computer compares the destination IP address with its own IP address and subnet mask to determine whether the destination is on the same local subnet.
Step 2: Default Gateway
If the destination is on a different subnet, the source host sends the packet to its configured default gateway.
Step 3: Frame Delivery
The host uses ARP in IPv4 to discover the MAC address of the local gateway if it does not already know it.
Step 4: Router Receives the Packet
The router removes the incoming Layer 2 frame header and trailer, examines the IP packet's destination address, and performs a routing-table lookup.
Step 5: Route Selection
The router selects the route with the longest matching destination prefix. If multiple routes match the same prefix length, other route-selection rules determine which route is preferred.
Step 6: Packet Forwarding
The router forwards the packet through the selected outgoing interface, encapsulating it in a new Layer 2 frame appropriate for the outgoing link.
Step 7: Destination Network
The final router delivers the packet to the destination network. If the destination is directly connected, the router resolves the destination's Layer 2 address when necessary.
Important: The source and destination IP addresses normally remain unchanged during ordinary routing, but the Layer 2 source and destination addresses are rewritten at each routed Ethernet hop. Special mechanisms such as NAT can change IP addresses.
3. ROUTING TABLE
Definition:
A routing table is a data structure used by a router to determine where to forward packets based on their destination IP addresses.
Common Routing Table Fields:
- Destination Network: The network or prefix the route describes.
- Subnet Mask / Prefix Length: Identifies the size of the destination network.
- Next Hop: The next router used to reach the destination, if applicable.
- Outgoing Interface: The interface used to forward the packet.
- Metric: A value used by a routing protocol to compare routes.
- Administrative Distance (AD): A Cisco IOS preference value used to compare route sources for the same destination prefix.
- Route Source: Indicates whether the route is connected, static, or learned through a routing protocol.
Example Routing Table:
| Destination Network | Next Hop | Interface |
| --- | --- | --- |
| 192.168.1.0/24 | Directly connected | G0/0 |
| 192.168.2.0/24 | Directly connected | G0/1 |
| 192.168.3.0/24 | 192.168.2.2 | G0/1 |
| 0.0.0.0/0 | 192.168.2.254 | G0/1 |
Explanation:
- 192.168.1.0/24 is reachable through a directly connected network.
- 192.168.3.0/24 is reached through next-hop router 192.168.2.2.
- 0.0.0.0/0 is the default route, used when no more specific route matches.
Cisco Command to Display the Routing Table:
show ip routeOther useful commands:
show ip route connected
show ip route static
show ip interface brief
show running-config
4. TYPES OF ROUTING
There are three fundamental types of routing: Static Routing, Dynamic Routing, and Default Routing.
A. Static Routing
Definition:
Static routing is a method in which an administrator manually configures routes on a router.
The routes do not automatically learn alternative paths through a routing protocol. An administrator may need to change them when the topology changes.
Advantages:
- Simple for small networks.
- No routing-protocol update traffic.
- Gives the administrator direct control over route configuration.
- Useful for predictable networks and specific routing policies.
- Does not require dynamic routing protocol configuration.
Disadvantages:
- Requires manual configuration and maintenance.
- Can become difficult to manage in large networks.
- Does not automatically discover alternate paths.
- Incorrect entries can cause routing failures or loops.
Cisco Static Route Syntax:
ip route destination-network subnet-mask next-hop-ipExample:
enable
configure terminal
ip route 192.168.3.0 255.255.255.0 192.168.2.2This configures a route to 192.168.3.0/24 through next-hop address 192.168.2.2.
A route may also specify an outgoing interface, depending on the network type and platform.
B. Dynamic Routing
Definition:
Dynamic routing uses routing protocols to exchange routing information and calculate routes automatically.
Routers can learn remote networks, select preferred routes, and update their routing information after certain topology changes.
Advantages:
- Reduces the need to configure every remote network manually.
- Adapts to many network topology changes.
- Scales better than manually maintaining large numbers of static routes.
- Can provide alternate paths when the protocol and topology support them.
Disadvantages:
- Requires more configuration and knowledge.
- Uses CPU, memory, and network resources.
- Can take time to converge after a topology change.
- Incorrect configuration can cause routing loops or route leaks.
Examples of Dynamic Routing Protocols:
- RIP
- OSPF
- EIGRP
- IS-IS
- BGP
C. Default Routing
Definition:
Default routing uses a route that matches destinations for which no more specific route exists in the routing table.
The IPv4 default route is:
0.0.0.0/0
Cisco Configuration:
ip route 0.0.0.0 0.0.0.0 192.168.1.254This sends packets for otherwise unknown IPv4 destinations toward 192.168.1.254.
Common Use:
A small office router may have routes for its internal networks and a default route pointing toward its internet service provider.
Comparison of Routing Types:
| Feature | Static Routing | Dynamic Routing | Default Routing |
| --- | --- | --- | --- |
| Configuration | Manual | Protocol-based | Manually or dynamically installed |
| Route learning | No protocol-based learning | Learns routes through a protocol | Uses a catch-all route |
| Adaptation | Usually manual | Can adapt automatically | Depends on how the default route is maintained |
| Best use | Small or predictable networks | Medium and large networks | Unknown or external destinations |
5. ROUTING PROTOCOLS
Definition:
A routing protocol is a set of rules that routers use to exchange network reachability information and determine routes.
Routing protocols help routers learn which networks are available and select preferred paths.
Main Categories of Routing Protocols:
A. Distance Vector Protocols
Distance vector protocols share route information with neighboring routers and use a metric to determine how far away a destination is.
Examples:
- RIP
- EIGRP, often described as an advanced distance-vector or hybrid protocol
B. Link-State Protocols
Link-state protocols build a topology database and calculate shortest paths using a link-state algorithm.
Examples:
- OSPF
- IS-IS
C. Path-Vector Protocols
Path-vector protocols advertise reachability along with path attributes, such as the sequence of autonomous systems used to reach a destination.
Example:
- BGP
Interior Gateway Protocol (IGP):
An IGP exchanges routing information within a single autonomous system.
Examples: RIP, OSPF, EIGRP, IS-IS.
Exterior Gateway Protocol (EGP):
An exterior gateway protocol exchanges routing information between autonomous systems. The modern Internet's main interdomain routing protocol is BGP.
Autonomous System (AS):
An autonomous system is a collection of IP networks and routers under a common administrative routing policy, identified for Internet routing by an AS number.
6. RIP (ROUTING INFORMATION PROTOCOL)
Definition:
RIP is a distance-vector interior gateway routing protocol that uses hop count as its primary route metric.
Main Features:
- Uses hop count to select routes.
- Maximum usable distance is 15 hops.
- A distance of 16 hops is considered unreachable.
- RIP uses periodic routing updates.
- RIP is relatively simple to configure.
- It is best suited to small or learning environments rather than large modern networks.
Hop Count:
Hop count is the number of routers a packet must pass through to reach a destination.
Example:
- Network A is 1 hop away.
- Network B is 3 hops away.
- Network C is 16 hops away and is considered unreachable by RIP.
RIP Versions:
RIPv1:
- Classful routing protocol.
- Does not include subnet mask information in its routing updates.
- Does not support variable-length subnet masks in the same way as RIPv2.
RIPv2:
- Classless routing protocol.
- Includes subnet mask information.
- Supports VLSM and CIDR.
- Uses multicast address 224.0.0.9 for updates.
RIP Timers:
Common traditional Cisco RIP defaults include:
- Update timer: approximately 30 seconds.
- Invalid timer: approximately 180 seconds.
- Hold-down timer: implementation-dependent; often 180 seconds in classic Cisco documentation.
- Flush timer: approximately 240 seconds.
Timer values may vary by implementation and configuration.
RIP Configuration Example:
Suppose a router has directly connected networks 192.168.1.0/24 and 192.168.2.0/24.
enable
configure terminal
router rip
version 2
network 192.168.1.0
network 192.168.2.0
no auto-summaryThe exact network command behavior depends on the IOS implementation. On classic Cisco IOS, RIP network statements identify major networks and enable RIP on matching interfaces.
Verification Commands:
show ip route
show ip protocols
show running-configRIP-learned routes commonly have the code R in the Cisco routing table.
Advantages of RIP:
- Simple to understand.
- Easy to configure for small labs.
- Requires relatively few resources.
Disadvantages of RIP:
- Maximum 15-hop distance.
- Slower convergence than many modern alternatives.
- Hop count ignores bandwidth and delay.
- Less suitable for large or complex networks.
7. OSPF (OPEN SHORTEST PATH FIRST)
Definition:
OSPF is a link-state interior gateway routing protocol that calculates shortest paths using the Shortest Path First (SPF) algorithm, commonly associated with Dijkstra's algorithm.
Main Features:
- Supports classless routing, CIDR, and VLSM.
- Uses a cost metric.
- Supports hierarchical network design using areas.
- Converges relatively quickly in many topologies.
- Sends link-state information to maintain a topology database.
- Is widely used in enterprise networks.
OSPF Metric — Cost:
OSPF uses cost to compare routes. Cisco implementations commonly derive interface cost from a reference bandwidth divided by interface bandwidth, although the reference bandwidth and cost can be configured.
A lower total OSPF cost is preferred when comparing otherwise equivalent paths.
OSPF Areas:
An OSPF network can be divided into areas to improve scalability and limit the scope of some routing information.
Area 0:
Area 0 is the OSPF backbone area. Other regular areas are normally connected to Area 0, directly or through supported virtual-link arrangements.
Important OSPF Router Types:
- Internal Router: All its OSPF interfaces belong to the same area.
- Backbone Router: Has an interface in Area 0.
- Area Border Router (ABR): Connects OSPF areas and maintains area-related topology information.
- Autonomous System Boundary Router (ASBR): Introduces routes from another routing source into OSPF through redistribution.
A router can meet more than one of these definitions.
OSPF Neighbor Relationship:
Routers on a compatible shared network exchange Hello packets to discover neighbors and form adjacencies as required.
OSPF neighbors must have compatible settings, including relevant area, authentication, network-type, timer, and other parameters.
OSPF Packet Types:
- Hello: Discovers and maintains neighbors.
- Database Description (DBD): Summarizes link-state database information.
- Link-State Request (LSR): Requests specific link-state information.
- Link-State Update (LSU): Carries link-state advertisements.
- Link-State Acknowledgment (LSAck): Acknowledges link-state information.
OSPF Configuration Example:
enable
configure terminal
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0In this example:
- 1 is the locally significant OSPF process ID.
- 0.0.0.255 is the wildcard mask for a /24 network.
- area 0 places matching interfaces in the backbone area.
OSPF Verification Commands:
show ip ospf neighbor
show ip ospf
show ip route ospf
show ip protocolsOSPF-learned routes commonly appear with the code O in a Cisco routing table. Inter-area and external OSPF routes can use codes such as O IA, O E1, and O E2.
Advantages of OSPF:
- Supports large and hierarchical networks.
- Supports VLSM and CIDR.
- Uses cost rather than hop count alone.
- Offers relatively fast convergence.
- Supports equal-cost multipath routing when conditions permit.
Disadvantages of OSPF:
- More complex to configure and troubleshoot than RIP.
- Maintains a topology database and requires SPF calculations.
- Requires careful area planning in larger deployments.
8. EIGRP (ENHANCED INTERIOR GATEWAY ROUTING PROTOCOL)
Definition:
EIGRP is an advanced distance-vector routing protocol developed by Cisco. It uses the Diffusing Update Algorithm (DUAL) to calculate loop-free paths and support rapid convergence.
Main Features:
- Uses a composite metric.
- Commonly considers bandwidth and delay by default.
- Can maintain successor and feasible successor routes.
- Supports VLSM and CIDR.
- Uses partial and bounded updates rather than sending a complete routing table periodically in the traditional RIP style.
- Supports equal-cost and, when configured appropriately, unequal-cost load balancing.
Important EIGRP Terms:
Successor:
The best next-hop route selected for a destination.
Feasible Successor:
A qualifying backup route that satisfies EIGRP's feasibility condition and can provide a loop-free alternative.
Feasible Distance (FD):
The lowest calculated metric from the local router to a destination, including the route through the selected successor.
Reported Distance (RD):
The metric reported by a neighbor for reaching the destination.
EIGRP Metric:
EIGRP's traditional default metric calculation considers bandwidth and delay. Other metric components, such as reliability and load, can be included when configured, but are not normally used by default.
EIGRP Configuration Example:
enable
configure terminal
router eigrp 100
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
no auto-summaryHere, 100 is the EIGRP autonomous system number; routers that must form an EIGRP adjacency need compatible AS settings and other required parameters.
Some platforms support named EIGRP configuration instead of the classic AS-number syntax.
Verification Commands:
show ip eigrp neighbors
show ip eigrp topology
show ip protocols
show ip route eigrpEIGRP-learned routes commonly appear with the code D in Cisco routing tables.
Advantages:
- Fast convergence in many network designs.
- Supports VLSM and CIDR.
- Can use feasible successor routes as loop-free alternatives.
- Supports unequal-cost load balancing with appropriate configuration.
Disadvantages:
- More complex than simple static routing or RIP.
- Configuration and interoperability depend on platform support.
- Traditional EIGRP has historically been associated with Cisco environments, although an open EIGRP specification exists.
9. BGP (BORDER GATEWAY PROTOCOL)
Definition:
BGP is a path-vector routing protocol used to exchange routing information between autonomous systems. It is the principal interdomain routing protocol used on the public Internet.
Main Features:
- Exchanges network reachability between autonomous systems.
- Uses TCP port 179.
- Supports policy-based route selection.
- Uses attributes such as ASPATH, LOCALPREF, and MED.
- Does not select routes solely on the shortest physical distance.
- Supports extensive routing policies and route filtering.
Types of BGP:
eBGP (External BGP):
Exchanges routes between different autonomous systems.
iBGP (Internal BGP):
Exchanges BGP routes between peers within the same autonomous system.
Important BGP Attributes:
- AS_PATH: Lists autonomous systems through which a route has passed and helps prevent many routing loops.
- LOCAL_PREF: Used within an AS to express a preferred outbound routing policy; higher values are generally preferred.
- MED (Multi-Exit Discriminator): Can suggest a preferred entry point into an AS; lower values are generally preferred when compared under the applicable rules.
- NEXT_HOP: Identifies the next hop used to reach the advertised destination.
- ORIGIN: Indicates the origin type of a route.
BGP Route Selection:
BGP uses a sequence of decision criteria and policy rules. The exact sequence depends on implementation and configuration.
Common factors include:
- Local preference
- AS path length
- Origin type
- MED, where applicable
- eBGP versus iBGP preference
- IGP cost to the BGP next hop
- Additional tie-breakers
BGP Configuration Example:
The following is an illustrative Cisco IOS-style eBGP configuration. Replace the AS numbers, addresses, and network prefix with the values for the actual topology.
enable
configure terminal
router bgp 65001
neighbor 192.0.2.2 remote-as 65002
network 198.51.100.0 mask 255.255.255.0The network statement generally advertises the specified prefix only when an appropriate matching route exists in the local routing table.
Verification Commands:
show ip bgp summary
show ip bgp
show ip route bgpAdvantages of BGP:
- Scales to very large networks.
- Supports complex routing policies.
- Enables routing between autonomous systems.
- Helps providers and large organizations control route advertisements and path preferences.
Disadvantages of BGP:
- Complex to configure and troubleshoot.
- Requires careful filtering and policy design.
- Poor configuration can lead to route leaks or large-scale reachability problems.
- Convergence can be slower than IGP convergence in some scenarios.
10. COMPARISON OF ROUTING PROTOCOLS
| Feature | RIP | OSPF | EIGRP | BGP |
| --- | --- | --- | --- | --- |
| Main type | Distance vector | Link state | Advanced distance vector | Path vector |
| Main use | Small networks/labs | Enterprise IGP | Enterprise IGP | Inter-AS routing |
| Main metric | Hop count | Cost | Composite metric | Policy and path attributes |
| Maximum hop limit | 15 usable hops | No RIP-style hop limit | No RIP-style hop limit | No RIP-style hop limit |
| Convergence | Relatively slow | Usually fast | Usually fast | Policy- and topology-dependent |
| Supports VLSM | RIPv2 does | Yes | Yes | Yes |
| Typical Cisco route code | R | O | D | B |
Important: Route codes, metrics, and features can differ by implementation and software version. BGP's selection process is policy-driven and cannot be reduced to a single numerical metric.
11. ADMINISTRATIVE DISTANCE (AD)
Definition:
Administrative Distance is a Cisco routing preference value used to rank routes learned from different sources for the same destination prefix. A lower value is preferred.
Common Cisco Default Values:
| Route Source | Administrative Distance |
| --- | --- |
| Directly connected | 0 |
| Static route | 1 |
| EIGRP summary route | 5 |
| eBGP | 20 |
| EIGRP internal | 90 |
| OSPF | 110 |
| IS-IS | 115 |
| RIP | 120 |
| EIGRP external | 170 |
| iBGP | 200 |
These are common Cisco IOS defaults and may vary by platform or configuration.
Example:
If a router learns the same destination prefix from OSPF with AD 110 and RIP with AD 120, the OSPF route is normally preferred, assuming the routes are otherwise eligible and no policy or platform-specific behavior changes the outcome.
Administrative Distance vs Metric:
- Administrative Distance: Compares the trust preference of different route sources.
- Metric: Compares routes within a routing protocol or routing context.
Important: Longest-prefix matching is performed when forwarding packets. AD helps determine which route source is installed for a given prefix; it does not override a more-specific route during ordinary forwarding.
12. LONGEST PREFIX MATCH
Definition:
Longest-prefix matching means a router selects the matching route with the greatest number of leading network bits.
Example Routing Table:
- 10.0.0.0/8
- 10.1.0.0/16
- 10.1.2.0/24
- 0.0.0.0/0
For destination 10.1.2.50, the router selects 10.1.2.0/24 because it is the most specific matching prefix.
For destination 10.1.5.50, the router selects 10.1.0.0/16.
For destination 10.5.5.5, the router selects 10.0.0.0/8.
For a destination that matches none of these specific routes, the default route may be used if one is installed and usable.
Key Point: Longest-prefix matching is the primary forwarding rule when multiple destination prefixes match a packet's destination address.
13. ROUTING LOOPS AND CONVERGENCE
Routing Loop:
A routing loop occurs when packets are repeatedly forwarded between routers instead of progressing toward their destinations.
Common Causes:
- Incorrect static routes.
- Inconsistent routing information during convergence.
- Routing protocol configuration errors.
- Route redistribution problems.
- Incorrect summarization or filtering.
Effects:
- Packets may circulate until their IP TTL reaches zero.
- Bandwidth and router resources may be wasted.
- Communication can fail or become delayed.
Prevention and Mitigation:
- Correct route configuration.
- Appropriate routing protocol design.
- Split horizon and route poisoning where supported.
- Route filtering and careful redistribution.
- Loop prevention mechanisms built into routing protocols.
- Monitoring and troubleshooting routing tables.
Convergence:
Convergence occurs when routers have updated their routing information after a change and have reached a consistent usable routing state.
Factors Affecting Convergence:
- Routing protocol type.
- Network size and topology.
- Update and timer settings.
- Link failure detection time.
- Number of affected routes.
- Hardware and software performance.
- Configuration and policy complexity.
14. ROUTING PROTOCOL METRICS
A metric is a value used to compare possible paths to a destination.
Common Metrics:
- Hop Count: Number of routers along a path.
- Bandwidth: Capacity of a link.
- Delay: Time required for data to traverse a link.
- Cost: A calculated or configured value used by protocols such as OSPF.
- Reliability: A measure of link dependability, where supported.
- Load: A measure of link utilization, where supported.
- Policy Attributes: BGP can choose paths based on administrative routing policy.
Protocol Examples:
- RIP uses hop count.
- OSPF uses cost.
- EIGRP traditionally uses a composite metric based by default on bandwidth and delay.
- BGP uses a decision process based on path attributes and policy.
Important: Metrics from different routing protocols are not directly comparable. Administrative distance is often used to compare route sources for the same prefix on Cisco routers.
15. ROUTING IN CISCO PACKET TRACER
Example Topology:
- PC1 connected to Router R1.
- R1 connected to R2.
- R2 connected to PC2.
IP Addressing Plan:
| Device | Interface | IP Address | Subnet Mask |
| --- | --- | --- | --- |
| PC1 | NIC | 192.168.1.10 | 255.255.255.0 |
| R1 | G0/0 | 192.168.1.1 | 255.255.255.0 |
| R1 | G0/1 | 10.0.0.1 | 255.255.255.252 |
| R2 | G0/0 | 10.0.0.2 | 255.255.255.252 |
| R2 | G0/1 | 192.168.2.1 | 255.255.255.0 |
| PC2 | NIC | 192.168.2.10 | 255.255.255.0 |
PC1 Default Gateway: 192.168.1.1
PC2 Default Gateway: 192.168.2.1
Configure router interfaces as appropriate for the device models:
R1 Configuration:
enable
configure terminal
interface gigabitEthernet 0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
interface gigabitEthernet 0/1
ip address 10.0.0.1 255.255.255.252
no shutdown
exitR2 Configuration:
enable
configure terminal
interface gigabitEthernet 0/0
ip address 10.0.0.2 255.255.255.252
no shutdown
exit
interface gigabitEthernet 0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exitStatic Routing on R1:
ip route 192.168.2.0 255.255.255.0 10.0.0.2Static Routing on R2:
ip route 192.168.1.0 255.255.255.0 10.0.0.1Verification:
On both routers:
show ip interface brief
show ip route
ping 10.0.0.2From PC1, test:
ping 192.168.2.10If the ping fails, verify interface status, IP addresses, subnet masks, default gateways, cabling, and both routers' return routes.
Important: Interface names may vary by router model. Use the interface names shown by show ip interface brief.
16. COMMON ROUTING TROUBLESHOOTING COMMANDS
Check Interface Status:
show ip interface briefCheck Routing Table:
show ip routeCheck Routing Protocols:
show ip protocolsCheck OSPF Neighbors:
show ip ospf neighborCheck EIGRP Neighbors:
show ip eigrp neighborsCheck BGP Neighbors:
show ip bgp summaryTest Reachability:
ping 192.168.1.1Trace the Path:
Cisco IOS:
traceroute 192.168.2.10Windows:
tracert 192.168.2.10Common Problems:
- Interface is administratively down.
- Incorrect IP address or subnet mask.
- Missing route to the destination network.
- Missing return route.
- Incorrect default gateway.
- Routing protocol not enabled on the correct interfaces.
- Mismatched OSPF area or incompatible neighbor settings.
- EIGRP autonomous system mismatch.
- BGP peer configuration or reachability problem.
- Access control lists blocking traffic.
17. IMPORTANT EXAM QUESTIONS AND ANSWERS
Q1. What is routing?
Routing is the process of selecting a path and forwarding IP packets between different networks using routers or Layer 3 switches.
Q2. What is a routing table?
A routing table stores destination prefixes and the information needed to reach them, such as next-hop addresses and outgoing interfaces.
Q3. What is static routing?
Static routing is a manually configured routing method in which an administrator enters routes directly into a router's configuration.
Q4. What is dynamic routing?
Dynamic routing uses routing protocols to exchange reachability information and learn routes automatically.
Q5. What is a default route?
A default route is a catch-all route used when no more-specific matching route is available. The IPv4 default route is 0.0.0.0/0.
Q6. What is RIP?
RIP is a distance-vector routing protocol that uses hop count as its metric. It supports a maximum usable distance of 15 hops.
Q7. What is OSPF?
OSPF is a link-state routing protocol that calculates shortest paths using the SPF algorithm and a cost metric.
Q8. What is EIGRP?
EIGRP is an advanced distance-vector routing protocol that uses DUAL and a composite metric to select routes and support rapid convergence.
Q9. What is BGP?
BGP is a path-vector protocol used to exchange routing information between autonomous systems, including on the public Internet.
Q10. What is an autonomous system?
An autonomous system is a collection of networks and routers operating under a common administrative routing policy.
Q11. What is administrative distance?
Administrative distance is a routing preference value used by Cisco routers to compare route sources for the same destination prefix. A lower value is normally preferred.
Q12. What is a routing metric?
A routing metric is a value used to compare routes. Examples include RIP hop count, OSPF cost, and EIGRP's composite metric.
Q13. What is convergence?
Convergence is the process by which routers update routing information after a network change and reach a consistent routing state.
Q14. What is longest-prefix matching?
Longest-prefix matching selects the matching route with the greatest number of leading network bits.
Q15. What is the difference between an IGP and an EGP?
An IGP exchanges routing information within an autonomous system. An EGP exchanges routing information between autonomous systems; BGP is the main modern example.
Q16. What is the difference between eBGP and iBGP?
eBGP exchanges routes between different autonomous systems, while iBGP exchanges BGP routes within the same autonomous system.
Q17. What is a routing loop?
A routing loop occurs when packets are repeatedly forwarded between routers instead of progressing toward their destination.
Q18. What is the difference between a routing protocol and a routed protocol?
A routing protocol, such as OSPF or RIP, exchanges routing information. A routed protocol, such as IP, carries traffic that routers forward.
18. QUICK REVISION NOTES
- Routing: Forwarding IP packets between networks.
- Router: A Layer 3 device used to connect IP networks.
- Routing Table: Stores routes to destination prefixes.
- Static Routing: Routes configured manually.
- Dynamic Routing: Routes learned through routing protocols.
- Default Route: Used when no more-specific route matches.
- RIP: Distance vector; hop-count metric; maximum 15 usable hops.
- OSPF: Link state; SPF algorithm; cost metric.
- EIGRP: Advanced distance vector; DUAL; composite metric.
- BGP: Path vector; inter-AS routing; policy-based route selection.
- IGP: Routing within an autonomous system.
- EGP: Routing between autonomous systems.
- AD: Compares route sources for the same destination prefix on Cisco routers.
- Metric: Compares paths within a routing protocol.
- Longest-Prefix Match: Selects the most specific matching route.
- Convergence: Updating routing information after a topology change.
- Routing Loop: Packets repeatedly circulate between routers.
- show ip route: Displays the IPv4 routing table.
- ping: Tests IP reachability.
- traceroute / tracert: Helps identify the path toward a destination.
END OF NOTES
Part 6 focuses on transport behavior and the ports and protocols commonly encountered in security operations.
TCP, UDP, PORTS & COMMON SERVICES — DETAILED NOTES
1. INTRODUCTION TO TRANSPORT LAYER
Definition:
The Transport Layer (Layer 4) of the OSI model provides communication between applications running on different devices. It uses protocols such as TCP and UDP to transport data between applications.
At the TCP/IP model's transport layer, TCP and UDP are two of the most widely used protocols.
Main Functions of the Transport Layer:
- Process-to-Process Delivery: Delivers data to the correct application on a device.
- Segmentation: Divides application data into manageable units.
- Reassembly: Allows data to be reconstructed at the receiving end.
- Port Addressing: Identifies the sending and receiving applications using port numbers.
- Error Detection: Uses checksums to detect corruption in transport data.
- Flow Control: TCP adjusts transmission to avoid overwhelming a receiver.
- Congestion Control: TCP adapts transmission to network congestion.
- Reliable Delivery: TCP provides mechanisms for ordered, reliable byte-stream delivery.
Important Transport Layer Protocols:
- TCP: Transmission Control Protocol.
- UDP: User Datagram Protocol.
Examples:
- Web browsing may use TCP or UDP depending on the web protocol.
- Email commonly uses TCP-based application protocols.
- DNS commonly uses UDP, but can also use TCP.
- Voice and video applications often use UDP for real-time traffic.
2. TCP (TRANSMISSION CONTROL PROTOCOL)
Definition:
TCP is a connection-oriented transport-layer protocol that provides a reliable, ordered byte stream between applications.
Before ordinary TCP data transfer begins, the two endpoints establish a connection. TCP uses sequence numbers, acknowledgments, retransmissions, and other mechanisms to provide reliable delivery.
Main Features of TCP:
- Connection-Oriented: Establishes a connection before normal data transfer.
- Reliable Delivery: Retransmits data when necessary.
- Ordered Delivery: Delivers bytes to the receiving application in the correct sequence.
- Error Detection: Uses a checksum to detect corruption.
- Flow Control: Uses a receiver-advertised window to control how much unacknowledged data can be in flight.
- Congestion Control: Adjusts sending behavior in response to network conditions.
- Full-Duplex Communication: Supports data transfer in both directions simultaneously.
- Acknowledgments: Uses ACKs to acknowledge received data.
- Byte-Stream Service: Treats application data as a continuous stream of bytes rather than separate messages.
Advantages of TCP:
- Reliable delivery.
- Maintains byte order.
- Handles lost or duplicated segments through its protocol mechanisms.
- Provides flow and congestion control.
- Suitable for applications that require accurate, complete data.
Disadvantages of TCP:
- Has more protocol overhead than UDP.
- Connection establishment introduces additional steps.
- Retransmissions and ordered delivery can increase latency.
- A missing segment may delay delivery of later bytes to the application.
Common Uses of TCP:
- HTTP/1.1 and HTTP/2
- HTTPS using HTTP over TLS over TCP
- FTP
- SSH
- SMTP
- IMAP
- POP3
- Many database connections
Important: HTTP/3 uses QUIC over UDP rather than TCP.
3. TCP THREE-WAY HANDSHAKE
Definition:
The TCP three-way handshake is the process used to establish a TCP connection between a client and a server.
It synchronizes the endpoints' initial sequence numbers and confirms that both sides can send and receive TCP segments.
Three Steps of the TCP Handshake:
Step 1: SYN
The client sends a TCP segment with the SYN flag set to request a connection.
Example:
Client → Server: SYN
Step 2: SYN-ACK
The server responds with a segment containing both the SYN and ACK flags.
Example:
Server → Client: SYN-ACK
Step 3: ACK
The client sends an acknowledgment to complete the handshake.
Example:
Client → Server: ACK
After the handshake, the connection can carry application data.
Simple Diagram:
Client Server
| |
| ----------- SYN ----------------> |
| |
| <-------- SYN-ACK --------------- |
| |
| ----------- ACK ----------------> |
| |
| Connection Established |Why Is the Three-Way Handshake Needed?
- Establishes a connection.
- Synchronizes sequence numbers.
- Confirms that both endpoints are reachable and ready to participate.
- Helps establish initial TCP connection parameters.
4. TCP CONNECTION TERMINATION
TCP connections are commonly closed using a four-segment exchange when each direction is closed separately.
Step 1: One endpoint sends a segment with the FIN flag.
Step 2: The other endpoint acknowledges the FIN.
Step 3: The other endpoint sends its own FIN when it is ready to close its sending direction.
Step 4: The first endpoint acknowledges that FIN.
Diagram:
Client Server
| |
| ------------- FIN --------------> |
| <------------- ACK -------------- |
| <------------- FIN -------------- |
| ------------- ACK --------------> |
| |
| Connection Closed |Important TCP Flags:
- SYN: Used to establish a connection and synchronize sequence numbers.
- ACK: Acknowledges received data or connection-control information.
- FIN: Indicates that an endpoint has finished sending data.
- RST: Resets or aborts a TCP connection.
- PSH: Requests prompt delivery of data to the receiving application, subject to implementation behavior.
- URG: Indicates that the urgent pointer field is significant.
Important: TCP connection closure does not always require exactly four separate segments. ACKs and FINs may be combined, and resets can terminate a connection differently.
5. TCP HEADER
Definition:
A TCP header contains control information used to deliver data reliably between applications.
The minimum TCP header is 20 bytes, excluding options.
Main TCP Header Fields:
- Source Port: Identifies the sending application's port.
- Destination Port: Identifies the receiving application's port.
- Sequence Number: Identifies the position of data bytes in the TCP byte stream.
- Acknowledgment Number: Indicates the next sequence number expected from the other endpoint when ACK is set.
- Data Offset: Specifies the TCP header length.
- Control Flags: Includes SYN, ACK, FIN, RST, and other flags.
- Window Size: Advertises the receiver's available TCP receive window.
- Checksum: Detects corruption in the TCP segment and associated pseudo-header information.
- Urgent Pointer: Used with the URG flag.
- Options: Can support features such as maximum segment size, window scaling, and selective acknowledgments.
TCP Header Size:
- Minimum: 20 bytes
- Maximum: 60 bytes
The maximum header length occurs when TCP options occupy the available header space.
6. UDP (USER DATAGRAM PROTOCOL)
Definition:
UDP is a connectionless transport-layer protocol that sends independent datagrams without establishing a TCP-style connection.
UDP does not provide built-in retransmission, in-order delivery, or TCP-style congestion control.
Main Features of UDP:
- Connectionless: No TCP-style handshake is required.
- Low Overhead: Has a small, simple header.
- No Built-in Retransmission: Lost datagrams are not automatically retransmitted by UDP itself.
- No Guaranteed Ordering: Datagrams may arrive out of order.
- No Built-in Flow Control: UDP does not provide TCP's receiver-window mechanism.
- Checksum: Provides error detection; checksum behavior differs between IPv4 and IPv6.
- Message-Oriented: Preserves datagram boundaries for the receiving application.
Advantages of UDP:
- Small header and low protocol overhead.
- No connection-establishment delay.
- Useful for time-sensitive applications.
- Supports multicast and broadcast-related applications where appropriate.
- Applications can implement their own reliability or congestion-control mechanisms if needed.
Disadvantages of UDP:
- No built-in reliable delivery.
- No built-in retransmission mechanism.
- No guarantee of in-order delivery.
- Applications must manage any required reliability themselves.
Common Uses of UDP:
- DNS queries in common cases
- DHCP
- VoIP and real-time media
- Online gaming
- NTP
- TFTP
- QUIC, which is used by HTTP/3
Important: UDP does not automatically make an application faster in every situation. Its advantages depend on the application's design and network conditions.
7. UDP HEADER
Definition:
The UDP header contains four fields and is only 8 bytes long.
UDP Header Fields:
- Source Port: Identifies the sending application when used.
- Destination Port: Identifies the receiving application.
- Length: Specifies the length of the UDP header and data.
- Checksum: Provides error detection.
UDP Header Size: 8 bytes.
Comparison of TCP and UDP Header Sizes:
- TCP: Minimum 20 bytes.
- UDP: 8 bytes.
This smaller UDP header contributes to its low overhead.
8. DIFFERENCE BETWEEN TCP AND UDP
| Feature | TCP | UDP |
| --- | --- | --- |
| Full form | Transmission Control Protocol | User Datagram Protocol |
| Connection | Connection-oriented | Connectionless |
| Reliability | Reliable byte-stream delivery | No built-in delivery guarantee |
| Ordering | Preserves byte order | No ordering guarantee |
| Handshake | Normally uses a three-way handshake | No TCP-style handshake |
| Retransmission | Built-in | Not built-in |
| Flow control | Yes | No TCP-style flow control |
| Congestion control | Built-in mechanisms | No built-in TCP-style congestion control |
| Header size | 20–60 bytes | 8 bytes |
| Data type | Byte stream | Datagram/message-oriented |
| Typical use | Web, email, SSH, file transfer | DNS, DHCP, real-time media, QUIC |
| Overhead | Generally higher | Generally lower |
When to Use TCP:
Use TCP when the application needs reliable, ordered delivery of all data, such as file transfer or a traditional web connection.
When to Use UDP:
Use UDP when an application benefits from datagrams and low protocol overhead, or when the application implements its own transport behavior, as with QUIC.
9. PORT NUMBERS
Definition:
A port number is a 16-bit number used by transport protocols such as TCP and UDP to identify application endpoints.
Port numbers help a device deliver incoming transport data to the correct application or service.
Port Number Range:
Port numbers range from 0 to 65535.
They are divided into three main ranges.
A. Well-Known Ports (0–1023)
These ports are associated with widely used standard services.
Examples:
- HTTP — TCP 80
- HTTPS — TCP 443
- SSH — TCP 22
- DNS — UDP/TCP 53
B. Registered Ports (1024–49151)
These ports are registered for particular applications or services, though actual use depends on configuration and implementation.
C. Dynamic / Private / Ephemeral Ports (49152–65535)
This is the range designated for dynamic and private use by IANA. Operating systems may use other ephemeral ranges depending on their configuration.
Source Port and Destination Port:
- Source Port: Identifies the originating application endpoint.
- Destination Port: Identifies the target application or service.
Example:
A client connects to a web server:
Client: 192.168.1.10:51500
Server: 203.0.113.10:443
Here:
- 51500 is an example client source port.
- 443 is the server's HTTPS destination port.
The client port is illustrative; the operating system selects an available ephemeral port.
Socket:
A socket is a software endpoint for communication. A TCP connection is commonly identified by the combination of source IP, source port, destination IP, and destination port, along with the transport protocol.
10. COMMON NETWORK PORTS AND SERVICES
A. Web Services
HTTP — Port 80/TCP
- Full form: Hypertext Transfer Protocol.
- Used to transfer web content.
- Commonly used for unencrypted HTTP communication.
- HTTPS is generally preferred for public websites.
HTTPS — Port 443/TCP
- Full form: Hypertext Transfer Protocol Secure.
- Protects HTTP communication using TLS.
- Commonly used for secure websites, APIs, and web applications.
HTTP/3 — UDP 443
- HTTP/3 uses QUIC over UDP.
- QUIC provides transport features and integrates TLS security.
- HTTP/3 commonly uses UDP port 443.
B. File Transfer Services
FTP — TCP Ports 20 and 21
- Full form: File Transfer Protocol.
- Port 21 is used for control.
- Port 20 is traditionally used for data in active-mode FTP.
- FTP can use different data ports depending on the mode and configuration.
- Standard FTP does not encrypt credentials or data.
SFTP — TCP Port 22
- Full form: SSH File Transfer Protocol.
- Transfers files over SSH.
- It is different from FTP and is not simply FTP with encryption.
TFTP — UDP Port 69
- Full form: Trivial File Transfer Protocol.
- A simple file-transfer protocol.
- Often used for network-device bootstrapping or configuration transfer in controlled environments.
- Does not provide built-in authentication or encryption.
C. Remote Access Services
SSH — TCP Port 22
- Full form: Secure Shell.
- Provides encrypted remote login and command execution.
- Commonly used to manage routers, switches, and Linux servers.
Telnet — TCP Port 23
- Provides remote terminal access.
- Sends data, including login credentials, without built-in encryption.
- Generally avoided for administrative access across untrusted networks.
RDP — TCP/UDP Port 3389
- Full form: Remote Desktop Protocol.
- Used for remote access to Windows desktops and servers.
- Commonly associated with TCP port 3389 and can also use UDP.
D. Email Services
SMTP — TCP Port 25
- Full form: Simple Mail Transfer Protocol.
- Commonly used for mail transfer between mail servers.
- Port 25 is also used in some mail submission arrangements, but client submission usually uses other ports.
SMTP Submission — TCP Port 587
- Commonly used by email clients to submit outgoing email.
- Usually uses STARTTLS when configured.
SMTPS / Implicit TLS Submission — TCP Port 465
- Commonly used for email submission with TLS from the beginning of the connection.
POP3 — TCP Port 110
- Full form: Post Office Protocol version 3.
- Used to retrieve email from a mail server.
- Secure POP3 commonly uses TCP port 995.
IMAP — TCP Port 143
- Full form: Internet Message Access Protocol.
- Used to access and manage email stored on a mail server.
- Secure IMAP commonly uses TCP port 993.
E. DNS and Address Configuration
DNS — UDP/TCP Port 53
- Full form: Domain Name System.
- Resolves domain names to IP addresses and supports other DNS record queries.
- UDP is commonly used for ordinary queries.
- TCP is used for zone transfers and can also be used for other DNS operations, including responses that require it.
DHCPv4 — UDP Ports 67 and 68
- Full form: Dynamic Host Configuration Protocol for IPv4.
- UDP port 67 is normally used by servers.
- UDP port 68 is normally used by clients.
- Automatically provides network configuration such as IP address, subnet mask, default gateway, and DNS servers.
DHCPv6 — UDP Ports 546 and 547
- UDP port 546 is normally used by clients.
- UDP port 547 is normally used by servers and relay agents.
F. Network Management Services
SNMP — UDP Ports 161 and 162
- Full form: Simple Network Management Protocol.
- UDP port 161 is commonly used for manager requests and agent responses.
- UDP port 162 is commonly used for notifications and traps.
- Used to monitor and manage routers, switches, servers, and other devices.
Syslog — UDP Port 514
- Used to transport system log messages in common configurations.
- Other transports and secure variants are also available.
NTP — UDP Port 123
- Full form: Network Time Protocol.
- Synchronizes clocks across networked devices.
G. Directory and Authentication Services
LDAP — TCP/UDP Port 389
- Full form: Lightweight Directory Access Protocol.
- Used to query and manage directory information.
- TCP is commonly used for ordinary LDAP connections.
LDAPS — TCP Port 636
- LDAP over TLS using implicit TLS.
Kerberos — UDP/TCP Port 88
- A network authentication protocol.
- Commonly used in Microsoft Active Directory environments.
SMB — TCP Port 445
- Full form: Server Message Block.
- Used for network file sharing, printer sharing, and related services.
H. Database Services
MySQL — TCP Port 3306
- A relational database management system.
- Port 3306 is its common default connection port.
PostgreSQL — TCP Port 5432
- A relational database management system.
- Port 5432 is its common default connection port.
Microsoft SQL Server — TCP Port 1433
- Common default TCP port for Microsoft SQL Server's Database Engine.
MongoDB — TCP Port 27017
- Common default port for MongoDB database connections.
I. Other Common Services
SIP — TCP/UDP Port 5060; TLS commonly uses TCP 5061
- Session Initiation Protocol.
- Used to establish, manage, and terminate multimedia communication sessions.
- Actual transport and port use depend on the deployment.
RADIUS — UDP Ports 1812 and 1813
- Port 1812 commonly handles authentication and authorization requests.
- Port 1813 commonly handles accounting.
- Used in network access authentication systems.
IPsec IKE — UDP Port 500
- Internet Key Exchange.
- Negotiates security associations for IPsec.
IPsec NAT Traversal — UDP Port 4500
- Used by IPsec NAT traversal mechanisms.
QUIC — UDP Port 443 commonly
- A modern transport protocol used by HTTP/3.
- Provides features including encryption integration, stream multiplexing, and connection migration.
Important: Port numbers indicate common defaults, not guarantees. Administrators can configure services to use different ports, and some services use multiple ports or transports.
11. QUICK PORT NUMBER TABLE
| Port | Protocol / Service | Transport |
| --- | --- | --- |
| 20 | FTP data, traditionally active mode | TCP |
| 21 | FTP control | TCP |
| 22 | SSH / SFTP | TCP |
| 23 | Telnet | TCP |
| 25 | SMTP | TCP |
| 53 | DNS | UDP/TCP |
| 67 | DHCPv4 server | UDP |
| 68 | DHCPv4 client | UDP |
| 69 | TFTP | UDP |
| 80 | HTTP | TCP |
| 88 | Kerberos | UDP/TCP |
| 110 | POP3 | TCP |
| 123 | NTP | UDP |
| 143 | IMAP | TCP |
| 161 | SNMP requests | UDP |
| 162 | SNMP traps/notifications | UDP |
| 179 | BGP | TCP |
| 389 | LDAP | TCP/UDP |
| 443 | HTTPS; HTTP/3 commonly | TCP; UDP for HTTP/3 |
| 445 | SMB | TCP |
| 465 | Email submission with implicit TLS | TCP |
| 500 | IKE for IPsec | UDP |
| 514 | Syslog, common default | UDP |
| 587 | SMTP submission | TCP |
| 636 | LDAPS | TCP |
| 993 | IMAPS | TCP |
| 995 | POP3S | TCP |
| 1433 | Microsoft SQL Server | TCP |
| 1812 | RADIUS authentication | UDP |
| 1813 | RADIUS accounting | UDP |
| 3306 | MySQL | TCP |
| 3389 | RDP | TCP/UDP |
| 5432 | PostgreSQL | TCP |
| 27017 | MongoDB | TCP |
12. HOW CLIENTS AND SERVERS USE PORTS
Example: Accessing a Website
Suppose a computer opens an HTTPS website.
Client:
- IP address: 192.168.1.10
- Source port: 51500 (example ephemeral port)
Server:
- IP address: 203.0.113.10
- Destination port: 443
The client sends traffic from its temporary source port to the server's HTTPS port.
The server's operating system delivers the received data to the appropriate listening application.
Example Connection:
192.168.1.10:51500 → 203.0.113.10:443
The response traffic normally travels in the reverse direction:
203.0.113.10:443 → 192.168.1.10:51500
Important Terms:
- Listening Port: A port on which an application waits for incoming connections or datagrams.
- Ephemeral Port: A temporary port often selected by a client operating system.
- Port Scanning: Testing ports to determine which services may be reachable.
- Firewall: A system that permits or blocks traffic according to security rules.
- Well-Known Port: A port from the range 0–1023.
13. TCP FLOW CONTROL AND CONGESTION CONTROL
Flow Control:
Flow control prevents a sender from overwhelming the receiver.
TCP uses a receive window advertised by the receiving endpoint to indicate how much additional data it can accept.
Congestion Control:
Congestion control helps prevent excessive traffic from overloading the network.
TCP uses algorithms to adjust its sending behavior based on network conditions, loss signals, acknowledgments, and other information.
Difference:
- Flow Control: Protects the receiving endpoint from excessive incoming data.
- Congestion Control: Helps manage the load placed on the network.
Retransmission:
TCP can retransmit data when it detects loss, using acknowledgments and timers.
Sequence Numbers:
TCP sequence numbers track byte positions in the stream.
Acknowledgment Numbers:
An acknowledgment number indicates the next sequence number expected by the receiving endpoint when the ACK flag is set.
14. COMMON NETWORK TROUBLESHOOTING COMMANDS
Windows Commands:
Display IP configuration:
ipconfigDisplay detailed IP configuration:
ipconfig /allTest connectivity:
ping 8.8.8.8Test DNS resolution:
nslookup example.comDisplay active connections and listening ports:
netstat -anoDisplay route information:
route printDisplay the path to a destination:
tracert example.comLinux Commands:
Display IP addresses:
ip addrDisplay listening TCP and UDP sockets:
ss -tulnDisplay routing information:
ip routeTest DNS resolution:
dig example.comTest connectivity:
ping 8.8.8.8Important: A service may listen on a port but still be unreachable because of firewall rules, routing problems, service binding, or access controls.
15. BASIC PRACTICAL EXERCISES
Exercise 1: Identify Listening Ports on Windows
Open Command Prompt and run:
netstat -anoObserve:
- Local address and port
- Foreign address and port
- Connection state
- Process ID (PID)
Exercise 2: Check DNS
Run:
nslookup example.comObserve whether the hostname resolves to an IP address.
Exercise 3: Check a Web Service
In a browser, open an HTTPS website. Use browser developer tools or a permitted network diagnostic tool to observe that HTTPS commonly uses destination port 443.
Exercise 4: Identify Services in Packet Tracer
- Add a server and a PC.
- Configure their IP addresses.
- Enable a service such as HTTP or DNS on the server.
- Configure the PC with the appropriate IP settings.
- Test the service from the PC.
- Observe how IP addressing and application services work together.
Exercise 5: Compare TCP and UDP
Use a protocol analyzer such as Wireshark on a network you own or are authorized to inspect.
- Capture traffic during ordinary web browsing.
- Identify TCP handshakes where present.
- Observe UDP traffic from services such as DNS or QUIC, where applicable.
- Compare TCP and UDP header fields.
16. IMPORTANT EXAM QUESTIONS AND ANSWERS
Q1. What is the Transport Layer?
The Transport Layer is Layer 4 of the OSI model. It provides communication between application processes on different devices using protocols such as TCP and UDP.
Q2. What is TCP?
TCP is a connection-oriented transport protocol that provides reliable, ordered byte-stream delivery.
Q3. What is UDP?
UDP is a connectionless transport protocol that sends datagrams without providing built-in reliable delivery or ordering.
Q4. What is the TCP three-way handshake?
It is the connection-establishment process consisting of SYN, SYN-ACK, and ACK.
Q5. What is TCP connection termination?
It is the process of closing TCP sending directions, commonly using FIN and ACK exchanges.
Q6. What is the size of the TCP header?
The TCP header is at least 20 bytes and can be up to 60 bytes with options.
Q7. What is the size of the UDP header?
The UDP header is 8 bytes.
Q8. What is a port number?
A port number is a 16-bit identifier used by TCP or UDP to direct data to an application endpoint.
Q9. What is the valid port number range?
Port numbers range from 0 to 65535.
Q10. What are well-known ports?
Well-known ports are in the range 0–1023 and are associated with widely used services.
Q11. What is the default HTTP port?
HTTP commonly uses TCP port 80.
Q12. What is the default HTTPS port?
HTTPS commonly uses TCP port 443. HTTP/3 commonly uses UDP port 443.
Q13. What is DNS?
DNS resolves domain names to IP addresses and supports other records and naming functions. It commonly uses UDP and TCP port 53.
Q14. What is DHCP?
DHCP automatically provides IP configuration to network clients. DHCPv4 normally uses UDP ports 67 and 68.
Q15. What is the difference between flow control and congestion control?
Flow control protects the receiver from excessive incoming data, while congestion control helps prevent excessive traffic from overloading the network.
Q16. Why is UDP used for real-time communication?
UDP has low overhead and does not require TCP-style retransmission and ordering. Applications can prioritize timely delivery, although packet loss may still occur.
Q17. What is the difference between FTP and SFTP?
FTP is a separate file-transfer protocol and does not encrypt traffic by default. SFTP transfers files over SSH, commonly using TCP port 22.
Q18. What is the difference between POP3 and IMAP?
POP3 is primarily used to retrieve email, often by downloading messages. IMAP allows clients to access and manage messages maintained on a mail server.
Q19. What is a socket?
A socket is a software endpoint for network communication. A TCP connection is commonly distinguished by its protocol and the source and destination IP addresses and ports.
Q20. Does every application use a unique port?
No. Different applications may use the same port on different IP addresses, and multiple connections to the same server port can be distinguished by their endpoint combinations.
17. QUICK REVISION NOTES
- TCP: Reliable, ordered, connection-oriented byte stream.
- UDP: Connectionless, datagram-oriented transport with low overhead.
- TCP Handshake: SYN → SYN-ACK → ACK.
- TCP Header: 20–60 bytes.
- UDP Header: 8 bytes.
- Port Number: 16-bit identifier, range 0–65535.
- HTTP: TCP 80.
- HTTPS: TCP 443.
- HTTP/3: QUIC over UDP, commonly port 443.
- FTP: TCP 21 for control; TCP 20 traditionally for active-mode data.
- SSH/SFTP: TCP 22.
- Telnet: TCP 23.
- SMTP: TCP 25; submission commonly TCP 587 or 465.
- DNS: UDP/TCP 53.
- DHCPv4: UDP 67 and 68.
- TFTP: UDP 69.
- POP3: TCP 110; secure POP3 commonly TCP 995.
- IMAP: TCP 143; secure IMAP commonly TCP 993.
- NTP: UDP 123.
- SNMP: UDP 161 and 162.
- BGP: TCP 179.
- LDAP: TCP/UDP 389; LDAPS TCP 636.
- SMB: TCP 445.
- RDP: TCP/UDP 3389.
- MySQL: TCP 3306.
- PostgreSQL: TCP 5432.
- Flow Control: Protects the receiver.
- Congestion Control: Helps manage network congestion.
- Ephemeral Port: Temporary port commonly selected by a client operating system.
END OF NOTES
Part 7 covers the services that make networks usable and the security issues that arise when they are abused.
DNS, DHCP & NAT — DETAILED NOTES
1. INTRODUCTION
DNS, DHCP, and NAT are three important networking technologies used in modern computer networks.
- DNS (Domain Name System): Converts domain names into IP addresses and provides other domain-related information.
- DHCP (Dynamic Host Configuration Protocol): Automatically provides IP configuration to network devices.
- NAT (Network Address Translation): Translates IP addresses, and sometimes transport-layer port numbers, as packets pass through a network device.
Example:
When a user opens www.example.com on a laptop:
- DHCP may have assigned the laptop an IP address, subnet mask, default gateway, and DNS server.
- DNS resolves the domain name to an IP address.
- NAT on the router may translate the laptop's private IP address when its traffic travels to the public internet.
2. DNS (DOMAIN NAME SYSTEM)
Definition:
DNS is a distributed, hierarchical naming system that translates domain names into information such as IP addresses. Its most familiar function is resolving domain names to IPv4 or IPv6 addresses.
Example:
A person can remember:
www.google.com
more easily than an IP address. DNS allows applications to look up the IP address associated with a domain name.
Main Functions of DNS:
- Resolves domain names to IPv4 addresses.
- Resolves domain names to IPv6 addresses.
- Identifies mail servers for a domain.
- Supports aliases and service discovery.
- Helps distribute traffic across multiple servers.
- Supports reverse lookups from IP addresses to names.
- Stores information about domain ownership and delegation through DNS records.
Why DNS Is Important:
Without DNS, users would often need to enter IP addresses directly instead of using domain names. DNS makes network services easier to access and manage.
How DNS Works:
Suppose a user wants to open www.example.com.
Step 1: User Enters a Domain Name
The user enters www.example.com into a browser.
Step 2: Check Local Caches
The operating system and browser may already have a cached DNS answer. If a valid cached answer exists, another lookup may not be necessary.
Step 3: Contact a DNS Resolver
If the answer is not cached, the device sends a query to a configured recursive DNS resolver.
Step 4: Resolver Finds the Answer
If the resolver does not already have a valid cached answer, it can query the DNS hierarchy. A typical process may involve:
- Root DNS servers
- Top-level domain (TLD) DNS servers
- Authoritative DNS servers
Step 5: Authoritative Answer
The authoritative server returns the relevant DNS record, such as an A record or AAAA record.
Step 6: Return the Answer
The resolver returns the answer to the client and may cache it according to its TTL.
Step 7: Connect to the Server
The browser can use the returned IP address to establish a connection to the web server.
DNS Resolution Diagram:
User's Computer
|
| DNS Query
v
Recursive DNS Resolver
|
| If answer is not cached
v
Root DNS Server
|
v
TLD DNS Server
|
v
Authoritative DNS Server
|
| DNS Answer
v
Recursive DNS Resolver
|
v
User's Computer
|
v
Connect to WebsiteImportant: This diagram represents a typical uncached resolution path. Real DNS resolution can differ because of caching, delegation, local policies, and other implementation details.
3. DNS SERVER TYPES
A. Recursive DNS Resolver
A recursive resolver receives queries from clients and attempts to obtain a complete answer. It may use its cache or query other DNS servers.
Examples include resolvers provided by an ISP, organization, or public DNS service.
B. Root DNS Servers
Root DNS servers direct resolvers toward the appropriate TLD servers. They do not normally store the individual IP addresses of every website.
C. TLD DNS Servers
Top-level domain servers provide delegation information for domains under extensions such as .com, .org, .in, and .net.
D. Authoritative DNS Servers
Authoritative DNS servers hold DNS records for the zones they serve and return authoritative answers for those records.
E. Local DNS Cache
A computer or application may cache DNS responses to reduce lookup delays and unnecessary queries.
4. COMMON DNS RECORD TYPES
A DNS record stores information associated with a domain name.
| Record | Purpose | Example Use |
| --- | --- | --- |
| A | Maps a name to an IPv4 address | example.com → 192.0.2.10 |
| AAAA | Maps a name to an IPv6 address | example.com → IPv6 address |
| CNAME | Creates an alias to another domain name | www.example.com → example.com |
| MX | Specifies mail servers for a domain | Email delivery |
| NS | Identifies authoritative name servers | DNS delegation |
| PTR | Maps an IP address to a domain name in reverse DNS | Reverse lookup |
| TXT | Stores text data | Verification and email policies |
| SOA | Contains zone authority and management information | Zone configuration |
| SRV | Specifies service locations and ports | Service discovery |
| CAA | Specifies which certificate authorities may issue certificates for a domain | Certificate issuance policy |
Important DNS Records Explained:
A Record:
An A record maps a domain name to an IPv4 address.
Example:
example.com → 192.0.2.10
AAAA Record:
An AAAA record maps a domain name to an IPv6 address.
CNAME Record:
A CNAME record makes one domain name an alias of another domain name.
Example:
www.example.com → example.com
A CNAME generally cannot coexist with other ordinary data at the same owner name, subject to DNS protocol rules and specialized provider features.
MX Record:
An MX record specifies which mail servers accept email for a domain, along with their priorities.
NS Record:
An NS record identifies the name servers for a DNS zone or delegated domain.
PTR Record:
A PTR record supports reverse DNS lookup. For IPv4, reverse DNS commonly uses the in-addr.arpa domain; IPv6 uses ip6.arpa.
TXT Record:
TXT records can store verification strings and email-related policy information, including SPF-related data.
SOA Record:
The Start of Authority record contains important zone information, such as the primary name server, contact information in DNS format, serial number, and zone timers.
SRV Record:
An SRV record specifies information such as the target hostname and port for a service.
5. DNS PORTS AND PROTOCOLS
DNS commonly uses port 53.
- UDP port 53: Commonly used for ordinary DNS queries and responses.
- TCP port 53: Used for zone transfers and other DNS transactions, including cases where TCP is required or selected.
DNS can also be protected or transported through other mechanisms, such as DNS over TLS and DNS over HTTPS.
DNS over TLS (DoT):
- Commonly uses TCP port 853.
- Encrypts DNS communication between a client and resolver.
DNS over HTTPS (DoH):
- Uses HTTPS, commonly over TCP port 443 or HTTP/3 over UDP-based QUIC.
- Carries DNS messages inside HTTPS requests.
DNS Cache and TTL:
TTL (Time to Live) specifies how long a DNS record can be cached before it should be queried again.
A longer TTL can reduce query traffic but may cause changes to remain cached longer. A shorter TTL can help changes propagate more quickly but may increase query traffic.
DNS Commands:
Windows:
nslookup example.com
ipconfig /displaydns
ipconfig /flushdnsLinux:
dig example.com
dig example.com A
dig example.com MX
nslookup example.comCommon DNS Problems:
- Incorrect DNS server configuration.
- Missing or incorrect DNS records.
- Expired or stale cache entries.
- DNS server unavailability.
- Incorrect domain delegation.
- Firewall blocking DNS traffic.
- Incorrect local hosts-file entries.
DNS Security Issues:
- DNS Spoofing: Supplying false DNS responses.
- DNS Cache Poisoning: Causing a resolver to cache false DNS data.
- DNS Tunneling: Using DNS queries or responses to carry unauthorized data.
- DNS Amplification: Abusing DNS responses in certain distributed denial-of-service attacks.
Protection Methods:
- Use trusted DNS resolvers.
- Keep DNS software updated.
- Restrict recursive resolution to intended clients.
- Use DNSSEC validation where supported.
- Monitor DNS traffic for unusual behavior.
- Use encrypted DNS when appropriate for the environment.
DNSSEC provides mechanisms for authenticating DNS data. It does not encrypt ordinary DNS queries or responses.
6. DHCP (DYNAMIC HOST CONFIGURATION PROTOCOL)
Definition:
DHCP is a network protocol that automatically assigns IP configuration to devices on an IP network.
It reduces the need to manually configure every computer, phone, printer, and other network device.
Information DHCP Can Provide:
- IP address
- Subnet mask or prefix information
- Default gateway
- DNS server addresses
- Lease duration
- Domain name and other optional configuration parameters
Advantages of DHCP:
- Reduces manual configuration.
- Helps prevent address conflicts when properly managed.
- Makes it easier to add or remove devices.
- Supports centralized IP address management.
- Makes network administration easier in large networks.
- Allows addresses to be reused after leases expire or are released, subject to server policy.
DHCP Components:
DHCP Client: The device requesting network configuration.
DHCP Server: The service that allocates addresses and provides configuration options.
DHCP Scope or Pool: The range of addresses available for assignment on a network.
DHCP Lease: A time-limited allocation of an address to a client.
DHCP Relay Agent: A router or Layer 3 device that forwards DHCP messages between clients and servers on different IP subnets.
DHCP Reservation: A configuration that associates a particular client identifier or hardware address with a chosen IP address, depending on server implementation.
7. DHCP DORA PROCESS
DHCPv4 commonly uses a four-step process called DORA when a client obtains an address through the standard initial allocation exchange.
DORA stands for:
- D — Discover
- O — Offer
- R — Request
- A — Acknowledgment
Step 1: DHCP Discover
The client broadcasts a DHCP Discover message to locate DHCP servers because it may not yet have a usable IP address.
Step 2: DHCP Offer
A DHCP server responds with a DHCP Offer proposing an address and configuration parameters.
Step 3: DHCP Request
The client sends a DHCP Request to indicate which offer it is accepting.
Step 4: DHCP Acknowledgment
The selected DHCP server sends a DHCP ACK confirming the allocation and providing the configuration.
DORA Diagram:
DHCP Client DHCP Server
| |
| -------- DISCOVER --------------> |
| |
| <--------- OFFER ---------------- |
| |
| -------- REQUEST ---------------> |
| |
| <---------- ACK ----------------- |
| |
| IP Configuration Received |Important: DHCP can use different message exchanges for renewal, rebinding, address conflict detection, and other situations. DORA describes the common initial allocation process.
8. DHCP LEASE AND RENEWAL
Definition:
A DHCP lease is the period during which a client is permitted to use an assigned IP address under the server's lease rules.
Lease Process:
- The DHCP server allocates an address.
- The client uses the address for the lease period.
- The client attempts to renew the lease before it expires.
- If renewal succeeds, the lease is extended.
- If renewal fails, the client may try again using the DHCP rebinding process.
- If the lease expires without successful renewal, the client must stop using the address and obtain valid configuration.
Common DHCPv4 Timers:
- T1: The client normally attempts renewal with the original server at approximately 50% of the lease duration.
- T2: The client normally attempts rebinding with any available server at approximately 87.5% of the lease duration.
These are standard default timing proportions, but implementation and configuration details may affect behavior.
Example:
If a DHCP lease lasts 24 hours:
- T1 is approximately 12 hours.
- T2 is approximately 21 hours.
DHCP Address Pool Example:
A network administrator configures the following scope:
- Network: 192.168.1.0/24
- Gateway: 192.168.1.1
- DNS server: 192.168.1.10
- DHCP pool: 192.168.1.100–192.168.1.200
Clients can receive available addresses from the configured pool along with the appropriate network settings.
Important: The server should be configured to avoid assigning addresses that are already in use by statically configured devices.
9. DHCP PORTS
DHCPv4 uses UDP.
- UDP port 67: Normally used by DHCP servers.
- UDP port 68: Normally used by DHCP clients.
DHCPv6 uses:
- UDP port 546: Normally used by clients.
- UDP port 547: Normally used by servers and relay agents.
Why Does DHCP Use Broadcasts?
A new client may not yet know its IP address or the address of a DHCP server. DHCPv4 therefore commonly uses broadcasts during initial discovery.
DHCP Relay Agent:
A DHCP server may be located on a different subnet from the client. Routers do not normally forward local IPv4 broadcasts, so a relay agent forwards DHCP messages to a configured server.
On Cisco IOS, a relay can commonly be configured with:
interface gigabitEthernet 0/0
ip helper-address 192.168.1.10Here, 192.168.1.10 is an example DHCP server address. The command must be configured on the interface that receives the client broadcasts, using the actual server address and interface for the network.
DHCP Commands:
Windows:
ipconfig /all
ipconfig /release
ipconfig /renewLinux systems using NetworkManager or other network managers may manage DHCP automatically. Common diagnostic commands include:
ip addr
ip route
resolvectl statusAvailable DHCP client commands vary by Linux distribution and network manager.
DHCP Troubleshooting:
- Check that the DHCP server is running.
- Check the DHCP pool and available addresses.
- Verify VLAN and subnet configuration.
- Check the relay agent if the server is on another subnet.
- Check for rogue DHCP servers.
- Check DHCP snooping and firewall rules.
- Verify the default gateway and DNS options.
- Check whether the client has a self-assigned IPv4 address such as 169.254.x.x, which can indicate failure to obtain DHCP configuration in common Windows environments.
DHCP Security Risks:
- Rogue DHCP servers can provide malicious gateways or DNS settings.
- DHCP starvation attacks can exhaust available addresses.
- Incorrect DHCP scopes can cause address conflicts.
Protection Methods:
- Enable DHCP snooping on supported managed switches.
- Mark trusted and untrusted switch ports appropriately.
- Restrict access to network infrastructure.
- Monitor DHCP server logs.
- Use appropriate network access controls.
10. NAT (NETWORK ADDRESS TRANSLATION)
Definition:
NAT is a technique that modifies IP address information in packets as they pass through a router, firewall, or other network device.
NAT is often used to allow devices with private IPv4 addresses to access external networks through one or more public IPv4 addresses.
Why NAT Is Used:
- Conserves public IPv4 addresses.
- Allows many private-network devices to share public addressing.
- Supports communication between differently addressed networks.
- Can simplify certain network migrations and address-overlap scenarios.
- Can work alongside firewall rules and other security controls.
Important: NAT is not a replacement for a firewall and does not, by itself, guarantee network security.
11. PRIVATE AND PUBLIC IP ADDRESSES
Private IPv4 Addresses:
The following IPv4 ranges are reserved for private networks under RFC 1918.
| Private Range | CIDR | Common Use |
| --- | --- | --- |
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | Large private networks |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | Medium private networks |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | Home and small office networks |
Private IPv4 addresses are not globally routable on the public internet.
Public IP Address:
A public IP address is globally routable when it is properly allocated and not subject to special-use restrictions or routing policy.
Example:
A laptop may use:
192.168.1.10
The router may use a public address assigned by the internet service provider for outbound internet access.
NAT may translate the laptop's private address to the router's public address.
12. HOW NAT WORKS
Suppose a laptop has a private IP address and visits a website.
Before NAT:
- Source IP: 192.168.1.10
- Source port: 51500
- Destination IP: 203.0.113.20
- Destination port: 443
After NAT/PAT at the Router:
- Translated source IP: 198.51.100.10
- Translated source port: 62001
- Destination IP: 203.0.113.20
- Destination port: 443
The public and destination addresses above are illustrative documentation addresses, not real assigned endpoints.
Steps:
- The laptop sends a packet to the website.
- The router receives the packet from the private network.
- NAT translates the source address and, when using PAT, may translate the source port.
- The router records the translation in its NAT state or mapping table.
- The packet travels toward the website.
- The response returns to the translated public address and port.
- The router uses its translation state to forward the response to the correct internal device.
NAT Translation Table Example:
| Inside Local Address | Inside Global Address | Destination |
| --- | --- | --- |
| 192.168.1.10:51500 | 198.51.100.10:62001 | 203.0.113.20:443 |
| 192.168.1.11:51501 | 198.51.100.10:62002 | 203.0.113.20:443 |
The example shows how multiple internal devices can share one public IP address by using different translated source ports.
13. TYPES OF NAT
A. Static NAT
Definition:
Static NAT creates a fixed mapping between an internal address and an external address.
Example:
192.168.1.10 ↔ 198.51.100.10
Features:
- One-to-one address mapping.
- Mapping is configured manually.
- Useful when a particular internal device needs a consistent external address mapping.
- May be used for selected services or systems that require predictable address translation.
Advantages:
- Predictable mapping.
- Suitable for specific server-access requirements when combined with routing and firewall policies.
Disadvantages:
- Can require one public address per mapped internal address.
- Does not automatically provide security.
B. Dynamic NAT
Definition:
Dynamic NAT maps private addresses to addresses selected from a configured public address pool.
Features:
- Uses a pool of external addresses.
- Allocations are made dynamically.
- Multiple internal devices may share the pool over time.
- Simultaneous translation capacity depends on available addresses and implementation.
Example:
Private address pool:
192.168.1.100–192.168.1.150
Public NAT pool:
198.51.100.10–198.51.100.20
An internal device may receive a temporary mapping to an available public address.
Advantages:
- More flexible than manually creating every mapping.
- Allows addresses to be allocated as needed.
Disadvantages:
- Requires a sufficient public address pool for simultaneous mappings in common configurations.
- May not support more simultaneous mappings than the available pool allows unless another technique is used.
C. PAT (PORT ADDRESS TRANSLATION)
Definition:
PAT translates multiple internal private addresses to one public IP address, distinguishing simultaneous connections through translated port numbers. It is also commonly called NAT overload in Cisco terminology.
Example:
- Laptop A: 192.168.1.10:51500
- Laptop B: 192.168.1.11:51501
Both may share the public IP address 198.51.100.10, but use different translated source ports.
Advantages:
- Conserves public IPv4 addresses.
- Supports many internal devices sharing one public IPv4 address.
- Commonly used in home and office routers.
Disadvantages:
- Can complicate inbound connections and peer-to-peer applications.
- May require port forwarding or other configuration for externally initiated connections.
- Some applications and protocols need special handling through NAT.
Important: In everyday usage, people often say NAT when they specifically mean PAT.
14. NAT TERMINOLOGY
Inside Local Address:
The address assigned to an internal device, as seen from the internal network. It is often a private IPv4 address.
Inside Global Address:
The address representing an internal device to the outside network after translation.
Outside Global Address:
The address assigned to the external destination.
Outside Local Address:
The address by which an external destination is represented on the internal network, which may differ in specialized NAT designs.
Example:
A laptop has an internal address 192.168.1.10. After translation, the external network sees 198.51.100.10.
- Inside local: 192.168.1.10
- Inside global: 198.51.100.10
NAT Table:
The NAT table stores translation mappings or state that allows the device to associate translated traffic with the corresponding internal or external endpoints.
15. NAT CONFIGURATION IN CISCO PACKET TRACER
The following examples use Cisco IOS-style commands. Interface names, feature support, and exact configuration requirements vary by device model.
Example Network:
- Internal LAN: 192.168.1.0/24
- Router LAN interface: 192.168.1.1
- Router WAN interface: 203.0.113.2/30
- ISP next hop: 203.0.113.1
The public-side addresses are for documentation and lab illustration only.
Step 1: Configure Router Interfaces
enable
configure terminal
interface gigabitEthernet 0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
no shutdown
exit
interface gigabitEthernet 0/1
ip address 203.0.113.2 255.255.255.252
ip nat outside
no shutdown
exitStep 2: Create an ACL Matching the Internal Network
access-list 1 permit 192.168.1.0 0.0.0.255This ACL selects the internal addresses permitted for translation by the example NAT configuration.
Step 3: Configure PAT / NAT Overload
ip nat inside source list 1 interface gigabitEthernet 0/1 overloadThis allows matching internal traffic to share the public address of the WAN interface using port translation when needed.
Step 4: Configure a Default Route
ip route 0.0.0.0 0.0.0.0 203.0.113.1Step 5: Verify NAT
show ip nat translations
show ip nat statistics
show access-lists
show ip routeImportant: The ISP-side interface and next hop must actually be configured and reachable in the lab. NAT alone does not create internet connectivity. Correct routing, interface status, and any required upstream configuration are also necessary.
16. DHCP CONFIGURATION IN CISCO PACKET TRACER
A Cisco router can act as a DHCPv4 server on supported platforms.
Example:
- LAN network: 192.168.1.0/24
- Router gateway: 192.168.1.1
- DNS server: 192.168.1.10
- Excluded addresses: 192.168.1.1–192.168.1.20
Configuration:
enable
configure terminal
ip dhcp excluded-address 192.168.1.1 192.168.1.20
ip dhcp pool LAN_POOL
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 192.168.1.10
exitVerification Commands:
show ip dhcp binding
show ip dhcp pool
show running-configExpected Result:
A client configured for DHCP should receive an available address from the pool, along with the subnet mask, default gateway, and DNS server information.
17. DNS CONFIGURATION IN CISCO PACKET TRACER
In Packet Tracer, a server can provide DNS service for a simulated network.
Basic Steps:
- Add a server to the topology.
- Assign the server a static IP address.
- Open the server's Services tab.
- Select DNS.
- Enable the DNS service.
- Add an A record, such as www.example.com, pointing to the IP address of a web server.
- Configure the client to use the DNS server's IP address.
- Open the client browser and test the domain name.
Example:
DNS server:
192.168.1.10
Web server:
192.168.1.20
DNS A record:
www.example.com → 192.168.1.20
If the client has correct IP settings and DNS configuration, it should be able to resolve www.example.com to the web server's IP address.
Important: The DNS service, record, and web server must all be configured correctly for a successful browser test.
18. DIFFERENCE BETWEEN DNS, DHCP AND NAT
| Feature | DNS | DHCP | NAT |
| --- | --- | --- | --- |
| Full form | Domain Name System | Dynamic Host Configuration Protocol | Network Address Translation |
| Main purpose | Resolves names to DNS data | Assigns IP configuration | Translates packet addresses |
| Common transport | UDP/TCP | UDP | Operates on packets at a network boundary |
| Common ports | 53 | DHCPv4 UDP 67/68 | No single dedicated NAT port |
| Main benefit | Easier name-based access | Automatic device configuration | Public IPv4 address conservation |
| Example | example.com to an IP | Assigning 192.168.1.100 | Translating a private source IP |
| Common device/service | DNS resolver/server | DHCP server | Router/firewall |
Simple Summary:
- DNS answers: "What address or other DNS information belongs to this name?"
- DHCP answers: "What IP configuration should this device use?"
- NAT answers: "How should packet addresses or ports be translated as traffic crosses this boundary?"
19. COMMON NETWORK TROUBLESHOOTING SCENARIOS
Scenario 1: Website Does Not Open by Domain Name
Possible causes:
- DNS server is unreachable.
- The domain record is incorrect.
- The DNS cache contains stale information.
- The website itself is unavailable.
Tests:
nslookup example.com
ping 8.8.8.8If an IP address is reachable but the name cannot be resolved, DNS may be the problem. However, ICMP traffic can be blocked, so a failed ping alone does not prove that a host or service is unavailable.
Scenario 2: Computer Does Not Receive an IP Address
Possible causes:
- DHCP server is down.
- DHCP pool is exhausted.
- Incorrect VLAN assignment.
- Missing DHCP relay configuration.
- DHCP messages are blocked.
- Rogue DHCP configuration is interfering.
Tests:
ipconfig /all
ipconfig /release
ipconfig /renewScenario 3: Devices Have IP Addresses but Cannot Access the Internet
Possible causes:
- Incorrect default gateway.
- Missing route.
- NAT is not configured correctly.
- The WAN interface is down.
- Upstream routing or firewall rules are incorrect.
- DNS is unavailable.
Scenario 4: NAT Translation Does Not Appear
Possible causes:
- Internal traffic is not reaching the router.
- The NAT ACL does not match the source address.
- The inside and outside interfaces are reversed.
- Traffic is not traversing the expected router.
- The router has no usable route toward the destination.
- No matching traffic has yet generated a translation.
Scenario 5: DNS Works but the Website Still Does Not Open
Possible causes:
- Web server is down.
- TCP port 443 or 80 is blocked.
- TLS configuration is incorrect.
- The browser is using a proxy.
- Routing or NAT is incorrect.
- The server is reachable but the application is failing.
20. IMPORTANT EXAM QUESTIONS AND ANSWERS
Q1. What is DNS?
DNS stands for Domain Name System. It is a distributed naming system that resolves domain names into IP addresses and provides other domain-related information.
Q2. What is the purpose of DNS?
DNS allows users and applications to locate network resources using domain names instead of relying on IP addresses alone.
Q3. What is an A record?
An A record maps a domain name to an IPv4 address.
Q4. What is an AAAA record?
An AAAA record maps a domain name to an IPv6 address.
Q5. What is a CNAME record?
A CNAME record creates an alias from one domain name to another domain name.
Q6. What is DHCP?
DHCP is a protocol that automatically provides IP configuration to network clients.
Q7. What does DORA stand for?
DORA stands for Discover, Offer, Request, and Acknowledgment. These are the four common stages in the initial DHCPv4 allocation process.
Q8. Which ports does DHCPv4 use?
DHCPv4 normally uses UDP port 67 for servers and UDP port 68 for clients.
Q9. What is a DHCP lease?
A DHCP lease is a time-limited allocation that permits a client to use an assigned IP address under the server's lease rules.
Q10. What is a DHCP relay agent?
A DHCP relay agent forwards DHCP messages between clients and servers located on different IP subnets.
Q11. What is NAT?
NAT is a technique that translates IP address information in packets as they pass through a network device.
Q12. What is static NAT?
Static NAT creates a fixed mapping between an internal address and an external address.
Q13. What is dynamic NAT?
Dynamic NAT allocates translations from a configured pool of external IP addresses.
Q14. What is PAT?
PAT, or Port Address Translation, allows multiple internal devices to share one public IP address by distinguishing their connections using translated port numbers.
Q15. What is the difference between NAT and PAT?
NAT is the general address-translation technique. PAT is a form of NAT that also translates transport-layer port numbers so that multiple connections can share an IP address.
Q16. What are private IPv4 address ranges?
The private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
Q17. Does NAT provide complete network security?
No. NAT does not replace a firewall, endpoint security, or proper access controls.
Q18. What is DNS TTL?
TTL specifies how long DNS data may be cached before it should be queried again.
Q19. What is DNSSEC?
DNSSEC provides authentication mechanisms for DNS data. It does not encrypt ordinary DNS queries or responses.
Q20. What is the difference between DNS and DHCP?
DNS resolves names to DNS information, while DHCP automatically provides network configuration such as IP addresses and default gateways.
21. QUICK REVISION NOTES
- DNS: Resolves domain names into IP addresses and other DNS information.
- DNS Port: UDP/TCP 53.
- DoT: DNS over TLS, commonly TCP 853.
- DoH: DNS over HTTPS, commonly HTTPS on port 443.
- A Record: IPv4 address.
- AAAA Record: IPv6 address.
- CNAME: Domain-name alias.
- MX: Mail server information.
- NS: Name server information.
- PTR: Reverse DNS.
- TTL: Controls DNS caching duration.
- DHCP: Automatically provides IP configuration.
- DORA: Discover, Offer, Request, Acknowledgment.
- DHCPv4 Ports: UDP 67 and 68.
- DHCPv6 Ports: UDP 546 and 547.
- DHCP Lease: Time-limited IP address allocation.
- DHCP Relay: Forwards DHCP messages between subnets.
- NAT: Translates IP address information.
- Static NAT: Fixed address mapping.
- Dynamic NAT: Uses a pool of external addresses.
- PAT: Allows multiple devices to share a public IP through port translation.
- Private IPv4 Ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
- NAT Overload: Common Cisco term for PAT.
- nslookup: Tests DNS name resolution.
- ipconfig /all: Displays Windows network configuration.
- ipconfig /renew: Requests or renews DHCP configuration.
- show ip nat translations: Displays NAT translation entries on supported Cisco IOS devices.
- show ip dhcp binding: Displays DHCP address bindings on supported Cisco IOS devices.
END OF NOTES
Part 8 introduces the major network security controls used to prevent, detect and contain unwanted traffic.
FIREWALLS, ACLs, IDS/IPS, VPN & ZERO TRUST — DETAILED NOTES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. FIREWALL
Definition:
A firewall is a network security device or software that monitors and controls incoming and outgoing network traffic according to predefined security rules. It acts as a barrier between a trusted network and an untrusted network, such as the internet.
Purpose of a Firewall:
- Prevent unauthorized access to a network.
- Allow legitimate traffic and block unwanted traffic.
- Protect computers, servers, and network devices from certain attacks.
- Control access to websites, applications, ports, and IP addresses.
- Monitor and log network connections.
- Enforce an organization's security policies.
How a Firewall Works:
- A packet arrives at the firewall.
- The firewall checks packet information, such as source IP, destination IP, port, protocol, and connection state.
- It compares the information against its security rules.
- The firewall allows, blocks, or rejects the traffic according to the rules.
- Some firewalls also inspect application data and detect suspicious activity.
Types of Firewalls:
1. Packet-Filtering Firewall
- Examines packet headers.
- Uses source IP, destination IP, port number, and protocol.
- Usually does not inspect the full application data.
- Fast and simple.
- Provides limited protection against sophisticated attacks.
2. Stateful Inspection Firewall
- Tracks the state of network connections.
- Maintains a state table of active connections.
- Determines whether packets belong to legitimate established sessions.
- Provides more protection than basic stateless filtering.
3. Proxy Firewall
- Acts as an intermediary between a client and a destination server.
- Receives requests and forwards them on behalf of the client.
- Can inspect application-layer traffic.
- Helps hide internal client details from external servers.
- May introduce additional processing delay.
4. Next-Generation Firewall (NGFW)
- Combines traditional firewall functions with advanced security features.
- May include application awareness, intrusion prevention, URL filtering, and threat intelligence.
- Can identify and control applications rather than relying only on port numbers.
- Commonly used in enterprise networks.
5. Host-Based Firewall
- Installed on an individual computer or server.
- Controls traffic entering and leaving that particular device.
- Example: Windows Defender Firewall.
6. Network-Based Firewall
- Protects a network segment or an entire organization.
- Usually deployed at network boundaries or between internal network segments.
- Can protect multiple devices simultaneously.
Firewall Actions:
- Allow: Permits the traffic.
- Deny/Drop: Blocks the traffic, often without replying.
- Reject: Blocks the traffic and may send an error response.
- Log: Records information about the traffic or rule match.
Advantages of Firewalls:
- Reduce unauthorized network access.
- Help control network communication.
- Support security monitoring and auditing.
- Can limit the spread of attacks between network segments.
Limitations of Firewalls:
- Cannot prevent every type of attack.
- May not stop threats hidden in permitted traffic without advanced inspection.
- Cannot fully protect against careless users or compromised authorized accounts.
- Incorrect rules may expose sensitive services.
- Must be regularly updated and reviewed.
Example:
An organization configures a firewall to allow HTTPS traffic on TCP port 443 to its public web server while blocking unsolicited connections to internal computers.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. ACCESS CONTROL LISTS (ACLs)
Definition:
An Access Control List (ACL) is an ordered set of rules used to permit or deny network traffic based on specified conditions.
ACLs are commonly configured on routers, Layer 3 switches, firewalls, and other network security devices.
Purpose of ACLs:
- Control traffic entering or leaving an interface.
- Restrict communication between network segments.
- Allow or block specific IP addresses and protocols.
- Limit access to services using port numbers.
- Enforce network security policies.
Information Used by ACLs:
- Source IP address.
- Destination IP address.
- Protocol, such as TCP, UDP, or ICMP.
- Source or destination port numbers.
- Direction of traffic.
- Other criteria supported by the device.
Types of ACLs in Cisco Networking:
1. Standard ACL
- Primarily filters traffic using the source IPv4 address.
- Does not normally filter by destination address or TCP/UDP port.
- Often placed closer to the destination because it has fewer matching criteria.
2. Extended ACL
- Can filter by source IP, destination IP, protocol, and TCP/UDP port numbers.
- Provides more precise traffic control.
- Often placed closer to the source of the traffic being filtered, when appropriate.
3. Named ACL
- Uses a descriptive name instead of only a numeric identifier.
- Can be standard or extended.
- Easier to identify and maintain in larger networks.
4. Numbered ACL
- Identified by a numeric range defined by the device or operating system.
- Can be standard or extended.
How ACLs Work:
- A packet reaches an interface or device where an ACL is applied.
- The device checks the ACL entries in order.
- The first matching rule determines the action.
- If no rule matches, the packet is subject to the ACL's implicit behavior.
Important ACL Rule:
Most Cisco IPv4 ACLs have an implicit deny all at the end. If traffic does not match an explicit permit statement, it is denied.
Example — Cisco Standard ACL:
Router(config)# access-list 10 permit 192.168.1.0 0.0.0.255
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip access-group 10 inExplanation:
- access-list 10 creates a numbered standard ACL.
- permit 192.168.1.0 0.0.0.255 permits addresses in the 192.168.1.0/24 network.
- ip access-group 10 in applies the ACL to traffic entering the interface.
Example — Cisco Extended ACL:
Router(config)# access-list 101 permit tcp 192.168.1.0 0.0.0.255 any eq 443
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip access-group 101 inExplanation:
This example permits TCP traffic from the 192.168.1.0/24 network to any destination using destination port 443. Other traffic is denied by the implicit deny unless additional rules permit it.
Wildcard Mask:
A wildcard mask tells a Cisco ACL which bits of an address to check.
Example:
- Subnet mask: 255.255.255.0
- Wildcard mask: 0.0.0.255
- Network: 192.168.1.0/24
Important ACL Commands:
show access-lists
show ip interface
show running-configThese commands help inspect ACL rules, interface settings, and the running configuration.
Advantages of ACLs:
- Simple and efficient traffic filtering.
- Control communication between network segments.
- Reduce unnecessary or unauthorized traffic.
- Support least-privilege network access.
Limitations of ACLs:
- Complex rule sets are difficult to maintain.
- Rule order can affect results.
- ACLs do not automatically provide deep inspection of application content.
- Misconfiguration may block legitimate traffic or allow unwanted access.
ACL vs Firewall:
- ACL: Primarily matches traffic against configured rules.
- Firewall: May provide connection tracking, application inspection, threat detection, logging, and other advanced controls.
- Some firewalls also use ACL-like rules internally.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. IDS — INTRUSION DETECTION SYSTEM
Definition:
An Intrusion Detection System (IDS) monitors network traffic or system activity to identify suspicious behavior, policy violations, or possible security attacks.
An IDS generally detects and alerts rather than automatically blocking traffic inline.
Purpose of IDS:
- Detect suspicious network activity.
- Identify possible malware communication.
- Detect scanning and attack patterns.
- Generate alerts for security teams.
- Support investigation and incident response.
Types of IDS:
1. Network-Based IDS (NIDS)
- Monitors traffic across a network or network segment.
- Often deployed near important network links.
- Can identify suspicious patterns in observed traffic.
- Visibility depends on network placement and encryption.
2. Host-Based IDS (HIDS)
- Monitors activity on an individual computer or server.
- May inspect system logs, file changes, processes, and system events.
- Helps detect unauthorized changes to a host.
Detection Methods:
1. Signature-Based Detection
- Compares activity with known attack patterns.
- Effective for recognized threats with available signatures.
- May fail to detect completely new or modified attacks.
2. Anomaly-Based Detection
- Identifies deviations from established normal behavior.
- Can help detect unknown or unusual threats.
- May produce false positives when legitimate behavior changes.
3. Behavior-Based Detection
- Looks for suspicious patterns of actions or activity.
- Can help identify malicious behavior even when an exact signature is unavailable.
- Accuracy depends on the quality of detection logic and available context.
How IDS Works:
- Collects network packets, logs, or host activity.
- Analyzes the collected information.
- Compares activity against signatures, policies, or behavioral models.
- Identifies suspicious events.
- Generates an alert or report for investigation.
Advantages of IDS:
- Provides visibility into suspicious activity.
- Helps security teams investigate incidents.
- Can detect activity that passes through basic firewall rules.
- Supports security auditing and monitoring.
Limitations of IDS:
- Usually does not block attacks by itself.
- Can generate false positives and false negatives.
- Encrypted traffic may limit inspection.
- Requires tuning, updates, and alert review.
Examples of IDS Software:
- Snort: Can be used for intrusion detection and, in supported configurations, prevention.
- Suricata: Supports network threat detection and inline prevention.
- Zeek: Focuses on network security monitoring and analysis.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. IPS — INTRUSION PREVENTION SYSTEM
Definition:
An Intrusion Prevention System (IPS) monitors network traffic or system activity and can automatically block or prevent traffic identified as malicious.
An IPS is commonly deployed inline, meaning traffic passes through it.
Purpose of IPS:
- Detect malicious traffic.
- Block known attack patterns.
- Stop certain exploit attempts.
- Drop suspicious packets or reset connections.
- Enforce security policies automatically.
Types of IPS:
1. Network-Based IPS (NIPS)
- Protects network traffic.
- Usually deployed inline at important network links.
- Can block suspicious packets or connections.
2. Host-Based IPS (HIPS)
- Operates on an individual host.
- May prevent suspicious processes, system changes, or malicious activity.
- Its capabilities depend on the specific product.
3. Wireless IPS (WIPS)
- Monitors wireless environments for threats such as unauthorized access points and certain wireless attacks.
- Some solutions can take preventive actions.
How IPS Works:
- Traffic passes through the IPS.
- The IPS inspects traffic using configured rules and detection methods.
- Suspicious activity is identified.
- The IPS takes a configured action, such as dropping packets, blocking a connection, or generating an alert.
- Security events are logged for further analysis.
Advantages of IPS:
- Can block detected attacks automatically.
- Reduces reliance on manual intervention for known threats.
- Adds another layer of defense beyond basic filtering.
- Can help enforce security policies in real time.
Limitations of IPS:
- Incorrect rules may block legitimate traffic.
- False negatives may allow attacks through.
- Inline deployment can introduce latency or create an availability concern.
- Signatures and detection rules must be maintained.
IDS vs IPS:
| Feature | IDS | IPS |
| --- | --- | --- |
| Full form | Intrusion Detection System | Intrusion Prevention System |
| Main purpose | Detect suspicious activity | Detect and prevent suspicious activity |
| Typical placement | Monitors a traffic copy or host activity | Commonly deployed inline |
| Automatic blocking | Usually no | Yes, when configured |
| Traffic handling | Often observes traffic | Traffic passes through inline deployment |
| Main risk | Missed or uninvestigated alerts | False blocking or disruption |
| Example use | Alert on port scans | Drop traffic matching a malicious exploit signature |
Remember: IDS detects; IPS detects and can block.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5. VPN — VIRTUAL PRIVATE NETWORK
Definition:
A Virtual Private Network (VPN) creates an encrypted or otherwise protected tunnel across an untrusted network, such as the internet, to help protect data in transit and provide secure remote or site-to-site connectivity.
Purpose of VPN:
- Protect data traveling across public networks.
- Provide remote access to internal resources.
- Connect geographically separated office networks.
- Reduce exposure of traffic to people observing the underlying network.
- Support secure access to business systems.
Types of VPN:
1. Remote-Access VPN
- Connects an individual user or device to a private network.
- Commonly used by employees working remotely.
- Often requires VPN software, authentication, and security checks.
2. Site-to-Site VPN
- Connects two or more networks over an untrusted network.
- Commonly used to connect branch offices.
- Often implemented between routers or firewalls.
3. Intranet VPN
- Connects different locations belonging to the same organization.
- Enables secure communication between internal networks.
4. Extranet VPN
- Provides controlled connectivity between an organization and external partners or suppliers.
- Access should be restricted to required resources.
Common VPN Technologies and Protocols:
1. IPsec VPN
- Operates at the IP layer.
- Commonly used for site-to-site VPNs and some remote-access solutions.
- Provides security services such as encryption, integrity, and peer authentication when appropriately configured.
2. SSL/TLS VPN
- Uses TLS-based security.
- Often used for remote access to selected applications or internal resources.
- The exact capabilities depend on the implementation.
3. WireGuard
- A modern VPN protocol designed for a relatively simple configuration and efficient operation.
- Uses modern cryptographic primitives.
4. OpenVPN
- An open-source VPN solution that uses TLS-based mechanisms.
- Can be configured for remote access and site-to-site connectivity.
Important IPsec Concepts:
- AH (Authentication Header): Provides integrity and authentication-related services but does not encrypt the packet payload.
- ESP (Encapsulating Security Payload): Can provide encryption, integrity, and authentication, depending on configuration.
- Transport Mode: Protects the IP payload while generally retaining the original IP header.
- Tunnel Mode: Encapsulates the original IP packet inside a new IP packet; commonly used for site-to-site VPNs.
How a VPN Works:
- A user or gateway initiates a VPN connection.
- The VPN peers authenticate each other or the user is authenticated.
- Security parameters and cryptographic keys are established.
- Traffic is protected and sent through the VPN tunnel.
- The receiving VPN endpoint verifies and decrypts the protected traffic.
- The traffic is forwarded to its destination according to network policy.
VPN Advantages:
- Protects data in transit.
- Supports secure remote access.
- Connects offices across different locations.
- Can reduce the need for dedicated private circuits in some scenarios.
VPN Limitations:
- Does not automatically protect a device from malware.
- Does not guarantee that the VPN endpoint or destination is trustworthy.
- A compromised user account may still be abused.
- Poor configuration or weak authentication can undermine security.
- VPN connections can introduce latency and overhead.
- A VPN provider or organization may still have visibility into traffic after it exits the tunnel.
Important Security Practices:
- Use strong authentication, preferably multifactor authentication (MFA).
- Use modern, properly configured cryptography.
- Keep VPN software and gateways updated.
- Restrict users to the resources they need.
- Monitor unusual login and connection activity.
Example:
An employee at home connects to the company's VPN, authenticates using MFA, and securely accesses an internal application over the internet.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6. ZERO TRUST SECURITY MODEL
Definition:
Zero Trust is a security approach based on the principle “Never trust, always verify.” It requires access requests to be evaluated using identity, device condition, context, and policy rather than automatically trusting a user or device because it is inside the corporate network.
Zero Trust does not mean trusting nobody under any circumstances. It means that access should be explicitly verified and continuously governed.
Core Principles of Zero Trust:
1. Verify Explicitly
- Authenticate and authorize users and devices.
- Consider identity, location, device health, application, and risk signals where appropriate.
- Use MFA for stronger identity verification.
2. Use Least-Privilege Access
- Give users only the permissions required for their tasks.
- Limit access to specific applications and resources.
- Avoid unnecessary administrator privileges.
3. Assume Breach
- Design systems on the assumption that an attacker may already be present.
- Segment networks and restrict movement between systems.
- Monitor activity and prepare for incident response.
Important Components of Zero Trust:
1. Identity and Access Management (IAM)
- Manages user identities and permissions.
- Supports authentication and authorization.
2. Multi-Factor Authentication (MFA)
- Requires two or more different types of authentication factors.
- Examples include a password plus an authenticator app or security key.
3. Device Security
- Checks whether a device meets required security standards.
- May consider operating-system updates, endpoint protection, encryption, and device management status.
4. Microsegmentation
- Divides a network or environment into smaller security zones.
- Restricts communication between workloads and systems.
- Helps limit lateral movement after a compromise.
5. Continuous Monitoring
- Collects security events and evaluates suspicious activity.
- Supports detection and response to changes in risk.
6. Policy-Based Access
- Determines whether access should be granted based on defined rules and context.
- Policies can consider identity, device, resource sensitivity, and risk.
How Zero Trust Works:
- A user requests access to an application or resource.
- The system verifies the user's identity.
- The device and other relevant context are evaluated.
- Access policy determines the appropriate permissions.
- Access is limited to the required resource and actions.
- Activity is monitored, and access may be reevaluated when risk or conditions change.
Advantages of Zero Trust:
- Reduces excessive trust in internal networks.
- Limits unauthorized access and lateral movement.
- Supports secure remote work and cloud environments.
- Encourages strong identity verification.
- Improves control over access to sensitive resources.
Challenges of Zero Trust:
- Implementation may be complex.
- Requires identity, device, and access-policy management.
- Legacy applications may be difficult to integrate.
- Excessive restrictions can affect productivity.
- Monitoring and policy maintenance require ongoing effort.
Traditional Security vs Zero Trust:
| Traditional Perimeter-Based Approach | Zero Trust Approach |
| --- | --- |
| Often emphasizes the network boundary | Protects access to individual resources |
| May grant more trust to internal network traffic | Verifies access regardless of network location |
| May rely heavily on VPN access | Can use VPNs, identity-aware proxies, or other controlled access mechanisms |
| May allow broad internal connectivity | Emphasizes least privilege and segmentation |
| May focus on perimeter defenses | Uses identity, device state, policy, and monitoring |
Important Point:
Zero Trust does not replace every firewall or VPN. Firewalls, VPNs, MFA, endpoint security, and monitoring can all be components of a Zero Trust architecture.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7. DIFFERENCE BETWEEN FIREWALL, ACL, IDS, IPS, VPN, AND ZERO TRUST
| Technology | Primary Purpose | Main Function |
| --- | --- | --- |
| Firewall | Network traffic security | Allows or blocks traffic using security policies |
| ACL | Rule-based access control | Permits or denies matching traffic |
| IDS | Threat detection | Monitors and alerts on suspicious activity |
| IPS | Threat prevention | Detects and can block suspicious activity |
| VPN | Secure connectivity | Protects traffic in transit through a tunnel |
| Zero Trust | Access-control strategy | Verifies each access request and limits privileges |
Easy Example:
Imagine a college network.
- Firewall: Controls traffic entering or leaving the college network.
- ACL: Allows a specific student network to access approved services while denying other traffic.
- IDS: Alerts the administrator when a computer performs suspicious port scanning.
- IPS: Blocks traffic matching a detected attack pattern.
- VPN: Allows an authorized teacher to connect securely from home.
- Zero Trust: Verifies the teacher's identity and device, then grants access only to the applications the teacher is authorized to use.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8. BASIC NETWORK SECURITY BEST PRACTICES
- Configure firewalls using a documented, least-privilege policy.
- Review ACLs regularly and remove unnecessary rules.
- Keep IDS/IPS signatures and security software updated.
- Monitor and investigate security alerts.
- Use MFA for remote access and administrator accounts.
- Configure VPNs with strong authentication and modern cryptography.
- Segment networks to separate users, servers, guests, and sensitive systems.
- Apply security patches to routers, switches, servers, and endpoints.
- Disable unused services and close unnecessary ports.
- Use centralized logging and synchronize device clocks.
- Back up network device configurations securely.
- Test security controls and maintain an incident-response plan.
- Apply Zero Trust principles to identities, devices, applications, and data.
- Avoid exposing management interfaces directly to the public internet.
- Regularly review user access and revoke permissions that are no longer required.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
9. IMPORTANT EXAM QUESTIONS AND ANSWERS
Q1. What is a firewall?
A firewall is a hardware device or software system that monitors and controls incoming and outgoing network traffic according to predefined security rules.
Q2. What is an ACL?
An Access Control List is an ordered set of rules used to permit or deny network traffic based on criteria such as IP addresses, protocols, and port numbers.
Q3. What is the difference between standard and extended ACLs?
A standard ACL primarily filters by source IPv4 address, whereas an extended ACL can also filter by destination IP, protocol, and TCP/UDP port numbers.
Q4. What is an IDS?
An Intrusion Detection System monitors network traffic or host activity to identify suspicious behavior and generate alerts.
Q5. What is an IPS?
An Intrusion Prevention System detects suspicious activity and can automatically block malicious traffic when configured to do so.
Q6. Differentiate between IDS and IPS.
IDS mainly detects and alerts, while IPS can detect and actively prevent malicious traffic. IDS is commonly used for monitoring; IPS is commonly deployed inline.
Q7. What is a VPN?
A Virtual Private Network provides a protected connection across an untrusted network and is commonly used for secure remote access and site-to-site connectivity.
Q8. What is the difference between remote-access VPN and site-to-site VPN?
A remote-access VPN connects an individual user or device to a private network. A site-to-site VPN connects entire networks, such as two branch offices.
Q9. What is Zero Trust?
Zero Trust is a security model that verifies access requests explicitly, applies least privilege, and assumes that a breach may occur.
Q10. What is microsegmentation?
Microsegmentation divides a network or computing environment into small security zones and restricts communication between them to reduce the impact of a compromise.
Q11. Can a VPN replace a firewall?
No. A VPN protects traffic in transit and provides secure connectivity, whereas a firewall enforces traffic-control policies. Both may be used together.
Q12. Can an IDS block attacks?
A conventional IDS generally detects and alerts rather than blocking traffic. An IPS is designed to take preventive actions, although some IDS-capable products also offer prevention modes.
Q13. What is the implicit deny rule in ACLs?
It is the default behavior in many ACL implementations, including Cisco IPv4 ACLs, where traffic that matches no explicit permit rule is denied.
Q14. Why is MFA important in Zero Trust?
MFA requires multiple different authentication factors, making unauthorized access more difficult when one factor, such as a password, is compromised.
Q15. What is the principle of least privilege?
It means giving a user, device, or application only the minimum permissions needed to perform its required tasks.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
10. QUICK REVISION
- Firewall: Controls network traffic according to security rules.
- ACL: Uses ordered permit and deny rules.
- Standard ACL: Primarily checks source IPv4 addresses.
- Extended ACL: Can check source, destination, protocol, and ports.
- IDS: Detects suspicious activity and alerts.
- IPS: Detects and can block malicious activity.
- VPN: Provides a protected tunnel over an untrusted network.
- IPsec: A suite of protocols used to protect IP communications.
- Remote-access VPN: Connects an individual user to a private network.
- Site-to-site VPN: Connects separate networks.
- Zero Trust: Verify explicitly, use least privilege, and assume breach.
- MFA: Uses multiple different authentication factors.
- Microsegmentation: Restricts communication between smaller network or workload segments.
- Defense in depth: Uses multiple complementary security controls rather than relying on a single control.
FINAL SUMMARY:
Firewalls and ACLs control network traffic. IDS and IPS identify suspicious activity, with IPS also capable of blocking it. VPNs protect communications across untrusted networks. Zero Trust is a broader security strategy that verifies users and devices, limits permissions, and continuously manages access risk.
The strongest security approach combines these technologies with secure configuration, regular updates, monitoring, and effective incident response.
Part 9 maps common attacks to the network layers and focuses on recognition, indicators and defensive controls.
NETWORK ATTACKS & DEFENSIVE THINKING — DETAILED NOTES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. INTRODUCTION TO NETWORK ATTACKS
Definition:
A network attack is an attempt to gain unauthorized access to a network, steal information, disrupt communication, misuse network resources, or compromise the confidentiality, integrity, and availability of systems and data.
Network attacks may target computers, servers, routers, switches, wireless networks, applications, and users.
Objectives of Network Attacks:
- Unauthorized Access: Enter a system or network without permission.
- Data Theft: Steal passwords, personal information, or confidential files.
- Data Modification: Change, corrupt, or manipulate information.
- Service Disruption: Make a website, server, or network unavailable.
- Privilege Escalation: Obtain permissions beyond those originally granted.
- Espionage: Secretly monitor communications or collect sensitive information.
- Financial Gain: Steal money, demand ransom, or commit fraud.
- Resource Abuse: Use compromised devices for spam, cryptocurrency mining, or attacks against other systems.
Basic Security Objectives — CIA Triad:
1. Confidentiality
- Ensures information is accessible only to authorized people or systems.
- Protected using encryption, access controls, and authentication.
- Example: Encrypting confidential student records.
2. Integrity
- Ensures information remains accurate and is not changed without authorization.
- Supported by hashes, digital signatures, access controls, and audit logs.
- Example: Preventing unauthorized modification of examination results.
3. Availability
- Ensures authorized users can access services and information when required.
- Supported by backups, redundancy, capacity planning, and DDoS protection.
- Example: Keeping a college website available during heavy traffic.
Other Security Principles:
- Authentication: Verifies who a user or system is.
- Authorization: Determines what an authenticated user is allowed to do.
- Accounting/Auditing: Records activities for monitoring and investigation.
- Non-repudiation: Provides evidence that can help prevent a party from falsely denying an action, depending on the system and evidence.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. CLASSIFICATION OF NETWORK ATTACKS
Network attacks can be classified into two major categories.
A. Passive Attacks
A passive attack involves observing or monitoring communication without directly changing the data or disrupting the system.
Examples:
- Eavesdropping.
- Traffic analysis.
- Unauthorized observation of unencrypted communication.
- Monitoring network communication patterns.
Characteristics:
- Focuses on collecting information.
- May be difficult to detect because data is not necessarily modified.
- Encryption and traffic protection can reduce the risk.
B. Active Attacks
An active attack attempts to modify data, impersonate a system, gain unauthorized access, or disrupt services.
Examples:
- Denial-of-Service (DoS).
- Man-in-the-Middle (MitM).
- Spoofing.
- Replay attacks.
- Unauthorized modification of transmitted data.
- Malware delivery.
Characteristics:
- May alter, inject, delete, or block information.
- Can affect system availability or integrity.
- May be identified through monitoring, authentication controls, and anomaly detection.
Passive vs Active Attacks:
| Feature | Passive Attack | Active Attack |
| --- | --- | --- |
| Main objective | Observe or collect information | Alter, inject, impersonate, or disrupt |
| Data modification | Usually no | Often possible |
| Detection | Often difficult | May be easier to identify, but not always |
| Example | Eavesdropping | Denial-of-Service |
| Common defense | Encryption | Authentication, filtering, monitoring, and resilience |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. COMMON NETWORK ATTACKS
3.1 Denial-of-Service (DoS) Attack
Definition:
A Denial-of-Service (DoS) attack attempts to make a computer, server, application, or network unavailable to legitimate users.
It may exhaust bandwidth, connection capacity, memory, CPU resources, or application processing capacity.
How It Works:
- An attacker sends excessive or specially crafted traffic or requests.
- The target consumes available resources.
- Legitimate requests become slow or fail.
- Users experience service interruption.
Example:
A website becomes unavailable because its server is overwhelmed by a large volume of unwanted requests.
Defensive Measures:
- Rate limiting.
- Network and application traffic filtering.
- DDoS protection services.
- Redundant infrastructure and capacity planning.
- Monitoring unusual traffic spikes.
- Working with an internet service provider when necessary.
3.2 Distributed Denial-of-Service (DDoS) Attack
Definition:
A Distributed Denial-of-Service (DDoS) attack uses multiple systems to overwhelm a target with traffic or requests.
Compromised devices may form a botnet, which an attacker controls to generate traffic.
DoS vs DDoS:
- DoS: Attack traffic may originate from a single source or a limited number of sources.
- DDoS: Attack traffic comes from many distributed systems.
- DDoS attacks are often more difficult to mitigate because traffic comes from multiple locations.
Defensive Measures:
- Use a DDoS mitigation service.
- Apply rate limiting and traffic filtering.
- Monitor traffic volume and source patterns.
- Use load balancing and resilient network architecture.
- Coordinate with the ISP or hosting provider.
Important Point: Blocking one IP address is usually insufficient against a large distributed attack.
3.3 Man-in-the-Middle (MitM) Attack
Definition:
A Man-in-the-Middle (MitM) attack occurs when an attacker secretly positions themselves between two communicating parties to observe or potentially alter their communication.
Example:
A user connects to a malicious or compromised public Wi-Fi network, and an attacker attempts to intercept communication that is not properly protected.
Possible Consequences:
- Credential theft.
- Information disclosure.
- Unauthorized modification of messages.
- Session hijacking.
Defensive Measures:
- Use properly validated HTTPS/TLS connections.
- Avoid ignoring certificate warnings.
- Use secure Wi-Fi with strong encryption.
- Apply MFA to sensitive accounts.
- Use a trusted VPN where appropriate.
- Avoid transmitting sensitive information over insecure channels.
3.4 Spoofing Attack
Definition:
Spoofing is the act of falsifying identifying information to impersonate another device, user, or system.
Common Types:
IP Spoofing
- Falsifies the source IP address in packets.
- May be used in reflection attacks or to conceal the apparent origin of traffic.
- Defenses include ingress/egress filtering and appropriate network controls.
MAC Spoofing
- Changes or imitates a device's MAC address.
- Can be used to evade simplistic MAC-based restrictions.
- Defenses include stronger authentication, port security where appropriate, and network access controls.
ARP Spoofing
- Sends forged Address Resolution Protocol (ARP) messages on a local IPv4 network.
- May associate an attacker's MAC address with another device's IP address.
- Can enable interception or disruption of local network traffic.
- Defenses include Dynamic ARP Inspection (DAI), DHCP snooping where supported, segmentation, and appropriate switch configuration.
DNS Spoofing
- Attempts to provide false DNS information so that a user connects to an unintended destination.
- Defenses include trusted DNS infrastructure, DNSSEC validation where supported, endpoint security, and HTTPS certificate validation.
3.5 Phishing
Definition:
Phishing is a social-engineering attack in which an attacker tricks a person into revealing sensitive information, opening a malicious attachment, or visiting a deceptive website.
Although phishing often targets people rather than network protocols, it can lead to network compromise.
Common Types:
- Email Phishing: Fraudulent emails sent to many recipients.
- Spear Phishing: Messages tailored to a particular person or organization.
- Smishing: Phishing through SMS or text messages.
- Vishing: Phishing through voice calls.
- Clone Phishing: A deceptive copy of a legitimate message containing a substituted malicious link or attachment.
Warning Signs:
- Unexpected requests for passwords or verification codes.
- Suspicious links or mismatched website addresses.
- Unexpected attachments.
- Urgent or threatening language.
- Requests to bypass normal approval procedures.
- Unexpected payment or account-change instructions.
Defensive Measures:
- Verify requests through a trusted, independent channel.
- Never disclose passwords or MFA codes to an unverified requester.
- Use email filtering and endpoint protection.
- Enable MFA or phishing-resistant authentication where possible.
- Report suspicious messages to the appropriate security team.
3.6 Password Attacks
A password attack attempts to obtain, guess, steal, or reuse authentication credentials.
Common Types:
Brute-Force Attack
- Attempts many possible password combinations.
- Can be slowed by rate limits, account protections, and strong passwords.
Dictionary Attack
- Tries likely passwords or words from a prepared list.
- Defended against by using long, unique passwords and blocking commonly used passwords.
Credential Stuffing
- Uses credentials leaked from one service to attempt access to other services.
- Works particularly well when people reuse passwords.
- Defended against by using unique passwords, MFA, and suspicious-login detection.
Password Spraying
- Tries a small number of common passwords against many accounts.
- Can evade simplistic per-account lockout policies.
- Defenses include banned-password lists, MFA, risk-based detection, and monitoring across accounts.
Defensive Measures:
- Use a password manager.
- Create long, unique passwords for every service.
- Enable MFA.
- Use rate limiting and suspicious-login detection.
- Store passwords securely using an appropriate salted password-hashing algorithm.
- Avoid sharing accounts.
3.7 Replay Attack
Definition:
A replay attack occurs when an attacker captures a valid message, authentication exchange, or transaction and retransmits it to attempt to repeat an action or gain unauthorized access.
Example:
A poorly designed authentication system accepts a previously captured authentication message a second time.
Defensive Measures:
- Use nonces or unpredictable challenges.
- Include timestamps or sequence numbers where appropriate.
- Reject duplicate transaction identifiers.
- Use secure session protocols.
- Design authentication protocols to prevent reuse of old messages.
3.8 Session Hijacking
Definition:
Session hijacking occurs when an attacker obtains or abuses a user's active session identifier or session credentials to impersonate the user.
Possible Causes:
- Stolen session cookies.
- Malware on a device.
- Cross-site scripting vulnerabilities.
- Insecure session handling.
- Exposure of session information through insecure communication.
Defensive Measures:
- Use HTTPS throughout the application.
- Set session cookies with appropriate Secure, HttpOnly, and SameSite attributes.
- Regenerate session identifiers after authentication or privilege changes.
- Expire inactive sessions.
- Revoke sessions after password changes or suspected compromise.
- Protect endpoints from cross-site scripting.
3.9 Malware
Definition:
Malware is malicious software designed to damage systems, steal information, spy on users, disrupt services, or provide unauthorized access.
Common Types:
Virus
- Attaches to files or programs and spreads when infected content is executed.
Worm
- Can self-propagate between systems, often by exploiting vulnerabilities or weak configurations.
Trojan Horse
- Appears legitimate but performs malicious actions.
Ransomware
- Encrypts or otherwise blocks access to data and demands payment.
Spyware
- Secretly collects information about a user or system.
Rootkit
- Attempts to conceal malicious activity or maintain privileged access.
Bot
- A compromised device that can be controlled remotely, potentially as part of a botnet.
Defensive Measures:
- Install software from trusted sources.
- Keep operating systems and applications updated.
- Use endpoint protection.
- Restrict administrator privileges.
- Disable unnecessary services and macros where appropriate.
- Maintain tested offline or immutable backups.
- Train users to identify suspicious content.
3.10 DNS-Based Attacks
DNS (Domain Name System) translates domain names into information such as IP addresses.
Common DNS Threats:
DNS Cache Poisoning
- Attempts to insert false DNS information into a resolver's cache.
- May direct users to an unintended destination.
DNS Tunneling
- Misuses DNS queries and responses to carry data or command traffic.
- May be used for covert communication or data exfiltration.
DNS Amplification
- Abuses DNS infrastructure to generate amplified traffic toward a victim, often using spoofed source addresses.
Defensive Measures:
- Use well-configured DNS resolvers.
- Apply DNSSEC validation where appropriate.
- Monitor unusual query volumes and suspicious domain patterns.
- Restrict recursive DNS service to authorized users where applicable.
- Apply source-address validation to reduce spoofed traffic.
- Investigate unexpected DNS activity.
3.11 Wireless Network Attacks
Wireless networks face threats because communication travels over radio signals.
Common Threats:
- Rogue Access Point: An unauthorized wireless access point connected to or impersonating part of a network.
- Evil Twin: A deceptive access point that imitates a legitimate Wi-Fi network.
- Wi-Fi Eavesdropping: Attempting to observe wireless communication.
- Deauthentication Abuse: Forged management frames or related techniques used to disconnect clients, where protections are absent or ineffective.
- Weak Wi-Fi Password Attacks: Attempts to gain access by exploiting weak credentials or insecure configurations.
Defensive Measures:
- Use WPA3 where supported, or appropriately configured WPA2-AES.
- Use strong, unique Wi-Fi credentials.
- Disable obsolete security modes such as WEP.
- Use Protected Management Frames (802.11w/PMF) where supported.
- Separate guest Wi-Fi from internal systems.
- Monitor for rogue access points.
- Avoid automatically trusting similarly named public Wi-Fi networks.
3.12 VLAN Hopping
Definition:
VLAN hopping is an attack in which a malicious device attempts to access traffic or network segments that should be isolated by VLAN configuration.
Defensive Measures:
- Disable Dynamic Trunking Protocol (DTP) where it is not required.
- Configure access ports explicitly as access ports.
- Use an appropriate unused native VLAN for trunks.
- Restrict which VLANs are permitted on trunk links.
- Disable unused switch ports.
- Apply appropriate switch security features.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. SOCIAL ENGINEERING AND HUMAN-FACTOR ATTACKS
Definition:
Social engineering is the manipulation of people into revealing information, granting access, or performing actions that weaken security.
Attackers often exploit trust, fear, urgency, curiosity, or a desire to help.
Common Techniques:
1. Pretexting
- Inventing a believable story to obtain information or access.
- Example: Someone falsely claims to be technical support.
2. Baiting
- Offering something attractive to persuade a person to perform an unsafe action.
- Example: A malicious USB drive labelled as a reward.
3. Tailgating
- Following an authorized person into a restricted physical area without independent authorization.
4. Impersonation
- Pretending to be a manager, vendor, administrator, or trusted organization.
5. Business Email Compromise (BEC)
- Using compromised or deceptive business email communications to manipulate employees into transferring money or disclosing information.
Defensive Thinking:
- Verify identity independently.
- Follow approval processes for payments and sensitive changes.
- Never bypass security procedures because of urgency.
- Report suspicious activity.
- Provide regular security-awareness training.
Important Point: Security is not only a technical problem. Human behavior and organizational procedures are also essential.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5. COMMON NETWORK ATTACK INDICATORS
A network administrator should recognize unusual behavior that may indicate a security incident.
Possible Warning Signs:
- Sudden spikes in network traffic.
- Unusually high CPU, memory, or bandwidth usage.
- Repeated failed login attempts.
- Logins at unexpected times or from unfamiliar locations.
- Unknown devices appearing on the network.
- Unexpected DNS requests or connections to suspicious domains.
- Unusual outbound traffic from internal systems.
- Repeated port scans or connection attempts.
- Unexplained configuration changes on routers or switches.
- Unexpected account privilege changes.
- Disabled antivirus or security services.
- Files suddenly becoming encrypted or inaccessible.
- Users reporting unexpected MFA prompts.
- Unexpected outbound connections from servers that normally provide only a specific service.
Important: One indicator does not always prove an attack. Administrators should correlate logs, verify the context, and investigate before reaching conclusions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6. DEFENSIVE THINKING IN NETWORK SECURITY
Definition:
Defensive thinking is the practice of anticipating threats, identifying weaknesses, reducing unnecessary exposure, detecting suspicious activity, and preparing to respond effectively to security incidents.
It focuses on asking not only “How does this system work?” but also “What could go wrong, how would I notice, and how could I limit the damage?”
Core Defensive Principles:
1. Defense in Depth
- Use multiple complementary security controls.
- Do not rely on a single firewall or antivirus product.
- Combine network filtering, endpoint protection, access controls, monitoring, backups, and user training.
2. Least Privilege
- Give users and services only the permissions they need.
- Avoid using administrator accounts for routine tasks.
- Review and remove unnecessary permissions.
3. Secure by Default
- Disable unnecessary services.
- Change default credentials.
- Use secure configurations from the beginning.
- Avoid exposing management interfaces to untrusted networks.
4. Minimize Attack Surface
- Reduce the number of exposed services, applications, accounts, and ports.
- Remove unused software.
- Close unnecessary firewall rules.
- Disable unused switch ports.
5. Network Segmentation
- Separate users, servers, guest devices, and sensitive systems.
- Use VLANs, firewalls, and access-control rules appropriately.
- Limit unnecessary communication between network segments.
6. Patch Management
- Apply security updates in a timely and controlled manner.
- Prioritize vulnerabilities according to severity, exposure, and actual risk.
- Verify that updates have been successfully installed.
7. Strong Authentication
- Use unique passwords and MFA.
- Protect administrator accounts.
- Remove inactive accounts.
- Monitor suspicious login activity.
8. Continuous Monitoring
- Review logs and security alerts.
- Monitor traffic patterns.
- Detect abnormal behavior.
- Ensure that alerts are investigated rather than ignored.
9. Data Protection
- Encrypt sensitive data in transit and at rest where appropriate.
- Limit access to confidential information.
- Maintain secure, tested backups.
- Apply data-retention and deletion policies.
10. Incident Preparedness
- Maintain an incident-response plan.
- Identify responsible personnel.
- Know how to isolate affected systems.
- Preserve logs and evidence.
- Test recovery procedures.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7. THE ATTACK SURFACE
Definition:
The attack surface is the collection of points through which an attacker might attempt to enter, affect, or extract information from a system.
Types of Attack Surface:
Network Attack Surface
- Open ports.
- Exposed services.
- Public IP addresses.
- Misconfigured routers and firewalls.
- Wireless access points.
Application Attack Surface
- Web forms.
- APIs.
- Login pages.
- Software vulnerabilities.
- File-upload functions.
Human Attack Surface
- Users who may be deceived.
- Weak password practices.
- Unverified requests.
- Improper handling of sensitive information.
Physical Attack Surface
- Unlocked server rooms.
- Unattended devices.
- Exposed network ports.
- Unsecured USB devices.
Ways to Reduce the Attack Surface:
- Disable unused ports and services.
- Remove unnecessary applications.
- Restrict administrative access.
- Patch known vulnerabilities.
- Use network segmentation.
- Secure wireless networks.
- Review firewall and ACL rules.
- Train users to recognize social engineering.
- Protect physical access to network equipment.
- Regularly audit the environment.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8. BASIC PORT SCANNING AND NETWORK DEFENSE
Definition:
A port scan is a technique used to identify network ports that are open, closed, or filtered on a target system.
Administrators use authorized port scanning to inventory exposed services and verify firewall rules. Attackers may also use scanning for reconnaissance.
Common Port States:
- Open: A service is accepting connections on the port.
- Closed: The host is reachable, but no service is listening on that port.
- Filtered: A firewall or another control prevents the scanner from determining whether the port is open or closed.
Example of Defensive Interpretation:
Suppose a college web server is intended to provide HTTPS only.
- TCP port 443 is expected to be accessible.
- SSH on port 22 should be restricted to authorized administrators.
- Database ports should not be publicly accessible unless there is a specific, justified requirement.
Defensive Actions:
- Inventory exposed ports.
- Identify the service listening on each port.
- Confirm whether the service is necessary.
- Restrict access with firewalls and ACLs.
- Disable unused services.
- Review exposure after configuration changes.
Important: An open port does not automatically indicate a vulnerability. Risk depends on the service, its configuration, its exposure, and whether it contains known or exploitable weaknesses.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
9. BASIC DEFENSIVE NETWORK COMMANDS
Use these commands on systems and networks you own or are authorized to administer.
Windows Commands:
1. View IP Configuration
ipconfig
ipconfig /allDisplays IP addresses, gateways, DNS servers, and other network configuration details.
2. Test Connectivity
ping 192.168.1.1Tests basic IP reachability. A failed response does not always mean the host is unavailable because ICMP may be blocked.
3. Trace the Network Path
tracert example.comShows the path toward a destination where intermediate devices respond to the probes.
4. Display Network Connections
netstat -anoDisplays network connections, listening ports, and process IDs on supported Windows versions.
5. Check DNS Resolution
nslookup example.comQueries DNS information for the specified domain.
6. Display the ARP Cache
arp -aDisplays cached IPv4-to-MAC address mappings.
7. Display the Routing Table
route printShows the system's IPv4 and IPv6 routing information.
Linux Commands:
1. Display IP Addresses
ip addr2. Display Routes
ip route3. Show Listening Ports and Connections
ss -tulpnDepending on permissions, process details may require elevated privileges.
4. Test Connectivity
ping -c 4 192.168.1.15. Inspect DNS Resolution
dig example.com6. Display Neighbor or ARP Information
ip neigh7. Review System Logs
journalctlUseful for reviewing system events on systems using systemd.
Defensive Command-Line Workflow:
- Check local IP configuration.
- Confirm the default gateway and DNS settings.
- Test connectivity to the gateway.
- Verify DNS resolution.
- Inspect listening services and active connections.
- Review logs for suspicious activity.
- Compare results against the system's intended configuration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
10. BASIC NETWORK SECURITY INCIDENT RESPONSE
Definition:
Incident response is the organized process of identifying, containing, investigating, eliminating, and recovering from a security incident.
Common Incident-Response Phases:
1. Preparation
- Create policies and response plans.
- Train personnel.
- Maintain backups and logging.
- Identify critical systems and contacts.
2. Detection and Analysis
- Review alerts and logs.
- Determine which systems are affected.
- Assess the likely scope and severity.
- Preserve relevant evidence.
3. Containment
- Isolate affected systems where appropriate.
- Block malicious connections.
- Disable compromised accounts if necessary.
- Avoid actions that unnecessarily destroy evidence.
4. Eradication
- Remove malware or unauthorized access mechanisms.
- Fix exploited vulnerabilities.
- Reset compromised credentials.
- Correct the underlying misconfiguration.
5. Recovery
- Restore systems from trusted sources.
- Apply patches and hardening.
- Validate that services operate normally.
- Monitor closely for signs of reinfection.
6. Lessons Learned
- Document what happened.
- Identify weaknesses in controls and procedures.
- Improve monitoring, training, and response plans.
- Track corrective actions to completion.
Important Defensive Rule:
When a serious incident occurs, follow the organization's response process. Preserve evidence, notify the appropriate security personnel, and avoid making uncontrolled changes that could worsen the incident.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11. PRACTICAL EXAMPLE — SECURING A COLLEGE NETWORK
Imagine a college network containing administrative computers, student labs, servers, and guest Wi-Fi.
Potential Risks:
- Students accessing administrative systems.
- Malware spreading between lab computers.
- Password theft through phishing.
- Unauthorized devices connecting to the network.
- Public exposure of internal services.
- Denial-of-Service against the college website.
Defensive Design:
1. Network Segmentation
- Create separate VLANs for administration, students, servers, and guests.
- Restrict traffic between VLANs using firewalls or Layer 3 ACLs.
2. Firewall Rules
- Permit only necessary traffic to public servers.
- Restrict internal management interfaces.
- Prevent guest Wi-Fi users from accessing sensitive internal resources.
3. Access Control
- Use unique accounts and role-based permissions.
- Apply MFA to administrators and sensitive applications.
- Remove accounts when users leave the organization.
4. Endpoint Security
- Patch computers regularly.
- Use endpoint protection.
- Restrict software installation privileges.
- Maintain a secure configuration baseline.
5. Monitoring
- Collect firewall, server, and authentication logs.
- Alert on unusual login attempts and unexpected outbound traffic.
- Monitor important network services.
6. Backups
- Keep protected backups of important academic and administrative information.
- Test restoration regularly.
- Restrict access to backup systems.
7. Incident Response
- Prepare procedures for compromised computers and accounts.
- Identify who can isolate a device or disable an account.
- Practice recovery from malware and service outages.
Result:
A layered defense makes unauthorized access more difficult, helps detect suspicious activity, limits the spread of compromise, and supports faster recovery.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12. DEFENSIVE THINKING CHECKLIST
When evaluating any network or system, ask these questions:
- Assets: What systems and information are important?
- Threats: Who or what could harm these assets?
- Exposure: Which services, ports, applications, and accounts are accessible?
- Authentication: Are users and devices properly verified?
- Authorization: Does each user have only the required permissions?
- Segmentation: Can an attacker move easily between network segments?
- Patching: Are operating systems, applications, and network devices updated?
- Monitoring: Would suspicious behavior generate a useful alert?
- Data Protection: Is sensitive information protected in transit and at rest?
- Backups: Can critical systems be restored after an incident?
- Response: Does the organization know how to contain and investigate an incident?
- Testing: Have defensive controls been checked in an authorized environment?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13. IMPORTANT EXAM QUESTIONS AND ANSWERS
Q1. What is a network attack?
A network attack is an attempt to gain unauthorized access, steal or modify data, disrupt services, or compromise network security.
Q2. What is the CIA triad?
The CIA triad consists of Confidentiality, Integrity, and Availability. These are three fundamental objectives of information security.
Q3. Differentiate between passive and active attacks.
Passive attacks observe or monitor communications without necessarily changing them. Active attacks attempt to modify data, impersonate systems, gain access, or disrupt services.
Q4. What is a DoS attack?
A Denial-of-Service attack attempts to make a service unavailable by exhausting resources or otherwise disrupting normal operation.
Q5. What is a DDoS attack?
A Distributed Denial-of-Service attack uses multiple distributed systems to overwhelm a target with unwanted traffic or requests.
Q6. What is a Man-in-the-Middle attack?
A Man-in-the-Middle attack occurs when an attacker positions themselves between communicating parties to observe or potentially modify their communication.
Q7. What is spoofing?
Spoofing is the falsification of identifying information, such as an IP address, MAC address, or DNS information, to impersonate another system or mislead a recipient.
Q8. What is phishing?
Phishing is a social-engineering technique that uses deceptive messages or websites to trick people into disclosing sensitive information or performing unsafe actions.
Q9. What is malware? Name four types.
Malware is software designed to perform malicious actions. Four types are viruses, worms, Trojans, and ransomware.
Q10. What is a replay attack?
A replay attack occurs when an attacker captures and retransmits a previously valid message or transaction to attempt to repeat an action or gain unauthorized access.
Q11. What is the attack surface?
The attack surface is the set of possible entry points through which an attacker could attempt to access, affect, or extract information from a system.
Q12. What is defense in depth?
Defense in depth is a security strategy that combines multiple complementary controls so that the failure of one control does not automatically compromise the entire system.
Q13. What is the principle of least privilege?
It means granting users, devices, and applications only the permissions necessary to perform their required tasks.
Q14. What is network segmentation?
Network segmentation divides a network into smaller sections and restricts communication between them to improve security and contain incidents.
Q15. Why are backups important for network security?
Backups help restore data and services after incidents such as ransomware, accidental deletion, hardware failure, or data corruption, provided the backups remain protected and recoverable.
Q16. What is incident response?
Incident response is a structured process for detecting, containing, investigating, eliminating, and recovering from security incidents.
Q17. How can a network administrator detect suspicious activity?
By monitoring logs, authentication attempts, network traffic, endpoint alerts, DNS activity, unusual outbound connections, and unexpected configuration changes.
Q18. Why is encryption important?
Encryption helps protect information from unauthorized disclosure when data is stored or transmitted, provided cryptographic keys and endpoints are properly secured.
Q19. Does an open port always indicate an attack?
No. An open port indicates that a service is accepting connections. Its risk depends on whether the service is necessary, properly configured, patched, and appropriately restricted.
Q20. What is the most important principle of defensive thinking?
Anticipate threats, minimize unnecessary exposure, apply layered controls, monitor for suspicious activity, and prepare to respond and recover.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14. QUICK REVISION NOTES
- Network Attack: An attempt to compromise network confidentiality, integrity, or availability.
- CIA Triad: Confidentiality, Integrity, Availability.
- Passive Attack: Observes or collects information.
- Active Attack: Modifies, injects, impersonates, or disrupts.
- DoS: Attempts to make a service unavailable.
- DDoS: Uses multiple systems to overwhelm a target.
- MitM: Intercepts or potentially modifies communication between parties.
- Spoofing: Falsifies identifying information.
- Phishing: Tricks users into disclosing information or taking unsafe actions.
- Brute Force: Tries many possible passwords.
- Credential Stuffing: Reuses leaked credentials across services.
- Replay Attack: Reuses a previously captured message or transaction.
- Malware: Software intended to perform malicious actions.
- Ransomware: Malware that holds data or systems hostage.
- DNS Poisoning: Attempts to corrupt DNS information.
- Attack Surface: All potential entry points into a system.
- Defense in Depth: Multiple layers of security controls.
- Least Privilege: Minimum necessary permissions.
- Segmentation: Restricts communication between network sections.
- Incident Response: Detect, contain, eradicate, recover, and learn.
- Secure Configuration: Disable unnecessary services and restrict access.
- Monitoring: Analyze logs and traffic to detect suspicious behavior.
FINAL SUMMARY:
Network security requires understanding both how attacks work and how to prevent, detect, contain, and recover from them. Common threats include DoS/DDoS, spoofing, MitM, phishing, password attacks, malware, and DNS attacks.
Effective defensive thinking combines the CIA triad, least privilege, defense in depth, network segmentation, patch management, strong authentication, monitoring, secure backups, and incident-response planning. The goal is not simply to prevent every possible attack, but also to detect compromise early, limit its impact, and restore normal operations safely.
Part 10 connects networking knowledge to SOC operations, packet analysis, cloud networking, logging and monitoring.
SOC NETWORKING TOOLS, MONITORING, WI-FI & CLOUD — DETAILED NOTES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. INTRODUCTION TO SECURITY OPERATIONS CENTER (SOC)
Definition:
A Security Operations Center (SOC) is a centralized team, facility, or function responsible for continuously monitoring an organization's IT systems, detecting security threats, investigating suspicious activities, and coordinating responses to cybersecurity incidents.
A SOC protects networks, servers, endpoints, applications, cloud infrastructure, and sensitive information.
Main Objectives of a SOC:
- Detect cyberattacks and suspicious network activity.
- Monitor network traffic and security logs.
- Investigate security alerts.
- Identify compromised devices and user accounts.
- Coordinate incident response.
- Reduce the impact of cyberattacks.
- Maintain visibility into network and system security.
- Support compliance, auditing, and reporting.
Main Functions of a SOC:
1. Monitoring
- Collects information from network devices, servers, endpoints, firewalls, and cloud services.
- Watches for suspicious behavior and unusual events.
2. Threat Detection
- Identifies indicators of compromise, malicious traffic, unauthorized access, and policy violations.
3. Investigation
- Analyzes alerts and determines whether an event is a genuine security incident or a false positive.
4. Incident Response
- Coordinates actions such as isolating an affected endpoint, disabling a compromised account, or blocking malicious traffic.
5. Threat Hunting
- Proactively searches for suspicious behavior that may not have generated an alert.
6. Reporting
- Documents incidents, response actions, findings, and recommendations.
Common SOC Team Roles:
- SOC Analyst Tier 1: Monitors alerts, performs initial triage, and escalates suspicious events.
- SOC Analyst Tier 2: Investigates incidents in greater depth and coordinates containment.
- SOC Analyst Tier 3: Handles advanced investigations, threat hunting, detection engineering, and complex incidents.
- Incident Responder: Coordinates containment, eradication, and recovery.
- Security Engineer: Configures and maintains security tools and detection systems.
- SOC Manager: Oversees operations, priorities, reporting, and team performance.
Typical SOC Workflow:
- Collect logs and telemetry.
- Detect suspicious behavior.
- Generate a security alert.
- Triage and prioritize the alert.
- Investigate the event.
- Contain the threat if confirmed.
- Remove the cause and recover affected systems.
- Document the incident and improve detection rules.
Example:
If a college server receives hundreds of unusual login attempts, the SOC investigates the source, checks authentication logs, determines whether the activity is malicious, and applies suitable controls to protect the server.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. IMPORTANT SOC NETWORKING TOOLS
SOC teams use tools to observe network traffic, investigate endpoints, correlate logs, detect threats, and troubleshoot connectivity.
2.1 Wireshark
Definition:
Wireshark is a network protocol analyzer used to capture and inspect network packets.
Main Uses:
- Analyze network protocols.
- Troubleshoot connectivity problems.
- Investigate DNS queries and responses.
- Inspect TCP handshakes and retransmissions.
- Identify unusual communication patterns.
- Examine unencrypted protocol data when visible.
Important Features:
- Packet capture.
- Protocol dissection.
- Display filters.
- Stream following.
- Packet timing and endpoint statistics.
Example Display Filters:
dnsDisplays DNS packets.
tcpDisplays TCP packets.
ip.addr == 192.168.1.10Displays packets involving the specified IPv4 address.
tcp.port == 443Displays TCP packets using port 443.
icmpDisplays ICMP packets.
Important Point: HTTPS encryption generally prevents Wireshark from displaying application content in readable form unless suitable decryption material and conditions are available. Packet metadata and some protocol details may still be visible.
2.2 Nmap
Definition:
Nmap (Network Mapper) is a network discovery and security auditing tool used to identify hosts, open ports, and services on networks.
Main Uses:
- Discover devices on an authorized network.
- Identify exposed ports.
- Determine which services are listening.
- Support security audits.
- Verify whether firewall rules expose unintended services.
Basic Commands:
nmap 192.168.1.10Scans common ports on a specified host.
nmap -sV 192.168.1.10Attempts to identify services and versions on discovered ports.
nmap -sn 192.168.1.0/24Performs host discovery across the specified subnet without a regular port scan.
Important Point: Scan only networks and systems you own or are explicitly authorized to test. Scanning may trigger security alerts or violate organizational policy.
2.3 tcpdump
Definition:
tcpdump is a command-line packet-capture tool commonly used on Linux and Unix-like systems.
Example Commands:
sudo tcpdump -i anyCaptures traffic on available interfaces supported by the system.
sudo tcpdump -i eth0 port 53Captures traffic involving port 53 on interface eth0.
sudo tcpdump -i eth0 host 192.168.1.10Captures traffic to or from the specified host.
sudo tcpdump -i eth0 -w capture.pcapSaves captured packets to a file for later analysis.
Uses:
- Troubleshooting network communication.
- Investigating DNS issues.
- Capturing packets for later inspection.
- Examining TCP connection behavior.
- Supporting incident investigations.
2.4 Ping
Definition:
Ping tests IP reachability using ICMP Echo Request and Echo Reply messages when those messages are permitted.
Example:
ping 192.168.1.1Uses:
- Check basic connectivity.
- Estimate round-trip time.
- Detect packet loss in the tested exchange.
Limitation: A failed ping does not necessarily mean the host is down. Firewalls may block ICMP while other services remain available.
2.5 Traceroute / Tracert
Definition:
Traceroute identifies the network path toward a destination by sending probes with varying time-to-live (TTL) or hop-limit values.
Windows:
tracert example.comLinux:
traceroute example.comUses:
- Troubleshoot routing problems.
- Identify where responses stop along a path.
- Investigate possible network delays.
Limitation: Some routers do not respond to probes, so missing hops do not necessarily indicate a network failure.
2.6 Netstat and SS
These tools display active network connections and listening sockets.
Windows:
netstat -anoLinux:
ss -tulpnUses:
- Identify listening ports.
- Inspect established connections.
- Investigate unexpected services.
- Correlate connection information with processes where permissions allow.
2.7 Nslookup and Dig
These tools help investigate DNS resolution.
Windows:
nslookup example.comLinux:
dig example.comUses:
- Check whether a domain resolves.
- Inspect DNS records.
- Troubleshoot DNS failures.
- Investigate unexpected DNS responses.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. NETWORK MONITORING
Definition:
Network monitoring is the continuous observation and analysis of network devices, traffic, connectivity, performance, and security events to ensure that a network operates correctly and securely.
Objectives of Network Monitoring:
- Detect outages and connectivity failures.
- Identify suspicious network activity.
- Monitor bandwidth consumption.
- Track device health and availability.
- Detect performance bottlenecks.
- Investigate network incidents.
- Maintain service reliability.
Types of Network Monitoring:
1. Availability Monitoring
- Checks whether a device or service is reachable.
- Uses methods such as ICMP probes and service checks.
2. Performance Monitoring
- Measures latency, packet loss, throughput, and utilization.
- Helps identify congestion and service degradation.
3. Traffic Monitoring
- Observes communication patterns, protocols, traffic volume, and flows.
- Can help identify abnormal traffic or unauthorized communication.
4. Security Monitoring
- Looks for suspicious activity, policy violations, and indicators of compromise.
- Uses logs, alerts, network telemetry, and threat-detection tools.
5. Configuration Monitoring
- Tracks changes to device configurations.
- Helps detect unauthorized modifications to routers, switches, and firewalls.
Important Network Monitoring Metrics:
Latency
- The time taken for data to travel between points.
- Usually measured in milliseconds (ms).
- High latency can make applications feel slow.
Packet Loss
- The percentage of transmitted packets that fail to reach their destination.
- Can cause poor voice/video quality and retransmissions.
Bandwidth
- The maximum data-carrying capacity of a network connection, typically expressed in bits per second.
Throughput
- The actual rate at which useful data is successfully transferred.
- Usually lower than the theoretical bandwidth.
Jitter
- Variation in packet delay.
- Especially important for real-time voice and video communication.
CPU and Memory Utilization
- Indicates how much processing and memory capacity a device is using.
- Sustained high utilization may signal overload or abnormal activity.
Uptime
- The period for which a system or service remains operational.
Example:
A network link has a bandwidth of 100 Mbps but delivers only 35 Mbps of actual throughput. Possible reasons include congestion, protocol overhead, wireless interference, or limitations in the endpoints.
Network Monitoring vs Security Monitoring:
| Feature | Network Monitoring | Security Monitoring |
| --- | --- | --- |
| Primary focus | Availability and performance | Threats and policy violations |
| Common metrics | Latency, loss, throughput | Failed logins, suspicious flows, alerts |
| Typical tools | PRTG, Zabbix, SNMP systems | SIEM, IDS/IPS, EDR, NDR |
| Main outcome | Reliable network operation | Detection and investigation of threats |
The two overlap: network performance data can also reveal security incidents.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. SNMP — SIMPLE NETWORK MANAGEMENT PROTOCOL
Definition:
SNMP is a protocol used to monitor and manage network devices such as routers, switches, servers, printers, and access points.
Main Components:
1. SNMP Manager
- The monitoring system that queries devices and receives notifications.
2. SNMP Agent
- Software running on a managed device that provides monitoring information.
3. Managed Device
- The router, switch, server, or other device being monitored.
4. Management Information Base (MIB)
- A structured collection of managed objects and their identifiers.
5. Object Identifier (OID)
- A unique identifier used to refer to a managed object.
SNMP Operations:
- GET: Retrieves information from a managed device.
- GETNEXT / GETBULK: Retrieves subsequent or multiple values.
- SET: Changes a managed value when authorized and supported.
- TRAP: Sends an unsolicited notification from an agent.
- INFORM: Sends a notification that expects acknowledgment.
SNMP Versions:
- SNMPv1: Original version with limited security.
- SNMPv2c: Adds improvements such as bulk retrieval but uses community strings rather than strong message-level security.
- SNMPv3: Supports security features such as authentication, integrity, and optional encryption, depending on configuration.
Important Security Recommendation:
Prefer SNMPv3 with appropriate authentication and privacy settings. Restrict management access to trusted monitoring systems and avoid exposing SNMP to untrusted networks.
Example:
A monitoring server queries a switch's interface counters to determine how much traffic is passing through a port.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5. SYSLOG AND SECURITY LOGGING
Definition:
Syslog is a standard mechanism used to transmit or process system log messages from network devices, servers, and applications.
Purpose of Logging:
- Record system events.
- Investigate failures.
- Detect unauthorized access.
- Track configuration changes.
- Support incident response and auditing.
Common Log Sources:
- Firewalls.
- Routers and switches.
- Authentication systems.
- Servers and operating systems.
- Applications.
- VPN gateways.
- Cloud services.
- Endpoint protection tools.
Common Security Log Events:
- Failed authentication attempts.
- Successful logins from unusual locations.
- Administrator account changes.
- Firewall rule modifications.
- New device connections.
- Malware detection alerts.
- Unusual outbound connections.
- Changes to security settings.
Syslog Severity Levels:
| Level | Name | General Meaning |
| --- | --- | --- |
| 0 | Emergency | System is unusable |
| 1 | Alert | Immediate action required |
| 2 | Critical | Critical condition |
| 3 | Error | Error condition |
| 4 | Warning | Warning condition |
| 5 | Notice | Significant but normal event |
| 6 | Informational | Informational message |
| 7 | Debug | Debugging details |
Best Practices:
- Centralize important logs.
- Synchronize device clocks using a trusted time source.
- Restrict access to log storage.
- Protect logs against unauthorized alteration.
- Define sensible retention periods.
- Alert on meaningful events instead of generating excessive noise.
Important Point: Logs are most useful when they have accurate timestamps, sufficient context, and a reliable process for review and investigation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6. SIEM — SECURITY INFORMATION AND EVENT MANAGEMENT
Definition:
A SIEM system collects, normalizes, correlates, and analyzes security-related data from multiple sources to help detect suspicious activity and support incident investigation.
Main Functions:
1. Log Collection
- Gathers events from firewalls, servers, endpoints, applications, and cloud platforms.
2. Normalization
- Converts information from different sources into a consistent format.
3. Correlation
- Connects related events to identify patterns that may indicate an attack.
4. Alerting
- Generates alerts when configured detection rules or analytics identify suspicious activity.
5. Investigation
- Allows analysts to search and compare events across systems.
6. Reporting
- Produces reports for investigations, audits, and security operations.
Example of SIEM Correlation:
- A user has many failed login attempts.
- The same account then logs in successfully from an unusual source.
- The account accesses sensitive data shortly afterward.
- The SIEM correlates these events and generates an alert for investigation.
This pattern may indicate account compromise, but the analyst must validate the context.
Popular SIEM Platforms:
- Microsoft Sentinel.
- Splunk Enterprise Security.
- IBM QRadar.
- Elastic Security.
SIEM Advantages:
- Centralized visibility.
- Correlation across multiple systems.
- Faster investigation.
- Historical search and reporting.
- Detection of patterns that may be difficult to identify in isolated logs.
SIEM Limitations:
- Poor-quality logs reduce detection accuracy.
- Incorrect rules can generate false positives.
- High data volumes may increase storage and operational costs.
- Effective use requires tuning, investigation, and skilled personnel.
SIEM vs IDS:
- IDS: Focuses on detecting suspicious activity in network traffic or host activity.
- SIEM: Collects and correlates security events from many sources.
- An IDS can send alerts to a SIEM for broader investigation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7. IDS, IPS, EDR, AND NDR
IDS — Intrusion Detection System
- Detects suspicious network or host activity.
- Commonly generates alerts.
IPS — Intrusion Prevention System
- Detects suspicious activity and can block it when configured for prevention.
EDR — Endpoint Detection and Response
- Collects endpoint telemetry and helps detect, investigate, and respond to threats on computers and servers.
- Can support actions such as isolating a compromised endpoint.
NDR — Network Detection and Response
- Analyzes network traffic and related telemetry to identify suspicious communication patterns.
- Helps investigate lateral movement, command-and-control traffic, and other network-based threats.
Comparison:
| Tool | Main Visibility | Primary Purpose |
| --- | --- | --- |
| IDS | Network traffic or host activity | Detection and alerts |
| IPS | Traffic passing through an inline control | Detection and prevention |
| EDR | Endpoint activity | Endpoint threat detection and response |
| NDR | Network traffic and flows | Network threat detection and investigation |
| SIEM | Logs and events across many sources | Correlation, alerting, and investigation |
Example:
If a laptop begins communicating with a
Study progress is saved to your account. The final exam is Part 11.