A NETWORK is two or more computers or devices that are linked in order to share information. Networks are broken into different subsets based on their size and function. The OSI (Open Systems Interconnection) model provides a conceptual framework for understanding network functions. The OSI Model was developed in the 1970s and 1980s, and it is a conceptual model that breaks networking into seven separate layers. Each layer refers to a set of functions that are responsible for specific tasks. In the OSI model, the definition of the application layer is narrower in scope. The OSI model defines the application layer as only the interface responsible for communicating with host-based and user-facing applications. OSI then explicitly distinguishes the functionality of two additional layers, the session layer and presentation layer, as separate levels below the application layer and above the transport layer. OSI specifies a strict modular separation of functionality at these layers and provides protocol implementations for each. In contrast, the Internet Protocol Suite compiles these functions into a single layer.
The processes of encapsulation and de-encapsulation work in exactly the same way with the TCP/IP model as they do with the OSI model. At each layer of the this models a header is added during Data_encapsulation, and removed during Data_de-encapsulation.
OSI Model - 7 Layers with Data Encapsulation:
Figure: OSI Model showing data encapsulation (adding headers at each layer) on the sender side and de-encapsulation (removing headers) on the receiver side. Each layer has a specific Protocol Data Unit (PDU) name.
The Physical, and lowest layer of the model, covers how unstructured data, like bits, is transmitted. Over these wires and signals, the raw data bits are received as a stream of 0s and 1s. Fixing errors that occur just at this layer means considering physical damage or interference. Some concrete examples of this are the ways wires are configured, the way signals are transferred over those wires, and the radio frequencies computers use. Technology such as WiFi, Bluetooth, and cable standards such as CAT5 and CAT6 all operate at this layer. This layer also includes the hardware part of modems, adapters, and repeaters.
The Data Link layer covers how data is sent from device to device when they are connected on the same local network.
The Network layer describes how data packets are routed between wider networks such as the Internet. Data packet at the network layer is routed from a source IP address to a destination IP address via Domain Name System.
Layers 1 through 3 of the OSI Model are concerned with addressing, packet forwarding, and delivery, establishing basic connectivity. Layer 4, the Transport Layer, focuses on providing the transport services that network applications depend upon. The Transport layer refers to how data is actually transferred. The transport layer handles how the data(files, media, etc) from user/client are split (segmentation), the rate at which the packets are sent, and how errors are handled if data packets don’t make it to the site’s server. The most common transport protocols on the Internet are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).
TCP Three-Way Handshake - Connection Establishment:
Figure: TCP three-way handshake for connection establishment. Client sends SYN, server responds with SYN-ACK, client sends final ACK. Connection state progresses from SYN_SENT → SYN_RECEIVED → ESTABLISHED. TCP ensures reliable, ordered data delivery through sequence numbers and acknowledgments.
When two computers or devices have established connection / started an exchange of information, we call that a session. The Session layer in OSI is responsible for opening, closing, and maintaining sessions. In terms of opening and closing, the session layer includes authentication and authorization measures. For example, without logging in or having the right permissions, you may not be able to connect to parts of a website. But if you are logged in, your access permission is stored for a set amount of time, or session length.
The Presentation layer includes all the methods that convert data into a format usable by an application⬇️. This layer handles functions such as encoding/decoding, encryption/decryption, and compression/decompression of files.
The application layer of the OSI model essentially provides networking options to programs running on a computer. It works almost exclusively with applications, providing an interface for them to use in order to transmit data. The final layer of the OSI model is the Application layer. This layer includes websites, browsers, email, mobile applications, and how they render Internet data so that we can interact with it.
In the Internet protocol suite, the application layer contains the communications protocols and interface methods used in process-to-process communications across an Internet Protocol (IP) computer network. The application layer only standardizes communication and depends upon the underlying transport layer protocols to establish host-to-host data transfer channels and manage the data exchange in a client–server or peer-to-peer networking model. Though the TCP/IP application layer does not describe specific rules or data formats that applications must consider when communicating, the original specification (in RFC 1123) does rely on and recommend the robustness principle for application design. You will hear more often about the TCP/IP model, which is a 4-Abstraction layered model that makes direct reference to current Internet implementations. Its foundational protocols are TCP and IP.
| Feature | OSI Model | TCP/IP Model |
|---|---|---|
| Layers | 7 Layers | 4 or 5 Layers (Network Access, Internet, Transport, Application) |
| Purpose | Conceptual framework, standardized design | Practical, industry-standard, widely implemented |
| Development | Developed by ISO | Developed by ARPA (DOD) |
| Reliability | Connection-oriented (Transport), Connection-less (Network) can be implemented | Both connection-oriented (TCP) and connectionless (UDP) options |
| Protocols | Protocol independent | Protocols are built into the model |
| Focus | Clear separation of services, interfaces, protocols | Less strict separation, more flexible |
| Relevance | Primary reference model for understanding networking | Practical model for Internet communication |
| Interoperability | More rigid due to strict layering | More adaptable, easier for cross-platform communication |
| Security | Security considerations at all layers (conceptual) | Security often implemented at specific layers (e.g., IPSec at Network) |
TCP/IP Model vs OSI Model Layer Mapping:
Figure: Comparison of OSI 7-layer model with TCP/IP 4-layer model. TCP/IP combines OSI's Application, Presentation, and Session layers into a single Application layer, and merges Physical and Data Link into the Network Access layer.
This layer emcompasses group of methods and communications protocols confined to the link that a host is physically connected to i.e the physical interface between the host system and the network hardware. It defines how data packets are to be formatted for transmission and routings. The link is the physical and logical network component used to interconnect hosts or nodes in the network and a link protocol is a suite of methods and standards that operate only between adjacent network nodes of a network segment. The link layer includes the protocols that define communication between local (on-link) network nodes which fulfill the purpose of maintaining link states between the local nodes, such as the local network topology, and that usually use protocols that are based on the framing of packets specific to the link types.
The goal of this layer is to provide reliable communications between hosts connected on a network. Some of the services provided by this layer of the network stack include.
Data Framing - Breaking up the data stream into individual frames in packets. Data frames are groups of data bits at the Link layer that need to be routed to the correct physical location.
Checksums - Sending checksum data for each frame to enable the receiving node to determine whether or not the frame was received error-free/Corruption-free via Frame Check Sequence
Acknowledgment - Sending either a positive (data was received) or negative (data was not received but expected) acknowledgement from receiver to sender to ensure reliable data transmission.
Flow Control - Buffering data transmissions to ensure that a fast sender does not overwhelm a slower receiver.
Includes Various Protocols such as Wired Ethernet IEEE802.3, Wireless LAN IEEE802.11(WIFI), Neighbor Discovery Protocol(NDP), Secure Neighbor Discovery (SEND), Gratuitous ARP(GARP), Point-to-point Protocol(PPP), Media Access Control Protocols I.e Carrier-sense multiple access with collision detection (CSMA/CD) is a media access control (MAC) method used most notably in early Ethernet technology for local area networking. It uses carrier-sensing to defer transmissions until no other stations are transmitting. This is used in combination with collision detection in which a transmitting station detects collisions by sensing transmissions from other stations while it is transmitting a frame. When this collision condition is detected, the station stops transmitting that frame, transmits a jam signal, and then waits for a random time interval before trying to resend the frame. CSMA/CD is a modification of pure carrier-sense multiple access (CSMA). CSMA/CD is used to improve CSMA performance by terminating transmission as soon as a collision is detected, thus shortening the time required before a retry can be attempted.
In Internet Protocol (IP) networks, the MAC address of an interface corresponding to an IP address may be queried with the Address Resolution Protocol (ARP) for IPv4 and the Neighbor Discovery Protocol (NDP) for IPv6, It routes data frames to the correct physical/MAC addresses. A switch (could be your computer or router) keeps track of local devices and their MAC addresses and makes sure data frames get to the correct physical location. Also Reverse Address Resolution Protocol(RARP) Operates here.
This particular layer has several unique security vulnerabilities that can be exploited by a determined adversary.
Wired Networks
✔️ Content Address Memory(CAM)/ MAC Address table exhaustion attack
✔️ Address Routing Protocol(ARP) spoofing
✔️ Dynamic Host Config Protocol(DHCP) starvation
Wireless Networks
✔️ Hidden Node Attack
✔️ De-auth(De-authentication) Attack
Is a Layer of group of Internetworking methods(concepts of connecting multiple networks with each other via gateways), protocols & specifications that are used to transport network packets(IP-based packets) from the ordination host across network boundaries, If necessary to the destination host specified by an Internet protocol address put simply, This is where IP Logical Addressing system and Routing occur. A common design aspect in the internet layer is the robustness principle: "Be liberal in what you accept, and conservative in what you send"
In its operation as a connectionless protocol, the internet layer is not responsible for reliable transmission. It provides only an unreliable service, and best effort delivery. This means that the network makes no guarantees about the proper arrival of packets. This in accordance with the end-to-end principle. Since packet delivery across diverse networks is an inherently unreliable and failure-prone operation, the burden of providing reliability was placed with the end points of a communication path, i.e., the hosts, rather than on the network. This is one of the reasons of the resiliency of the Internet against individual link failures and its proven scalability. The aspect of data integrity function of providing reliability of service is the duty of higher level protocols, such as the (TCP) in the transport layer.
The internet layer has three basic functions: Routing: Is the forwarding of packets from a source host to the next router that is one hop closer to the intended destination host on another network through gateways. For outgoing packets, select the next-hop host (gateway) and transmit the packet to this host by passing it to the appropriate link layer implementation. For incoming packets, capture packets and pass the packet payload up to the appropriate transport layer protocol, if appropriate. Provide Error Detection & Diagnostic Capability. Usually through Internet Control Message Protocol(ICMP) & Internet Group Management Protocol(IGMP)
The transport layer is responsible for delivering data to the appropriate application process on the host computers. The services in this layer are conveyed to an Application Programming Interface through the transport layer protocols, Their services may include the following features. ✔️Connection-Oriented Communication ✔️Same Order Delivery ✔️Reliability through error-detection code I.e Checksum, SYN/ACK ✔️Flow Control Management ✔️Traffic Congestion Avoidance ✔️Multiplexing==>Ports providing multiple endpoints on single node. *Transport Layer Protocols includes also UDP-lite Reliable UDP(RUDP) Multipath TCP Stream Control Transmission Protocol(SCTP) Datagram Congestion Control Protocol(DCCP)
At this layer, the TCP/IP protocol suite defines how different applications on separate hosts establish connections and track communications. Understanding how protocols use ports to establish connections is critical for configuring and supporting network services. Protocols at the Transport layer are concerned with the delivery of multiplexed application data.
A TCP/IP host may be running multiple services/applications or communicating in parallel with multiple servers, clients, and peers. This means that incoming packets must be directed to the appropriate service or application. To facilitate this, each TCP/IP application type is assigned a unique identifier called a Port Number.
A Socket is a software process that identifies a specific endpoint for communication. A connection is formed when a client requests a service from a server using a combination of IP address and port number.
Client IP:Client PORT (e.g., 192.168.1.10:51234)Server IP:Server PORT (e.g., 192.168.1.1:80)A server socket can support multiple connections from a number of client sockets, and a client may open multiple connections to the same server port. Each combination of Source Socket and Destination Socket forms a separate connection, listed in the host's State Table. Server replies are directed to the ephemeral (client) port that opened the connection, allowing data to be received by the correct application on the client.
This includes the opening and closing of sessions, translating data, and the interaction with content at the application level. Here, there are multiple protocols for web content, email, and accessing files, including HTTP, FTP, SMTP, and more.
IPv4 vs IPv6 Header Comparison Summary:
Size & Structure:
Key Field Differences:
Address Length:
Header Checksum:
Fragmentation:
Options Handling:
Quality of Service:
Processing Efficiency:
IPv6 Extension Headers (Chain):
Migration & Coexistence:
Networks in an internetwork must have a way of uniquely identifying each logical network and each individual host within those networks.
Subnetting Calculation Process:
Determine Requirements:
Calculate Host Bits:
Calculate Subnet Bits:
Determine New Prefix Length:
Calculate Subnet Mask:
Magic Number Method:
Identify Subnet Ranges:
VLSM (Variable Length Subnet Mask):
Common Mistakes to Avoid:
SUBNETTING is a logical subdivision of IP network. The process of dividing a network into two or more networks is called subnetting. The main purpose of subnetting is to help relieve network congestion and improve network performance & security. Subnet 1 2 4 8 16 32 64 128 256 Host 256 128 64 32 16 8 4 2 1 S.Mask /24 /25 /26 /27 /28 /29 /30 /31 /32
The 1s in the mask are always contiguous. For example, this mask is valid: 11111111 11111111 11111111 00000000 But the following string is not a valid mask: 11111111 00000000 11111111 00000000
An IPv4 address represents both a Network ID and a Host ID. A 32-bit Network Mask (netmask) is used to distinguish these two components within a single IP address. The mask "conceals" the host ID portion, thereby revealing the network portion.
The scheme of using rigid octet boundaries (Classful addressing) is inflexible, so a system of dividing networks into subnetworks was devised.
/24 (255.255.255.0) network like 198.51.100.0/24 allows $2^8 - 2 = 254$ possible host IDs.198.51.100.0/24 into /28 subnets (using a subnet mask of 255.255.255.240):
198.51.100.0/28 (Hosts 1-14, Network 0, Broadcast 15)198.51.100.16/28 (Hosts 17-30, Network 16, Broadcast 31)198.51.100.32/28 (Hosts 33-46, Network 32, Broadcast 47)198.51.100.48/28 (Hosts 49-62, Network 48, Broadcast 63)198.51.100.0/24). Hosts within the same larger network use the longer subnet mask to differentiate the subnets.When designing an IPv4 addressing scheme, it's essential to consider:
Fundamental Rules for IP Addressing:
IP command-line utilities enable you to gather information about how your systems are configured and how they communicate over a TCP/IP network.
These settings can be configured statically or dynamically (DHCP).
Windows Configuration Methods:
netsh commands from the legacy command prompt interface. netsh interface ip show config will report the IP configuration. Changes made with netsh are typically persistent.Get-NetAdapter and Get-NetIPAddress can be used to query the existing configuration.New-NetIPAddress or Set-NetIPAddress can be used to apply a new configuration or modify an existing one.Internet Access for Private Networks:
169.254.1.1 to 169.254.254.254 range (169.254.0.0/16). The first and last subnets within this range are typically unused.255.255.255.255 is used to broadcast to the local network when the local network address is unknown.Before the widespread use of netmasks (subnet IDs) to identify the network ID portion of an address, Classful Addressing allocated a network ID based on the first octet of the IP address.
0.0.0.0/0: The "unspecified address" used when a specific IP address is unknown, typically as a source when a client is seeking a DHCP lease.| Class | First Octet Range | Default Subnet Mask | Common Use |
|---|---|---|---|
| A | 1-126 | 255.0.0.0 | Large networks |
| B | 128-191 | 255.255.0.0 | Medium-sized networks |
| C | 192-223 | 255.255.255.0 | Small networks |
| D | 224-239 | N/A (Multicast) | Multicast |
| E | 240-255 | N/A (Reserved) | Research/Reserved |
Reserved IP Ranges (Classful Legacy):
224.0.0.0 - 239.255.255.255): Used for multicasting.240.0.0.0 - 255.255.255.255): Reserved for testing and experimental use.127.0.0.0 - 127.255.255.255 or 127.0.0.0/8):
CIDR was designed to solve two major problems with classful addressing:
CIDR collapsed routing entries into one single entry, simplifying the information Internet routers needed to locate networks. Unlike classful addressing, CIDR does not determine the network mask based on the first octet of the IP address.
198.51.101.0/24, 198.51.102.0/24, etc.) can be summarized as 198.51.100.0/22 (a "supernet prefix")./22 prefix, so the complexity of the LAN's subnets is hidden and doesn't clog up their routing tables./24 prefix or multiple prefixes to create subnets of different sizes./24 vs. /28)./30 prefix is often selected for router-to-router links (2 bits remaining for host IDs, $2^2 - 2 = 2$ usable addresses, one for each router interface).VLANs are a Layer 2 mechanism to address the contention dilemma when too many hosts are attached to the same switch, as excessive broadcast traffic can reduce performance.
The core function of IP is to facilitate the creation of a group of distinct but interconnected networks, referred to as the "Internetwork." This means that packets addressed to hosts on remote networks must be forwarded via one or more intermediate systems that establish routing between networks.
Nodes within each subnet can see one another directly (they are in the same broadcast domain), but they can only communicate with nodes in other subnets via a router.
Within each subnet or broadcast domain, nodes use MAC addresses to forward frames to one another. TCP/IP includes the ARP protocol to perform the task of resolving an IP address to a hardware (MAC) address.
198.51.100.0/28, 198.51.100.1 might be the default gateway.ARP Request/Reply Sequence - MAC Address Discovery:
Figure: ARP protocol operation showing MAC address discovery process. Host A broadcasts ARP request asking "Who has IP 192.168.1.20?", Host B (owner of that IP) responds with unicast ARP reply containing its MAC address DD:EE:FF:44:55:66. Both hosts cache the mapping to avoid future ARP requests. Essential for Layer 2 frame forwarding within the same subnet.
These techniques define how an IP packet addresses its recipient(s).
FF:FF:FF:FF:FF:FF), meaning there is also a broadcast domain scope at Layer 2.224.0.0.0 to 239.255.255.255) configured for use with multicast groups.01:00:5E:xx:xx:xx).ICMP is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send Error Reporting, Diagnostic Functions and operational information indicating success or failure when communicating with another IP address. This errors are directed to the source IP address of the originating packet. for example, an error is indicated when a requested service is not available or that a host or router could not be reached. Internet Control Message Protocol version 6 (ICMPv6) is the implementation of the Internet Control Message Protocol (ICMP) for Internet Protocol version 6 (IPv6)
IGMP is a communications protocol used by hosts and adjacent routers on IPv4 networks to establish multicast group memberships. IGMP is an integral part of IP multicast and allows the network to direct multicast transmissions only to hosts that have requested them. IGMP is used on IPv4 networks. Multicast management on IPv6 networks is handled by Multicast Listener Discovery (MLD) which is a part of ICMPv6 in contrast to IGMP's bare IP encapsulation. Through IGMP Snooping, routers (and Layer 2 switches capable of snooping) become multicast-aware of IGMP group membership requests. This allows them to avoid flooding multicast transmissions out of all ports (treating them like broadcasts), thereby conserving bandwidth and reducing unnecessary traffic for hosts not interested in the multicast stream.
| Field | Bits (Offset) | Description |
|---|---|---|
| Type | 8 (0-7) | Identifies the ICMPv6 message type. |
| Code | 8 (8-15) | Provides more specific information about the message type. |
| Checksum | 16 (16-31) | For error-checking. In ICMPv6, it includes a pseudo-header (from the IPv6 header) for more robust error detection. |
| Message Body | Variable | Contains the specific information related to the message type (e.g., unreachable code, router advertisement data). |
The ICMPv6 protocol must limit the number of error messages sent to the same destination to avoid network overload.
0. Source & Destination Address
0. Hop Limit – Replaces the TTL field in IPv4 but performs the same function
0. Traffic Class – Describes the packet's priority
0. Flow Label – Used for Quality of Service (QoS) management, useful for real-time streams. Set to 0 for packets not part of any delivery sequence or structure
0. Payload Length – Indicates the length of the packet payload, up to a maximum of 64 kilobytes.For flows where the payload is bigger than that, this field is ignored and a special Jumbo Payload (up to 4GB) option is established
0. Next Header – Describes what the next extension header (if any) is or where the actual payload begins.Also tells the destination host/router how to interpret the data that follows the header.The extension headers replace the Options field in IPv4 and cover functions such as:
• Fragmentation
• Reassembly
• Security (e.g., AH, ESP)
• Source Routing
IPv6 routers do not perform IP fragmentation. IPv6 hosts are required to do one of the following: perform Path MTU Discovery, perform end-to-end fragmentation, or send packets no larger than the default maximum transmission unit (MTU), which is 1280 octets.
IPv6 is the most recent version of the Internet Protocol, designed to replace IPv4 due to the exhaustion of IPv4 addresses. It uses 128-bit addresses, providing a significantly larger address space than IPv4's 32-bit addresses. This expansion allows for connecting a vast number of devices to the internet, including the increasing number of Internet of Things (IoT) devices.
Key Features and Benefits: • Larger Address Space: IPv6 provides a theoretical address pool of 340 undecillion addresses, compared to IPv4's 3.7 billion. • Improved Routing: IPv6 simplifies routing headers, uses hierarchical addressing, and enables more efficient routing through techniques like summary routes and route aggregation. • No Need for NAT: IPv6 eliminates the need for Network Address Translation (NAT), as devices have their own unique public IPv6 addresses. • Enhanced Security: IPv6 includes built-in authentication and privacy support. • Auto-configuration: IPv6 allows for automatic address configuration, simplifying network setup. • Improved Multicast Routing: IPv6 provides better support for multicast routing. • Flow Labeling: IPv6 supports flow labeling, a mechanism for marking network packets with specific quality of service (QoS) requirements. Transition to IPv6: • The transition to IPv6 is a global effort, with major ISPs and network equipment manufacturers supporting it. • The transition is expected to be gradual, with many organizations continuing to use IPv4 for the time being. It's important to ensure that devices and applications are IPv6-compatible to avoid potential connectivity issues during the transition.
The IPv6 header is streamlined and differs significantly from IPv4.
0 for packets not part of any specific delivery sequence or structure.0, and a Jumbo Payload option (up to 4 GB) is established in an extension header.Extension Headers replace the Options field in IPv4 and cover various functions such as:
The IPv6 packet structure is simplified, even though the headers are larger (40 bytes compared to IPv4's 20-60 bytes).
IPv6 addresses are 128 bits long and are typically represented in hexadecimal notation (16 bytes). Each double-byte (16 bits) number is expressed as 4 hexadecimal digits. ADDRESS FORMAT: HEXADECIMAL means 16-bit representation - Double-Octet / byte (1Byte = 8bits)With each double-octet field expressed as 4 hex digits
Example: ABCD:0183:F2C6:2C4F:3B2D:A6F5:F53C:2605
To make IPv6 addresses easier to read and write, compression rules are used:
0183 becomes 183).0000) can be replaced by a double colon (::).
2001:db8:0000:0000:0abc:0000:defo:1234 can be compressed to 2001:db8::abc:0:defo:1234.[] because both the URL and IPv6 address use colon delimiters for different purposes.
http://[2001:db8::1]/index.html2001:db8:0000:0000:0abc:0000:ABCD:1234 Compressed as: 2001:db8::abc:0:ABCD:1234IPv6 uses 128-bit addresses, providing an exponentially larger address space than IPv4.
2000::/3.FE80::/10. Not routable.FC00::/7 or FD00::/8.FF00::/8.Prefix/Length: IPv6 network addresses are written using classless inter-domain routing (CIDR) notation, where /N is the length of the network prefix in bits.Networks are likely to run both IPv4 and IPv6 in some or all parts of the infrastructure. Transition mechanisms ensure interoperability.
2002::/16) for addresses assigned to 6to4 interfaces, which includes a representation of the IPv4 address.In IPv6, an interface must always be configured with a link-local address (one for each link), even if it also has a globally unique address. One or more routable addresses can be assigned in addition to the link-local address.
The 64-bit Interface ID, which is the host portion of an IPv6 address, can be determined using two main techniques:
FF:FE is inserted in the middle, and the 7th bit (Universal/Local bit) is inverted.IPv6 supports multicast. The components of a multicast address (ff00::/8) are subdivided as follows:
ff (First 8 bits): Indicate that the address is within the multicast scope (11111111).1 (0001): Node-Local (to all interfaces on the same node).2 (0010): Link-Local (to all nodes on the same link).5 (0101): Site-Local (deprecated).E (1110): Global.The Multicast Listener Discovery (MLD) protocol allows nodes to form a multicast group and discover whether members of a group are present on a local subnet. Well-known multicast addresses are reserved for specific functionality (e.g., ff02::1 for all nodes, ff02::2 for all routers). Hosts use an appropriate multicast address to communicate with groups.
No Broadcast Addressing in IPv6: IPv6 does not implement broadcast addresses. Multicast addresses are used instead for functionalities that would have used broadcasts in IPv4.
ICMPv6 is an updated version of ICMP (ICMPv4) with new features.
What is An RFC "Request for Comments" is a publication from the Internet Society (Internet Engineering Task Force) and are the official documents of Internet specifications, protocols, procedures. Leading zeros must be removed in each hextet (16-bit segment)/double-octet Rules for Shortening IPv6 Addresses: • :: Must be used to shorten the longest contiguous string of all 0 hextets. • If there is only one hextet of all zeros, it can also be shortened to ::. • If there are two equal length choices of all 0 hextets, use :: to shorten the one on the left. • Hexadecimal characters must be written using lower case (a-f).
INTERFACE ID (Known as EUI-64) Where MAC Address = 48-bit →→ Converted to 64-bit Can be determined using 2 techniques:
A relatively simple translation mechanism allows driver software to create a 64-bit Interface ID (EUI-64) from the MAC address by inserting 16 bits (FFFE) in the middle. • Also known as: • MAC-Derived Address • Interface Identifier • EUI-64 HOW [EUI-64] IS CREATED FROM MAC ADDRESS + fffe [16 bits] Consider a MAC Address 00:0c:29:ab:1c:2d (Example MAC Address). The MAC address is split into halves, and modified into EUI-64 by inserting a known constant 16bits (hexadecimal) of FFFE. Consider a MAC Address b4:45:5a:1c:2d:3f Split into halves: b4:45:5a and 1c:2d:3f Insert FFFE: b4:45:5a:ff:fe:1c:2d:3f 7th bit of the first octet (b4 in binary is 1011 0100): 1 Flipping the 7th bit: 0 Binary after flipping: 1011 0000 Hexadecimal after flipping: b0 Therefore EUI-64 = b045:5aff:fe1c:2d3f 64 bit long.
EUI stands for Extended Unique Identifier: Modified EUI-64 is a method of converting a MAC Address (48 bits) into a 64-bit Interface Identifier [which then becomes the "host portion" of a /64 IPv6 Address]. How to Convert the MAC Address to a Modified EUI-64: 0. Divide the MAC Address in half: 12:34:56 and 78:90:AB (Example: 1234.5678.90AB) 0. Insert FFFE in the middle: 12:34:56:FF:FE:78:90:AB 0. Invert the 7th bit: The 7th bit (Universal/Local bit) of the first octet is inverted. Example: If the first octet is 12 (binary 00010010), inverting the 7th bit (from the left, starting at 1) results in 00010110, which is 16 in hexadecimal. So, 12:34:56:FF:FE:78:90:AB becomes 16:34:56:FF:FE:78:90:AB. WHY INVERT the 7th bit? Because MAC Addresses can be divided into 2 types: UNIVERSALLY ADMINISTERED ADDRESS (UAA) - Uniquely assigned to the device by the manufacturer. LOCALLY ADMINISTERED ADDRESS (LAA) - Manually assigned by an administrator (MAC Address). You can identify a UAA / LAA by its 7th bit of the MAC address, called the U/L bit (Universal/Local bit). U/L bit set to 0 → UAA (in MAC address) means the EUI-64 Interface ID was derived from a UAA. U/L bit set to 1 → LAA (in MAC address) means the EUI-64 Interface ID was derived from a LAA. IN the context of IPv6 addresses and EUI-64, the meaning of the U/L bit is reversed. Therefore: U/L bit set to 0 (in EUI-64) → Indicates a Universally Administered Address (derived from a UAA MAC). U/L bit set to 1 (in EUI-64) → Indicates a Locally Administered Address (derived from a LAA MAC).
The client uses a false pseudo-random number for the Interface ID. ⚠️ Why? The first method has privacy concerns, because the Interface Identifier exposes the MAC, making the host uniquely identifiable and trackable on the internet. 🔐 Using a token (random Interface ID) mitigates this to some degree.
Network addresses are written using Classless Notation, where /nn is the length of the network prefix in bits. Within the /64-bit network IP — as with IPv4 subnets — the length of any given network prefix is used to determine whether two addresses belong to the same network, within that bit-limit, including the subnet as well. IPv6 multicast addressing has features and protocols in common with IPv4 multicast, but also provides changes and improvements by eliminating the need for certain protocols. IPv6 does not implement traditional IP broadcast, i.e. the transmission of a packet to all hosts on the attached link using a special broadcast address, and therefore does not define broadcast addresses. In IPv6, the same result is achieved by sending a packet to the link-local all nodes multicast group at address ff02::1, which is analogous to IPv4 multicasting to address 224.0.0.1. • UNICAST ADDRESSES: Used for one source to a single destination. • MULTICAST ADDRESSES: Used for one source to multiple destinations (that joined the specific Multicast Group). The Destination-IP-Address is configured from a special range for use within the Multicast Group. • ANYCAST ADDRESSES: Used for "one source" to "one of many destinations" (the nearest one).
UNICAST ADDRESSING (OR NETWORK ADDRESSING) In IPv6, unicast addressing is scoped — it’s tied to a region of the network. There are 3 common types: 0. Global Unicast Addressing 0. Link-Local Addressing (Private Addressing) 0. Unique Local Addressing
The equivalent of public IPv4 addresses. These are public addresses which can be used over an internetwork. NOTE: They are globally unique and allow for regular routing across the internet. Originally defined as the 2000::/3 block, encompassing addresses from 2000:: to 3FFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF. However, now defined as all addresses that do not fall within other reserved prefixes. Example: 2001:0DB8:8B00:0001:0000:0000:0000:0001/64 • The first 3 bits indicate that the address is within the global scope.Globally scoped unicast addresses start with 2 (0010) or 3 (0011). • 48-bit Global Routing Prefix: Assigned by IANA to the ISP, are allocated hierarchically to regional registries → ISPs → End-users. • 16-bit Subnet Identifier: Used by the organization to create various subnets or identify site-specific subnet addresses. • 64-bit Interface Identifier: Specified by the organization to identify the host portion of the address. Custom Routing Prefix + Subnet breakdown:
| 3-bit Network ID | 45-bit Global Routing Prefix | 16-bit Subnet ID | 64-bit Interface ID |
|---|---|---|---|
| ➡️ Total: 128-bit IPv6 Global Unicast Address |
These are private addresses which cannot be used over the Internet. They do not necessarily need to be globally unique since they are used freely within internal networks. Cannot be routed over the Internet. Packets destined for a unique local address will be dropped by the ISP. Uses the block FC00::/7 (FC00:: to FDFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF); however, a later update requires the 8th bit to be set to 1, so the first two digits will be FD. Ranges are FD00::/8 to FDFF::/8. Example: FD45:93AC:8A8F:0001:0000:0000:0000:0001/64 • 8-bit Prefix: Indicates a Unique Local Address (FD::/8). • 40-bit Global ID: Randomly generated. • 16-bit Subnet Identifier: Used by the organization for subnetting. • 64-bit Interface Identifier: Assigned to the host.
Refers to addresses that are used for communication within a single link (subnet). Automatically generated on IPv6-enabled interfaces. Use command ipv6 enable on an interface (under interface configuration mode) to enable IPv6 on that interface. Uses the address block FE80::/10 (FE80:: to FEBF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF). However, the standard states that the 54 bits after FE80::/10 should be all 0 initially, and the last 64 bits form the interface identifier. Similar to the Global Unicast Address, the Host 64-bit / Interface-ID is generated using the Modified EUI-64 format. Link-Local: Routers will not route packets with a Link-local destination IPv6 address, but they can be used for routing protocol peerings (OSPF uses Link-local addresses for Neighbor adjacencies) and for Static Routes as next-hop addresses. Also used by Neighbor Discovery Protocol to discover nodes and routers on the local link. ✅ No need for ARP or MAC-to-IP mapping tricks in IPv6. • Nodes on the same subnet are referred to as neighbors • Link-local range: fe80::/10 • Starts with fe80 • Prefix: 1111 1110 10 → 54-bit prefix • Next 54 bits set to 0 • Last 64 bits are the Interface ID Think of it as the IPv6 equivalent of IPv4’s APIPA (Automatic Private IP Addressing) → 169.254.0.0/16
However, unlike IPv4, an IPv6 host is always configured with a link-local address (one for each interface), even if it also has a globally unique address. According to OS behavior, a link-local address is also appended with a Zone Index or Scope ID, in the form: • %1 on Windows • or an interface name like eth0 on Linux/macOS 📌 This is used to determine the source of the address and bind the traffic to a specific interface
• Uses special address ranges starting with ff__::/8
• Common link-local multicast: ff02::/16
Multicast scope and type is embedded in the address structure:
| 8 bits (Prefix) | 4 bits (Flags) | 4 bits (Scope) | 112 bits (Group ID) |
|---|---|---|---|
| ff | Flags (0000) | Scope (e.g. 1, 2) | Group Identifier |
• First 8 bits: Always 1111 1111 (ff) → Indicates multicast address
• Next 4 bits (Flags): Specify multicast type or behavior
• Next 4 bits (Scope): 🧠 Well-known Multicast Addresses are used for specific purposes (like all-routers or all-nodes groups). For example:
• 0001 → Node-local (all interfaces on the same node) -> ff02::1 — All nodes on the local link
• 0010 → Link-local (on the same subnet or link) -> ff02::2 — All routers on the local link
• Final 112 bits: Define the multicast group within that scope
A new feature of IPv6 whereby ONE source communicates with one of multiple destinations. Anycast means that a group of multiple routers are configured with the same IPv6 address. They make use of a Routing protocol to advertise the address and a Prioritization Algorithm & various Metrics to forward packets to the Destination Address (anycast group). Routers will forward packets to its nearest router configured with that Anycast Group IP Address based on the Routing protocol's prioritization & metrics. There is no specific address range for Anycast Addresses. They use a regular Unicast address (Global Unicast or Unique Local) and specify it as an anycast Group Address. This is configured using the "anycast" keyword. Example: Router(config-if)# ipv6 address 2001:db8:1:1::99 /128 anycast Notice the use of a /128 prefix with a Global Unicast address being configured as anycast.
• Multicast addresses are reserved to replace the functionality of broadcast addresses (which do not exist in IPv6).
• Instead of broadcasting, IPv6 hosts use appropriate multicast addresses to reach multiple devices on a local subnet.
@ * Unspecified Address ::= ::/128: Used for when a host hasn't obtained a valid address yet. @ IPv6 Default Routes: Are configured as ::/0, which is the IPv6 equivalent of IPv4's 0.0.0.0/0. @ * Loopback Address ::= ::1/128: Resolves to test the loopback TCP/IP protocol stack on the local device. Messages sent to this address are processed within the local device, but not sent to other devices. This is the IPv6 equivalent of IPv4's 127.0.0.1.
NB: An IPv6 Solicited-Node multicast Address is calculated from a Unicast Address (typically Link-Local). The format is ff02::1:ff followed by the last 24 bits (6 hexadecimal digits) of the Unicast Address. Example: If a Unicast Address is fe80::aabb:ccdd:eeff, its Solicited-Node multicast address would be ff02::1:ffaa:bbcc:eeff.
Note: IPv6 defines Multicast scopes which indicate how far the packets should be forwarded. The addresses starting with "FF02::" are Link-Local Scope. The Internet Protocol Version 6 (IPv6) address prefixes [FE80::/10 and FF02::/16] are not routable over the public internet. [FE80::/10] are Link-Local Unicast addresses, and [FF02::/16] are Link-Local Multicast addresses. Likely the [FC00::/7] range used for Unique Local Unicast addressing are globally not routable outside the organization's internal network.
The MLD protocol allows nodes to Join a multicast group && Discover whether other members of a multicast group are present on the link
Neighbor Discovery Protocol (NDP): Is a protocol used with IPv6. It replaces ARP (which is no longer used in IPv6) and performs the ARP-like function. NDP uses ICMPv6 messages and solicited-node multicast addresses to learn the MAC address of other hosts (ARP in IPv4 uses broadcast messages). Two key message types are within NDP: 0. Neighbor Solicitation (NS) + ICMPv6 Type135: • Source IP: The IPv6 address of the node sending the solicitation. • Destination IP: The Solicited-Node multicast address of the target IPv6 address. • Destination MAC: A multicast MAC address based on the destination IPv6 address. 0. Neighbor Advertisement (NA) + ICMPv6 Type 136: • Source IP: The IPv6 address of the node sending the advertisement. • Destination IP: The IPv6 address of the node that sent the Neighbor Solicitation (Unicast). • Destination MAC: The unicast MAC address of the node that sent the Neighbor Solicitation.
Routers on the local network communicate via two main message types within NDP: 0. Router Solicitation (RS) = ICMPv6 Type 133: • Sent to Multicast address FF02::2 (All Routers). • Sent when an interface is enabled/a host is connected to the network. • Allows hosts to automatically discover routers on the local network. 0. Router Advertisement (RA) = ICMPv6 Type 134: • Sent to Multicast Address FF02::1 (All Nodes). • Sent periodically even if the router hasn't received an RS message. • Sent in response to RS messages. • Contains the IPv6 network prefix(es) allocated to the local link, default router information, and other configuration parameters. • Facilitates Stateless Address Autoconfiguration (SLAAC).
IPv6 Address Allocation Methods: • SLAAC (Stateless Address Autoconfiguration) in IPv6: • Hosts use the RS/RA messages to learn/discover the known IPv6 Network prefix(es) that have been allocated to the Network Segment of the local link, then automatically generate an IPv6 address. • Using EUI-64 or a privacy extension, the device generates its own interface ID. • The device does not rely on a stateful server like DHCPv6 for address assignment. • Using the "ipv6 address /prefix-length eui-64" command, you manually enter the prefix. • Using the "ipv6 address autoconfig" command, you don't need to enter the prefix; the device uses NDP to learn the prefix used on the local link. The devices will use EUI-64 to generate the Interface ID, or a pseudo-randomly generated number. • Stateful DHCPv6: • Hosts explicitly request IPv6 addresses and other configuration parameters from a DHCPv6 server. • The DHCPv6 server maintains state information about the addresses it has assigned. • Static Allocation: • IPv6 addresses are manually configured on the host.
Allows hosts to check if other devices on the local link are using the same IPv6 Address. DAD Uses 2 Messages (NS & NA). DAD is performed any time an IPv6 enabled interface initializes or an IPv6 address is configured on an interface (SLAAC/Manual). The Host will send an NS to its own IPv6 address [Solicited-Node Multicast] to perform DAD: • If it doesn't get a Reply, it knows the address is Unique. • If it gets a reply, it means another host on the network is already using the address.
| Prefix / Address | Name / Scope | Description | IPv4 Equivalent |
|---|---|---|---|
fe80::/10 | Link-local (Unicast) | Used on the local subnet; not forwarded by routers | 169.254.0.0/16 (APIPA) |
::/128 | Unspecified Address | A host that has not yet obtained an address | 0.0.0.0 |
::1/128 | Loopback Address | Used to test the local host (loopback interface) | 127.0.0.1 |
ff00::/8 | Multicast (Internetwork Scope) | General prefix for multicast addresses | N/A (IPv4 used broadcast) |
ff02::1 | All Nodes (Link-local Multicast) | Replaces broadcast; reaches all nodes on local link | 255.255.255.255 (limited use) |
ff02::2 | All Routers (Link-local Multicast) | Used to reach all routers on the local link | N/A |
ff02::1:ffXX:XXXX | Solicited-node Multicast | Used for NDP (Neighbor Discovery Protocol) to find link-layer addresses | ARP equivalent |
::/0 | Default Route | Represents the default gateway | 0.0.0.0/0 |
| IPv6 Multicast Address | IPv4 Equivalent | Multicast Scope | Description | Notes |
|---|---|---|---|---|
FF01::X/16 | N/A | Node/Interface-Local | Used to send traffic to a service within the local interface/host. | Packet doesn't leave the local host. The Node/Interface-local multicast [FF01::/16] addresses are only used on the interface itself. |
FF02::1/16 | 224.0.0.1 | Link-Local | All Nodes/Hosts | Functions as a Broadcast. Refers to its use in the local subnet. Routers will not route these packets between subnets. |
FF02::2/16 | 224.0.0.2 | Link-Local | All Routers | Hello messages. |
FF02::5/16 | 224.0.0.5 | Link-Local | All OSPF Routers | Multicast message. |
FF02::6/16 | 224.0.0.6 | Link-Local | All OSPF DR/BDRs | Multicast message. |
FF02::9/16 | 224.0.0.9 | Link-Local | All RIP Routers | Multicast message. |
FF02::A/16 | 224.0.0.10 | Link-Local | All EIGRP Routers | Multicast message. |
FF05::X/16 | N/A | Site-Local | N/A | Packets can be forwarded by Routers but should be limited to a small physical location. |
FF08::X/16 | N/A | Organization-Local | N/A | Wider in scope than site-local, covering an entire company (organization). |
FF0E::X/16 | N/A | Global | N/A | No boundaries, possible to be routed over the Internet. ROUTABLE |
| Address Type | Prefix/Range (Hex) | Description | IPv4 Equivalent (Conceptual) |
|---|---|---|---|
| Global Unicast | 2000::/3 (2xxx::/3 to 3xxx::/3) | Routable over the internet, similar to public IPv4 addresses. Assigned hierarchically by IANA, RIRs, ISPs, and then to end-users. Begins with 2 or 3. | Public IPv4 Addresses |
| Link-Local Unicast | fe80::/10 | Spans a single subnet (they are not forwarded by routers). Nodes on the same link are referred to as neighbors. Each IPv6 interface must always be configured with a link-local address. Equivalent to IPv4 APIPA (169.254.0.0/16). | APIPA (169.254.0.0/16) |
| Multicast | ff00::/8 (ff02::/16 for link-local multicast) | Used for one-to-many communication within an internetwork or link-local scope. Replaces broadcast addressing (which is not implemented in IPv6). | IPv4 Multicast (e.g., 224.0.0.0/4) |
| Solicited-Node Multicast | ff02::1:ff00:0/104 | A special multicast address automatically created for each unicast or anycast address assigned to an interface. Used for Neighbor Discovery (NDP) to perform address resolution and duplicate address detection without broadcasting. | Part of ARP functionality (but without broadcasts) |
| Unspecified Address | ::/128 (0:0:0:0:0:0:0:0) | Represents the absence of an address. Used as a source address when a host has not yet obtained a valid address (e.g., during DAD). | 0.0.0.0 |
| Unique-Local Address | fc00::/7 to fd00::/7 | Similar to IPv4 private addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). Used for private networks that are not meant to be routed on the internet. Has a larger random component than site-local addresses (now deprecated). | Private IPv4 Addresses |
| Loopback Address | ::1/128 | Used for testing the loopback TCP/IP stack on the local host. | 127.0.0.1 |
| All-Nodes Multicast | ff02::1 | A link-local scope multicast address for all IPv6 devices on a local link. Equivalent to IPv4 limited broadcast. | 255.255.255.255 (limited broadcast) |
| All-Routers Multicast | ff02::2 | A link-local scope multicast address for all IPv6 routers on a local link. Used by hosts to find routers via Router Solicitation messages. | Part of router discovery functionality |
| DHCP Multicast | ff02::1:2 | Used by DHCPv6 clients to discover DHCPv6 servers. | Part of DHCP discovery functionality |
IPv6 provides other technical benefits in addition to a larger addressing space. In particular, it permits hierarchical address allocation methods that facilitate route aggregation across the Internet, and thus limit the expansion of routing tables. The use of multicast addressing is expanded and simplified, and provides additional optimization for the delivery of services. Device mobility, security, and configuration aspects have been considered in the design of the protocol. It simplifies aspects of address configuration, network renumbering, and router announcements when changing network connectivity providers. It simplifies processing of packets in routers by placing the responsibility for packet fragmentation into the end points. The IPv6 subnet size is standardized by fixing the size of the host identifier portion of an address to 64 bits.
The addressing architecture of IPv6 allows three different types of transmission: unicast, anycast and multicast. IPv6 is not foreseen to supplant IPv4 instantaneously. Both protocols will continue to operate simultaneously for some time. Therefore, IPv6 transition mechanisms are needed to enable IPv6 hosts to reach IPv4 services and to allow isolated IPv6 hosts and networks to reach each other over IPv4 infrastructure.
On the Internet, data is transmitted in the form of network packets. IPv6 specifies a new packet format, designed to minimize packet header processing by routers. Because the headers of IPv4 packets and IPv6 packets are significantly different, the two protocols are not interoperable. IPv6 does not implement traditional IP broadcast, i.e. the transmission of a packet to all hosts on the attached link using a special broadcast address, and therefore does not define broadcast addresses. The results are achieved using multicasting, because it does not support the broadcast addressing method, on which the functionality of the Address Resolution Protocol (ARP) in IPv4 is based. IPv6 implements the Neighbor Discovery Protocol (NDP) in the link layer, which relies on ICMPv6 and multicast transmission
Both IPv4 and IPv6 addresses are ultimately represented in binary, although you'll commonly see them in decimal (IPv4) or hexadecimal (IPv6) format for convenience. Each segment (octet in IPv4, hextet in IPv6) ultimately represents 8 bits of binary.
The Transmission Control Protocol provides a communication service at an intermediate level between an Application program & the Internet Protocol. It provides host-to-host connectivity at the transport layer of the Internet model. At the transport layer, TCP handles all handshaking and transmission details and presents an abstraction of the network connection to the application typically through a network socket interface.
At the lower levels of the protocol stack(I.e IP), due to network congestion, traffic load balancing, or unpredictable network behaviour, IP packets may be lost, duplicated, or delivered out of order. TCP detects these problems, requests re-transmission of lost data, rearranges out-of-order data and even helps minimize network congestion to reduce the occurrence of the other problems. If the data still remains undelivered, the source is notified of this failure. Once the TCP receiver has reassembled the sequence of octets originally transmitted, it passes them to the receiving application. Thus, TCP abstracts the application's communication from the underlying networking details.
TCP is optimized for accurate delivery rather than timely delivery and can incur relatively long delays (on the order of seconds) while waiting for out-of-order messages or re-transmissions of lost messages. TCP is a reliable stream delivery service which guarantees that all bytes received will be identical and in the same order as those sent. Since packet transfer by many networks is not reliable, TCP achieves reliability using a technique known as Selective Acknowledgement(SACK) with Re-Transmission or Duplicate Cumulative Acknowledgements (DupAcks) with Retransmission Timeout(RTO). This requires the receiver to respond with an acknowledgement message as it receives the data. The sender keeps a record of each packet it sends and maintains a timer from when the packet was sent. The sender re-transmits a packet if the timer expires before receiving the acknowledgement. The timer is needed in case a packet gets lost or corrupted.
While IP handles actual delivery of the data, TCP keeps track of segments - the individual units of data transmission that a Data Stream is divided into for efficient routing through the network. Processes transmit data by calling on the TCP and passing buffers/streams of data as arguments. The TCP packages the data from these buffers into segments and calls on the internet module [e.g. IP] to transmit each segment to the destination TCP. For example, when an HTML file is sent from a web server, the TCP software layer of that server divides the file into segments and forwards them individually to the internet layer in the network stack. The internet layer software(IP) encapsulates each TCP segment into an IP packet by adding a header that includes (among other data) the destination IP address. When the client program on the destination computer receives them, the TCP software in the transport layer re-assembles the segments and ensures they are correctly ordered and error-free as it streams the file contents to the receiving application.
Transmission Control Protocol is a connection-oriented protocol and requires handshaking to set up end-to-end communications. Once a connection is set up, user data may be sent bi-directionally over the connection. User Datagram Protocol is a simpler message-based connectionless protocol. Connectionless protocols do not set up a dedicated end-to-end connection. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver. Reliable – TCP manages message acknowledgment, retransmission and timeouts. Multiple attempts to deliver the message are made. If data gets lost along the way, data will be re-sent. In TCP, there's either no missing data, or, in case of multiple timeouts, the connection is dropped. Unreliable – When a UDP message is sent, it cannot be known if it will reach its destination; it could get lost along the way. There is no concept of acknowledgment, retransmission, or timeout. Ordered – If two messages are sent over a connection in sequence, the first message will reach the receiving application first. When data segments arrive in the wrong order, TCP buffers the out-of-order data until all data can be properly re-ordered and delivered to the application. Not ordered – If two messages are sent to the same recipient, the order in which they arrive cannot be guaranteed. Heavyweight – TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. Lightweight – There is no ordering of messages, no tracking connections, etc. It is a very simple transport layer designed on top of IP. Streaming – Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries. Datagrams – Packets are sent individually and are checked for integrity on arrival. Packets have definite boundaries which are honored upon receipt; a read operation at the receiver socket will yield an entire message as it was originally sent. TCP is used extensively by many internet applications, including the World Wide Web (WWW),HTTP email, File Transfer Protocol, Secure Shell, peer-to-peer file sharing, and streaming media. No congestion control – UDP itself does not avoid congestion. Congestion control measures must be implemented at the application level or in the network. Broadcasts – being connectionless, UDP can broadcast - sent packets can be addressed to be receivable by all devices on the subnet. Multicast – a multicast mode of operation is supported whereby a single datagram packet can be automatically routed without duplication to a group of subscribers.
The use of sequencing, acknowledgments, and retransmission means that TCP requires numerous header fields to keep track and maintain state information. A TCP segment encapsulates application layer data.
| Field Name | Size (Bytes) | Description |
|---|---|---|
| Source Port | 2 | Identifies the sending application. |
| Destination Port | 2 | Identifies the receiving application. |
| Sequence Number (Seq #) | 4 | The identification of the first byte of the current segment in the data stream. Allows the receiver to reassemble messages correctly and deal with out-of-order packets. |
| Acknowledgment Number (Ack #) | 4 | The Sequence Number of the next segment expected from the other host (i.e., the Sequence Number of the last segment received +1). Lack of acknowledgment (due to delays) or Negative Acknowledgment (NACK for lost/damaged packets) forces retransmission. |
| Data Offset | 4 bits | Specifies the size of the TCP header. |
| Reserved | 6 bits | Reserved for future use. |
| Flags | 1 byte | Contains control bits such as ACK (Acknowledgment), SYN (Synchronize sequence numbers - for connection initiation), FIN (Finish - for connection termination), RST (Reset - for abrupt termination). |
| Window | 2 | The amount of data the host is willing to receive before sending another acknowledgment. This is a key part of TCP's flow control mechanism. |
| Checksum | 2 | Ensures the validity of the segment. Calculated on the value of not only the TCP header and payload but also part of the IP header. |
| Urgent Pointer | 2 | If urgent data is being sent, this specifies the end of that urgent data within the segment. |
| Options | Variable | Allows further connection parameters to be configured. The most important is Maximum Segment Size (MSS), which allows the host to specify how large the segments it receives should be, minimizing fragmentation as they are transported over data link frames. |
A TCP connection is established using a Three-Way Handshake:
A host can end a session gracefully using a Four-Way Handshake (involving FIN and ACK flags from both sides). A host can also end a session abruptly using an RST (Reset) flag, typically indicating an error, failure, or suspicious activity. The server expects regular acknowledgments for segments it sends. If a timeout occurs without an acknowledgment, it means the information didn't arrive, and the server automatically resends that segment. This overhead makes TCP suitable when reliability and integrity are paramount, even if it results in slightly slower transmission.
User/Unreliable Datagram Protocol UDP uses a simple connectionless communication model with a minimum of protocol mechanisms where Prior communications are not required in order to set up communication channels or data paths. UDP provides checksums for data integrity, and port# for addressing different functions at the source and destination of the datagram. It has no handshaking dialogues, and thus exposes the user's program to any unreliability(no Assurance) of the underlying network; there is no guarantee of delivery, ordering, or duplicate protection. While these are certainly drawbacks for some types of applications, other applications that want to prioritize transmission speed and efficiency over security and reliability may leverage UDP. UDP is suitable for purposes where error checking and correction are either not necessary or are performed in the application; UDP avoids the overhead of such processing in the protocol stack. Time-sensitive applications often use UDP because dropping packets is preferable to waiting for packets delayed due to retransmission, which may not be an option in a real-time system In order to remedy the security issue, encryption protocols are commonly used. Lacking reliability, UDP applications must be willing to accept some packet loss, reordering, errors or duplication. If using UDP, the end user applications must provide any necessary handshaking such as real time confirmation that the message has been received. A number of UDP's attributes make it especially suited for certain applications. ✔️It is transaction-oriented, suitable for simple query-response protocols where queries must be fast and only consist of a single request followed by a single reply packet I.e Domain Name System or the Network Time Protocol. ✔️It provides datagrams, suitable for modeling other protocols such as IP tunneling or remote procedure call and the Network File System. ✔️ It is simple, suitable for bootstrapping or other purposes without a full protocol stack, such as the DHCP and Trivial File Transfer Protocol. ✔️It is stateless, suitable for very large numbers of clients, such as in streaming media applications such as IPTV. ✔️The lack of retransmission delays makes it suitable for real-time applications such as Voice over IP, online games, and many protocols using Real Time Streaming Protocol. ✔️Because it supports multicast, it is suitable for broadcast information such as in many kinds of service discovery and shared information such as Precision Time Protocol and Routing Information Protocol.
Unlike TCP, UDP is a Connectionless, Non-Reliable method of communication with no acknowledgments or built-in flow control.
A UDP header is only 8 bytes, consisting of:
The unit of data packets transferred between hosts using this protocol is referred to as a Datagram. No prior communications are required to set up communication channels or data paths, which is characteristic of Connectionless protocols (no handshake dialogue). This design exposes the user's program to the unreliability of the underlying network.
TLS (Transport Layer Security) is the successor to the deprecated Secure Sockets Layer (SSL). It is a cryptographic protocol designed to provide communication security over computer networks. TLS runs in the Application Layer of the Internet protocol suite. It is composed of two layers: the TLS Record Protocol and the TLS Handshake Protocol. Transport Layer Security TLS is a widely adopted cryptographic security protocol designed to facilitate secure data transmission via encryption. TLS evolved out of the encryption protocol known as SSL (Secure Sockets Layer), which has since been deprecated in favor of TLS. While these two protocols are different, the terms are sometimes used interchangeably. Using TLS with HTTP will allow you to use HTTPS (Hypertext Transfer Protocol Secure), which helps denote the presence of the extra security. Once the client and server have agreed to use TLS, they negotiate a stateful connection by using a handshaking procedure. The protocols use a handshake with an Asymmetric Encryption cipher (Initial Handshake/Hello Phase Cipher Suites) to establish not only cipher settings but also a session-specific shared key with which further communication is encrypted using a Symmetric cipher. During this handshake, the client and server agree on various parameters used to establish the connection's security:
In addition to the above, careful configuration of TLS can provide additional privacy-related properties such as forward secrecy, ensuring that any future disclosure of encryption keys cannot be used to decrypt any TLS communications recorded in the past. TLS supports many different methods for exchanging keys, encrypting data, and authenticating message integrity. As a result, secure configuration of TLS involves many configurable parameters, and not all choices provide all of the privacy-related properties described in the list above (see the tables below § Key exchange, § Cipher security, and § Data integrity). Attempts have been made to subvert aspects of the communications security that TLS seeks to provide, and the protocol has been revised several times to address these security threats. Developers of web browsers have repeatedly revised their products to defend against potential security weaknesses after these were discovered (see TLS/SSL support history of web browsers). *Forward Secrecy is a property of cryptographic systems which ensures that a “session key derived from a set of public and private keys” will not be compromised if one of the private keys is compromised in the future, ensuring that any future disclosure of encryption keys cannot be used to decrypt any TLS communications recorded in the past. *A digital certificate certifies the ownership of a public key by the named subject of the certificate, and indicates certain expected usages of that key. This allows others (relying parties) to rely upon signatures or on assertions made by the private key that corresponds to the certified public key. Keystores and trust stores can be in various formats, such as .pem, .crt, .pfx, and .jks. *Certificate authority TLS typically relies on a set of trusted third-party certificate authorities to establish the authenticity of certificates. Trust is usually anchored in a list of certificates distributed with user agent software. and can be modified by the relying party. *TLS interception (or HTTPS interception if applied particularly to that protocol) is the practice of intercepting an encrypted data stream in order to decrypt it, read and possibly manipulate it, and then re-encrypt it and send the data on its way again. This is done by way of a "transparent proxy": the interception software terminates the incoming TLS connection, inspects the HTTP plaintext, and then creates a new TLS connection to the destination
Clients request that a server sets up a TLS connection, achieved either by:
STARTTLS command) to switch a connection from unencrypted (e.g., port 80 for HTTP) to encrypted.The TLS Handshake is a complex process but can be summarized:
When secure via TLS, connections between client and server offer:
Internet Protocol Security(IPsec) is a suite of protocols defined by RFC 4301, "Security Architecture for the Internet Protocol" for securing IP communications by authenticating, encapsulating & encrypting each IP packet in a data stream. Which has found widespread use in securing virtual private networks. IPsec includes protocols for establishing mutual authentication between agents at the beginning of a session and negotiation of cryptographic keys to use during the session. IPsec can protect data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-network), or between a security gateway and a host (network-to-host).
IPsec can be used to secure IPv4 and/or IPv6 communications on local networks and for remote access protocols. Each host that uses IPsec must be assigned an IPsec policy. An IPsec policy sets the authentication mechanism and also the protocols and mode for the connection (Transport / Tunnel). Hosts must be able to match at least one security method for a connection to be established.
The IPsec protocols AH and ESP can be implemented in a host-to-host transport mode, as well as in a network tunneling mode. In computer networks, a tunneling protocol is a communication protocol which allows for the movement of data from one network to another, by exploiting encapsulation. It involves allowing private network communications to be sent across a public network (such as the Internet) through a process called encapsulation. The tunneling protocol works by using the data portion of a packet (the payload) to carry the packets that actually provide the service. Tunneling uses a layered protocol model such as those of the OSI or TCP/IP protocol suite, but usually violates the layering when using the payload to carry a service not normally provided by the network. Typically, the delivery protocol operates at an equal or higher level in the layered model than the payload protocol. According to the definition of tunneling, one can use it to access resources that are available only to internal networks. To create/facilitate such tunnels, an appropriate application should be used. The most known one is SSH
Transport Mode:
Tunnel Mode:
Encapsulation is a generic networking concept that involves wrapping one protocol's payload inside another so it can be transmitted across a network. It's used for routing and transporting data, but not by default for security or encryption. Examples include an IPv6 packet over an IPv4 network (6 to 4 Tunneling and Encapsulation), and Generic Routing Encapsulation (GRE) which wraps Layer 3 traffic inside IP packets with no mechanism for authentication. Tunneling is a more specific use case of Encapsulation, which refers to Encapsulating and Routing packets through a "TUNNEL". IPsec VPN tunnels traffic with encryption, while GRE tunnels traffic without encryption. All Tunneling involves Encapsulation, but not all Encapsulation is Tunneling (e.g., MPLS and GRE). Also, not all tunnels are Encrypted (e.g., L2TP and GRE). Tunneling may or may not imply encryption. IPsec doesn't support Broadcast & Multicast traffic, only Unicast. To SUMMARIZE:
IP Header | AH Header | TCP/UDP Header | PayloadIP Header | ESP Header | TCP/UDP Header | Payload | ESP Trailer | ESP Authentication DataIPsec's encrypting and hashing functions depend on shared secrets. The secrets must be communicated to both hosts, and the hosts must confirm one another's identity (mutual authentication). The Internet Key Exchange (IKE) protocol handles authentication and key exchange, establishing the Security Association (SA). Most IPsec implementations consist of an IKE daemon that runs in user space and an IPsec stack in the kernel that processes the actual Internet Protocol packets.
Tunneling involves encapsulating one protocol's packets within another protocol's packets to carry them across an incompatible network or to provide secure, logical links.
Traditionally, application and client-suite VPNs require a client application that implements the protocols and authentication methods supported by the VPN gateway.
The canvas element introduced in HTML5 allows modern browsers to draw and update a desktop with relatively little lag, enabling many browsers to act as "clientless" VPN/RDP clients. Also referred to as an HTML5 VPN, this solution uses a protocol called WebSockets, which enables bidirectional messages to be sent between the server and client without requiring the overhead of separate HTTP requests.
Remote host access refers to operating a computer or configuring a network appliance without needing to use a terminal directly connected to it. This can be implemented within a local network or over a public network. (Image Placeholder - Remote Access VPN)
DMVPN is a Cisco-developed solution that allows Routers to dynamically create a full Mesh of IPsec tunnels without having to manually configure every single tunnel. DMVPN provides the configuration simplicity of a Hub and Spoke WAN topology (each Spoke Router only needs one tunnel configured) and the efficiency of direct spoke-to-spoke communication (spoke routers can communicate directly without traffic passing through the Hub (VPN HeadEnd)). They communicate between themselves by a temporary encrypted VPN setup between them by the DMVPN. This process also involves the use of Next Hop Resolution Protocol (NHRP) to identify destination addresses and GRE tunnels to encapsulate the encrypted IPsec packets. DMVPN Configuration Commands • Interface Tunnel 0 • tunnel source "Interface" • tunnel Destination "ip-addr"
❗️Application Programming Interface (API)- A protocol intended to be used as an interface by software components to communicate with each other. ❗️Buffer- A region of a physical memory storage used to temporarily prevent data from continuing while it is being moved from one place to another. ❗️Buffer Underrun- A state occurring when a buffer used to communicate between two devices or processes is fed with data at a lower speed than the data is being read from it. ❗️Checksum- A fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. ❗️Connection Oriented Communication- A data communication mode whereby the devices at the end points use a protocol to establish an end-to-end logical or physical connection before any data may be sent. ❗️Connectionless- A data communication mode in which a message can be sent from one end point to another without prior arrangement. ❗️Data Stream- A sequence of digitally encoded coherent signals (packets of data or data packets) used to transmit or receive information that is in the process of being transmitted. ❗️Datagram- A basic transfer unit associated with a packet-switched network in which the delivery, arrival time, and order of arrival are not guaranteed by the network service. ❗️Deadlock- A situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does. ❗️Ephemeral Port- A short lived port allocated automatically from a predefined range. ❗️Handshaking- An automated process of negotiation that dynamically sets parameters of a communications channel established between two entities before normal communication over the channel begins. ❗️Latency- A measure of time delay experienced in a system. ❗️Maximum segment size (MSS)- A parameter of the TCP protocol that specifies the largest amount of data that a computer or communications device can receive in a single TCP segment. ❗️Multiplexing- A method by which multiple analog message signals or digital data streams are combined into one signal over a shared medium. ❗️Network Congestion- A data communication situation in which a link or node is carrying so much data that its quality of service deteriorates. ❗️Registered Port- A transport protocol port assigned by the Internet Assigned Numbers Authority (IANA) for use with a certain protocol or application. ❗️Reliability- A reliable protocol is a communication protocol that notifies the sender whether or not the delivery of data to intended recipients was successful with respect to the delivery of data to the intended recipient(s), as opposed to an unreliable protocol, which does not provide notifications to the sender as to the delivery of transmitted data. ❗️Slow start- One of the algorithms that TCP uses to control congestion inside the network, in which the TCP window size is increased each time an acknowledgment is received. ❗️TCP window scale option- An option to increase the TCP receive window size above its maximum value of 65,535 bytes ❗️Ports- A port is a software structure that is identified by the port number, a 16 bit integer value, allowing for port numbers between 0 and 65535. Applications can use datagram sockets to establish host-to-host communications. An application binds a socket to its endpoint of data transmission, which is a combination of an IP address and a port. In this way, UDP provides application multiplexing. Port 0 is reserved, but is a permissible source port value if the sending process does not expect messages in response. ❗️Packet Retransmission(PAR)- is the resending of packets which have been either damaged or lost. Retransmission is one of the basic mechanisms used by protocols operating over a packet switched computer network to provide reliable communication. Networks are usually "unreliable", meaning they offer no guarantees that they will not delay, damage, or lose packets, or deliver them out of order. Protocols which provide reliable communication over such networks use a combination of acknowledgments & Retransmission of missing or damaged packets (usually initiated by a time-out), and checksums to provide that reliability. *Positive Acknowledgment ACK *Negative Acknowledgment NACK *Selective Acknowledgments SACK *Cumulative Acknowledgments CACK ❗️Automatic repeat request (ARQ), also known as automatic repeat query, is an error-control method for data transmission that uses acknowledgements (messages sent by the receiver indicating that it has correctly received a packet) and timeouts (specified periods of time allowed to elapse before an acknowledgment is to be received) to achieve reliable data transmission over an unreliable communication channel. If the sender does not receive an acknowledgment before the timeout, it re-transmits the packet until it receives an acknowledgment or exceeds a predefined number of retransmissions. The ARQ protocol also provides flow control, which may be combined with congestion avoidance. Variations of ARQ protocols include *Stop-and-wait ARQ *Go-Back-N ARQ *Selective Repeat ARQ
google.com) into machine-readable IP addresses (e.g., 172.217.160.142).Hosts on The Internet maintains two principal namespaces, the domain name hierarchy and the Internet Protocol (IP) address spaces., which is used for routing and network interface identification. An often-used analogy to explain the Domain Name System is that it serves as the phone book for the Internet by translating human-friendly computer hostnames into IP addresses. For example, the domain name www.example.com translates to the addresses 93.184.216.34 (IPv4) and 2606:2800:220:1:248:1893:25c8:1946 (IPv6). The translation between addresses and domain names is performed by the Domain Name System (DNS), a hierarchical, decentralized, distributed naming system that allows for the subdelegation of namespaces to Internet resources by designating authoritative name servers for each domain, Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the underlying network protocols.
.com, .org, .net, .edu, .gov, and country codes like .uk, .de. They know the addresses of authoritative name servers for second-level domains.google in google.com). These are registered by individuals or organizations.www, mail, ftp in www.example.com).(Image Placeholder - DNS Hierarchy)
The domain name space consists of a tree data structure. Each node or leaf in the tree has a label and zero or more resource records (RR), which hold information associated with the domain name. The domain name itself consists of the label, concatenated with the name of its parent node on the right, separated by a dot. The tree sub-divides into zones beginning at the root name server zone. A DNS zone may consist of only one domain, or may consist of many domains and sub-domains, depending on the administrative choices of the zone manager. A domain name consists of one or more parts, technically called labels, that are conventionally concatenated, and delimited by dots, such as example.com. The right-most label conveys Top-Level Domain (TLD) servers; for example, the domain name www.example.com belongs to the top-level domain COM <parent node>. The hierarchy of domains descends from right to left; each label to the left specifies a subdivision, or subdomain of the domain to the right. As with root name servers, TLD servers keep track of the next level down: Authoritative name servers. When a TLD server receives your request for information, the server passes it down to an appropriate Authoritative name server. Authoritative name servers are used to store DNS records for domains directly. In other words, every domain in the world will have its DNS records stored on an Authoritative name server somewhere or another; they are the source of the information. When your request reaches the authoritative name server for the domain you're querying, it will send the relevant information back to you, allowing your computer to connect to the IP address behind the domain you requested.
(Image Placeholder - DNS Query Process)
DNS Resolvers➡️The client side of the DNS is called a DNS resolver. A resolver is responsible for initiating and sequencing the queries that ultimately lead to a full resolution (translation) of the resource sought. DNS resolvers are classified by a variety of query methods, such as recursive, non-recursive, and iterative. A resolution process may use a combination of these methods. DNS protocol transport primarily uses the UDP port 53 to serve requests. TCP is also used for tasks such as zone transfers. Some resolver implementations use TCP for all queries. Record Caching➡️A standard practice in implementing name resolution in applications is to reduce the load on the Domain Name System servers by caching results locally, or in intermediate resolver hosts. Results obtained from a DNS request are always associated with the time to live (TTL), an expiration time after which the results must be discarded or refreshed. Reverse Lookup➡️A reverse DNS lookup is a query of the DNS for domain names when the IP address is known. Multiple domain names may be associated with an IP address. The DNS stores IP addresses in the form of domain names as specially formatted names in pointer (PTR) records within the infrastructure top-level domain arpa. For IPv4, the domain is in-addr.arpa. For IPv6, the reverse lookup domain is ip6.arpa. The IP address is represented as a name in reverse-ordered octet representation for IPv4, and reverse-ordered nibble representation for IPv6. DNS message format➡️The DNS protocol uses two types of DNS messages, Queries and Replies; both have the same format. Each message consists of a Header + 4 sections: Question, Answer, Authority, & an additional space. A header field controls the content of these 4 sections. The Header section consists of the following field: Identification, Flags, Number of questions, Number of answers, Number of authority resource records (RRs), and Number of additional RRs. Each field is 16 bits long, and appears in the order given. The identification field is used to match responses with queries. DNS over HTTPS (DoH) is a protocol for performing remote Domain Name System (DNS) resolution via the HTTPS protocol. A goal of the method is to increase user privacy and security by preventing eavesdropping and manipulation of DNS data by man-in-the-middle attacks[1] by using the HTTPS protocol to encrypt the data between the DoH client and the DoH-based DNS resolver. DNS over TLS (DoT) is a network security protocol for encrypting and wrapping Domain Name System (DNS) queries and answers via the Transport Layer Security (TLS) protocol. The goal of the method is to increase user privacy and security by preventing eavesdropping and manipulation of DNS data via man-in-the-middle attacks. While DNS-over-TLS is applicable to any DNS transaction, it was first standardized for use between stub or forwarding resolvers and recursive resolvers, in RFC 7858
A Host-Name is assigned to a computer by an administrator, usually at the time of OS installation. The host name needs to be unique on the local network.
A Fully Qualified Domain Name (FQDN) is used to provide a unique identity for a host belonging to a particular Internetwork, to avoid the possibility of duplicate host names on the Internet.
FQDN Structure:
MY.HOST.Domain.TLD (e.g., www.example.com)
MY.HOST: Host Name (unique within its domain)Domain: Second-Level Domain Name (unique within a TLD)TLD: Top-Level Domain (e.g., .com, .org, .net, .gov)Numerous hosts may exist within the same Domain and TLD. The "root" (represented by a dot .) is at the end of the FQDN but is usually omitted in most cases.
A Domain Name is unique within a TLD. Once registered, it cannot be used by another organization. However, the same Domain Name may be registered within different TLDs (e.g., example.com and example.org).
FQDN Rules: FQDNs must follow certain rules:
The Domain Name System (DNS) is a global hierarchy of distributed name server databases that contain information on domains and hosts within those domains.
At the top of the DNS Hierarchy is the Root, which is represented by the null label (just a period .). There are 13 root name servers (A-M).
Below the root are the Top-Level Domains (TLDs). These include:
.com, .org, .net, .biz, .gov. ICANN (Internet Corporation for Assigned Names and Numbers) manages these generic TLDs..uk, .ca, .au. These are generally managed by an organization appointed by the relevant government.The Root DNS Servers have complete information about the TLD Servers. In turn, the TLD Servers have information relating to servers for the second-level domains. No single name server has complete information about all domains. Records within the DNS tell them where an Authoritative Name Server for missing information can be found.
An FQDN reflects this hierarchy, from most specific on the left (the host's resource record with its Name:IP address mapping) to the least specific on the right (the TLD and root).
The process of translating an FQDN into an IP address is known as Name Resolution.
.com, .org, etc.).example.com).Recursive lookup means that if the required server is not authoritative, it takes on the task of querying other name servers until it finds the requested record or times out.
Most Internet-accessible DNS Servers disable recursive queries for external clients. Recursive Resolvers are typically only accessible by authorized clients (e.g., subscribers within an ISP's network or clients on a private LAN).
DNS Resolution Process - Recursive and Iterative Queries:
Figure: DNS resolution showing the complete query process. Client makes recursive query to local DNS server, which performs iterative queries to Root → TLD → Authoritative servers. Each server either provides the answer or refers to the next level in the hierarchy. Final answer is cached at multiple levels with TTL.
A DNS Zone contains numerous resource records. These records allow a DNS name server to resolve queries for names and services hosted in the domain into IP addresses. The most common types of records stored in the DNS database are for Start of Authority (SOA), IP addresses (A and AAAA), SMTP mail exchangers (MX), name servers (NS), pointers for reverse DNS lookups (PTR), and domain name aliases (CNAME)
DNS Servers have Forward Lookup Zones and Reverse Lookup Zones.
in-addr.arpa. For IPv6, each character is expressed in reverse order up to the network prefix as a subdomain and appended with ip6.arpa.
198.51.100.1 becomes 1.100.51.198.in-addr.arpa2001:0db8::abcd:ef12:1234 becomes 4.3.2.1.2.1.f.e.d.c.b.a.d.c.b.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.0.2.ip6.arpaDNS Name Servers maintain DNS namespace in Zones. A single Zone namespace might host records for multiple Domains. A single name server might be configured to manage multiple Zones.
A name server that holds complete records for a domain can be defined as Authoritative. This means that a record in the zone identifies the server as a name server for that namespace. Both Primary & Secondary name servers are authoritative.
Servers that don't maintain a zone are referred to as Cache-Only Servers during the name resolution process. A non-authoritative answer from a server is one that derives from a cached record rather than directly from the zone records.
Each Resource Record can be configured with a default TTL (Time to Live) value, measured in seconds. This value instructs resolvers how long a query result can be kept in cache.
The use of caching and the distributed nature of DNS means that configuration errors can occur in several different places. To investigate name resolution issues:
ipconfig /allhostname -I or ip anslookup (Windows): Troubleshoots DNS name resolution.
nslookup without arguments starts it in interactive mode.nslookup [options] [Host] [DNS Server]options: Specifies lookup subcommand (e.g., -type=ns to query name servers, -type=MX for mail records).Host: Can be a Host Name, Domain Name/FQDN, or an IP address.DNS Server: The IP address of a specific server to use for the query (e.g., 8.8.8.8 for Google DNS).Resolve-DnsName (PowerShell - Windows): Provides a more sophisticated, scripted approach using cmdlets. It allows for more flexible testing of name resolution (e.g., checking HOSTS file, DNS Cache, specific DNS servers).dig (Domain Information Groper - Linux/Unix/macOS): A powerful command-line tool for querying DNS servers.
dig host will search for the A record for the Host, Domain, or FQDN; dig -x [IP Address] will perform a PTR (reverse) lookup.DNS caching is performed by both DNS servers and client computers. Each application on a client computer might also be configured to manage its own DNS cache rather than relying on a shared Operating System cache.
Changes to Resource Records (and subsequent updates) can be relatively slow to propagate around the Internet due to caching.
Planning for a Record Change:
A company will use primary & secondary NS to maintain authoritative zone records for the domains it manages.
subdomain.bigsupport.com would be served from internal name servers, allowing a client PC (pc1.bigsupport.com) to contact a local application server (crm.bigsupport.com). The name servers hosting these internal subdomain records must not be accessible from the Internet for security.bigsupport.com, in order for Internet hosts to use a web server at www.bigsupport.com or send email to an @bigsupport.com address, the zone records for bigsupport.com must be hosted on a name server that is accessible over the Internet.It is generally a good idea to separate the DNS servers used to host zone records (authoritative servers) from the ones used to service client requests for non-authoritative domains (recursive resolvers/forwarders).
Devices will save the DNS Server’s responses to a local DNS cache, this means they don’t have to query the server every single time they want to access a particular destination, this may lead to DNS cache poisoning. For hosts in a network to use dns, you don’t need to configure DNS on the routers , the routers simply forward the DNS messages like any other packets. Cisco router can be configured as a DNS server , although rare. A Cisco Router can also be configured as a DNS client Most devices have a Hosts file which existed before dns to save the Hostname of IP addresses local to a device, which is C:\windows\system32\drivers\etc\hosts or /etc/hosts Normal DNS requests and responses are sent by UDP port 53, DNS can use TCP or generates TCP sessions for only Zone Transfers and query responses that exceed 512bytes—Recursive DNS Search [which allow DNS servers to provide authoritative name resolution to hosts].
A Recursive DNS server is that, when asked for information it does not have, performs a repetitive (recursive) process to ask other DNS servers in sequence, sending repeated DNS messages in an effort to identify the authoritative DNS server or DNS server that knows the information.
Router> enable Router# configure terminal Router(config)# ip dns server -> Configure a Router to act as a DNS server Router(config)# ip host hostname host-IP -> Add an entry to the ip hostname table, Building the router’s own host table with a list of hostname/IP address mappings. Router(config)# ip name-server 8.8.8.8 -> Specify address of name server to use, this Configures an external DNS Server that router will query, if the requested record is not in its own host table. Router(config)# ip domain lookup -> Enable Router to perform DNS queries. Becoming a DNS client. Router(config)# ip domain name FQDN -> Configure the default domain name locally, once done all connected devices to the router, will have a FQDN of hostname.FQDN Router(config)# do show hosts -> To view the routers DNS cache and host table.
DHCP DORA Process Sequence:
Figure: DHCP DORA process showing the four-phase IP address acquisition: (D)iscover → (O)ffer → (R)equest → (A)cknowledge. Client starts with no IP (0.0.0.0), broadcasts to find servers, receives offers, selects one, and gets configuration confirmed. Includes lease management with T1 (renewal) and T2 (rebind) timers.
A DHCP Server must be allocated a static IP Address and configured with a range of IP Addresses and Subnet Masks, plus option values, to allocate as a Scope. To define a scope, you must provide a start & end IP Address along with a Subnet mask.
The server maintains a one-to-one mapping of scopes to subnets (i.e., no scope can cover more than one subnet & no subnet can contain more than one scope). The DHCP Server must be placed in the same Subnet as its clients.
More advanced DHCP servers might be configured to manage & support multiple scopes. Where a server provides IP Config for multiple subnets/scopes, it must choose the pool to service each request based on the subnet from which the request originated.
For fault tolerance and redundancy, Split Scopes can be configured with non-overlapping address ranges. DHCP for multiple subnets is usually handled by configuring Relay Agents to forward requests to a central DHCP server.
An IP Address is leased by the server for a limited period only. A client can attempt to renew or rebind the lease before it expires. If the lease cannot be renewed, the client must release the IP address and start the DHCP DORA process again.
A long lease time means the client doesn't have to renew the lease often. Where the DHCP server's Address pool is not replenished frequently or IP addresses are in short supply, a shorter lease period enables the DHCP Server to allocate addresses previously assigned to hosts that have become inactive on the Network.
If both T1 & T2 timers elapse, the client releases the IP address and broadcasts to discover a new server.
To force a release of a lease, a Windows Client can use IPCONFIG /RELEASE and IPCONFIG /RENEW. Linux clients can use dhclient, Network Manager, or Systemd-Networks.
Failure to renew a lease: A Windows host reverts to Automatic Private IP Addressing (APIPA) (addresses in the range 169.254.0.0/16). Linux might use link-local config, set the Address to unknown, or leave the interface unconfigured.
Each additional Option supplied by a DHCP Server is identified by a byte or decimal Value. Such Options include:
A set of default/global options can be configured on a server-wise basis. Default Options can be overridden by setting scope-specific Options.
One disadvantage of the standard Dynamic Assignment method is that it doesn't guarantee that any given client will retain the same IP Address over time.
The DHCP Relay Agent (configured on RFC 1542 Compliant Routers) intercepts DHCP broadcast frames, then applies a Unicast Address for the appropriate DHCP server(s) and forwards them over the interface for the subnet containing the server. The DHCP Server can identify the original IP Subnet from the packet and offer a lease from the appropriate scope (subnet range). The DHCP relay also performs the reverse process of directing responses from the server to the appropriate client Subnet.
IP Helper functionality can be configured on Routers to allow certain types of broadcast traffic (including DHCP) to be forwarded to an interface. The IP helper function supports the function of the DHCP relay agent. UDP forwarding is a more general application of the same principle.
IPv6's Stateless Address Auto-Configuration (SLAAC) process can locate routers and generate a host address with a suitable network prefix automatically. Therefore, the role of a DHCP Server in IPv6 is different. DHCPv6 is often just used to provide additional option settings, rather than leases for host addresses.
As IPv6 does not support broadcasts, clients use the multicast Address for routers (ff02::1:2) to discover a DHCPv6 server, using Neighbor Discovery Protocol (NDP).
ff02::1:2.Note: There is no mechanism in DHCPv6 for setting the Default Route; the host learns the default gateway from the Router Advertisement (NDP).
Renew lease after T1; if not, check back at timer T2. The countdown is reset if the lease is renewed.
EVERY HOST INTERFACE NEEDS AN IP CONFIG TO COMMUNICATE ON A TCP/IP NETWORK.
DHCP (BootP-Server UDP 67 / BootP-Client UDP 68) is used to allow hosts to automatically/dynamically learn various aspects of their network configuration, such as IP ADDRESS, SUBNET MASK, DEFAULT GATEWAY, DNS SERVER without manual/static configuration. DHCP allows both the permanent assignment of host addresses, but more commonly, DHCP assigns a temporary lease of IP addresses. With these leases, the DHCP server can reclaim IP addresses when a device is removed from the network, making better use of the available addresses. DHCP also enables mobility.
DHCP server ‘lease’ IP address to clients. These leases are usually not permanent, and the client must give up the address at the end of the lease.
ipconfig /release.ipconfig /renew.DHCP operations fall into four phases: client-server discovery, IP lease offer, IP lease request, & IP lease acknowledgement. These stages are often abbreviated as DORA for:
DHCP clients, however, have a somewhat unique problem: they do not have an IP address yet, but they need to send these DHCP messages inside IP packets. To make that work, DHCP messages make use of two special IPv4 addresses that allow a host that has no IP address to still be able to send and receive messages on the local subnet:
Some Network Engineers might choose to configure each router in a network topology as the DHCP sever for its connected LANs to keep the protocol flow local. However, for large enterprises it’s recommended to use a centralized DHCP server. A centralized DHCP server approach has advantages as well. In fact, some Cisco design documents suggest a centralized design as a best practice, in part because it allows for centralized control and configuration of all the IPv4 addresses assigned throughout the enterprise.
If the server is centralized, it won’t receive the DHCP clients’ broadcast DHCP messages (as broadcast messages don’t leave the local subnet). To fix this, we configure a router to act as a DHCP RELAY AGENT. The router-RelayAgent will forward the clients' broadcast DHCP messages to the remote DHCP server as Unicast messages.
In some enterprise networks, that router configuration can be a single command on many of the router’s LAN interfaces (ip helper-address server-ip), which identifies the DHCP server by its IP address. This feature, by which a router relays DHCP messages by changing the IP addresses in the packet header, is called DHCP relay.
A DHCP pool is a subnet of addresses that can be given to DHCP clients, as such as other info such as default gateway and dns server. Ensure to create a separate DHCP pool for each network the router is acting as a DHCP server for.
Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.20
Specify a range of addresses that won’t be given to DHCP clients. The server needs to know which addresses in the subnet to not lease. This list allows the engineer to reserve addresses to be used as static IP addresses.
Router(config)# ip dhcp pool LAN_CLIENTs
Specify DHCP pool name.
Router(dhcp-config)# network 192.168.10.0/24
Specify the subnet of addresses to be assigned to clients (excluding the excluded addresses). The DHCP server can use this information to know all addresses in the subnet. (The DHCP server knows to not lease the subnet ID or subnet broadcast address.)
Router(dhcp-config)# default-router IP-ADDR
This is the IP address of the router on that subnet. Specify the default gateway that DHCP client should use. Host Default Router Setting Should Equal Router Interface Address.
Router(dhcp-config)# dns-server 8.8.8.8
Specify the DNS server that DHCP clients should use. This is a list of DNS server IP addresses.
Router(dhcp-config)# domain-name FQDN
Specify the Domain-Name of the Network.
Router(dhcp-config)# lease days hours minutes
The server leases an address for a time (usually a number of days), and then the client can ask to renew the lease. If the client does not renew, the server can reclaim the IP address and put it back in the pool of available IP addresses. The server configuration sets the maximum time for the lease.
Router(dhcp-config)# lease infinite
This configures AUTOMATIC ALLOCATION, which sets the DHCP lease time to infinite. As a result, once the server chooses an address from the pool and assigns the IP address to a client, the IP address remains with that same client indefinitely.
Router(config)# interface Gx/y
Specify the interface connected to the subnet of the client devices.
Router(config-if)# ip helper-address dhcp-server-IP
Configure an interface to forward/“RELAY” DHCP broadcasts across a network to the IP address of the DHCP server.
We first specified an interface on the router serving the subnet that requires a DHCP, and then we configured a relay agent for that interface using the IP address of a centralized DHCP server. Ensure the router has a static or dynamic route to the DHCP server. The DHCP relay feature must be configured for any router interface that connects to a subnet where:
Once such interfaces have been identified, the configuration requires the ip helper-address interface subcommand on each of those interfaces. The ip helper-address server-ip subcommand tells the router to do the following for the messages coming in an interface, from a DHCP client:
ip helper-address command).This command gets around the “do not route packets sent to 255.255.255.255” rule by changing the destination IP address. Once the destination has been set to match the DHCP server’s IP address, the network can route the packet to the server.
NOTE: THE IP HELPER-ADDRESS command configures an interface to forward broadcasts to the following UDP ports for the protocols DNS, TFTP, NetBios, TACACS.
Router(config)# interface Gx/y
Specify the interface connected to the DHCP server.
Router(config-if)# ip address dhcp
Use the command to tell the router to use DHCP to learn its own IP address. The router then adds a default route based on the default gateway (routers do not normally use a default gateway setting; only hosts use a default gateway setting. However, the router takes advantage of that information by turning that default gateway IP address into the basis for a default route) to its IP routing table. In most every case it makes more sense to statically configure router interface IP addresses with the address listed in the ip address address mask interface subcommand. However, configuring a router to lease an address using DHCP makes sense in some cases with a router connected to the Internet; in fact, most every home-based router does just that. A router with a link to the Internet can learn its IP address and mask with DHCP and also learn the neighboring ISP router’s address as the default gateway. Additionally, router can distribute that default route to the rest of the routers using an interior routing protocol like OSPF. To recognize this route as a DHCP-learned default route, look to the administrative distance value of 254. IOS uses a default administrative distance of 1 for static routes configured with the ip route configuration command but a default of 254 for default routes added because of DHCP. Like Windows, macOS adds a default route to its host routing table based on the default gateway, as well as a route to the local subnet calculated based on the IP address and mask learned with DHCP.
Router()# show ip dhcp binding
Displays all the DHCP clients that are currently assigned addresses, as well as information on Lease expiration, Device IP & MAC.
To see more details specific to DHCP, instead use the show dhcp lease command to see the (temporarily) leased IP address and other parameters.
Router()# show dhcp lease
Router()# show ip dhcp pool
Verify the configured IPv4 subnets in a DHCP pool, on a router configured as a DHCP server.
(Image Placeholder - HTTPS Process)
The HTTP (The Hyper Text Transfer Protocol) handles our web requests to servers. HTTP functions as a request–response protocol in the client–server computing model. HTTP uses a set of verbs, like GET, POST, PUT, and HEAD, to retrieve and send data. Anytime a page is loaded, there are multiple web requests to retrieve content like images, text, and formatting code. High-traffic websites often benefit from web “CACHE” servers that deliver content on behalf of upstream servers to improve response time. Web browsers “CACHE” previously accessed web resources and reuse them, when possible, to reduce network traffic. HTTP is a “STATELESS” protocol. A stateless protocol does not require the HTTP server to retain information or status about each user for the duration of multiple requests. However, some web applications implement “Statefulness” or server side sessions using for instance HTTP “COOKIES” or hidden variables within web forms.
To send email, the standard is SMTP is an internet standard connection-oriented, text-based, communication protocol for electronic mail transmission in which a mail sender communicates with a mail receiver by issuing command string & necessary data over a reliable ordered data stream channel(TCP). Mail servers and other Mail/Message Transfer agents use SMTP to send and receive mail messages, SMTP servers commonly use the TCP on port number 25 (for unencrypted plaintext) and 587 (for encrypted communications). The SMTP server performs three basic functions:
Email is submitted by a mail client (mail user agent, MUA) to a mail server (mail submission agent, MSA) using SMTP on TCP port 587 involving a SMTP Handshake. Most mailbox providers still allow submission on traditional port 25. The MSA delivers the mail to its mail transfer agent (mail transfer agent, MTA). Often, these two agents are instances of the same software launched with different options on the same machine. The main difference between an MTA and an MSA is that connecting to an MSA requires SMTP Authentication. The boundary MTA uses DNS to look up the MX (mail exchangers) DNS resource record for the recipient's domain (the part of the email address on the right of @). The MX record contains the name of the target-destination MTA. Based on the target host and other factors, the sending MTA selects a recipient server and connects to it to complete the mail exchange. An MDA (mail delivery agents) saves messages in the relevant mailbox format. As with sending, this reception can be done using one or multiple computers, Once delivered to the local mail server, the mail is stored for batch retrieval by authenticated mail clients (MUAs). Sender MUA >> MSA >> MTA 📤 >> DNS Lookup of MX records Recipient 📥 MTA >> MDA >> MUA >> Forwarded to IMAP/POP
Mail is retrieved by end-user applications, called email clients, using Internet Message Access Protocol (IMAP), a protocol that both facilitates access to mail and manages stored mail, or the Post Office Protocol (POP) which typically uses the traditional inbox mail file format. “SMTP defines message transport, not the message content. Thus, it defines the mail envelope and its parameters, such as the envelope sender, but not the header (except trace information) nor the body of the message itself. STD 10 and RFC 5321 define SMTP (the envelope), while STD 11 and RFC 5322 define the message (header and body), formally referred to as the Internet Message Format.”
IMAP is an Internet standard protocol used by email clients to retrieve email messages from a mail server over a TCP/IP connection. IMAP was designed with the goal of permitting complete management of an email box by multiple email clients, therefore clients generally leave messages on the server until the user explicitly deletes them, This and other characteristics of IMAP operation allow multiple clients to manage the same mailbox. IMAP offers access to the mail storage. Clients may store local copies of the messages, but these are considered to be a temporary cache. An IMAP server typically listens on port number 143. IMAP over SSL/TLS (IMAPS) is assigned the port number 993. Advantages over POP
POP is an application-layer Internet standard protocol used by e-mail clients to retrieve e-mail from a mail server. POP version 3 (POP3) is the version in common use. A POP3 server listens on well-known port number 110 for service requests. Encrypted communication for POP3 is either requested after protocol initiation, using the STLS command, if supported, or by POP3S, which connects to the server using Transport Layer Security (TLS) or Secure Sockets Layer (SSL) on well-known TCP port number 995.
SSH Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. SSH provides a secure channel over an unsecured network by using a client–server architecture, connecting an SSH client application with an SSH server. IT professionals and engineers use this to help configure and program a system remotely and securely. The standard TCP/UDP/SCTP port for SSH is 22. The encryption used by SSH is intended to provide Confidentiality and Integrity of data over an unsecured network, such as the Internet. SSH uses public-key cryptography to Authenticate the remote computer and allow it to authenticate the user, if necessary. SSH is typically used to log into a remote machine and execute commands, but it also supports tunneling, forwarding TCP ports and X11 connections; it can transfer files using the associated SSH file transfer (SFTP) or secure copy (SCP) protocols.[2]
SSH is a secure alternative to the non-protected login protocols (such as telnet, rlogin) and insecure file transfer methods (such as FTP). Putty is for Windows Operating System. Just a regular GUI interface for SSH protocol.
In SSH, a private key is used for authenticating computers and users. A host key authenticates servers, and an Authorized keys and identity key serves as an authentication credential for a user. Together they are called SSH keys. In SSH, public key cryptography is used for authenticating computers and users. Host keys authenticate hosts. Authorized keys and identity keys authenticate users. The most common type of SSH key is an authorized key, which is a public key.
ssh-keygen - creates a key pair for public key authenticationssh-copy-id - configures a public key as authorized on a serverssh-agent - Authentication Agent to hold private key for Public key authenticationssh-add - Adds private Key identities/fingerprints to the OPENSSH Authentication Agent.SSH (Secure Shell) is a protocol primarily used for secure remote login and other secure network services over an insecure network. It uses the client-server model and supports various forms of tunneling, which can be utilized to securely forward traffic over the network.
Architecture—>The SSH-2 protocol has an internal architecture (defined in RFC 4251) with well-separated layers, namely:
The SSHFP DNS record provides the public host key fingerprints in order to aid in verifying the authenticity of the host.
SSHD_confignetstat -aep | grep ':\*' — >LINUXsudo lsof -i -P | grep -i "listen" —>MacOS[Protocol 2][PermitRootLogin no]ChallengeResponseAuthentication no && HostBasedAuthentication no && PasswordAuthentication no && Pluggable Authentication Modules [UsePAM yes]PermitEmptyPasswords noAllowTcpForwarding no && AllowStreamLocalForwarding no && GatewayPorts no && PermitTunnel noLoginGraceTime should be set to lowest amount in secsLogLevel VERBOSE —> This way, the key fingerprint for any SSH key used for login is logged. No longer needed therefore SyslogFacility AUTH && LogLevel INFOListenAddress host|IPv4_addr|IPv6_addr or ListenAddress host|IPv4_addr:port or ListenAddress [host|IPv6_addr]:portKexAlgorithms option. We recommend ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256MACs option. A good value is hmac-sha2-256,hmac-sha2-512[Ciphers aes128-ctr,aes192-ctr,aes256-ctr HostKeyAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2- nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256 MACs hmac-sha2-256,hmac-sha2-512,hmac-sha1]FTP URL syntax ftp://[user[:password]@]host[:port]/url-path (the bracketed parts are optional). Users could connect to the FTP server anonymously if the server is configured to allow it, meaning that we could use it even if we had no valid credentials. If we look back at our nmap scan result, the FTP server is indeed configured to allow anonymous login: If you need a refresher, the ftp -h command will help you figure out the available commands for the FTP service on your local host.ftp-anon: Anonymous FTP login allowed (FTP code 230) from NMAP SCANLogin successful.ftp://public.ftp-servers.example.com/mydirectory/myfile.txt represents the file myfile.txt from the directory mydirectory on the server public.ftp-servers.example.com as an FTP resource. The URL ftp://user001:secretpassword@private.ftp-servers.example.com/mydirectory/myfile.txt adds a specification of the username and password that must be used to access this resource.Explicit FTPS is an extension to the FTP standard that allows clients to request FTP sessions to be encrypted. This is done by sending the "AUTH TLS" command. The server has the option of allowing or denying connections that do not request TLS.) or entirely replaced by ✅SSH/Secure File Transfer Protocol (SFTP is a network protocol that provides file access, file transfer, and file management over any reliable data stream has a similar command set for users, but uses the Secure Shell protocol (SSH) to transfer files. Unlike FTP, it encrypts both commands and data, preventing passwords and sensitive information from being transmitted openly over the network.) This protocol assumes that it is run over a secure channel, such as SSH, that the server has already authenticated the client, and that the identity of the client user is available to the protocol. It cannot interoperate with FTP software. *SFTP is not FTP run over SSH*Remote Synchronization is an open source utility that provides fast incremental file transfer, Fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied. It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use. The main concern with FTP is that it is a very old and slow protocol. FTP is a protocol used for copying entire files over the network from a remote server. In many cases there is a need to transfer only some changes made to a few files and not to transfer every file every single time. For these scenarios, the rsync protocol is generally preferred. The changes that need to get transfered are called deltas. Using deltas to update files is an extremely efficient way to reduce the required bandwidth for the transfer as well as the required time for the transfer to complete. It follows directly from the definition of rsync that it's a great tool for creating/maintaining backups and keeping remote machines in sync with each other. Both of these functionalities are commonly implemented in corporate environment. In these environments time is of of the most importance, so rsync is preferred due to the speedup it offers for these tasks.
The main stages of an rsync transfer are the following:
rsync OPTION … USER@{TargetHOSTIP}::SRC DEST
rsync {target_IP}::public/flag.txt flag.txt
where SRC is the file or directory (or a list of multiple files and directories) to copy from, DEST is the file or directory to copy to, and square brackets indicate optional parameters.
The [OPTION] portion of the syntax, refers to the available options in rsync . The list with all valid options is available over at the official manual page of rsync under the section Options Summary .
The [USER@] optional parameter is used when we want to access the the remote machine in an authenticated way. If we don't have any valid credentials at our disposal so we will omit this portion and try an anonymous authentication.
As our first attempt we will try to simply list all the available directories to an anonymous user. Reading through the manual page we can spot the option --list-only , which according to the definition is used to "list the files instead of copying them" ->> rsync --list-only {target_IP}::
✔️Port 135: RPC
svchost.exe. This is one of the main processes in any Windows operating system & it should not be terminated.✔️Port 139: NETBIOS
✔️SMB - Server Message Block Protocol
SMB - Server Message Block Protocol - is a client-server communication protocol used for sharing access to files, printers, serial ports and other resources on a network.
Servers make file systems and other resources (printers, Serial Ports between Endpoints, named pipes, APIs) available to clients on the network. Client computers may have their own hard disks, but they also want access to the shared file systems and printers on the servers.
The SMB protocol is known as a response-request protocol, meaning that it transmits multiple messages between the client and server to establish a connection.
During scanning, we will typically see port 445 TCP open on the target, reserved for the SMB protocol.
Usually, SMB runs at the Application or Presentation layers of the OSI model, pictured below. Due to this, it relies on lower-level protocols for transport. The Transport layer protocol that Microsoft SMB Protocol is most often used with is NetBIOS over TCP/IP (NBT). Clients connect to servers using TCP/IP (actually NetBIOS over TCP/IP {NBT} as specified in RFC1001 and RFC1002). Microsoft Windows operating systems since Windows 95 have included client and server SMB protocol support.
Samba, an open source server that supports the SMB protocol, was released for Unix systems. To access an SMB share, we need a client to access resources on servers (i.e SMBClient). We will be using SMBClient because it's part of the default samba suite.
Smbclient will attempt to connect to the remote host and check if there is any authentication required. If there is, it will ask you for a password for your local username. We should take note of this. If we do not specify a specific username to smbclient when attempting to connect to the remote host, it will just use your local machine's username. That is the one you are currently logged into your Virtual Machine with. This is because SMB authentication always requires a username, so by not giving it one explicitly to try to login with, it will just have to pass your current local username to avoid throwing an error with the protocol.
In this case, we do not have such credentials, so what we will be trying to perform is any of the following:
ADMIN$ Share: This is a special share that exists on Windows machines used primarily for system administration - allowing system admins to have remote access to every disk volume on the Remote system, typically allowing access to the C:\Windows directory on the remote machine. These shares may not be permanently deleted but may be disabled.
IPC$ Share: This share is used for inter-process communication (IPC), allowing programs running on networked computers to communicate with each other via named pipes and is not part of the file system.
C$: Administrative share for the C:\ disk volume. This is where the operating system is hosted - File system of the Windows Machine the SMB server is hosted
WorkShares: Custom share
In the context of Impacket's psexec.py, here's what happens:
connectTree('IPC$') to establish a session for IPC. This connection is crucial for sending commands & managing comms btw the local & remote systems.✔️Telnet
Telnet is an application protocol which allows you, with the use of a telnet client, to connect to and execute commands on a remote machine that's hosting a telnet server.
The telnet client will establish a connection with the server. The client will then become a virtual terminal- allowing you to interact with the remote host.
The user connects to the server by using the Telnet protocol, which means entering "telnet" into a command prompt. The user then executes commands on the server by using specific Telnet commands in the Telnet prompt.
You can connect to a telnet server with the following syntax: "telnet [ip] [port]"
✔️NFS
NFS stands for "Network File System" and allows a system to share directories and files with others over a network.
By using NFS, users and programs can access files on remote systems almost as if they were local files. It does this by mounting all, or a portion of a file system on a server. The portion of the file system that is mounted can be accessed by clients with whatever privileges are assigned to each file.
First, the client will request to mount a directory from a remote host on a local directory just the same way it can mount a physical device. The mount service will then act to connect to the relevant mount daemon using RPC (Remote Procedure Call).
The server checks if the user has permission to mount whatever directory has been requested. It will then return a file handle which uniquely identifies each file and directory that is on the server.
If someone wants to access a file using NFS, an RPC call is placed to NFSD (the NFS daemon) on the server. This call takes parameters such as:
These are used in determining access rights to the specified file. This is what controls user permissions, I.E read and write of files.
Open Network Computing Remote Procedure Call (ONC RPC) / Secure RPC is fundamental to the Secure NFS system. The goal of Secure RPC is to build a system that is at minimum as secure as a time-sharing system (one in which all users share a single computer). A time-sharing system authenticates a user through a login password. With data encryption standard (DES) authentication, the same authentication process is completed. Users can log in on any remote computer just as they can on a local terminal, and their login passwords are their passports to network security.
The first of which is key to interacting with any NFS share from your local machine: nfs-common. It is important to have this package installed on any machine that uses NFS, either as client or server. It includes programs such as: lockd, statd, showmount, nfsstat, gssd, idmapd and mount.nfs.
The fundamental notion behind the end-to-end principle is that for two processes communicating with each other via some communication means, the reliability obtained from that means(protocol) cannot be expected to be perfectly aligned with the reliability requirements of the protocol processes.
*packet* appears in both informal and formal usage, whereas in more precise terminology*segment* refers to the TCP layer protocol data unit (PDU)*datagram* refers to the UDP layer protocol data unit (PDU)*datagram* to the IP protocol data unit (PDU)*frame* to the data link layer protocol data unit (PDU)“Every network host is a node, but not every network node is a host”“HOST is a NODE” that participates in user applications, either as a server, client, or both. A server is a type of host that offers resources to the other hosts. Typically a server accepts connections from clients who request a service function.A firewall is a tool designed to intercept and assess incoming and outgoing packets. Depending on the types of devices we are protecting, and what we are protecting them from, we may choose to use different types of firewalls. They work mostly on the Network & Internet-Protocol Layer. Firewalls implement Network Address Translation.
✔️Packet-Filtering Firewalls
✔️Circuit-Level Firewalls
✔️Stateful Inspection Firewalls
--state option, which categorizes packets based on connection state as described in the following man page excerpt:
INVALID meaning that the packet is associated with no known connection, ESTABLISHED meaning that the packet is associated with a connection which has seen packets in both directions, NEW meaning that the packet has started a new connection, or otherwise associated with a connection which has not seen packets in both directions, and RELATED meaning that the packet is starting a new connection, but is associated with an existing connection, such as an FTP data transfer, or an ICMP error.✔️Application Firewalls
✔️Next-Generation Level Firewalls (NGLF)
Voice over IP (VoIP) and Video Teleconferencing have become standard communication methods. Many networks are upgrading from legacy voice services to IP-based protocols and products. Voice and video communication over IP networks has become ubiquitous, replacing traditional circuit-switched telephony and enabling rich multimedia experiences. These services rely on a suite of specialized protocols to ensure real-time delivery, quality of service (QoS), and session management. This chapter explores the foundational protocols that enable voice (VoIP) and video communication across IP networks. Voice over IP (VoIP) Fundamentals
Voice over IP (VoIP) is a methodology and group of technologies for the delivery of voice communications and multimedia sessions over Internet Protocol (IP) networks, such as the Internet. It functions by converting analog audio signals into digital packets that are then transmitted over the network.
Key Components of a VoIP System: IP Phones: Devices that convert voice into IP packets and vice-versa. Can be hardware or software (softphones). VoIP Gateways: Connect traditional PSTN (Public Switched Telephone Network) lines to IP networks, allowing calls between the two. Call Processors/IP PBX (Private Branch Exchange): Manage call setup, routing, and features like voicemail, conferencing, etc. Codecs: Algorithms used to compress and decompress digital audio signals. Examples include G.711 (PCMU/PCMA), G.729, G.722.
Legacy voice services traditionally use the Public Switched Telephone Network (PSTN). A common residential telephone installation would be serviced by a simple box providing a single analog interface to the local exchange. This analog interface is known as Plain Old Telephone Service (POTS), where each line provides a single channel for incoming and outgoing calls.
For businesses requiring many voice lines, a digital trunk line is used, often referred to as Time Division Multiplexing (TDM). A TDM circuit can multiplex separate voice data channels for transmission over a single cable.
A Private Branch Exchange (PBX) is an automated switchboard providing a single connection point for an organization's voice lines. A TDM-based PBX connects to telecommunication carriers over a digital trunk line, which supports multiple channels (e.g., for multiple concurrent calls). This PBX allows for the configuration of the internal phone system to direct and route calls to local extensions and provides other telephony features such as call waiting, forwarding, music on hold, and voicemail.
A VoIP-enabled PBX replaces the TDM-based PBX. It establishes connections between local VoIP endpoints, with data transmitted over the local Ethernet network. A VoIP PBX can also route incoming/outgoing calls to and from an external network. This might involve calls between internal & external VoIP endpoints or with callers on the voice telephone network. VoIP-based PBXs also support traditional telephony features.
A VoIP PBX would normally be placed at the network edge and protected by a firewall. Internal clients connect to the PBX over Ethernet data cabling, using IP at network layers for addressing. The VoIP PBX uses the organization's Internet link to connect to a VoIP service provider, which facilitates inbound and outbound calling.
VoIP protocols are designed to support real-time services and cover one or more of the following functions:
SIP Endpoints are the end-user devices, also known as User Agents, such as IP-enabled handsets or client-server web conferencing software. Each device, conference, or telephony user is assigned a unique SIP Address, known as a SIP Uniform Resource Indicator (URI). Examples include sip:jamie@support.com or sip:2622136227@support.com. There is also a tel: URI Scheme allowing SIP Endpoints to dial a landline or cell phone. A tel: URI can either use the global telephone format or a local format for internal extensions.
SIP runs over UDP or TCP ports 5060 (unsecured) and 5061 (SIP-TLS). It has its own reliability & retransmission mechanisms, benefiting most from the lower overhead, reduced latency, and jitter of UDP. SIP primarily provides session management. Key SIP Components/Roles:
User Agent (UA): Endpoints that initiate or terminate calls. Divided into:
User Agent Client (UAC): Initiates SIP requests.
User Agent Server (UAS): Receives SIP requests and sends responses.
SIP Proxy Server: Intermediary entities that receive SIP requests, forward them to the next hop, and return responses. Can also handle routing decisions.
SIP Registrar Server: Accepts REGISTER requests from UAs to record their current location.
SIP Redirect Server: Accepts a SIP request, maps the address of the called party to zero or more new addresses, and returns these addresses to the client. The client then contacts the new address directly.
Basic SIP Call Flow (Simplified):
INVITE: UAC sends INVITE to UAS (via proxy) to initiate a call.
100 Trying: Proxy acknowledges INVITE.
180 Ringing: UAS informs UAC that the called party is being alerted.
200 OK: Called party answers, UAS sends 200 OK.
ACK: UAC acknowledges 200 OK, call is established.
RTP: Media (voice/video) flows directly between UAs using RTP.
BYE: Either UA sends BYE to terminate call.
200 OK: Receiver acknowledges BYE.
H.323 is an ITU-T recommendation that defines protocols for providing audio-visual communication sessions on any packet network. While less common for new deployments compared to SIP, it is still used in many legacy enterprise and service provider networks, particularly for video conferencing systems. H.323 is a binary, complex protocol that defines various components and their interactions.
Key H.323 Components/Roles:
H.323 vs. SIP (Key Differences):
| Feature | H.323 | SIP |
|---|---|---|
| Origin | ITU-T (Telecommunications Focus) | IETF (Internet Focus) |
| Complexity | More complex, binary, monolithic | Simpler, text-based, modular |
| Architecture | Gatekeeper-centric, tightly coupled | Client-server, peer-to-peer, loosely coupled |
| Ports | Uses multiple well-defined ports | Primarily UDP/5060, TCP/5060 |
| Scalability | Less scalable in large, distributed environments | Highly scalable |
| Extensibility | Less flexible, harder to extend | Highly extensible, easy to adapt |
| Legacy Use | Common in legacy video conferencing, PSTN gateways | Dominant for modern VoIP/UC deployments |
RTP and RTCP are fundamental protocols for delivering real-time voice and video data over IP networks once a session has been established by signaling protocols like SIP or H.323.
Video communication over IP involves specific protocols and codecs for efficient compression, transmission, and rendering of video streams.
VoIP/SIP Endpoints can be implemented as software (softphones) or as dedicated hardware handsets.
SIP Endpoints can establish communications directly in a peer-to-peer architecture. However, it's more typical to use intermediary servers, directory servers, and VoIP Gateways. A Voice Gateway is a component that translates between a VoIP system and legacy voice equipment and networks (e.g., POTS lines, TDM PBXs).
Hybrid/Hardware-based VoIP PBX Integration (Type 1):
Legacy System Connecting to VoIP Service Provider (Type 2):
Connecting POTS Handsets to VoIP PBX (Type 3):
In essence, a VoIP Gateway is a component in a network that allows calls to be placed to and from voice telephony networks (PSTN) and packetized telephony networks (VoIP).
Cabling is the backbone of any network infrastructure, providing the physical medium for data transmission. Proper cabling ensures reliable and high-performance network operations. This chapter delves into the various standards and types of cabling, focusing on Ethernet (copper) and Fibre Optic cabling. Ethernet cabling, primarily copper-based, is widely used for local area networks (LANs) due to its cost-effectiveness and ease of installation. Different categories of Ethernet cables support varying speeds and distances.
IEEE 802.3 Standards are the most important Ethernet specifications for effectively deploying wired LANs. Ethernet dominates the wired LAN market due to ease of installation and upgradability.
All Networking Signals use EM Radiation of one type or another, such as:
Taking advantage of wave characteristics, signals are transmitted over the wave by modulation & encoding schemes. An example of encoding is transitioning between low to high voltage states in an electrical circuit, which in turn encodes digital info as 0, 1 data bits.
Copper Cable transmits Electrical Signals using low voltage circuits between connected nodes in a circuit. It suffers from high Attenuation (i.e., signals lose strength over long distances).
Fibre Optics, on the other hand, carries very high frequency radiation in the Infrared light part of the EM spectrum. The light signals are not susceptible to outside noise interference and are less affected by attenuation, supporting higher bandwidth over longer links than copper cabling.
XGBase-Y
X: Bit Rate in Mbps or Gbps (e.g., 10, 100, 1000, 10G, 40G).Base: Baseband (all Ethernet transmission is Baseband, meaning the entire frequency range is used for one signal at a time, versus broadband which divides the frequency).Broadband: Multiple frequencies sharing the same medium of connectivity. Common in Fiber Optic.Y: Media type designator (e.g., T for Twisted Pair, SX for Short wavelength multimode fiber, LX for Long wavelength multimode fiber).Bandwidth refers to the frequency range measured in cycles per second or Hertz (Hz). In networking, this means the amount of data transferred, measured in bits per second (bps). For a signal with 100MHz frequency bandwidth, it can transfer much more than 100 Mbps. Due to the higher frequency required, sometimes this can cause interference. Therefore, shielding is required for longer distance Fibre Optic runs.
Since Ethernet is a multiple access area network (i.e., available communication capacity is shared between nodes connected to the same medium of transmission), the Media Access Control (MAC) refers to the method a network technology uses to determine when nodes communicate in shared media and to deal with possible issues of two devices communicating simultaneously.
Each network node connected to the same media is said to be in the Same Collision Domain.
Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a protocol governing media access. A collision is a state when signals are present in an interface's transmit and receive lines simultaneously. On detecting a collision, the node broadcasts a Jam Signal. Every other node attempts a Backed-off wait for a random period before attempting to retransmit again. This mechanism means only half-duplex transmission is possible (Transmit OR Receive, but NOT BOTH simultaneously).
Using screened or shielded cable means that you must also use screened or shielded connectors. Their elements should not be mixed with unscreened/unshielded elements.
A Plenum space is an air-handling space in a building (e.g., false ceilings, raised floors). This space can be used for telecommunications cabling. Therefore, building regulations demand the use of fire-retardant Plenum Cabling in such places. Plenum cables must not emit large amounts of smoke when burned, be self-extinguishing, and meet other fire safety standards. (Compare with General Purpose (non-plenum) CM/CMR/CMP cables).
Riser Cables are passed through floors, in conduits or lift shafts.
Coaxial Cable is categorized using Radio Grade (RG) Standards, which represent the thickness of the core conductor and the cable's characteristics. Coaxial means a cable made of 2 conductors that share the same axis. The core conductor is made of a copper core (solid or stranded, not twisted) and enclosed by plastic insulation. A wire mesh (second conductor) serves as both shielding from EMI and as a ground (earth) surrounding the insulating material. Coax is usually terminated using BNC connectors, securely screwed or crimped.
Twin-Axial (Twinax) is similar to coax but contains 2 twin conductors. Mostly used in data centers (10GbE and 40GbE) interconnects up to 5m for passive cable types and 10m for active cable types. Terminated using SFP+ Direct Attach Copper (DAC) and QSFP+ DAC transceivers.
American Wire Gauge (AWG) is a measure of wire thickness. Increasing AWG number represents thinner wire.
These standards define classes of networking infrastructure.
International ISO/IEC 11801: International cabling standards.
Telecommunications Industry Association (TIA) standards: US-centric cabling standards (e.g., ANSI/TIA/EIA 568). Structured cabling is a scheme for deploying Ethernet cabling.
Work Area: User space for equipment connected to the network, usually via a wall outlet.
Horizontal Cabling: Connects user work areas to the nearest Horizontal Cross-Connect (HCC) / Telecommunications Room (TR). Referred to as a "distribution frame." Consists of cabling from a single floor, made up of cables run horizontally through wall ducts.
Backbone Cabling: Connecting Horizontal Cross-connects via Intermediate Cross-Connects (ICCs). Inside risers, elevator shafts, HVAC spaces referred to as Vertical cross-connects, running up and down between floors.
Telecommunications Room (TR): Houses HCCs, essentially a termination point for the Horizontal Cabling along with a connection to backbone cabling.
Equipment Room: Houses the main intermediate cross-connects, houses complex equipment such as switches, routers & modems.
Entrance Facilities / DEMARC POINT: Required for the access provider's network and for inter-building communications, marking the point at which external cabling (outside plant) is joined to internal premises cabling.
These techniques ensure that cabling is reliable and easy to maintain.
Copper wire is terminated using a distribution frame or Punchdown Block. A punchdown block comprises a large number of Insulation-Displacement Connections (IDCs).
In data networks, numerous MACs (Moves, Adds, Changes) would require reterminating the wiring. A Patch Panel is a type of distribution block with IDCs on one side & pre-terminated RJ-45 modular ports on the other, allowing incoming & outgoing connections to be reconfigured by changing the Patch Cable Connections, which is much simpler than reterminating punchdown blocks.
The structured cabling forming a backbone is terminated at the back of the patch panel on the IDCs. An RJ-45 patch cord is used to connect the port to another network port, typically a switch port housed in the same rack.
Fixed cable is terminated using a Punchdown Tool, which fixes conductors into an IDC. Different formats for IDCs (66, 110, BIX & KRONE) all require different cutting blades. Blades are double-sided: one side pushes the core into the terminal while the other side cuts excess.
A Patch Cord is created using a Cable Crimper, which fixes a plug to a cable. The boots are specific to the type of connector and cable, though some may have modular dies to support a range of RJ type plugs.
You must untwist the ends of the wire pairs (no more than 0.375") and place them into the connector die in the correct order for the wiring configuration (T568A or T568B) you want. For shielded/screened cable, termination must be made to shielded RJ-45 or modular plugs. A shielded modular plug has a metal housing and is not terminated using a standard cable crimper.
This entire note is Cable Management for Copper Cabling Ethernet. Next, we will look into Fiber Distribution Panels.
Wavelength Division Multiplexing (WDM) is a means of using a single fiber strand to transmit and/or receive more than one channel at a time. This involves Optical Add/Drop Multiplexers (OADMs) which can insert or remove signals for a given wavelength. Wavelength Division Multiplexing (WDM) helps enable bi-directional communication over a single strand of fiber by using different wavelengths for each channel. This is achieved by combining multiple optical carriers into a single fiber.
Twisted Pairs consist of two wires with equal and opposite signals (Transmit +, Transmit -, Receive +, Receive -). The twist provides advantages like limited interference. The pairs within the same cable have different twist rates, which helps in signal reconstruction by reducing crosstalk.
| Category | Max Speed | Max Distance (100Mbps) | Max Distance (1Gbps) | Max Distance (10Gbps) | Shielding | Notes |
|---|---|---|---|---|---|---|
| Cat3 | 10 Mbps | 100 meters | N/A | N/A | UTP | Older voice and 10BASE-T data networks. |
| Cat5 | 100 Mbps | 100 meters | N/A | N/A | UTP | Common for 100BASE-TX Ethernet. |
| Cat5e | 1 Gbps | 100 meters | 100 meters | N/A | UTP | Enhanced for Gigabit Ethernet, reduced crosstalk. |
| Cat6 | 1 Gbps | 100 meters | 100 meters | 55 meters | UTP/STP | Better performance at higher bandwidths, often with internal separator. |
| Cat6a | 10 Gbps | N/A | N/A | 100 meters | UTP/STP | Enhanced for 10 Gigabit Ethernet over full distance. |
| Cat7 | 10 Gbps | N/A | N/A | 100 meters | S/FTP | Designed for 10 Gigabit Ethernet, individually shielded pairs. |
| Cat8 | 25/40 Gbps | N/A | N/A | 30 meters | F/UTP, S/FTP | Designed for 25GBASE-T and 40GBASE-T, typically for data centers. |
Note:
Optical Fiber transmits data using light signals. Fiber Optic Cabling supports higher bandwidth over long distances than copper. Fiber Optic signals use Infrared pulses, which are not susceptible to interference or attenuation.
Both the Cladding and Core are made up of similar material, however, with different refractive indexes, so as to create a boundary that causes light to bounce back into the core via total internal reflection. The surrounding buffer is an outer protective plastic coating.
Each optic strand can only transfer light in a single direction at a time. Therefore, multiple strands are bundled together for transmission & reception simultaneously. Fiber Optic Cables are specified using the core/cladding size in microns, the composition (either Fiberglass rods or Kevlar plastic), and the mode of operation.
Fibre Optics is used in backbone links in campus networks, data centers, and storage area networks due to the increased bandwidth for server interconnections.
Fibre Optic is divided into Single Mode (SMF) and Multimode (MMF) types. MMF is characterized by the Optical Mode designators (OM1, OM2, OM3, OM4).
Comparison: Fibre gives better upgrade potential in the future, while copper is cheaper to install, and more hosts are installed with network cards supporting copper than fiber.
Different types of connectors are used to terminate fibre optic cables, each with specific applications and advantages.
| Connector Type | Ferrule Size (mm) | Description | Common Use Cases | Notes |
|---|---|---|---|---|
| SC (Standard Connector) | 2.5 | Push-pull latching mechanism, square connector. | Data communications, telecom, LAN, Fibre Channel | Easy to use, good for high-density patching. |
| LC (Lucent Connector) | 1.25 | Small form-factor, latching mechanism, often used in duplex. | High-density patches, data centers, SFP/SFP+ transceivers | Half the size of SC, very popular due to small size. |
| ST (Straight Tip) | 2.5 | Bayonet mount, typically used with multi-mode fiber. | Older networks, campuses, military applications | Twist-on/off mechanism, common with multi-mode. |
| FC (Ferrule Connector) | 2.5 | Screw-on locking mechanism, common in single-mode. | Data communication, telecom, high-vibration environments | Provides high connection strength, often used in industrial settings. |
| MPO/MTP (Multi-fiber Push-on/pull-off) | N/A (Multi-fiber) | Multi-fiber connector housing 8, 12, 24, or more fibers. | Data centers, backbone, high-density environments | Used for parallel optics, requires specialized tools. |
| Standard | Speed | Fibre Type | Max Distance (Typical) | Notes/Common Use Cases |
|---|---|---|---|---|
| 100BASE-FX | 100 Mbps | Multi-Mode Fibre | up to 2 km | |
| 1000BASE-SX | 1 Gbps | Multi-Mode Fibre | up to 550 m | (Short Wavelength) |
| 1000BASE-LX | 1 Gbps | Single-Mode or Multi-Mode Fibre | up to 5 km (SMF) / 550m (MMF) | (Long Wavelength) |
| 10GBASE-SR | 10 Gbps | Multi-Mode Fibre | up to 300 m (OM3) / 400 m (OM4) | (Short Reach) |
| 10GBASE-LR | 10 Gbps | Single-Mode Fibre | up to 10 km | (Long Reach) |
| 40GBASE-SR4 | 40 Gbps | Multi-Mode Fibre | up to 100 m (OM3) / 150 m (OM4) | Uses MPO/MTP connectors. |
| 40GBASE-LR4 | 40 Gbps | Single-Mode Fibre | up to 10 km | |
| 100GBASE-SR4 | 100 Gbps | Multi-Mode Fibre | up to 70 m (OM3) / 100 m (OM4) | Uses MPO/MTP connectors. |
| 100GBASE-LR4 | 100 Gbps | Single-Mode Fibre | up to 10 km |
Controlling light and applying the laws of physics are crucial at the physical contact (PC) points of connectors. Return loss refers to light reflected back to the source. This is resolved using different polishing techniques:
Because continually reconnecting fiber optic cables risks wear & tear damage, and to avoid replacing cable runs through conduit, permanent cables are run through conduit walls to wall posts at the access area end and to a Fiber Distribution Panel at the switch end.
Fiber patch cables are used to complete the link from the wall post to the NIC, and from the patch panel to the switch port.
A Fusion Splice achieves a more permanent join with lower insertion loss. The Fusion splicing machine performs a precise alignment between the two strands and then permanently joins them together using heat; the strands are welded. A High precision instrument must be kept clean & maintained following guidelines.
Network devices are the fundamental components that enable communication and data exchange within a computer network. They perform various functions, from simply extending a signal to intelligent routing and security. Understanding how these devices are categorized helps in designing, implementing, and troubleshooting networks effectively. Devices can be categorized based on their function, the OSI layer at which they primarily operate, or their role within a network's architecture.
Network devices often operate predominantly at specific layers of the OSI (Open Systems Interconnection) model, influencing their functionality and interaction with data.
These devices operate at the lowest layer, dealing with the physical transmission of raw bit streams over a physical medium. They are primarily concerned with the electrical, mechanical, procedural, and functional characteristics of the network.
A Hub acts like a multi-port repeater so that every port receives transmissions sent from any other port. Consequently, every hub port is part of the same shared media access area and within the same Collision Domain. All node interfaces are half-duplex, using the CSMA/CD protocol. The media bandwidth (10 Mbps / 100 Mbps) is shared between all nodes. When Ethernet is wired with a hub, there needs to be a means of distinguishing the Interface on an End system (Computer host / client) from the Interface on an Intermediate system (a HUB). The end system is referred to as MDI (Medium-Dependent Interface). The interface on the hub is referred to as MDI Crossover (MDI-X). This means that the Transmit (Tx) wires on the host connect to Receive (Rx) wires on the hub.
Hubs:
Repeater: Overcomes the distance limitation by boosting a signal at some point along the cable run. This is a Layer 1 (Physical Layer) device.
Media Converter: When a repeater is used to transition from one Cable type to another, thereby connecting two cable segments of different types.
Transceivers A network might involve multiple types of Cabling. When this occurs, switches & Router equipment must be able to terminate different cable and connector types, and devices must convert from one media type to another. There are also Transceiver modules for Copper wire Cabling. In the past, Transceiver modules were based on the Gigabit Interface Converter (GBIC) form factor, which used Subscriber Connector (SC) ports for Gigabit Ethernet. It has been replaced by SFP (Small Form-Factor Pluggable), also known as Mini-GBIC. SFP uses LC connectors and is also designed for Gigabit Ethernet. Enhanced SFP (SFP+) is an updated specification to support 10GbE but still uses the LC form factor, with different modules to support various Ethernet standards. A transceiver is designed to support a specific wavelength. Transceivers must be installed as matched pairs. The term MSA (Multi-Source Agreement) is intended to ensure that a transceiver from one vendor is compatible with the switch/router module of another vendor.
The Quad Small Form-Factor Pluggable (QSFP) is a transceiver with a form factor of 4x1 Gigabit (4Gbps) links, typically aggregated to a single 4Gbps channel.
The Enhanced QSFP (QSFP+) is designed to support the 40GbE standard by provisioning 4 x 10Gbps links, where four strands transmit and four are unused, to transmit a full-duplex 40Gbps link.
Transceiver combines a Transmitter (Tx) and Receiver (Rx) in a single component.
Transceiver Form Factors
These devices operate at the Data Link Layer, dealing with MAC (Media Access Control) addresses and frames. They provide error-free transfer of data frames from one node to another over the physical layer.
An Ethernet Bridge establishes a connection between separate physical network segments while keeping all nodes in the same logical network (Broadcast Domain), thereby reducing the number of collisions caused by having too many nodes contending for access. By isolating these segments from each other, nodes in one domain do not slow down or contend with nodes in another domain.
An Ethernet Bridge builds a MAC address table in memory to track which addresses are associated with which of its ports. It's initially empty pre-initialization, but information is constantly added as the bridge listens to the connected segments. Entries are flushed out of the table after a period to ensure information remains current. If no record of a hardware address (MAC) exists or the frame is a broadcast/multicast, then the bridge floods the frame to all segments except for the source segment (acting like a Layer 1 HUB).
The contention problem (where the probability of collision increases and opportunity to transmit becomes less frequent as more devices access the shared medium) is improved by bridges but not fully resolved.
Bridges:
Switches: The contention problem can be completely resolved by moving from a shared Ethernet System to Switched Ethernet, thereby replacing Hubs & Bridges. Switches perform the same function as bridges, but in a more granular way and support many more ports. Gigabit and 10 Gigabit Ethernet (GbE / 10GbE) cannot be deployed without switches.
Each Switch port is a separate Collision Domain. In effect, the switch establishes a point-to-point link between any two network nodes. This is referred to as MICRO SEGMENTATION (absence of segments).
As with a bridge, traffic on all switch ports is in the same Broadcast Domain, unless the switch is configured to use Virtual LANs (VLANs).
These devices operate at the Network Layer, dealing with IP (Internet Protocol) addresses and packets. They are responsible for routing packets between different networks (IP subnets).
These devices operate at higher OSI layers, often performing complex functions that go beyond simple packet forwarding, examining data content, and managing application-level traffic.
Network devices can also be categorized based on their logical placement and role within a network's design, especially in hierarchical models (e.g., Cisco's three-tier model).
| Role/Function | Typical Devices | Key Features |
|---|---|---|
| Access Layer Devices | Layer 2 Switches (unmanaged or basic managed) | Port security, VLAN assignments, PoE (Power over Ethernet). |
| Distribution Layer Devices | Layer 3 Switches, Routers | Inter-VLAN routing, ACLs (Access Control Lists), QoS (Quality of Service), redundancy (e.g., HSRP, VRRP). |
| Core Layer Devices | High-end Layer 3 Switches, Routers | Extreme forwarding capacity, redundancy, low latency. Focus solely on fast packet forwarding. |
| Wireless Devices | Wireless Access Points (APs), Wireless LAN Controllers (WLCs) | SSID management, security (WPA3), roaming, client management. |
| Security Devices | Dedicated Firewalls, Intrusion Prevention Systems (IPS), VPN gateways, Web Application Firewalls (WAFs) | Packet filtering, stateful inspection, deep packet inspection, threat intelligence. |
The InterOperating System (IOS) is the proprietary operating system used on Cisco Systems routers and network switches. Understanding its boot phase is crucial for network administrators to troubleshoot startup issues and manage device configurations. The IOS boot phase involves a sequence of steps that the device performs to load its operating system and configuration.
The Cisco IOS Boot Sequence:
Power-On Self-Test (POST):
Load Bootstrap (Boot Loader):
Locate and Load Cisco IOS Image:
boot system command configured with a TFTP path.0x2102 (default): Tells the router to attempt to load an IOS image from Flash, then ROM.0x2101: Boots directly into ROMmon mode.0x2142: Tells the router to ignore the startup-config during boot. (Useful for password recovery).Load Configuration File (Startup-config):
startup-config file is stored in NVRAM.startup-config is copied into RAM and becomes the running-config. This applies all the saved configurations (interface settings, routing protocols, passwords, etc.) to the device.startup-config is found in NVRAM, the device enters Setup Mode (or initial configuration dialog), prompting the user to perform a basic configuration. This typically happens on a brand-new device or after erasing the NVRAM.Running Configuration:
running-config.running-config in RAM. These changes are lost upon reboot unless explicitly saved to startup-config in NVRAM using the copy running-config startup-config command (or write memory).IOS exists as a file—a single file—that the router then loads into RAM to use as its operating system. To better understand the process, you need to understand the IO file system (IFS), which defines how IOS stores files (including the IOS file). The IOS image upgrade process occurs by copying new IOS files into the router and then booting the router with that new IOS. Every OS creates file systems to store files. A computer needs some type of permanent storage, but it needs more than just a place to store bytes. The OS organizes the storage into a file system, which includes directories, structure, and filenames, with the associated rules. By using a file system, the OS can keep data organized so the user and the applications can find the data later. As for the physical storage, Cisco routers typically use flash memory, with no hard disk drive. Flash memory is re-writeable, permanent storage, which is ideal for storing files that need to be retained when the router loses power. Cisco purposefully uses flash memory rather than hard disk drives in its products because there are no moving parts in flash memory, so there is a smaller chance of failure as compared with disk drives. Some routers have flash memory on the motherboard. Others have flash memory slots that allow easy removal and replacement of the flash card, but with the intent that the card remain in the device most of the time. Also, many devices have USB slots that support USB flash drives. Flash memory is where the IOS image (or multiple images) is permanently stored when the device is powered off. Think of it as the hard drive for your IOS.
Flash memory is electrically erasable programmable read-only memory (EEPROM), which allows for updates and storage of multiple IOS versions. For each physical memory device in the router, IOS creates a simple IOS file system and gives that device a name. IOS uses these file systems for other purposes as well, with these types:
Many IOS commands refer to files in an IFS, but only some commands refer directly to the files by their formal names. The more command itself displays the contents of a file. However, many commands use a keyword that indirectly refers to a formal filename, to reduce typing. For example:
show running-config command: Refers to file system:running-configshow startup-config command: Refers to file nvram:startup-configshow flash command: shows the files in the default flash file system (flash0:)Router# show file systems
boot system filepath → This command tells the router the location of the Upgraded IOS image to boot from on device startup. I.e. boot system flash:c2900-universalk9-mz.SPA.155-2.T1.bindelete filepath → delete flash:c2900-universalk9-mz.SPA.155-2.T1.binThe more general dir flash0: command lists the contents of that same file system, with similar information. You can use the dir command to display the contents of any local IFS.
Router# dir flash0:
One of the first steps to upgrade a router’s IOS to a new version is to obtain the new IOS image and put it in the right location. Typically, Cisco routers have their IOS in one of the local physical file systems, most often in permanent flash. The only requirement is that the IOS be in some reachable file system—even if the file sits on an external server and the device loads the OS over the network. However, the best practice is to store each device’s IOS file in flash that will remain with the device permanently.
The process to upgrade an IOS image into flash memory, using the following steps:
copy command from the router, copying the file into the flash memory that usually remains with the router on a permanent basis. (Routers usually cannot boot from the IOS image in a USB flash drive.)Router# copy tftp|ftp flash
The copy tftp|ftp flash command Copies the IOS Image to Flash Memory.
The copy command does a simple task—copy a file—but the command also has several small items to check. It needs a few pieces of information from the user, so the command prompts the user for that information by showing the user some text and waiting for the user’s input. The command works through these kinds of questions:
The router prompts you for answers to some of these questions, as necessary. For each question, you should either type an answer or press Enter if the default answer (shown in square brackets at the end of the question) is acceptable. Afterward, the router erases flash memory if directed, copies the file, and then verifies that the checksum for the file shows that no errors occurred in transmission.
The copy command allows you to use a URI for the source and/or destination, which lets you put most or all of the information in the command line itself. Each URI refers to the formal name of a file in the IFS. The “ftp” part identifies the protocol, of course. After the //, the text references the username and password, as well as the FTP server’s IP address. After the single / comes the filename on the server. Although the command is long, it has only two parameters, with the long first parameter and the short keyword flash as the second parameter. The COPY command lists the source location as the first parameter and the destination as the second. The destination in this case, flash, is a keyword that refers to the default flash, typically flash0:, but it does not identify a specific filename. As a result, IOS prompts the user for a specific destination filename, with a default (in brackets) to keep the source filename. In this case, the user just pressed Enter to accept the default. To avoid being prompted at all, the command could have listed flash:c2900-universalk9-mz.SPA.155-2.T1.bin as that second parameter, fully defining the destination file.
The IOS copy command, when using the tftp or ftp keyword, makes the command act as a client. The client connects to a TFTP or FTP server and then attempts to transfer the file.
Cisco provides a means to check the integrity of the IOS file to prevent malicious downloads. First, when Cisco builds a new IOS image, it calculates and publishes an MD5 hash value for that specific IOS file. That is, Cisco uses as input the IOS file itself, runs the MD5 math algorithm against that file, producing a hex code. Cisco places that code at the download site for all to see. Then, you run that same MD5 math on your router against the IOS file on the router, using the IOS verify command. That command will list the MD5 hash as recalculated on your router. If both MD5 hashes are equal, the file has not changed.
MD5 Verification of IOS Images— The verify /md5 command generates the MD5 hash on your router/switch. Note that you can include the hash value computed by Cisco as the last parameter or leave it off. If you include it, IOS will tell you if the locally computed value matches what you copied into the command. If you leave it out, the verify command lists the locally computed MD5 hash, and you have to do the picky character-by-character check of the values yourself.
Router# verify /md5 flash:c2900-universalk9-mz.SPA.155-2.T1.bin [MD5_HASH_FROM_CISCO]
Device provisioning involves the automated setup and configuration of new network devices. This includes applying initial configurations, setting up interfaces, assigning IP addresses, and implementing basic security policies. Automating these steps eliminates manual, repetitive tasks, significantly speeding up the deployment process and minimizing the risk of human error.
Compliance checks automate the process of verifying if device configurations adhere to predefined standards and policies. While important for maintaining network health and security, they don't directly involve the initial configuration process.
Device software management focuses on automating the upgrading, patching, and managing of software versions on network devices. This is crucial for maintenance but not the primary task of initial configuration.
Data collection and telemetry involve the automated gathering of performance metrics and operational data from network devices. This provides valuable insights but doesn't directly impact the efficiency and accuracy of the configuration process itself.
SW/RT>enable → Enter privileged modeSW/RT>Exit → Exit privileged exec mode or cli terminalSW/RT# configure terminal → Enter Global Configuration Mode TerminalWrite or Write Memorycopy run startcopy running-config startup-configSW(config)# hostname Office → Change Switch HostnameThe ultimate way to protect passwords in Cisco IOS devices is to not store passwords in IOS devices. That is, for any functions that can use an external authentication, authorization, and accounting (AAA) server, use it. The configuration labelled SSH and TELNET in the figure supports both SSH and Telnet, but consider allowing SSH only by instead using the transport input ssh command. The Telnet protocol sends all data unencrypted, so any attacker who copies the message with a Telnet login will have a copy of the password.
SW/RT# enable passwd Cisco123
This sets password to protect privileged mode with a password. Cisco used the enable password password global command to define the password that users had to use to reach enable mode (after using the enable EXEC command).
SW/RT# service password-encryption
Encrypt the Clear Text password. Cisco attempted to solve this clear-text problem by adding a command to encrypt those passwords: the service password-encryption global configuration command. This command encrypts passwords that are normally held as clear text, specifically the passwords for these commands:
password password (console or vty mode)username name password password (global)enable password password (global)IOS adds the encryption or encoding type of “7” to the command, which specifically refers to passwords encrypted with the service password-encryption command. While the service password-encryption global command encrypts passwords, the no service password-encryption global command does not immediately decrypt the passwords back to their clear-text state. Instead, after you enter the no service password-encryption command, the passwords remain encrypted until you change a password. Unfortunately, the service password-encryption command does not protect the passwords very well. Armed with the encrypted value, you can search the Internet and find sites with tools to decrypt these passwords.
Cisco has never removed the much weaker enable password command from IOS. So, on a single switch (or router), you can configure one or the other, both, or neither. What, then, does the switch expect us to type as the password to reach enable mode? It boils down to these rules:
enable secret password command (and ignore the enable password password command).The Cisco enable secret command protects the password value by never even storing the clear-text password in the configuration. However, that one sentence may cause you a bit of confusion: If the router or switch does not remember the clear-text password, how can the switch know that the user typed the right password after using the enable command?
enable secret command and stores the hash of the password in the configuration.enable command to reach enable mode, a password that needs to be checked against that configuration command, IOS hashes the clear-text password as typed by the user.As a result, IOS can store the hash of the password but never store the clear-text password; however, it can still determine whether the user typed the same password.
SW/RT# enable secret password
However, using secret uses a more secure encryption algorithm (MD5 Hashing {5}, PBKDF2 {4}, SHA-256 {8}, scrypt {9}) for encrypting the enable password stored in the configuration file.
enable [algorithm-type md5] secret passwordenable algorithm-type sha256 secret passwordenable algorithm-type scrypt secret passwordSW/RT# username user password pass
Encoding the Passwords for Local Usernames.
SW/RT# login local
Login to the Local User; Request for Username:password.
IOS does not use the same logic for the username command as it does for allowing both the enable secret plus enable password commands to exist in the same configuration. IOS allows:
username command for a given username—either a username user password password command or a username user secret password command.username password and username secret) in the same router or switch (for different usernames).You should use the username secret command instead of the username password command when possible. However, note that some IOS features require that the router knows a clear-text password via the username command (for instance, when performing some common authentication methods for serial links called PAP and CHAP). In those cases, you still need to use the username password command.
SW1(config)#ip default-gateway 192.168.1.254
Configure the switch's default gateway. If SW1 doesn't have a default gateway, it can't communicate with devices outside its subnet.
SW1(config)#enable secret ccna
If an enable password/secret isn't configured, you won't be able to access privileged exec mode when connecting via Telnet.
SW1(config)#username maverick secret ccna
SW1(config)#access-list 1 permit host 192.168.2.1
Configure an ACL to limit which devices can connect to the VTY lines.
SW1(config)#line vty 0 15
Telnet/SSH access is configured on the VTY lines. There are 16 lines available, so up to 16 users can be connected at once. (VTY stands for Virtual TeleType).
SW1(config-line)#login local
SW1(config-line)#exec-timeout 5 0
SW1(config-line)#transport input telnet|ssh|all|none
Allows either Telnet/SSH or Both/No transport connections on the Virtual Teletypewriter console line configured.
SW1(config-line)#access-class 1 in
Apply the ACL to the VTY lines. *access-class applies an ACL to the VTY lines, ip access-group applies an ACL to an interface.
SSH (Secure Shell) was developed in 1995 to replace less secure protocols like Telnet. In computing, a shell is a computer program which exposes an operating system's services to a human user or other program. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer's role and particular operation. It is named a shell because it is the outermost layer around the operating system. SSHV2, a major revision of SSHV1, was released in 2006. If a device supports both version 1 and version 2, it is said to run 'version 1.99'.
Connect: ssh -L username ip-address or ssh username@ip-address
SW(config)# hostname Office
Change Switch Hostname.
SW1(config)#ip domain name jeremysitlab.com
The FQDN of the device is used to name the RSA keys. FQDN = Fully Qualified Domain Name (host name + domain name).
SW1(config)#crypto key generate rsa
Generate the RSA keys.
SW1(config)#crypto key generate rsa modulus Length is an alternate method.
*length must be 768 bits or greater for SSHv2
SW1(config)#enable secret ccna
or
SW1(config)#username Maverick secret ccna
SW1(config)#access-list 1 permit host 192.168.2.1
SW1(config)#ip ssh version 2
(optional, but recommended) Restrict SSH to version 2 only.
SW1(config)#line vty 0 15
Configure all VTY lines, just like Telnet.
SW1(config-line)#login local
Enable local user authentication. *you can only use login local for SSH.
SW1(config-line)#exec-timeout 5 0
(optional, but recommended) Configure the exec timeout.
SW1(config-line)#transport input ssh
Best practice is to limit VTY line connections to SSH only.
SW1(config-line)#access-class 1 in
(optional, but recommended) Apply the ACL to restrict VTY line connections. When an external user connects to a router or switch using Telnet or SSH, IOS uses a vty line to represent that user connection. IOS can apply an ACL to the vty lines, filtering the addresses that can telnet or SSH into the router or switch. If filtered, the user never sees a login prompt. ACL checks the source IP address of packets for incoming Telnet/SSH connections.
IOS also supports using ACLs to filter outbound Telnet and SSH connections. For example, consider a user who first uses Telnet or SSH to connect to the CLI and now sits in user or enable mode. With an outbound vty filter, IOS will apply ACL logic if the user tries the telnet or ssh commands to connect out of the local device to another device.
To configure an outbound VTY ACL, use the access-class acl out command in VTY configuration mode. Once configured, the router filters any attempts made by current vty users to use the telnet and ssh commands to initiate new connections to other devices.
Of the two options—to protect inbound and outbound connections—protecting inbound connections is by far the more important and more common. However, to be complete, outbound VTY ACLs have a surprisingly odd feature in how they use the ACL. When the out keyword is used, the standard IP ACL listed in the access-class command actually looks at the destination IP address, and not the source. That is, it filters based on the device to which the telnet or ssh command is trying to connect.
| Command / Context | Description |
|---|---|
line console 0 | Command that changes the context to console configuration mode. |
line vty 1st-vty last-vty | Command that changes the context to vty configuration mode for the range of vty lines listed in the command. |
login (Console and vty config) | Tells IOS to prompt for a password. |
password pass-value (Console and vty config) | Lists the password required if the login command is configured. |
login local (Console and vty config) | Tells IOS to prompt for a username and password, to be checked against locally configured username global configuration commands. |
| `username name [algorithm-type md5 | sha256 |
username name password pass-value (Global) | Defines a username and password, stored in clear text in the configuration by default. |
| `crypto key generate rsa [modulus 512 | 768 |
| `transport input {telnet | ssh |
[no] service password-encryption (Global) | Global command that encrypts all clear-text passwords in the running-config. The no version of the command disables the encryption of passwords when the password is set. |
enable password pass-value (Global) | Global command to create the enable password, stored as a clear text instead of a hashed value. |
| `enable [algorithm-type md5 | sha256 |
no enable secret (Global) | Global command to delete the enable secret command. |
no enable password (Global) | Global command to delete the enable password command. |
A Network Interface is the means by which a node is connected to the media and exchanges data with other network nodes. A Network Interface Card (NIC) is a transceiver component responsible for physically connecting the node to the transmission medium (a chip).
Each Ethernet network interface port has a Unique Media Access Control Address (hardware address / Ethernet Address). In IEEE Terminology, this is an EUI (Extended Unique Identifier). An EUI-64 is a 64-bit Hardware Address. A mechanism allows for translations between the 48-bit MAC address and 64-bit EUI-64 address.
Ethernet encapsulates the payload from higher layer protocols within a Protocol Data Unit (PDU) called a frame.
| Preamble | Start Frame Delimiter (SFD) | Destination MAC | Source MAC | Ether Type / Length | Payload Data (from higher layer protocols) | Frame Check Sequence (FCS) |
|---|---|---|---|---|---|---|
| 7 bytes | 1 byte | 6 bytes | 6 bytes | 2 bytes | 46-1500 bytes | 4 bytes |
Preamble and SFD are used for clock synchronization and as part of the CSMA/CD protocol to identify collisions during transmissions very early from the Physical Layer, and as such are not technically considered to be part of the frame.
The frame contains a 4-byte long checksum called a Cyclic Redundancy Check (CRC) or Frame Check Sequence (FCS), which is calculated based on the contents of the frame. The receiving node performs the same calculation, and if it matches, accepts the frame. There is no mechanism for retransmission if damage is detected. CRC is not completely accurate at error checks.
The IEEE gives each manufacturer a range of numbers hard coded to every interface produced, called a Burned-In Address or Universal Address.
The first 3 bytes or octets (the first 6 Hex Digits) are also known as the Organizationally Unique Identifier (OUI) / OUI Admin Address.
A Locally Administered Address is used on networks in place of the manufacturer's universal coding system. It is defined by changing the U/L bit from 0 to 1. It becomes the responsibility of an organization's Internal Network Admin to ensure that all connected Interfaces are configured with a Unique MAC.
Broadcast Address: FF:FF:FF:FF:FF:FF
The I/G bit of a MAC address determines whether the frame is addressed to an Individual Node and/or a Group. If the I/G bits are all 1s, the MAC address is referred to as a Broadcast Address and should be processed by all nodes within the same broadcast domain.
The maximum size of the Data payload found in Layer 2 is 1500 Bytes. This upper limit size of the payload is referred to as Maximum Transmission Unit (MTU).
Excluding the preamble and SFD, a standard Ethernet frame has a maximum length of 1518 bytes (6 bytes Source MAC + 6 bytes Dest MAC + 2 bytes Ether Type field + 4 bytes FCS + 1500 bytes Payload).
To comply with Ethernet standards, the minimum length of an Ethernet frame is 64 bytes, so the payload must be at least 46 bytes. If this is not the case, it is auto-padded with redundant data. Some Gigabit Ethernet (GbE) and 10 Gigabit Ethernet (10GbE) support Jumbo Frames with much larger Maximum Transmission Units.
Switches normally support a range of Ethernet Standards so that older and newer Network Adapters can all be connected to the same Network.
Advanced Ethernet Switches support interconnections via high-speed backplanes to expandable capacity through plug-in modules, plus power supply redundancy, management consoles, and transceivers for fiber optic connectivity. They can, however, be distinguished using the following general categories:
Configuration of a Managed Switch can be performed at a Command Line Interface (CLI). Most Switch OS work in multi-Command modes or Hierarchies:
Stackable Switches precede Interface Identifiers with a module ID (different for each switch in the stack). Interfaces are identified by Type, slot on Switch used, and port number (directly correlated).
An Interface has a line status (up if a host is connected via a good cable), and a protocol status (up if an Ethernet link is established). Line status + protocol status "down" indicates a fault in either the link connection.
A Crossover Cable has T568A termination at one end and T568B termination at the other end of the cable. Historically, in the days of Hubs, dedicated Uplink ports and/or Crossover Cables were used to make connections between 2 separate hubs.
When a switch needs to be connected to another switch, communication would fail if both interfaces used MDI-X. Nowadays, most switch interfaces are configured to use Auto-MDI/MDIX by default. This means that the switch senses the configuration of the connected device or cable wiring. It senses that an MDI or Uplink to an MDIX port gets configured. This also ensures a link if a Crossover Cable is used to connect to an end system by mistake. Gigabit Ethernet Interfaces must support Auto-MDI/MDIX.
A switch learns MAC addresses by reading the source address when a frame is received on its port. The address mapping for that port is cached in a MAC Address Table, which is stored in a special type of memory known as Content Addressable Memory (CAM). CAM is optimized for searching rather than random access.
If a MAC address isn't found in a MAC Address table, the switch acts like a hub and transmits the frame out to all ports, except for the source port (FLOODING).
A Port Security Configuration validates the MAC Address of end systems that connect to a switch port. A port security configuration has three primary elements:
Port Aggregation means combining two or more separate cabled links into a single logical channel. From the host end, this can also be called Network Interface Card (NIC) Teaming / Bonding.
Link Aggregation Control Protocol (LACP) is used to auto-negotiate the bonded link between the switch port and the end system, detect configuration errors, and recover from the failure of one of the physical links.
Either ingress (incoming) OR egress (outgoing) traffic, or both, can be captured.
Unlike Hubs, Switches forward Unicast traffic only to the specific port connected to the intended destination interface, preventing sniffing of Unicast Traffic by hosts attached to the same switch.
Port Mirroring copies all packets sent to one or more source ports to a configured monitor port. On a Cisco Switch, this is referred to as Switched Port Analyzer (SPAN). The mirror port would be used by management monitoring software, such as a packet sniffer, network analyzer, or Intrusion Detection System.
Some types of ports need special optimized port settings, e.g., Storage Area Networks (SANs) found in data centers, which require special requirements to handle Jumbo Frames and Flow Control.
Power over Ethernet (PoE) is a means of supplying electrical power from a Switch via data cabling to a connected powered device (PD).
PoE Switches are referred to as Endpoint Power Sourcing Equipment. If an existing switch doesn't support PoE, a device called a Power Injector (Midspan) can be used.
Cat 3 or better is required to support PoE, while PoE+ must be Cat 5e or better.
Drawing power down the cable generates more heat. If this heat is not dissipated, it can affect data rates. Thermal performance can be achieved or improved using pure copper cabling with large conductors; as a thin conductor will generate more heat through resistance. Also, shielded cable is capable of dispersing heat more efficiently too, through absorption.
Unless configured differently, managed switches allow the configuration of Virtual LANs (VLANs) to logically separate ports into distinct broadcast domains. In a well-designed network, there is typically a 1:1 mapping between VLANs and subnets; it's like assigning one room (subnet) for each invisible space (VLAN) you've created.
VLAN Architecture Components:
Access Ports (Untagged):
Trunk Ports (Tagged):
Inter-VLAN Routing:
802.1Q Frame Structure:
VLAN Segmentation Benefits:
switchport voice vlan [ID]A broadcast domain is a network segment where a broadcast frame sent by any device is received by all other devices within the same segment. This characteristic defines the limitations and scope of broadcast traffic within a Layer 2 network (LAN).
VLANs are used to segment a physical network into multiple logical networks at Layer 2. Each VLAN forms its own broadcast domain, which helps in reducing unnecessary broadcast traffic and enhances network security and performance.
Configuration Steps:
Switch(config)# vlan [VLAN_NUMBER]
Switch(config-vlan)# name [VLAN_NAME]
fa0/1 as an access port in [VLAN_ID].
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan [VLAN_ID]
Default VLANs and Ranges:
In a network where the number of VLANs increases, using a separate interface for each VLAN becomes impractical. This is due to physical limitations such as the number of router interfaces and the inefficiency of managing multiple cables and ports.
The primary protocol used for trunking on modern networks is IEEE 802.1Q. It is essential for maintaining VLAN information as traffic moves between switches or to routers.
When a frame enters a switch:
Ensuring that the native VLAN matches on all interconnected trunk ports is critical to prevent VLAN hopping attacks and other security vulnerabilities. It is advisable to change the native VLAN from the default (VLAN 1) to another unused VLAN ID and configure this consistently across all devices.
Understanding and implementing inter-VLAN routing and trunking are vital for network scalability and efficiency. Proper use of trunking protocols like IEEE 802.1Q facilitates seamless communication across multiple VLANs while conserving physical resources. Additionally, careful configuration and management of VLAN settings and native VLAN configurations enhance network security and operational efficiency.
For traffic to flow between different VLANs, routing must occur at Layer 3:
Router-on-a-Stick: A single physical router interface can be subdivided into multiple logical sub-interfaces, each corresponding to a different VLAN. Here, each sub-interface handles traffic for a specific VLAN, and the encapsulation specifies the VLAN ID associated with the sub-interface.
Router(config)# interface fa0/0.1
Router(config-subif)# encapsulation dot1Q [VLAN_ID]
Router(config-subif)# ip address [IP_ADDRESS] [SUBNET_MASK]
Layer 3 Switches:
Switch(config)# interface vlan [VLAN_ID]
Switch(config-if)# ip address [IP_ADDRESS] [SUBNET_MASK]
Switch(config-if)# no shutdown
Properly configuring VLANs and managing broadcast domains are critical for maintaining network efficiency, security, and scalability. By segmenting a network into VLANs and correctly configuring inter-VLAN routing, network administrators can ensure optimal performance and robust security across the network infrastructure.
Multilayer or Layer 3 switches are advanced devices capable of both switching and routing functions, allowing for efficient handling of traffic within VLANs and between different networks.
To change the native VLAN on a router or switch, use the following commands depending on the device and requirement:
Router(config-subif)# encapsulation dot1Q <VLAN-ID> native
Switch(config-if)# switchport trunk native vlan <VLAN-ID>
IP Address Assignment:
Routing Capabilities:
Switch(config)# ip routing
Switch(config)# ip route 0.0.0.0 0.0.0.0 <next-hop-address>
Resetting an Interface to Default Configuration:
Switch(config)# default interface <interface-id>
Enabling Layer 3 Routing on the Switch:
Switch(config)#ip routing
Assigning an IP Address to a Routed Port:
Switch(config-if)# ip address <ip-address> <netmask>
Switch(config-if)# no switchport # This command transforms the interface from Layer 2 to Layer 3
Multilayer switches offer extensive flexibility and efficiency in managing inter-VLAN routing and overall network traffic. Proper configuration of native VLANs and understanding how to utilize and configure routed ports and SVIs are crucial for optimizing network performance and security. These capabilities allow network administrators to manage complex network topologies more effectively, integrating voice, data, and video traffic over a unified infrastructure.
Switch Virtual Interfaces (SVIs) represent a pivotal feature in Layer 3 switches, enabling inter-VLAN routing directly within the switch. This technique avoids the need for external routers for VLAN routing, simplifying network design and often enhancing performance.
SVI Initialization: By default, SVIs are administratively down on Cisco switches. To use them for routing traffic between VLANs, they must be explicitly enabled.
VLAN Requirements:
no shutdown command).Gateway Configuration: End devices within VLANs should have their gateway set to the IP address of the corresponding SVI, not to an external router.
The configuration of an SVI involves assigning it an IP address and enabling it. Here’s how to configure an SVI for VLAN 10 and VLAN 20 on a Cisco Layer 3 switch:
# Entering global configuration mode
Switch(config)# interface vlan 10
# Assigning an IP address to the SVI for VLAN 10
Switch(config-if)# ip address 192.168.1.1 255.255.255.192
# Enabling the SVI
Switch(config-if)# no shutdown
# Exiting back to global configuration mode
Switch(config-if)# exit
# Configuring SVI for VLAN 20
Switch(config)# interface vlan 20
Switch(config-if)# ip address 192.168.1.65 255.255.255.192
Switch(config-if)# no shutdown
Switch(config-if)# exit
Each SVI acts as a gateway for its respective VLAN, allowing inter-VLAN communication when combined with proper routing configurations.
Besides SVIs, Layer 3 switches can also configure physical interfaces to act as routed ports. This setting transforms an interface from a Layer 2 switch port into a Layer 3 interface similar to a router's interface.
Here's how to configure a routed port:
# Selecting the interface
Switch(config)# interface gigabitethernet 0/1
# Disabling switching functionality
Switch(config-if)# no switchport
# Assigning an IP address
Switch(config-if)# ip address 10.0.0.1 255.255.255.0
# Enabling the interface
Switch(config-if)# no shutdown
This configuration is ideal for point-to-point links between switches or connections to other routers. Configuring SVIs and routed ports on Layer 3 switches greatly enhances the flexibility and efficiency of network designs. These features facilitate advanced network segmentation, efficient routing, and simplified infrastructure with fewer devices and interconnections. Properly setting up and managing these interfaces ensures robust, scalable network architecture capable of supporting diverse organizational needs.
SW(config-if)# switchport mode trunk → Switch the Selected interface(s) port mode to Trunk (for Tagged Frames over Trunk Link).SW(config-if)# switchport trunk encapsulation dot1q|ISL → Sets the Encapsulation Negotiation Mode to either Dot1Q or ISL.SW# switchport trunk allowed vlan {Add|except|All|None|Remove} ID → This lets you configure vlan-IDs of the allowed VLAN when this port is In trunking mode.SW# switchport trunk native VLAN ID → The setting of native vlan is to ensure frames (untagged) coming over a trunk port gets forwarded to a specific native VLAN specified in the command.SW(config)# vlan 20 → Select Vlan 20 for Configuration.SW(config)# name UserNetwork → Set Common Name of VLAN UserNetwork.SW(config-if)# switchport access vlan ID → Switch configuration to Vlan ID.Dynamic Trunking Protocol (DTP) is a Cisco proprietary protocol that facilitates the automatic negotiation of trunk links between Cisco switches. This protocol simplifies network configuration and management by allowing switches to dynamically establish trunk links without manual intervention.
Dynamic Mode Setting:
# Set the dynamic mode to either auto or desirable
Switch(config-if)# switchport mode dynamic [auto | desirable]
Disabling DTP Negotiation:
# Disable DTP negotiation on an interface
Switch(config-if)# switchport nonegotiate
| Mode / Config | Auto | Trunk | Access | Desirable |
|---|---|---|---|---|
| Auto | Auto | Trunk | Access | Trunk |
| Trunk | Trunk | Trunk | Misconfig | Trunk |
| Access | Access | Misconfig | Access | Access |
| Desirable | Trunk | Trunk | Access | Trunk |
MISCONFIG indicates a misconfiguration error leading to possible traffic issues.Understanding Dynamic Trunking Protocol is crucial for configuring and managing VLANs effectively on Cisco switches. Properly leveraging DTP can lead to simplified management and automated switch configuration, but it requires careful handling to maintain network security and performance. Always ensure your switch configurations are deliberate and secure, especially in sensitive or complex network environments.
VLAN Trunking Protocol (VTP) simplifies the management of VLANs in a network by allowing centralized configuration changes on a VTP server that are automatically propagated to all other switches in the VTP domain.
# Set the VTP version
Sw(config)# vtp version [1 | 2 | 3]
# Set the VTP domain name
Sw(config)# vtp domain [Domain_Name]
# Configure VTP mode
Sw(config)# vtp mode [client | server | transparent]
# Display current VTP status
Sw# show vtp status
Understanding VTP is essential for network administrators to efficiently manage large-scale networks with multiple VLANs. Proper use of VTP can significantly reduce administrative overhead and potential for configuration errors. However, it requires cautious handling to maintain network stability and security.
The Spanning Tree Protocol (STP) was developed to address the challenges in a network with redundant paths, specifically to prevent Layer 2 loops. This protocol is essential for maintaining a stable network environment by managing a loop-free logical topology.
Cisco’s Per-VLAN Spanning Tree (PVST) enhances STP by allowing separate spanning tree instances for each VLAN configured in the network. This granularity allows for better load balancing and specific tuning of the network infrastructure.
The Spanning Tree Protocol and its enhancements like Cisco's PVST are critical for the design and operation of modern networks with redundancy. Understanding how to implement and manage these protocols helps in achieving a stable, efficient, and loop-free network topology, ensuring high availability and reliability in enterprise environments.
The Spanning Tree Protocol (STP) and Cisco's Per-VLAN Spanning Tree (PVST) play pivotal roles in preventing network loops and ensuring efficient traffic management across redundant paths. Understanding the mechanics of bridge priority and its impact on root bridge selection is crucial for network design and troubleshooting.
In practice, adjusting the bridge priority is a strategic decision used to optimize the topology of a network for reliability and efficiency. Network administrators must carefully plan these settings based on the network size, topology, traffic patterns, and organizational requirements.
For networks with multiple VLANs, PVST offers significant advantages by isolating potential issues and tuning performance on a per-VLAN basis, thereby enhancing overall network stability and responsiveness.
Understanding the intricacies of STP and PVST, including the roles of bridge priority and MAC addresses, is essential for managing modern network infrastructures. These protocols ensure that even in environments with complex and redundant paths, data packets find an optimal route, maintaining both network integrity and performance.
For understanding the relationship and calculation of the Bridge ID in Spanning Tree Protocol (STP), we will break down each part of the formula and provide a tabular layout to illustrate how the bridge priority from the Spanning Tree Protocol Data Unit (BPDU) translates into the overall Bridge ID.
Here's how these components combine to form the Bridge ID:
| Component | Description | Bits | Example Value |
|---|---|---|---|
| Bridge Priority | Base priority of the bridge | 4 | 32768 |
| + | |||
| Extended System ID | VLAN ID used as extended system ID | 12 | 100 |
| = | |||
| Total Bridge Priority | Combined value of priority + VLAN ID | 16 | 32868 |
| + | |||
| MAC Address | Unique identifier of the switch | 48 | 00-1A-2B-3C-4D-5E |
| ->> | |||
| Bridge ID | Final bridge identifier | 64 | 32868-001A2B3C4D5E |
00-1A-2B-3C-4D-5E): An example MAC address.32868-001A2B3C4D5E): The full 64-bit identifier used in STP operation to elect the root bridge and other roles.This structure ensures each bridge in a network can be uniquely identified not just by its hardware (MAC), but also by its configuration role within specific VLAN contexts.
To visualize the bit-level distribution across the different fields within the Bridge ID as used in Spanning Tree Protocol (STP) BPDU, we can break it down into a more detailed tabular format. This will show how the bits are allocated towards each component of the Bridge ID.
| Field | Bits | Description | Example Bits |
|---|---|---|---|
| Bridge Priority | 4 bits | Base priority of the bridge | 1000 |
| Extended System ID | 12 bits | VLAN ID used as extended system ID | 0000 0110 0100 |
| Total Bridge Priority | 16 bits | Sum of the above two fields | 1000 0000 0110 0100 |
| MAC Address | 48 bits | Unique identifier of the switch | 0000 0001 1010 0010 1011 0011 1100 0100 1101 0101 1110 |
Combining the Total Bridge Priority with the MAC Address to form the complete 64-bit Bridge ID looks like this:
Total Bridge Priority (32868) | MAC Address (00-1A-2B-3C-4D-5E) |
|---|---|
1000 0000 0110 0100 | 0000 0001 1010 0010 1011 0011 1100 0100 1101 0101 1110 |
1000 0000 0110 0100 0000 0001 1010 0010 1011 0011 1100 0100 1101 0101 1110
This structure ensures that within the frame of an STP BPDU, the Bridge ID uniquely identifies each configured bridge, factoring in both its role in network topology and its physical hardware identity.
When a switch is powered on, each assumes it is the potential Root Bridge, initiating the Spanning Tree Protocol by sending out Bridge Protocol Data Units (BPDUs). The election of the actual Root Bridge and subsequent roles of ports across the network are determined through comparisons and changes of these BPDUs. Here's a detailed breakdown of the process:
Root Ports:
Designated Ports:
Alternate Ports:
Sw(config-if)# spanning-tree portfast bpdufilter default: This command configures the interface to ignore BPDUs while PortFast is enabled, reverting to normal STP operation if a BPDU is received.Sw(config-if)# spanning-tree vlan [id] cost [value]: Sets the path cost for sending BPDUs for a specific VLAN.Sw(config-if)# spanning-tree vlan [id] priority [value]: Sets the STP priority for a particular VLAN to influence root bridge selection.Sw# spanning-tree mode [mstp | pvst | rapid-pvst]: Configures the type of Spanning Tree Protocol to be used across the network.Sw(config)# spanning-tree portfast default: Globally enables the STP PortFast feature on all access ports. This should be used to skip the initial STP states for directly connected devices that do not result in network loops.Sw(config-if)# spanning-tree bpdufilter enable/disable: Enables or disables BPDU filtering on a specific interface. When enabled, it stops sending or receiving BPDUs on that port.Sw# show spanning-tree VLAN-ID: Displays STP details for a specified VLAN.Sw# show spanning-tree detail: Provides comprehensive details about the root bridge, time parameters, and port states for each VLAN.These commands and settings are critical for managing how switches interact within a network, handling redundant paths, and ensuring there are no loops while maintaining optimal redundancy and failover capabilities.
Through the intelligent application of STP principles and careful configuration of bridge priorities and path costs, network administrators can effectively manage redundant paths and ensure robust network performance without loops. This makes STP a critical component in the design and operation of scalable, reliable Ethernet networks.
Sw(config-if)# spanning-tree portfast
Sw(config-if)# spanning-tree bpduguard enable
Sw(config-if)# spanning-tree bpdufilter enable
Sw(config-if)# spanning-tree guard root
Sw(config)# spanning-tree loopguard default
Enable PortFast on a Trunk Link:
Sw(config-if)# spanning-tree portfast trunk
Error Recovery Setup:
Sw(config)# errdisable recovery cause bpduguard
Sw(config)# errdisable recovery interval 300
Priority Adjustment in STP:
Sw(config)# spanning-tree vlan 11 root primary
Sw(config)# spanning-tree vlan 12 root secondary
Each feature of STP serves to optimize network performance, prevent inadvertent network disruptions due to topology changes, and enhance security by controlling which ports participate in STP. Proper configuration and understanding of these features are critical to maintaining a stable and efficient network environment.
Purpose: Protects your switch topology by preventing the switch from accepting superior BPDUs from switches outside your control. This is crucial when connecting LANs to external networks.
Behavior: If a Root Guard-enabled port receives a superior BPDU, it will enter a "Root Inconsistent" state, effectively disabling the port until the superior BPDUs cease.
Sw(config-if)# spanning-tree guard root
To re-enable a port disabled by Root Guard:
Purpose: Prevents loop inconsistencies in unidirectional link scenarios where a port unexpectedly stops receiving BPDUs.
Implementation: Should be enabled particularly on root and non-designated ports expected to receive BPDUs.
Sw(config-if)# spanning-tree loopguard enable
Recovery from Loop Guard:
Function: Ensures that PortFast-enabled edge/access ports are protected against configuration mistakes that could introduce BPDUs into the network, putting the port into an error-disabled state.
Sw(config-if)# spanning-tree bpduguard enable
Manual recovery from BPDU Guard violation:
Set a port's priority or designate a root bridge:
Sw(config)# spanning-tree vlan [vlan-id] priority [priority-value]
Sw(config)# spanning-tree vlan [vlan-id] root primary|secondary
Recovery mechanisms:
Sw(config)# errdisable recovery cause [cause]
Sw(config)# errdisable recovery interval [seconds]
Understanding and deploying STP enhancements correctly safeguards your network against unintentional loops and ensures optimal traffic flow through stable topology management. Each feature serves a specific purpose and should be configured according to the unique requirements of your network environment.
# Enter global configuration mode
Sw(config)#
# Set the spanning-tree mode to MST for Multiple instances or rapid-pvst for per VLAN RSTP calculation
Sw(config)# spanning-tree mode mst
Sw(config)# spanning-tree mode rapid-pvst
# Example to set link type on an interface, crucial for correct operation of RSTP
Sw(config-if)# spanning-tree link-type {point-to-point | shared }
# Set an interface as an edge port, equivalent to enabling PortFast
Sw(config-if)# spanning-tree portfast
RSTP and Cisco’s Rapid PVST+ provide enhancements over traditional STP by offering quicker convergence times, more efficient handling of BPDU information, and specific improvements tailored to environments with multiple VLANs. Understanding these protocols and their configurations can significantly improve the robustness and responsiveness of your network infrastructure.
SW3/RT#show ip interface brief → Displays all the Router Interfaces.
SW/RT# Show Interfaces <ID> → Displays specific interface information including duplex, speed and mac-address.
SW3/RT# show interfaces status → Displays interfaces and their VLAN status (Trunk/Access/Routed Ports).
SW# show interfaces trunk → Displays Information related to switchport configured as Trunk Ports.
SW# show vlan brief → Displays the access interface ports assigned to each VLAN and not the trunk ports that allow each VLAN.
SW# show Spanning-Tree → Displays Information {Root Bridge Information and the particular Switch/Bridge Information we queried via its CLI} about Spanning Tree Protocol for all VLANs that exist on the switch.
SW# show Spanning-Tree Vlan ID → Displays Information about Spanning Tree Protocol for a specified VLAN.
SW# show Spanning-Tree Interface ID Detail → Displays a more detailed/verbose Information about Spanning Tree Protocol for a specified Interface/switchport.
SW# Spanning-Tree mode ? {MST | PVST | Rapid-PVST} → Sets the Spanning Tree Mode to MST, PVST, Rapid-PVST.
SW# show Spanning-Tree Detail → Displays a more detailed/verbose Information about Spanning Tree Protocol for all VLANs that exist on the switch and an exact Root cost.
SW# Show interface Switchport
SW# Show interface ID Switchport
SW(config-if)# Spanning-Tree Portfast → Enables Portfast on Specified Interfaces. Should only be enabled on interfaces connected to end Hosts (PC/Laptop)-Access Ports; and not interfaces connected to HUBS/SWITCHES/BRIDGES -Trunk Ports etc; can cause temporary bridging loops.
SW(config-if)# Spanning-Tree Portfast Trunk → Enables Portfast on Trunk Interfaces. Should only be enabled on interfaces {connected to Virtualization Server with VMs in Separate VLANs OR connected to a Router via ROAS}.
SW# Spanning-Tree Portfast default → Enables Portfast on all Access Ports, doesn’t enable it on Trunk Ports, as these interfaces are connected to other switches In the network topology.
SW(config-if)# Spanning-Tree bpduguard enable|disable → This command enables/disables BPDU Guard on a specific interface, helping to protect the network from unwanted STP changes and ensuring that only designated switchports (Ports connected to other Switches) participate in the Spanning Tree process.
SW(config-if)# Spanning-Tree bpdufilter enable|disable → This command enables/disables BPDU filter on a specific interface, stops a switchport from sending BPDUs or processing received BPDUs.
SW# Spanning-Tree portfast bpduguard default → Enables BPDUGuard on all Portfast-enabled interfaces.
SW# Spanning-Tree Vlan ID root primary → Sets a particular VLAN to become the root bridge by automatically reducing its Bridge Priority, thereby making it the lowest Bridge ID in the network.
SW# Spanning-Tree Vlan ID root secondary → Sets a particular VLAN to become the secondary root bridge.
SW# Spanning-Tree Vlan ID Priority ?[4096 increments allowed {0-61440}] → Manually Sets a particular VLAN Bridge Priority.
SW# Spanning-Tree guard root → Sets/enables RootGuard on all STP ports, doesn’t have (config-if) versions.
SW(config-if)# Spanning-Tree guard loop | none → Enables/disables loop guard on a specific Non-Designated Switchports.
SW# Spanning-Tree loopguard default → Enables loop guard across all Non-Designated Switchports, this command reverses or nullifies the spanning-tree guard root.
EtherChannel is a technology used in networking to combine multiple physical links between two network devices into a single logical link. This aggregation enhances bandwidth and provides redundancy without causing layer 2 loops that protocols like STP aim to avoid.
| Command | Description |
|---|---|
interface port-channel 1 | Creates or selects a port-channel interface. |
port-channel load-balance src-dst-ip | Sets the EtherChannel load-balancing method based on source and destination IP addresses. |
interface range fa0/0-8 | Selects a range of interfaces for configuration. |
channel-group 1 mode active | Adds interfaces to channel group 1 and sets the EtherChannel mode to active (LACP). |
desirable + auto = EtherChannel formed (PAgP)active + passive = EtherChannel formed (LACP)auto + auto = No EtherChannel (PAgP)passive + passive = No EtherChannel (LACP)Decides which port to use for each data flow. Factors influencing this decision might include:
The choice of load balancing method can significantly impact the distribution of traffic across the links in an EtherChannel.
EtherChannel aggregates multiple physical interfaces into a single logical interface to enhance bandwidth and provide redundancy. Understanding the configuration requirements and ensuring consistency among member interfaces is crucial for proper operation.
| Command | Description |
|---|---|
show etherchannel summary | Displays a summary of all port-channels configured on the switch, including their status and associated physical ports. |
show etherchannel load-balance | Displays the current method used for load balancing across EtherChannels. |
If there are discrepancies in the configuration of interfaces intended for an EtherChannel, they will not be eligible for inclusion in the EtherChannel group. This ensures stability and prevents issues like loops or mismatched traffic handling.
| Mode | Compatible With |
|---|---|
| On | Static Mode Only |
| Active | Active, Passive |
| Passive | Active Only |
| Desirable | Auto, Desirable |
| Auto | Desirable Only |
Choosing the correct mode and protocol is essential for forming a stable EtherChannel link between switches.
Proper configuration and consistency across all member interfaces are key to successfully implementing an EtherChannel. By following these guidelines and using the appropriate commands, administrators can ensure high availability, increased bandwidth, and efficient use of infrastructure resources in their network environments. EtherChannel is essential for optimizing the use of physical links between switches, enhancing both bandwidth utilization and network redundancy. Depending on the network requirements and equipment, administrators can choose between static configuration or dynamic protocols (PAgP or LACP) to manage EtherChannels efficiently.
| Command | Description |
|---|---|
show etherchannel summary | This command displays a summary of all port-channels configured on the switch including their status and associated physical ports. |
show etherchannel detail | Provides detailed information about each port-channel, including protocol, member ports, and their individual statuses. |
show etherchannel load-balance | Displays the current method used for load balancing across EtherChannels. |
show running-config interface Port-channel1 | Shows the running configuration specific to the Port-channel interface. |
port-channel load-balance <method> | Enables EtherChannel Load Balancing Method. |
src-ip | Balances based on source IP address. |
dst-ip | Balances based on destination IP address. |
src-dst-ip | Balances based on both source and destination IP addresses. |
src-mac | Balances based on source MAC address. |
dst-mac | Balances based on destination MAC address. |
src-dst-mac | Balances based on both source and destination MAC addresses. |
src-port | Balances based on source port. |
dst-port | Balances based on destination port. |
src-dst-port | Balances based on both source and destination ports. |
| Command | Description |
|---|---|
interface range GigabitEthernet0/1 - 2 | Selects a range of GigabitEthernet interfaces. |
no switchport | Configures the physical interfaces as Layer 3 (routed) ports. |
| `channel-group 1 mode active { auto | desirable |
interface Port-channel2 | Selects or creates port-channel interface 2. |
no switchport | Configures the port-channel interface as Layer 3 (routed). |
ip address 192.168.1.1 255.255.255.0 | Assigns an IP address and subnet mask to the port-channel interface. |
| Command | Description |
|---|---|
interface range g0/1-3 | Selects a range of GigabitEthernet interfaces. |
no switchport | Configures these interfaces as Layer 3 (Routed) ports. |
ip routing | Enables IP routing on the switch (global configuration). |
channel-group 1 mode active | Creates channel group 1 and sets LACP active mode for the interfaces in the range. |
interface port-channel 1 | Enters the port-channel interface configuration mode. |
ip address [ipAddr] [Netmask] | Assigns an IP address and subnet mask to the port-channel interface. |
This setup uses IP address directly assigned to the port-channel, facilitating easier management and routing capabilities across the network.
The EtherChannel aggregation protocol (PAgP/LACP) must be uniform across all devices in the EtherChannel. If explicitly set, each switch port in the bundle must support the selected protocol.
A Router is a multi-homed Intermediate System with Network Links and Topology Information to facilitate forwarding packets between subnets, to or around an internetwork.
Information about the location of other IP networks and hosts is stored in the Routing Table. Each entry represents an available path to its destination network or hosts. The key components that define an entry in the routing table are:
| Component | Description |
|---|---|
| Protocol | The protocol implemented by the Router (e.g., OSPF, RIP, EIGRP, BGP, Static, Connected). |
| Destination | Routes can be defined to specific hosts but are more generally directed to Network IDs (Network ID / Host Address / Network Broadcast Address). |
| Interface | The local interface to use to forward a packet along the chosen route. |
| Gateway / Next Hop | The IP address of the next router along the path to the destination. |
| Metric | A value used to determine the best path among multiple routes to the same destination. |
| Administrative Distance (AD) | A value used to express the relative trustworthiness of the protocol supplying the route. |
Routing Table Entries fall into four general categories:
| Category | Description |
|---|---|
| Direct Network Routes | For subnets to which the Router is directly attached. The IP Network or Subnet for each active Router Interface is automatically added. Also known as Directly Connected Routes. |
| Remote Network Routes | For subnets and IP Networks that are not directly attached. Learned through a routing protocol or static configuration. Typically have a mask length less than /32. |
| Host Routes | For routes to a specific Host IP Address. A host route has a /32 prefix for IPv4 or /128 prefix for IPv6. |
| Default Routes | Used when an exact match for a network or host route is not found. Also known as the Gateway of Last Resort (0.0.0.0/0 for IPv4 or ::/0 for IPv6). |
| Feature | Static Routes | Default Routes |
|---|---|---|
| Configuration | Manually added by administrator. | A special type of static route. |
| Purpose | Directs traffic to a specific network or host. | Catches all traffic not matched by other routes. |
| Destination | Specific Network ID/Prefix or Host IP. | 0.0.0.0/0 (IPv4) or ::/0 (IPv6). |
| Persistence | Can be persistent (survives reboot) or non-persistent. | Typically persistent. |
| Reachability | Disabled if not reachable. | Operates as "Gateway of Last Resort". |
A floating static route is a static route with an administrative distance higher than that of a dynamic route to the same destination. It remains inactive in the routing table until the dynamic route is removed or becomes unavailable. This setup provides a backup path, ensuring continuity if the primary route fails. Floating static routes are used as backup routes to dynamic routes learned via protocols like OSPF or EIGRP. They are configured with a higher Administrative Distance (AD) than the primary route to ensure they are only used when the primary route fails.
When a Router Receives a packet, it reads the destination address in the packet and looks up a matching destination network IP address and prefix in its Routing table (Topology Database). If there is a match, the Router will forward the packet out of one of its interfaces by Encapsulating the packet in a new frame.
Frame Encapsulation based on Destination:
| Feature | IPv4 (Time To Live - TTL) | IPv6 (Hop Limit) |
|---|---|---|
| Behavior | Decremented by at least 1 at each router. | Decremented by 1 at each router. |
| Purpose | Prevents packets from endlessly circulating; nominally time unit, practically hop count. | Prevents packets from endlessly circulating; strictly hop count. |
| Discard | Packet discarded when TTL reaches 0. | Packet discarded when Hop Limit reaches 0. |
| Feature | IPv4 | IPv6 |
|---|---|---|
| Fragmentation | IP can fragment packets to fit within the MTU. | Does not allow/perform fragmentation at the router level. |
| Fields Used | ID, Flags, Fragment Offset IP header fields for reassembly. | N/A |
| MTU Handling | Router handles fragmentation. | Host performs Path MTU Discovery to determine smallest MTU along path and crafts packets accordingly. |
| ARP Message | Direction | Purpose |
|---|---|---|
| ARP Request | Broadcast to local segment | Asks which host has a specific IP address. |
| ARP Reply | Unicast response | From the host with the requested IP, providing its MAC. |
Command to view ARP table: show arp or show ip arp
| ICMP Type | Purpose |
|---|---|
| Echo Request (Ping) | Measures round-trip time to a destination host. |
| Echo Reply | Confirms reachability and provides round-trip time. |
| IP Address Type | Host Portion Bits | Description |
|---|---|---|
| Network Address | All 0s | Identifies the network itself; cannot be assigned to a host. |
| Broadcast Address | All 1s | Used to communicate with all hosts within that subnet. |
| First Usable Address | After network address | First valid assignable IP for a host. |
| Last Usable Address | Before broadcast address | Last valid assignable IP for a host. |
Here's a breakdown of common router interface configuration commands:
| Command | Description |
|---|---|
RT(config)# interface g0/0 | Enters interface configuration mode for GigabitEthernet 0/0. |
RT(config-if)# description "Link to ISP" | Sets a descriptive text for the interface. |
Router(config-if)# ip address 43.109.23.12 255.0.0.0 | Configures the IPv4 address and subnet mask on the interface. |
Router(config-if)# no shutdown | Activates the interface. |
Router(config)# ipv6 unicast-routing | Global Command: Enables IPv6 routing on the router (required for forwarding IPv6 packets). |
Router(config-if)# ipv6 enable | Enables IPv6 on an interface and automatically assigns a Link-Local Unicast IPv6 Address. |
Router(config-if)# ipv6 address 2001:db8:0:0::1/64 | Configures a Global Unicast IPv6 address with a specified prefix. |
Router(config-if)# ipv6 address autoconfig | Lets the router interface obtain an IPv6 address using stateless autoconfiguration (SLAAC); uses NDP to learn prefix. |
Router(config-if)# ipv6 address 2001:db8:0:1::/64 EUI-64 | Configures a Global Unicast IPv6 address where the 64-bit host portion is generated using EUI-64 from the MAC address. |
do show ip interface brief | Shows a summary of IPv4 interfaces and their status (executed from any mode with do). |
do show ipv6 interface brief | Shows a summary of IPv6 interfaces and their status (executed from any mode with do). |
When you configure an IP address on a router interface and bring it up, two types of routes are automatically created in the routing table:
| Route Type | Description | Example for 192.168.1.1 255.255.255.0 on GigabitEthernet0/2 |
|---|---|---|
| Connected Route | Represents the network or subnet to which the interface is directly attached. | 192.168.1.0/24 directly connected, GigabitEthernet0/2 |
| Local Route | Represents the specific IP address assigned to the interface itself. It's a host route to the interface's own IP. | 192.168.1.1/32 is directly connected, GigabitEthernet0/2 |
| Route Type | IPv4 Command Syntax | IPv6 Command Syntax | Notes |
|---|---|---|---|
| Static Route | `ip route [destination] [subnet mask] [next-hop-addr | exit-interface]` | `ipv6 route [destination/prefix] {next-hop-addr |
| Floating Static Route | `ip route [destination] [Netmask] [next-hop | exit-interface] [ad]` | `ipv6 route [destination/prefix] {next-hop-addr |
| Default Route | `ip route 0.0.0.0 0.0.0.0 [next-hop-addr | exit-interface]` | `ipv6 route ::/0 {next-hop-addr |
| Directly Attached Static (IPv6) | N/A | ipv6 route [destination/prefix] [exit-interface] | Cannot be used with Ethernet interfaces in IPv6. |
| Recursive Static (IPv6) | N/A | ipv6 route [destination/prefix] [next-hop-addr] | next-hop-addr must be routable (not link-local). |
| Fully Specified Static (IPv6) | N/A | ipv6 route [destination/prefix] [exit-interface] [next-hop-addr] | Most explicit; good for multi-access segments. |
/x to denote the number of bits used for the network portion.Based on the first octet, IP addresses were divided into classes with default subnet masks:
| Class | First Octet Range | Default Subnet Mask (Decimal) | Default Subnet Mask (CIDR) |
|---|---|---|---|
| A | 0-127 | 255.0.0.0 | /8 |
| B | 128-191 | 255.255.0.0 | /16 |
| C | 192-223 | 255.255.255.0 | /24 |
Routers serve both to link physically Remote networks and subdivide IP networks into multiple subnets. Router placement is generally driven by:
Edge Routers are placed at the network perimeter (WAN side) to distinguish External (Internet) and Internal Interfaces. They perform framing to repackage data from the private LAN Frame format to the WAN/Internet access frame format.
Edge Routers designed to work with DSL or cable broadband are often called SOHO Routers. Edge Routers with similar integrated functionality are also deployed by Enterprises for Branch Office Connectivity, which are designed to service medium to large networks with specialized processors to handle Routing & path forwarding processes, and memory to buffer data. They also support plug-in cards for WAN Interfaces and Site-to-Site VPN.
An Internal Router has no public-facing interface to the Internetwork. They serve to implement whatever network topology is required, meaning that traffic between the local subnets (LAN) is controlled by a separate Internal Router.
Many networks are segmented using the Virtual LANs (VLANs) feature of managed Switches. Traffic between VLANs is Routed in two scenarios:
Using a Router with a single Interface Connected to a Trunk Port on the switch: The Router's physical Interface is Configured with multiple "SUBINTERFACES". Each subinterface is configured with a specific VLAN ID. The Sub Interface routes traffic for a given VLAN and receives traffic from a given VLAN via the TRUNK PORT. The Sub Interface serving the destination VLAN receives traffic from the router. (This scenario does not scale well for tens of VLANs).
A Layer 3 Capable Switch: This is one that is optimized for Routing between VLANs. They can use static or dynamic Routing to identify which VLAN an IP Address should be forwarded to, and maintain a mapping table of IP and MAC addresses, thereby using low-latency Hardware-based forwarding. However, they do not typically have WAN interfaces and are not usually used for Routing at the network edge.
Routers are configured either via a Serial Connection (Console port) OR remotely over the network using SSH or Telnet with the Router via the IP Address of any configured Interface. Due to unforeseen Hardware Faults, best practice is to create a Virtual Interface (Loopback Interface) and assign it an IP address for use in remotely managing the Router. This is a way of giving the Router an internal IP Address not connected to any physical network, and therefore not reliant on a specific network link being available.
Principal Configuration tasks:
show route, show ip route, show ipv6 route commands output the active Routing Table on Cisco Routers.route command is used to view or modify the Routing table of End System (Linux and Windows) hosts. The routing table for an end system generally conforms to a single entry for the default route. Traffic that isn't addressed to the local subnet is sent over this default route.Route [–p] add [Dest IP] mask [Netmask] [Gateway IP] metric [Metric Value] IF [Interface]ip route which replaced deprecated legacy command-line tools):
ip route add [Dest IP] via [Gateway IP] dev [Interface]ip route add [Dest IP]/[Netmask Value] via [Gateway IP] dev [Interface]Routes added in this manner are non-persistent by default. Using the -p switch in Windows, routes can be permanently configured. In Linux, the command above cannot be used directly to add persistent (permanent) routes without additional configuration.
Subnetting is the process of dividing a single large network into smaller, logical subnetworks. This improves network performance, security, and IP address management.
| Approach | Description | Key Characteristic |
|---|---|---|
| FLSM (Fixed Length Subnet Mask) | All subnets created use the same subnet mask. | Simpler to manage, but can waste IP addresses. |
| VLSM (Variable Length Subnet Mask) | Subnets can have different sizes, allowing for more efficient use of IP space. | More complex to manage, but optimizes IP usage. |
| Subnet Mask | Common Use Case | Number of Usable IPs | Total Addresses | Network Address | Broadcast Address |
|---|---|---|---|---|---|
| /31 | Point-to-point links (2 routers) | 2 | 2 | No (implied) | No (implied) |
| /30 | Point-to-point links | 2 | 4 | Yes | Yes |
Given a parent network of 192.168.1.0/24, dividing this into multiple subnets could look like this:
| Subnet ID | CIDR | Usable Hosts | Total Addresses | Network Address | Broadcast Address |
|---|---|---|---|---|---|
| First Subnet | /25 | 126 | 128 | 192.168.1.0 | 192.168.1.127 |
| Second Subnet | /26 | 62 | 64 | 192.168.1.128 | 192.168.1.191 |
| Third Subnet | /27 | 30 | 32 | 192.168.1.192 | 192.168.1.223 |
| Fourth Subnet | /28 | 14 | 16 | 192.168.1.224 | 192.168.1.239 |
| Point-to-Point | /30 | 2 | 4 | 192.168.1.240 | 192.168.1.243 |
prefix length) decreases the number of available hosts but increases the number of possible subnets within the given address space.This structured approach to subnetting and supernetting helps organizations efficiently utilize their assigned IP address spaces, tailoring network divisions to actual usage needs, ensuring both flexibility and scalability.
Interface configuration is crucial for setting up how a router or multilayer switch interacts with different network segments.
| Command | Context | Description |
|---|---|---|
interface G0/1.10 | Sub-interface (Router/L3 Switch) | Enters sub-interface configuration mode for interface G0/1, associated with VLAN 10. Used for Router-on-a-Stick or inter-VLAN routing. |
interface G0/1 | Physical Interface (Router/Switch) | Selects a particular physical interface (e.g., GigabitEthernet 0/1) for configuration. |
no switchport | L3 Switch Interface (Global Config) | Configures or upgrades the selected interface as a "Routed Port" (Layer 3 functionality), removing its Layer 2 switching capabilities. |
ip address IPAddress Netmask | Interface (Router/L3 Switch) | Sets the IPv4 address and subnet mask for the interface. IPAddress must be a usable host address within the subnet range. |
no shutdown | Interface (Router/L3 Switch) | Enables or activates the interface. |
ipv6 unicast-routing | Global (Router/L3 Switch) | Global Command: Enables IPv6 routing on the device, allowing it to forward IPv6 packets. |
ipv6 enable | Interface (Router/L3 Switch) | Enables IPv6 on an interface and automatically assigns a Link-Local Unicast IPv6 Address. Does not configure a Global Unicast Address. |
ipv6 address 2001:db8:0:0::1/64 | Interface (Router/L3 Switch) | Configures a Global Unicast IPv6 address with a specified prefix on the interface. |
ipv6 address autoconfig | Interface (Router/L3 Switch) | Allows the router interface to obtain an IPv6 address using stateless autoconfiguration (SLAAC). Device uses NDP to learn the prefix. |
ipv6 address 2001:db8:0:1::/64 EUI-64 | Interface (Router/L3 Switch) | Configures a Global Unicast IPv6 address where the 64-bit Host Portion is generated using EUI-64 from the interface's 48-bit MAC address. |
| Command | Description |
|---|---|
show arp | Displays the device's IPv4 ARP table. |
show ip arp | Same as show arp. |
| Command | Context | Description |
|---|---|---|
ip routing | Global (L3 Switch) | Enables Layer 3 routing on a multilayer switch, allowing it to build and use an IP routing table. |
| `ip route 0.0.0.0 0.0.0.0 [Interface-ID | Interface-IP]` | Router/L3 Switch |
| `ipv6 route ::/0 [Interface-ID | Interface-IP]` | Router/L3 Switch |
| `ip route NetworkAddress NetMask {Next-hop-Addr | ExitInterface}` | Router/L3 Switch |
| `ipv6 route NetworkAddress/Prefix {Next-hop-Addr | ExitInterface}` | Router/L3 Switch |
ip route NetworkAddress NetMask Next-hop-Addr AD | Router/L3 Switch | Configures a Floating Static Route for IPv4. The AD (Administrative Distance) must be higher than the primary route's AD. |
| `ipv6 route NetworkAddress/Prefix {Next-hop-Addr | ExitInterface} AD` | Router/L3 Switch |
| Invalid IP Address Assignment | Valid IP Address Assignment | Rationale |
|---|---|---|
Network Address (e.g., 192.168.1.0/24) | First Usable Address | Network address identifies the network itself and cannot be assigned to a host or interface. |
Broadcast Address (e.g., 192.168.1.255/24) | Last Usable Address | Broadcast address is reserved for sending data to all hosts on the subnet. |
| IP outside subnet range | Within defined subnet | An IP address must belong to the subnet defined by the configured mask for proper communication. |
When setting up router interfaces, always ensure the IP address assigned:
This understanding will help prevent errors like "Bad mask" and ensure proper communication within and between subnets.
Complex Networks need to exchange Routing information rapidly to prevent outages, making static Routing updates impractical in most cases.
A Dynamic Routing Protocol uses an algorithm (categorized according to Topology & Metrics) to BUILD & maintain a Routing Information database. (These databases are separate from the Routing table). Most algorithms are classed as either Distance Vector OR Link State OR Both (Hybrid).
The database might contain more than one Route to the Same Destination. In this case, a metric is used to determine which path will be selected for use in the IP Routing table. The path with the lowest cost metric is preferred.
Convergence is the process whereby Routers using dynamic routing protocols agree on the network Topology. Network Routers must be able to communicate changes to other routers quickly to avoid Black Holes (where a packet is discarded without notice given back to the source) and loops (where a packet is forwarded around the network until its TTL Expires, and an "ICMP Time Exceeded" notification is sent to the source).
A Network where all routers share the Same Topology is described as Steady State. The time taken to reach steady state is a measure of a protocol's Convergence performance.
Route flapping refers to a Router changing the properties of a Route it's advertising quickly, often leading to serious convergence problems. A flapping interface frequently changes from offline → online and vice versa.
A Network under the administrative control of a single owner is referred to as an Autonomous System (AS). An "AS" identifies a group of network prefixes.
Another factor comparing Routing protocols is whether they support Classless Addressing.
| Protocol | Class / Port # | Type / Algorithms |
|---|---|---|
| Routing Information Protocol (RIP) | UDP 520 / 521 | Distance Vector |
| Enhanced Interior Gateway Routing Protocol (EIGRP) | IP Protocol #88 | Distance Vector / Hybrid |
| Open Shortest Path First (OSPF) | IP Protocol #89 | Link State |
| Border Gateway Protocol (BGP) | TCP 179 | Path Vector (Hybrid of DV/LS) |
If a Router has multiple entries to similar networks in a Routing Table, it must determine which route to prefer. Preference is first based on the LONGEST ADDRESS PREFIX MATCH OVER SHORTER ONES. E.g., 198.51.100.0/28 is preferred over 198.51.100.0/24. A longer prefix means fewer host IDs.
The next key point is ADMINISTRATIVE DISTANCE (AD). AD Value is used to express the relative trustworthiness of the protocol supplying the Route. Default AD Values are hard coded into the router & can be adjusted by the administrator if necessary.
| Route Type | Default AD (Cisco) |
|---|---|
| Connected | 0 |
| Static | 1 |
| EIGRP Summary Route | 5 |
| External BGP (EBGP) | 20 |
| Internal EIGRP | 90 |
| OSPF | 110 |
| IS-IS | 115 |
| RIP | 120 |
| External EIGRP | 170 |
| Internal BGP (IBGP) | 200 |
| Unknown / Unusable Route | 255 |
Given identical prefix lengths, a static route will be preferred to everything except a directly connected network. The value of 255 for Unknown Routes means that they will not be used. A Static Route with a higher AD could be defined to function as a backup if a preferred route update fails. Normally Router prefers Dynamic Routes because they have a lower AD.
I've analyzed your text on dynamic routing protocols. To improve clarity and comparison, I will add tables for:
Dynamic routing protocols significantly enhance network efficiency and scalability by automating route calculation and maintenance based on real-time network topology changes, which are quickly adapted to, ensuring efficient and reliable network communication. They contrast with static routes, which are manually set and do not adapt to network changes unless manually updated.
Dynamic routing protocols are broadly categorized based on their scope of operation:
| Category | Description | Sub-categories / Examples |
|---|---|---|
| Interior Gateway Protocols (IGP) | Used within a single Autonomous System (AS). | Distance Vector: RIP, EIGRP <br> Link State: OSPF, IS-IS |
| Exterior Gateway Protocols (EGP) | Used for routing between different Autonomous Systems. | Path Vector: BGP (Border Gateway Protocol) |
Here's a comparison of Distance Vector and Link State protocols:
| Characteristic | Distance Vector Protocols | Link State Protocols |
|---|---|---|
| Information Exchange | Exchange information about known destination networks and metrics with directly connected neighbors. | Each router advertises information about its directly connected links to all other routers in the network area. |
| Network View | "Routing by rumor"; information is passed sequentially from router to router, leading to a "tree" view of the network. | Each router builds an identical, comprehensive "map" or topology database of the entire network. |
| Calculation | Calculates routes based on information received from neighbors. | Independently calculates the best routes using its complete network map (e.g., Dijkstra's SPF algorithm). |
| Resource Usage | Generally less resource-intensive in terms of CPU/memory. | Generally requires more resources due to the amount of information processed and complex calculations. |
| Convergence Speed | Slower convergence due to "counting to infinity" issues and full table exchanges. | Faster convergence due to quick propagation of link state changes and independent recalculations. |
| Examples | RIP, EIGRP | OSPF, IS-IS |
Routers use several criteria to select the best path when multiple routes to a destination exist:
| Selection Factor | Description |
|---|---|
| Metric Value Determination | Routers use a metric value to determine the best route to a destination. The metric could be hop count, bandwidth, delay, or a combination of factors, depending on the routing protocol. Generally, a lower metric value indicates a better route. |
| Equal Cost Multi-path (ECMP) | If a router learns multiple routes to the same destination with the same metric via the same routing protocol, it can use ECMP to load balance traffic across all these routes. ECMP allows for load balancing across equally good paths, improving bandwidth utilization and redundancy. |
| Administrative Distance (AD) | This is a value used to rank the trustworthiness of the information received from different routing protocols. A lower administrative distance is preferred because it indicates a more reliable source. In cases where routes are learned from different protocols, the route with the lower administrative distance will be chosen. |
Different dynamic routing protocols use distinct metrics to calculate the best path:
| Routing Protocol | Primary Metric(s) | Notes |
|---|---|---|
| RIP | Hop Count | Each router counts as one hop. Limited to 15 hops. |
| EIGRP | Bandwidth, Delay (and optionally Reliability, Load) | Uses a composite metric; often considered a hybrid protocol. |
| OSPF | Cost (typically based on Bandwidth) | Cost is inversely proportional to bandwidth. Does not inherently consider latency. |
| IS-IS | Cost (typically based on Bandwidth) | Similar to OSPF in metric calculation. |
| BGP | Path Attributes (diverse set of parameters) | BGP's path selection is complex, using many attributes beyond a simple metric. |
RIP considers only a single piece of info about the Network Topology: the optimal path to a given Destination Network (lowest Hop Count). RIP sends Regular updates / triggered updates when changes occur of its own Routing database to neighboring routers. These neighbors receive the update and add unknown routes to its own Routing table, increasing the hop count by 1, and identifies the Originator of the update as the next hop to the specified network.
To prevent loops, the max hop count allowed is 15. This limits the size of a RIP network, since networks that have a hop count of 16 or higher are Unreachable for RIP.
RIP's simplicity makes it suited to small networks with few failover routes. Distance Vector Algorithms provide slower Convergence performance than link state algorithms due to the periodic need to propagate entire Routing tables to their neighbors. RIP is a non-native IP protocol, therefore encapsulated in the higher Transport layer datagrams (UDP 520/521).
RIP is used for small size networks with less than 15 subnets.
Type: Distance Vector protocol. Metric: Hop count. Maximum Hop Count: 15 (prevents routing loops). Timers: Update Timer: 30 seconds (advertises routing table). Invalid Timer: 180 seconds (marks a route invalid if no updates). Hold Down Timer: 180 seconds (prevents regular update instability). Flush Timer: 240 seconds (removes an invalid route).
RIPv1: Only supports classful routing, does not send subnet mask information.
RIPv2: Supports classless routing, sends subnet mask information, uses multicast address 224.0.0.9 for updates.
RIPnG: RIP Next Generation for IPv6.
EIGRP is an advanced distance vector routing protocol, often described as a hybrid protocol. It incorporates features of both distance vector and link-state protocols, enabling rapid convergence and efficient network communication. EIGRP is classed as an advanced distance vector or hybrid Routing protocol. It shares some basic principles with RIP; however, advanced changes include:
Type: Advanced Distance Vector (sometimes referred to as a hybrid protocol). Metric: Composite metric based on bandwidth, delay, reliability, load, and MTU. Features: Supports unequal-cost load balancing using variance, rapid convergence.
Feasible Distance (FD): Best known metric to reach a destination. Reported Distance/Advertised Distance (RD): Metric reported by a neighboring router to reach a destination. Successor: Route with the lowest FD to a destination. Feasible Successor: Backup route with a RD less than the FD of the successor. Hybrid Routing Protocol: Combines the best of distance vector and link-state protocols. Metric Calculation: Uses a composite metric based on bandwidth, delay, reliability, load, and MTU size. Load Balancing: Capable of unequal-cost load balancing using VARIANCE. Convergence: Faster than RIP due to its efficient algorithm and trigger updates.
EIGRP uses a complex formula to calculate its metric, considering multiple factors: ${Metric} = 256 * [ ( K_1 * {Bandwidth} +(K_2 * {Bandwidth}) / {256 - {Load}} + K_3 * {Delay}] * ({K_5}{{Reliability} + K_4}) ]$
Where $K_1$ to $K_5$ are constants that can be adjusted to prioritize certain metrics over others, but by default, Cisco routers use $K_1 = K_3 = 1$ and $K_2 = K_4 = K_5 = 0$, focusing mainly on bandwidth and delay.
To configure EIGRP on a router, you use the following commands within global configuration mode:
network [NETWORK_ADDRESS] [WILDCARD_MASK]: Specifies the interfaces on which EIGRP is enabled. The wildcard mask is the inverse of a subnet mask.eigrp router-id [ROUTER_ID]: Manually sets a unique identifier for the EIGRP routing process.no auto-summary: Disables automatic summarization of subnet routes into their major networks.maximum-paths [NUMBER_OF_PATHS]: Allows load balancing across multiple paths if available.variance [MULTIPLIER]: Enables unequal cost load balancing. Routes with a metric less than the product of the variance multiplied by the lowest metric (feasible distance) will be included in the routing table.Router(config)# router eigrp 100 Router(config-router)# network 10.0.0.0 0.0.0.255 Router(config-router)# eigrp router-id 1.1.1.1 Router(config-router)# no auto-summary Router(config-router)# maximum-paths 4 Router(config-router)# variance 2
This setup configures EIGRP for autonomous system 100, enables it on all interfaces with IP addresses in the 10.0.0.0/24 range, sets the router ID to 1.1.1.1, disables auto-summarization, allows up to 4 equal or unequal paths for load balancing, and sets the variance multiplier to 2.
EIGRP's sophisticated metric calculation and flexibility make it a robust choice for large enterprise networks seeking efficient, reliable routing with quick convergence times. Its ability to balance load across multiple paths, even those of unequal cost, provides enhanced network utilization and redundancy.
A wildcard mask uses opposite bits of a subnet mask. For example, a subnet mask of 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary. The corresponding wildcard mask would be 0.0.0.255, which is 00000000.00000000.00000000.11111111 in binary.
Shortcut for Wildcard Masks
To quickly convert a regular subnet mask to a wildcard mask, subtract each octet in the subnet mask from 255. Example:
255.255.255.0255 - 255.255 - 255.255 - 255.255 - 0 = 0.0.0.255OSPF is the most widely adopted link-state protocol, suited to large organizations with multiple redundant paths between networks. It has a higher Convergence performance than RIP and supports Classless Addressing. While RIP & EIGRP are generally flat, OSPF is Hierarchical, grouping connected hosts & Routers within an Autonomous System into Areas. Routers within a given area share the same Topological database of the network they serve. Routers that can connect to multiple areas are known as Area Border Routers. A Backbone Area (Area 0) is created by the collection of border routers. The Router applies a shortest path first algorithm to analyze the link-state database and build best-cost, loop-free routes into its Routing table. The use of areas to subdivide the network minimizes the amount of Routing traffic that must be passed around the network as a whole, further improving convergence performance, but requires more CPU and memory resources. Tagged as #89 in the IP datagram protocol header field. Supports clear text authentication.
Routers create a connectivity map of the network. Each router advertises information about its interfaces to its neighbors. These advertisements are passed along to other routers until all routers in the network develop the same map. Using this map, each router independently calculates the best routes to each destination. This allows OSPF to converge more quickly and react faster to topology changes than Distance Vector protocols. However, OSPF tends to be resource-intensive on the CPU. Routers store information about the network in Link State Advertisements (LSAs), which are organized in a structure called the Link State Database (LSDB). The LSDB is identical for all routers in the OSPF area. Routers will flood LSAs until all routers in the OSPF area develop the same map of the network.
OSPF Hierarchy:
Connectivity:
Areas and Performance:
Area Rules:
Routers:
Routing:
Basic OSPF Configuration:
router ospf <PID> command is used on the router to identify each of them.passive-interface command tells the router to stop sending OSPF Hello messages out of the interface; used on interfaces without OSPF neighbors.default-information originate command advertises a router's default route into the OSPF network.Default Information Originate Command: When you issue the default-information originate command, OSPF will advertise the router's Gateway of Last Resort (Default Route). This command configures OSPF to inject a router’s default external route into the OSPF domain. This is similar to redistributing routes in OSPF router configuration mode.
Redistributes Routes from Other Routing Protocols into OSPF: ASBR redistributes routes from other routing protocols into the OSPF domain.
This structured note provides clear instructions on various OSPF configurations including initialization, neighbor relationships, and detailed interface settings.
• DBD: Database Description
• LSR: Link State Request
• LSU: Link State Update
• DR: Designated Router
• BDR: Backup Designated Router
OSPF Interface Priority: Higher priority wins DR/BDR election. Default priority is 1 for all interfaces . Router ID: In case of a tie in priority, the higher Router ID wins. Election Non-preemptive: Once elected, roles are maintained unless the interface fails or OSPF is restarted.
| Requirement | Description |
|---|---|
| Area number | Must match. |
| Subnet | Interfaces must be within the same subnet. |
| OSPF Process | Must be running (not shutdown). |
| Router IDs | Must be unique. |
| Hello and Dead timers | Must match. |
| Authentication settings | Must match. |
| MTU settings | Must match. |
| OSPF network type | Must be consistent across interfaces. |
| NB EVEN THOUGH MTU AND NETWORK TYPE MISMATCH MAY STILL RESULT TO PARTIAL ADJACENCY(stuck in 2-way State), a mismatch of MTU and NETWORK TYPE ensures that routers won’t fully synchronize their LSDBs and have full OSPF adjacency |
Dead and hello timers are critical for detecting failed neighbors. To edit the dead interval and hello interval for an OSPF-enabled interface on a Cisco device, use the following commands in interface configuration mode:
Router(config)# interface [interface_id]
Router(config-if)# ip ospf hello-interval [seconds]
Router(config-if)# ip ospf dead-interval [seconds]
Note:The dead interval must be at least 4 times the hello interval (best practice). Both routers on the link must have matching hello and dead timers to form or maintain an adjacency.
Link-State Advertisements (LSAs):
Definition: A virtual interface internal to Cisco IOS, created via the command interface loopback number, where the number is an integer.
Purpose: Provides a consistent IP address to identify or reach the router, as it remains in an up/up state as long as the router is operational and not manually shut down.
State: Always "up/up" unless manually shut down.
Router(config)# interface loopback 0
Router(config-if)# ip address 1.1.1.1 255.255.255.255
This sequence of commands sets up a loopback interface with a specified IP address, ensuring that it is active and saved across reboots. Often configured for testing or management purposes.
| Network Type | Default On | Neighbor Discovery | DR/BDR Election | Adjacency | Multicast Addresses |
|---|---|---|---|---|---|
| 1. Broadcast | Ethernet & Fiber Distributed Data Interfaces | Uses multicast address 224.0.0.5 for OSPF Hello messages. | Mandatory | Full adjacency with DR and BDR. DROthers have a 2-way state. | General Hello: 224.0.0.5 <br> To DR/BDR: 224.0.0.6 |
| 2. Point-to-Point | Serial interfaces (PPP or HDLC encapsulations) | Directly between the two routers without DR/BDR elections. | No | Full adjacency automatically formed between the two connected routers. | General Hello: 224.0.0.5 <br> To DR/BDR: NO DR/BDR Messages |
| 3. Non-Broadcast (NBMA) | Frame Relay | Manual neighbor specification required due to lack of broadcast. | N/A | N/A | N/A |
DCE/DTE Roles (for Serial Interfaces):
| Command | Description |
|---|---|
RT(config-if)# ip ospf priority <value> | Changes OSPF Priority: Higher priority wins DR/BDR election. Default priority is 1 for all interfaces. |
RT(config)# clear ip ospf process | Clears the OSPF process, often used to force re-elections or database synchronization. |
RT# show controllers <interface-id> | Shows interface controllers, providing details about the physical layer and serial interface types (DCE/DTE). |
| `RT(config-if)# ip ospf network {broadcast | non-broadcast |
RT(config-if)# clock rate <value> | Sets Clock Rate for Serial Interface (DCE side). |
RT# router RIP | Enters RIP router configuration mode. |
RT# version 2 | Configures RIP version 2 (classless). |
RT# router eigrp Autonomous-system-id | Enters EIGRP router configuration mode (AS number must match between routers). |
RT# router ospf process-id | Enters OSPF router configuration mode (Process ID does not have to match between routers to form adjacency). A router can run multiple OSPF processes. |
RT(config-router)# variance [multiplier] | Allows EIGRP to use multiple paths that have a metric less than the best path multiplied by the variance value (unequal cost load balancing). |
RT(config-router)# no auto-summary | Prevents the router from summarizing routes to their classful boundaries (keeping addresses classless with CIDR/wildcard mask). |
RT(config-router)# passive-interface [Interface-ID] | Stops sending OSPF Hello messages (and EIGRP updates) out of a specified interface; used on interfaces without OSPF/EIGRP neighbors for security/efficiency. |
RT(config-router)# passive-interface default | Sets all interfaces to be Passive by default. |
RT(config-router)# no passive-interface intf-ID | Un-selects specified interfaces from being passive. |
RT(config-router)# Default-Information Originate | In OSPF, advertises a router’s Gateway of last resort (Default Route) into the OSPF domain, making the router an ASBR. |
RT(config-router)# network [network-address] [wildcard-mask] | For RIP/EIGRP/OSPF, specifies which networks on the router’s interfaces will participate. |
RT(config-router)# network [network-address] [wildcard-mask] area No. | For OSPF, activates OSPF on interfaces matching the network address/wildcard mask and assigns them to the specified area. |
RT(config-if)# ip ospf [process-id] area [area-id] | Alternatively, activates OSPF directly on an interface. |
OSPF's metric, called cost, is automatically calculated based on the bandwidth (speed) of the interface. All interfaces are equal and have a cost of 1 if calculated by dividing a reference bandwidth by the interface's real bandwidth.
(config-router)# auto-cost reference-bandwidth [bandwidth in Mbps]
Three Ways to Configure New Parameters for OSPF’s Metric Calculations:
| Method | Command | Description | Recommendation |
|---|---|---|---|
| Change Interface Bandwidth | RT(config-if)# bandwidth [bandwidth in kbps] | Manually changes the interface speed (bandwidth) used in the OSPF cost calculation. This is NOT recommended as it affects other protocols' metric calculations. | Not Recommended |
| Set OSPF Cost Manually per Interface | RT(config-if)# ip ospf cost [cost-value] | Manually configures the OSPF cost for an individual interface. This value overrides the calculated cost. | Used for fine-tuning |
| Change Reference Bandwidth | RT(config-router)# auto-cost reference-bandwidth [bandwidth in mbps] | Changes the reference bandwidth used in the OSPF cost calculation (Reference Bandwidth / Interface Bandwidth). This is the most recommended method for scaling OSPF costs. | Most Recommended |
| Command | Description |
|---|---|
RT# show ip protocols | Displays detailed information about all IP routing protocols configured on the router, including types (OSPF, EIGRP), status, network types, timers, and specific configurations. |
| `RT# show ip {eigrp | ospf} interface` |
| `RT# show ip {eigrp | ospf} interface brief` |
| `RT# show ip {eigrp | ospf} interface intf-ID` |
| `RT# show ip {eigrp | ospf} neighbor` |
| `RT# show ip {eigrp | ospf} topology` |
| Do's | Don'ts |
|---|---|
| Use Correct Subnet Masks. | Avoid Incorrect Next-Hop Addresses. |
| Specify Exact Routes for Non-Broadcast Interfaces. | Don't Overlook Routing Protocols for Larger Networks. |
| Verify Interface Statuses. | Avoid Unnecessary Routes. |
| Use Descriptive Comments. | Don't Forget Security. |
| Test Connectivity & Specify exact Default Gateway. | Avoid Misconfigurations. |
If OSPF (AD 110) is the primary routing protocol, and you need a backup static route:
Router(config)# ip route 192.168.1.0 255.255.255.0 10.1.1.2 200
This command configures a static route to the network 192.168.1.0/24 with a next-hop address of 10.1.1.2 and sets the AD to 200, ensuring it is used only if the OSPF route fails.
Route Preference Based on Address Length
BGP replaced Exterior Gateway Protocol (EGP). BGP is designed to be used within and between Routing Domains in a mesh network and as such is used as the Routing protocol on the Internet, primarily between ISPs.
| BGP Term | Description |
|---|---|
| MESH Network | A network of Routers in separate Autonomous Systems. |
| Interior BGP (IBGP) | Implemented within an Autonomous System. |
| Exterior BGP (EBGP) | Implemented between Autonomous Systems. |
AS is designed to hide the complexity of private Organization networks from the public Internet.
If all Internet locations had to be propagated to all Network Routers, the Routing tables would become too large to process. BGP prioritizes stability, so it is slow to converge. BGP is a non-native IP protocol; it works over TCP on port 179. It uses a classless network prefix called Network Layer Reachability Information (NLRI), a path routing vector. Path selection is based on multiple metrics: Hop count, Weight, Local Preference, Origin, AS Path, etc. (More complex than simple distance or bandwidth).
In the world of networking, ensuring continuous data flow and minimizing downtime is paramount. A fascinating aspect of network design involves the implementation of redundancy protocols across different layers. Let's delve into the similarities between EtherChannel at Layer 2 and First Hop Redundancy Protocols (FHRP) at Layer 3.
| Feature | EtherChannel (Layer 2) | FHRP (Layer 3) |
|---|---|---|
| Redundancy | Aggregates multiple physical links into a single logical link for enhanced bandwidth and redundancy. | Provides redundant gateway IPs to connected devices, preventing single points of failure (e.g., HSRP, VRRP, GLBP). |
| Load Balancing | Distributes traffic at Layer 2 among the links in the channel (e.g., source/dest MAC). | Distributes client requests among multiple routers, efficiently managing traffic at Layer 3. |
| Failover Capability | If one physical link fails, traffic automatically redistributes to remaining links without downtime. | Re-routes traffic to another router in the event of a gateway failure, ensuring high availability. |
While they operate at different layers within the OSI model, the core objectives align splendidly, showcasing the layered approach to network resilience. Understanding these protocols is essential for designing robust networks that can efficiently handle failures and ensure uninterrupted service delivery.
A First Hop Redundancy Protocol (FHRP) is a subnetwork designed to protect the default gateway used on a network by allowing 2 or more routers to provide backup for that address. In the event of a failed router, the backup router will take over the address, usually within a few seconds. Due to the degree of complexity in Endpoint-Hosts Routing Algorithms, configuring multiple default gateways for fault tolerance is impractical - FHRP resolves this issue by allowing multiple physical router appliances to function as a single logical router. Named as "First Hop" due to being an Endpoint-Host(s) Default Gateway or first router (HOP) in the path to whatever destination the hosts are trying to send traffic to.
An Active Router and a Standby Router are elected, Endpoints/Hosts in the network are configured to use the virtual IP as their default gateway. The Active router replies to ARP requests using the virtual MAC Address, so traffic destined for other networks will be sent to it. If the active router fails, the standby router becomes the next active router. However, with Non-Preemption enabled, the new Active Router will send Gratuitous ARP messages so that switches will update their MAC Address Tables. It now functions as the new default gateway. If the old active router comes back online/recovers from failure, by default it would not take back its role as the Active router. It becomes the standby router. Router selection is non-preemptive by default, similar to DR/BDR election in OSPF, although in FHRP, there's a way to configure "PREEMPTION."
FHRP plays a critical role in maintaining the accessibility of network services by providing seamless failover capabilities.
| Feature | Description | HSRPv1 Specifics | HSRPv2 Specifics |
|---|---|---|---|
| Developer | Cisco proprietary | N/A | N/A |
| Election | An Active & Standby Router are elected. | N/A | N/A |
| Supported Versions | V1 and V2 supported. | N/A | Adds IPv6 support. |
| Multicast IPv4 Address | 224.0.0.2 (V1) / 224.0.0.102 (V2) | 224.0.0.2 | 224.0.0.102 |
| Virtual MAC Address | 0000.0C07.ACxx (V1) / 0000.0C9F.Fxxx (V2) | 0000.0C07.ACxx | 0000.0C9F.Fxxx |
| Group Number | xx/xxx represents HSRP Group Number. Can be configured differently for each subnet/VLAN. | N/A | N/A |
| Best Practice | Group number settings should match VLAN numbers for organizational consistency. | N/A | N/A |
| Feature | Description |
|---|---|
| Standard | Open Standard - IEEE (IEEE 802.1Q - actually IEEE 802.1Q for VLANs, VRRP is RFC 3768) |
| Enhancements | Cisco proprietary enhancements available. |
| Election | A Master and Backup Router are elected. Load balances among multiple routers elected. |
| Multicast IPv4 Address | 224.0.0.18 |
| Virtual MAC Address | 0000.5000.01XX (XX represents the VRRP Group ID) |
| Load Balancing | Can be configured with a different master router in each subnet/VLAN to load balance. |
| Feature | Description |
|---|---|
| Capability | Provides redundancy AND load balances traffic between multiple available routers. |
| Load Balancing | Load Balances among Multiple Routers within a single subnet. |
| Election (AVG) | An Active Virtual Gateway (AVG) is elected. |
| AVF Assignment | Up to 4 Active Virtual Forwarders (AVF) are assigned by the AVG. |
| Multicast IPv4 Address | 224.0.0.102 (same as V2 HSRP) |
| Default Gateway | Each AVF acts as the default gateway. |
NOTE: The Active Router is determined by priority. Preempt causes the Router to take the role of active Router, even if another router already has the role. The Preempting Router must have a higher priority or IP Address.
Configuration commands:
RT# show standby
RT(config-if)# interface gx/y
RT(config-if)# standby version 1|2
RT(config-if)# standby group-number ip 'virtual-ip'
RT(config-if)# standby group-number priority 'priority'
RT(config-if)# standby group-number preempt
VRF is commonly used to facilitate MPLS and VRF-Lite. VRF allows us to divide one physical router into multiple virtual routers, similar to VLANs for switches.
| Feature | VLANs (Switches) | VRF (Routers) |
|---|---|---|
| Function | Divide a switch into multiple virtual switches with their own logical broadcast domains. | Divide a Router into multiple Virtual Routers, each with its own Routing Table. |
| Traffic Isolation | Broadcast domain isolation. | Traffic is isolated from each other; customer IP address schemes can overlap. |
| Configurable on | Switchports, SVIs. | Router Interfaces, Switch Virtual Interfaces (SVIs), and Routed ports on Multilayer Switches. |
| Traffic Flow | Traffic within one VLAN is isolated from others. | Traffic in one VRF cannot be forwarded out of an interface in another VRF (except with VRF Leaking). |
| Common Use | Enterprise LAN segmentation. | Service providers to carry traffic from multiple customers (e.g., on a PE Router). |
Traffic in one VRF cannot be forwarded out of an interface in another VRF. As an exception, VRF Leaking can be configured to allow traffic to pass between VRFs. VRF is used commonly by service providers to allow one device to carry traffic from multiple customers (e.g., on a PE Router).
IPv4 access control lists (ACL) give network engineers the ability to program a filter into a router. Each router, on each interface, for both the inbound and outbound direction, can enable a different ACL with different rules. Each ACL’s rules tell the router which packets to discard and which to allow through. IPv4 ACLs perform many functions in Cisco routers, with the most common use as a packet filter. Engineers can enable ACLs on a router so that the ACL sits in the forwarding path of packets as they pass through the router. After it is enabled, the router considers whether each IP packet will either be discarded or allowed to continue as if the ACL did not exist. ACLs can be used for many other IOS features as well. As an example, ACLs can be used to match packets for applying Quality of Service (QoS) features. QoS allows a router to give some packets better service, and other packets worse service.
Cisco routers can apply ACL logic to packets at the point at which the IP packets enter an interface, or the point at which they exit an interface. In other words, the ACL becomes associated with an interface and for a direction of packet flow (either in or out). That is, the ACL can be applied inbound to the router, before the router makes its forwarding (routing) decision, or outbound, after the router makes its forwarding decision and has determined the exit interface to use. In short, to filter a packet, you must enable an ACL on an interface that processes the packet, in the same direction the packet flows through that interface. When enabled, the router then processes every inbound or outbound IP packet using that ACL. When you think about the location and direction for an ACL, you must already be thinking about what packets you plan to filter (discard), and which ones you want to allow through. To tell the router those same ideas, you must configure the router with an IP ACL that matches packets. Matching packets refers to how to configure the ACL commands to look at each packet, listing how to identify which packets should be discarded and which should be allowed through.
When doing ACL processing, the router processes the packet, compared to the ACL, as follows: ACLs use first-match logic. Once a packet matches one line in the ACL, the router takes the action listed in that line of the ACL and stops looking further in the ACL.
This sequence of processing an ACL as a list happens for any type of IOS ACL: IP, other protocols, standard or extended, named or numbered. Finally, if a packet does not match any of the items in the ACL, the packet is discarded. The reason is that every IP ACL has a deny all statement implied at the end of the ACL. It does not exist in the configuration, but if a router keeps searching the list, and no match is made by the end of the list, IOS considers the packet to have matched an entry that has a deny action.
IOS refers to each line in an ACL as an Access Control Entry (ACE), but many engineers just call them ACL statements. IOS allows standard ACLs to match a range of addresses using a tool called a wildcard mask. Note that this is not a subnet mask. The wildcard mask (which this book abbreviates as WC mask) gives the engineer a way to tell IOS to ignore parts of the address when making comparisons, essentially treating those parts as wildcards, as if they already matched. You can think about WC masks in decimal and in binary, and both have their uses. To begin, think about WC masks in decimal, using these rules:
access-list 1 permit anySo, when and where should you use such a command? Remember, all Cisco IP ACLs end with an implicit deny any concept at the end of each ACL. That is, if a router compares a packet to the ACL, and the packet matches none of the configured statements, the router discards the packet. Want to override that default behavior? Configure a permit any at the end of the ACL. You might also want to explicitly configure a command to deny all traffic (for example, access-list 1 deny any) at the end of an ACL. Why, when the same logic already sits at the end of the ACL anyway? Well, the ACL show commands list counters for the number of packets matched by each command in the ACL, but there is no counter for that implicit deny any concept at the end of the ACL. So, if you want to see counters for how many packets are matched by the deny any logic at the end of the ACL, configure an explicit deny any. When routers apply an ACL to filter packets in the outbound direction, as shown in Example 2-3, the router checks packets that it routes against the ACL. However, a router does not filter packets that the router itself creates with an outbound ACL.
Examples of those packets include routing protocol messages and packets sent by the ping and traceroute commands on that router. In addition, if you add the log keyword to the end of an access-list command, IOS then issues log messages with occasional statistics about matches of that particular line of the ACL. Both the statistics and the log messages can be helpful in deciding which line in the ACL is being matched by a packet. When you troubleshoot an ACL for the first time, before getting into the details of the matching logic, take the time to think about both the interface on which the ACL is enabled and the direction of packet flow. Sometimes the matching logic is perfect—but the ACL has been enabled on the wrong interface, or for the wrong direction, to match the packets as configured for the ACL.
To match a specific address, just list the address. To match any and all addresses, use the ANY keyword. To match based only on the first one, two, or three octets of an address, use the 0.255.255.255, 0.0.255.255, and 0.0.0.255 WC masks, respectively. Also, make the source (address) parameter have 0s in the wildcard octets (those octets with 255 in the wildcard mask). To match a subnet, use the subnet ID as the source, and find the WC mask by subtracting the DDN subnet mask from 255.255.255.255.
The change IOS can make with an access-list command is to convert to 0 any octet of an address for which the wildcard mask’s octet is 255. For example, with a wildcard mask of 0.0.255.255, IOS ignores the last two octets. IOS expects the address field to end with two 0s. If not, IOS still accepts the access-list command, but IOS changes the last two octets of the address to 0s. Extended ACLs differ from standard ACLs mostly because of the larger variety of packet header fields that can be used to match a packet. One extended ACE (ACL statement) can examine multiple parts of the packet headers, requiring that all the parameters be matched correctly to match that one ACE. That powerful matching logic makes extended access lists both more useful and more complex than standard IP ACLs.
Numbered ACLs have existed in IOS since the early days of Cisco routers and IOS; however, for many years, through many IOS versions, the ability to edit a numbered IP ACL was poor. For example, to simply delete a line from the ACL, the user had to delete the entire ACL and then reconfigure it. The ACL editing feature uses an ACL sequence number that is added to each ACL permit or deny statement, with the numbers representing the sequence of statements in the ACL. ACL sequence numbers provide the following features for both numbered and named ACLs:
no sequence-number subcommand.ACLs have multiple uses, they function as a packet filter, instructing the router to permit or discard specific traffic, ACLs can filter traffic based on source/destination Layer 3 IP addresses, source /destination layer 4 ports. Different types of ACLs have a different range of numbers that can be used.
Configuring an ACL in Global Config Mode will not make the ACL take effect. The ACL must then be applied to an interface, ACLs are applied either inbound or outbound. ACLs are made up of one or more ACCESS CONTROL ENTRIES ACE. When the router checks a packet against the ACL, it processes the ACEs in order, from top to bottom. If the packet matches one of the ACEs in the ACL, the router takes the action and stops processing the ACL. All entries below the matching entry will be ignored. ACLs have multiple uses, and are processed sequentially from the first entry in the list to the last entry. They control packet flow across a network by either permitting or denying packets based on source network, destination network, (protocol or destination port-Extended). Each ACL can only be applied to a single protocol per interface and per direction, Multiples ACLs can be used to accomplish more complex packet flow through out an organization.
A very common point of confusion with Cisco ACLs! It seems counterintuitive, but the "in" and "out" directions in an ACL are always relative to the router interface itself, not the direction of the traffic flow in the network as a whole.
| Direction | Perspective | Processing Point | Action on Deny | Action on Permit |
|---|---|---|---|---|
| Inbound | Traffic coming into the router interface. | Router checks ACL before making any routing decisions. | Router drops the packet. | Router proceeds with routing. |
| Outbound | Traffic going out of the router interface. | Router checks ACL after making routing decisions and determining the exit interface. | Router drops the packet. | Router sends the packet out. |
NOTE: If you apply a new ACL named or numbered to the same interface in the same direction, it will replace/overwrite the previous one, in such case the last ACL we applied will be the running one. NOTE: If you added ACEs to an existing ACL, the ACEs will be appended to the end of the existing ACL; consequently, it may be necessary to re-create the ACL if you need the add an entry that should appear at or near the top of the ACL.
STANDARD ACLs match traffic based only on the source IP address of the packet. Standard ACLs can use numbers 1-99 and 1300-1999. A rule of thumb is to apply standard ACLs as close to the destination as possible.
They are identified with a number (i.e., ACL 1, ACL 2 etc). The Basic command to configure a “standard numbered” ACL is:
RT(config)# ip access-list standard number
RT(config-std-nacl)# deny 1.1.1.1 0.0.0.0
RT(config-std-nacl)# deny 1.1.1.1
RT(config-std-nacl)# permit any
RT(config-std-nacl)# permit 0.0.0.0 255.255.255.255
RT(config-std-nacl)# remark ## BLOCK BOB FROM ACCOUNTING ##
RT(config-std-nacl)# interface g0/0
RT(config-if)# ip access-group number {in | out}
Display commands for Standard Numbered ACLs:
RT(config)# do show access-lists
RT(config)# do show running-config | include access-lists
They are identified with a Name (i.e., ‘BLOCK_BOB’). They are configured by entering ‘standard named ACL configuration mode’ and then configuring each entry within that configuration mode.
RT(config)# ip access-list standard ACL_NAME
RT(config-std-nacl)# [entry-number] {deny | permit} ip wildcard-mask
RT(config)# ip access-list standard BLOCK_BOB
RT(config-std-nacl)# deny 192.168.1.24 0.0.0.0
RT(config-std-nacl)# permit any
RT(config-std-nacl)# remark ## configured April21,2025 ##
RT(config-std-nacl)# interface g0/0
RT(config-if)# ip access-group BLOCK_BOB {in | out}
NOTE: One disadvantage of the numbered ACL is that when configuring/deleting numbered ACLs from global config mode, you can’t delete individual entries, you can only delete the entire ACL. However, from config-std-nacl mode, you can use no entry-number to delete individual entries.
NOTE: One advantage of the named ACL is that you can easily delete individual entries in the ACL with RT(config-std-nacl)# NO sequence-number, and you can insert new entries in between other entries by specifying the sequence number. Named ACLs originally had three big differences compared to numbered ACLs:
Display commands for Standard Named ACLs:
RT(config)# do show access-lists
RT(config)# do show running-config | include access-list
RT(config)# do show running-config | section access-list
NOTE: There is a RESEQUENCING function that helps edit ACLs. The command is:
#ip access-list resequence number/name starting-seq-num increment
Extended ACLs let you imagine the exact path of the traffic you want to filter. This will make it easier to determine the source and destination. They match traffic based on more parameters -> on the src/dest IP address && src/dest Port/Protocol of the packet, so they are more precise and also more complex than standard ACLs. Extended ACLs can use numbers 100-199 and 2000-2699. Use named ACLs instead of numbered ones. They are easier to read and modify. If you specify the protocol, source IP, source Port, destination IP, destination Port, etc, a packet must match all of those values to match the ACL entry. Even if it matches all except one of the parameters, the packet won’t match that entry of the ACL.
RT(config)# access-list number [permit | deny] protocol src-IP dest-ip
RT(config)# ip access-list extended {name | number}
RT(config-ext-nacl)# [permit | deny] protocol src-IP dest-ip
RT(config-ext-nacl)# permit ip any any
RT(config-ext-nacl)# deny ip any any
RT(config-ext-nacl)# deny tcp src-ip “eq” src-port-num dest-ip “eq” dst-port-num
RT(config-ext-nacl)# deny udp src-ip “lt” src-port-num dest-ip “gt” dst-port-num
"Ever wonder where to place them on your Cisco router? 🤔 It's all about control! 💡Placement is KEY. Standard ACLs = 🚫 destination. Extended ACLs = 🎯 source. This prevents headaches and keeps your network lean. Think of ACLs like bouncers! 🚪"
| ACL Type | Analogy | Placement Rule | Rationale | Common Application |
|---|---|---|---|---|
| Standard ACLs | Like a 'destination only' filter. | Place them near the destination. | Because standard ACLs can filter packets only by source Internet Protocol (IP) address, they should be placed as close to the destination as possible. This prevents them from blocking legitimate traffic from the same source that needs to reach other destinations. If applied close to the source, there is a risk of blocking more traffic than intended. When applying them to an interface, applying them "outbound" is often the correct approach, meaning closer to the destination interface. The goal is to filter the traffic as it's about to leave the router towards its final destination, minimizing the impact on other traffic. | Often outbound |
| Extended ACLs | Super precise, checking ID and destination. | Place them near the source for maximum efficiency. | By contrast, you can use extended ACLs to filter packets based on Source & Destination IP, Protocols, and Ports. Extended ACLs should be placed as "close to the source" of the packet as possible, to limit how far the packets travel in the network before being denied. As a result, applying them "inbound" is often the correct approach, meaning on the interface where the traffic (we intend to permit or deny) enters the router. | Often inbound |
In Summary:
Layer 2 Discovery Protocols such as CDP and LLDP share information with and Discover information about neighbouring connected devices. Although they are layer 2 discovery protocols, they could be used to share layer 3 information as well. The shared information includes Hostname, IP address, Device type. Because they share information about devices in the network, they can be considered a security risk and are often not used. It is up to the network engineer/admin to decide if they want to use them in the network or not.
CDP is a Cisco Proprietary protocol, it’s enabled on Cisco devices (routers, switches, firewalls, IP phones, etc.).
| Feature | Description |
|---|---|
| Multicast Address | CDP messages are periodically sent to multicast address 0100.0CCC.CCCC (this same multicast address is used by Cisco on all its proprietary L2 Protocols, i.e., CDP/VTP/DTP/PagP/UDLD). When a device receives a CDP message, it processes and discards the message; it does not forward it to other devices. |
| Neighbor Discovery | CDP shows information about directly connected neighbors, because only directly connected devices share and receive CDP messages. |
| Default Timer | By default, CDP messages are sent once every 60 seconds. |
| CDP Holdtime | By default, the CDP HOLDTIME is 180 seconds. If a message isn’t received from a Neighbor for 180 seconds, the neighbor is removed from the CDP neighbor table. |
| CDPv2 | CDPv2 messages are sent by default. Version 2 offers a few more advanced features like the ability to identify native VLAN mismatches (between neighbors). |
| Default State | CDP is globally enabled by default on each interface. |
| Command | Description |
|---|---|
RT(config)# cdp run | To enable CDP globally. |
RT(config)# no cdp run | To disable CDP globally. |
RT(config-if)# cdp enable | To enable CDP on specific interfaces. |
RT(config-if)# no cdp enable | To disable CDP on specific interfaces. |
RT(config-if)# cdp timer seconds | To configure the CDP message timer. |
RT(config-if)# cdp holdtime seconds | To configure the CDP hold time. |
| Command | Description |
|---|---|
RT# show cdp | States whether CDP is enabled globally and lists the default update and holdtime timers. |
RT(config)# do show cdp traffic | Displays the number of CDP advertisement packets passed through an interface, and the number of CDP advertisements the device interfaces has sent and received. |
RT(config)# do show cdp interface [intf-ID] | Gives basic information about each interface; you can also specify a specific interface. |
RT(config)# do show cdp neighbors | Displays CDP details about its neighbors, including Local Interface (interface on the device issuing the command) & Device ID/Name of the Neighbor & Port ID (interface of the connected neighbor), their capabilities, and platform. |
RT(config)# do show cdp neighbors detail | Displays more information for CDP neighbors, i.e., Operating system & version of the neighboring device, VTP Management Information, and Information about VLAN Duplexity. |
RT(config)# do show cdp entry [neighbor-ID] | Lists the same information as the show cdp neighbors detail command, but only for the named neighbor (case sensitive). |
LLDP is an industry standard IEEE protocol (IEEE 802.1AB). It’s usually disabled globally on all interfaces on Cisco devices by default in favor of Cisco CDP. Cisco created the Cisco-proprietary CDP before any standard existed for a similar protocol. LLDP is usually more preferable to run in a Multi-vendor network. It must be manually enabled. A device can run CDP and LLDP at the same time.
| Feature | Description |
|---|---|
| Multicast MAC Address | LLDP messages are periodically sent to Multicast MAC address 0180.C200.000E. When a device receives an LLDP message, it processes and discards the message; it does not forward it to other devices. |
| Message Concepts | LLDP uses the same messaging concepts as CDP, encapsulating messages directly in data-link headers. |
| Default Timer | By default, LLDP messages are sent out every 30 seconds, with a default HOLDTIME of 120 seconds. |
| Reinitialization Delay | LLDP has an additional timer called the ‘Reinitialization Delay’; if LLDP is enabled (globally or on an interface), this timer will delay the actual initialization of LLDP by 2 seconds (default). |
| Separate Functions | LLDP separates the sending and receiving of LLDP messages as separate functions, allowing independent control of transmission and reception on an interface. |
| Command | Description |
|---|---|
RT(config-if)# lldp transmit | To enable LLDP on a specific interface (tx) to advertise LLDP messages. |
RT(config-if)# lldp receive | To enable LLDP on a specific interface (rx) as LLDP Recipient. |
RT(config)# lldp run | To enable LLDP globally (Cisco devices default to disable LLDP). This global configuration command sets the default mode of LLDP operation for any interface that does not have more specific LLDP subcommands (lldp transmit, lldp receive). Enables LLDP in both directions on those interfaces. |
RT(config)# no lldp run | To disable LLDP globally. |
RT(config)# lldp timer seconds | To configure the LLDP message timer. |
RT(config)# lldp holdtime seconds | To configure the LLDP holdtime timer. |
RT(config)# lldp reinit seconds | To configure the LLDP Reinitialization timer. |
| Command | Description |
|---|---|
RT(config)# do show lldp traffic | Displays the number of LLDP packets passed through an interface, and the number of LLDP advertisements the device interfaces have sent and received. |
RT(config)# do show lldp interface [intf-ID] | Gives some basic information about each interface; you can also specify a specific interface. It also displays the TX and RX state. |
RT(config)# do show lldp neighbors | Displays LLDP details about its neighbors, including Local Interface (interface on the device issuing the command) & Device ID/Name of the Neighbor & Port ID (interface of the connected neighbor), their capabilities, and platform. |
RT(config)# do show lldp neighbors detail | Displays more information for LLDP neighbors, i.e., Operating system & version of the neighboring device. VTP Management Information won’t be displayed (as VTP is Cisco Proprietary). Information about VLAN Duplexity. |
RT(config)# do show lldp entry [neighbor-ID] | Displays information per specific neighboring device ID, similar to #show lldp neighbors detail, but for the specified neighbor only. |
Both the show cdp neighbors and show lldp neighbors commands have “local intf” (interface) and “port ID” columns. These columns refer to the local device’s interface and the neighboring device’s interface, respectively. However, the LLDP output in the example does differ from CDP in a few important ways:
B as the capability code for switching, referring to bridge, a term for the device type that existed before switches that performed the same basic functions.SNMP Agent (UDP 161) and SNMP Manager (UDP 162) In 1988, RFC 1065, “Structure and Identification of Management Information for TCP/IP-based Internet,” proposed that information about devices on a TCP/IP-based network—configuration settings, status information, counters, and so on—could be broken down into a database of variables. Those variables could then be collected by management software to monitor and manage the IP-based network. After all, the elements of any IP-based machines would have commonalities. SNMP is an industry standard framework and protocol that was originally released in 1988. It can be used to monitor the status of devices, make configuration changes, etc. SNMP is an Application layer protocol that provides a message format for communication between what are termed managers and agents.
| Component | Description |
|---|---|
| SNMP Manager | A network management application running on a PC or server, typically called a Network Management Station (NMS). The SNMP Manager is the application on the NMS that interacts with the managed devices; it receives notifications, sends requests for information, sends configuration changes, etc. The SNMP Server Application provides an interface for the network admin to interact with, displays alerts, statistics, charts, graphs of performance metrics. The SNMP manager uses SNMP protocols to communicate with each SNMP agent. |
| SNMP Agent | The software running on the managed devices (router, switch, and so on) with knowledge of all the variables of that device that describes the device's configuration status and counters. It interacts with the SNMP Manager on the NMS by forwarding or receiving information from the NMS. |
| Managed Devices | Many SNMP agents exist in the network, one per device that is managed. Each agent keeps a database of variables that make up the parameters, status, and counters for the operations of the device. |
| Management Information Base (MIB) | This database, called the Management Information Base (MIB), has some core elements in common across most networking devices. It also has a large number of variables unique to that type of device—for instance, router MIBs will include variables not needed on switch MIBs, and vice versa. This information structure contains the variables that are managed by SNMP. The MIB defines/identifies each variable as an Object ID (OID). SNMP Object IDs are organized in a Hierarchical structure. The MIB then organizes the OIDs based in part on RFC standards and in part with vendor-proprietary variables. The MIB organizes all the variables into a hierarchy of OIDs, usually shown as a tree. Each node in the tree can be described based on the tree structure sequence, either by name or by number. |
IOS on routers and switches include an SNMP agent, with a built-in MIB, that can be enabled with the configuration shown later in this chapter. The NMS uses the SNMP Get, GetNext, and GetBulk messages (together referenced simply as Get messages) to ask for information from an agent. The NMS sends an SNMP Set message to write variables on the SNMP agent as a means to change the configuration of the device. These messages come in pairs, with, for instance, a Get Request asking the agent for the contents of a variable, and the Get “RESPONSE” supplying that information.
SNMP permits much flexibility in how you monitor variables in the MIB. The NMS, with historical stored data, can then analyze various statistical facts such as averages, minimums, and maximums. To be proactive, administrators can set thresholds for certain key variables, telling the NMS to send a notification (email, text, and so on) when a threshold is passed. In addition to asking for information with Get commands and setting variables on agents with the Set command, SNMP agents can initiate communications to the NMS. These messages, generally called notifications, use two specific SNMP messages: TRAP AND INFORM. SNMP agents send a Trap or Inform SNMP message to the NMS to list the state of certain MIB variables when those variables reach a certain state.
| Notification Type | Protocol Mechanism | Reliability |
|---|---|---|
| SNMP Traps | Available since SNMPv1. Uses a fire-and-forget process. The SNMP agent sends the Trap to the IP address of the NMS, with UDP as the transport protocol (as with all SNMP messages), and with no application layer error recovery. If the Trap arrives, great; if it is lost in transit, it is lost. | Unreliable |
| Inform Messages | Added with SNMPv2. Similar to Trap messages but with reliability. Still uses UDP but adds application layer reliability. The NMS must acknowledge receipt of the Inform with an an SNMP Response message, or the SNMP agent will time out and resend the Inform. | Reliable |
SNMP supports a few security mechanisms, depending on the particular version. First, one strong method to secure SNMP is to use ACLs to limit SNMP messages to those from known servers only. SNMP agents on Cisco routers and switches support SNMP messages that flow in both IPv4 and IPv6 packets. The SNMP agent can configure an IPv4 ACL to filter incoming SNMP messages that arrive in IPv4 packets and an IPv6 ACL to filter SNMP messages that arrive in IPv6 packets. Using an IPv4 and IPv6 ACL to secure an agent makes good sense. The only hosts that should be sending SNMP messages to the SNMP agent in a router or switch are the NMS hosts. Those NMS hosts seldom move and their IP addresses should be well known to the networking staff. It makes good sense to configure an ACL that permits packets sourced from the IP addresses of all NMS hosts, but no others.
| SNMP Version | Security Mechanism |
|---|---|
| SNMPv1 | Defined clear-text passwords called SNMP communities. Both the SNMP agent and the SNMP manager need prior knowledge of the same SNMP community value (called a community string). Defines both a read-only (RO) community (allows Get messages) and a read-write (RW) community (allows both reads and writes). |
| SNMPv2c | (Community-based SNMP Version 2) basically kept the same community security feature as SNMPv1. |
| SNMPv3 | Does away with communities and replaces them with: <br> - Message integrity: Confirms whether or not each message has been changed during transit. <br> - Authentication (optional): Adds authentication with username and password, using hashing (never clear text). <br> - Encryption (Confidentiality, optional): Encrypts the contents of SNMPv3 messages so attackers cannot read them. |
SYSLOG is an industry standard protocol. On Network devices, Syslog can be used to log events such as changes in interface status, changes in OSPF neighbor status, and system restarts. These Logs are essential when troubleshooting issues, examining the cause of incidents, etc. SYSLOG and SNMP are both used for monitoring and troubleshooting devices; they are complementary but their functionalities are different.
| Protocol | Purpose | Data Flow | Capabilities |
|---|---|---|---|
| SYSLOG | Used for system message logging. Events categorized by facility/severity are logged, used for system management, analysis, and troubleshooting. | Messages are sent from devices to the server. | Server cannot actively pull information (like SNMP GET) or modify variables (like SNMP Set). |
| SNMP | Used to retrieve and organize information about SNMP-managed devices. | Manager queries clients (GET) and modifies variables (SET). | Manager can actively pull information and modify variables. |
IOS dictates most of the contents of the messages, but you can at least toggle on and off the use of the timestamp (which is included by default) and a log message sequence number (which is not enabled by default). Log messages may just tell you about some mundane event, or they may tell you of some critical event. To help you make sense of the importance of each message, IOS assigns each message a severity level: the lower the number, the more severe the event that caused the message.
| Level Number | Keyword | Description |
|---|---|---|
0 | EMERGENCY | System is Unusable |
1 | ALERT | Action must be taken immediately |
2 | CRITICAL | Critical Conditions |
3 | ERROR | Error Conditions |
4 | WARNING | Warning Conditions |
5 | NOTICE | Normal But significant condition |
6 | INFORMATION | Informational Messages |
7 | DEBUG | Debug Level Message |
Of the eight log message severity levels, one level, debug level (7), has a special purpose: for messages generated as a result of a user logged in to the router or switch who issues a debug command. The DEBUG EXEC command gives the network engineer a way to ask IOS to monitor for certain internal events, with that monitoring process continuing over time, so that IOS can issue log messages when those events occur. The engineer can log in, issue the debug command, and move on to other work. The user can even log out of the device, and the debug remains enabled. IOS continues to monitor the request in that debug command and generate log messages about any related events. The debug remains active until some user issues the “no debug” command with the same parameters, disabling the debug.
While the debug command is just one command, it has a huge number of options, much like the show command may be one command, but it also has many, many options. The console user sees the log messages created on behalf of that debug command after the debug command completes. Note that all enabled debug options use router CPU, which can cause problems for the router. You can monitor CPU use with the show process cpu command, but you should use caution when using debug commands carefully on production devices. Also, note the more CLI users that receive debug messages, the more CPU that is consumed. So, some installations choose to not include debug-level log messages for console and terminal logging, requiring users to look at the logging buffer or syslog for those messages, just to reduce router CPU load.
Seq:time_stamp: %facility-severity-MNEMONIC:description
R1(config-line)# logging synchronous
R1(config)# service timestamps log [datetime | uptime] sec
R1(config)# service sequence-numbers
Syslog messages will be displayed in the CLI when connected to the device via the console port. By default, IOS shows log messages to console users for all severity levels of messages. That default happens because of the default logging console global configuration command.
R1(config)# logging console severity-level
R1(config)# logging console 6
*You can use the level number (6) or keyword (informational). *This will enable logging for the informational severity and higher.
Syslog messages will be displayed in the CLI when logged on to the device via Telnet/SSH. Disabled by default.
R1(config)# logging monitor severity-level
R1(config)# logging monitor informational
PC# terminal monitor
IOS has another global configuration setting—logging monitor—that tells IOS to enable the sending of log messages to all logged users. However, that default configuration is not enough to allow the user to see the log messages. The user must also issue the—terminal monitor—EXEC command during the login session, which tells IOS that this terminal session would like to receive log messages.
Syslog messages will be saved to RAM. By default, all messages are displayed. View the messages with show logging.
R1(config)# logging buffered [size] severity
R1(config)# logging buffered 8192 6
*Same points as above about the level.
*Buffer size is in bytes.
IOS can store copies of the log messages in RAM by virtue of the logging buffered global configuration command. Then any user can come back later and see the old log messages by using the show logging EXEC command. You could also clear out the old messages from the log with the clear logging EXEC command.
You can Configure the device to send Syslog messages to an external server. Syslog servers will listen for messages on UDP port 514. A server application that collects syslog messages from many devices over the network and stores them in a database. The syslog server also provides a user interface, so that IT administrators can view the log messages to troubleshoot problems; it also has reporting capabilities on these system messages. Some syslog servers can even respond to select system messages with certain actions such as emailing and paging.
R1(config)# logging host 192.168.1.100
R1(config)# logging trap severity-level
An option used frequently in production networks—all devices store their log messages centrally to a syslog server. RFC 5424 defines the syslog protocol, which provides the means by which a device like a switch or router can use a UDP protocol to send messages to a syslog server for storage. All devices can send their log messages to the server. Later, a user can connect to the server (typically with a graphical user interface) and browse the log messages from various devices. To configure a router or switch to send log messages to a syslog server, add the logging host {address | hostname } global command, referencing the IP address or host name of the syslog server. Use the logging trap severity-level to configure the severity level.
| Command | Description |
|---|---|
[no] logging console | Global command that enables (or disables with the no option) logging to the console device. |
[no] logging monitor | Global command that enables (or disables with the no option) logging to users connected to the device with SSH or Telnet. |
[no] logging buffered | Global command that enables (or disables with the no option) logging to an internal buffer. |
| `logging [host] ip-address | hostname` |
| `logging console level-name | level-number` |
| `logging monitor level-name | level-number` |
| `logging buffered level-name | level-number` |
| `logging trap level-name | level-number` |
[no] service sequence-numbers | Global command to enable or disable (with the no option) the use of sequence numbers in log messages. |
## NETWORK TIME PROTOCOL (NTP) (UDP PORT 123)
NTP’s job is to synchronize clocks, but NTP works best if you set the device clock to a reasonably close time before enabling the NTP client function with the NTP server command. Setting the time correctly gives NTP a good start toward synchronizing.
Routers, switches, other networking devices, and pretty much every device known in the IT world has a time-of-day clock. For a variety of reasons, it makes sense to synchronize those clocks so that all devices have the same time of day, other than differences in time zone. The Network Time Protocol (NTP) provides the means to do just that. NTP gives any device a way to synchronize their time-of-day clocks. NTP provides protocol messages that devices use to learn the timestamp of other devices. Devices send timestamps to each other with NTP messages, continually exchanging messages, with one device changing its clock to match the other, eventually synchronizing the clocks. As a result, actions that benefit from synchronized timing, like the timestamps on log messages, work much better.
Manually configuring the time on devices is not scalable; the manually configured clocks will drift, resulting in inaccurate time. NTP allows automatic syncing of time over a Network. Although the hardware calendar (built-in-clock) is the default time-source, the hardware clock and software clock are separate and can be configured separately.
NTP Clients request the time from NTP Servers, and then they synchronize their time to the time of the server. A device can be an NTP Server and an NTP Client at the same time. It will sync its time to a server, and other devices will sync their time to it. NTP allows accuracy of time within ~1 millisecond if the NTP server is in the same LAN, or ~50 milliseconds if connecting to the NTP server over a WAN/via Internet.
Some NTP Servers are better/more reliable than others; the distance of an NTP Server from the original reference clock is called a **STRATUM**. A high stratum level is considered less accurate.
| Stratum Level | Description |
| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **0** | A Reference Clock is usually a very accurate time device like an atomic clock or a GPS clock. Reference clocks are stratum 0 within the NTP hierarchy. |
| **1** | NTP servers directly connected to reference clock @stratum0 are known as Stratum 1 (i.e., Google servers). These are also called Primary Servers (an NTP primary server acts only as a server, with a reference clock external to the device, and has a stratum level of 1). |
| **2** | Stratum 2 NTP servers get their time from stratum1 servers, and so on. These are called Secondary Servers. They operate in server mode and client mode at the same time. NTP secondary servers are servers that use client/server mode, relying on synchronization with some other NTP server. |
| **15** | Stratum 15 is the maximum useful stratum. Anything above that is considered unreliable. |
NTP servers and clients use a number to show the perceived accuracy of their reference clock data based on stratum level. The lower the stratum level, the more accurate the reference clock is considered to be. An NTP server that uses its internal hardware or external reference clock sets its own stratum level. Then, an NTP client adds 1 to the stratum level it learns from its NTP server, so that the stratum level increases the more hops away from the original clock source.
Devices can also peer with devices at the same stratum to provide more accurate time. This is called **Symmetric Active mode**. Cisco devices can operate in three NTP modes: Server Mode, Client Mode, Symmetric Active Mode.
### NTP Configuration Commands
| Command | Description |
| :------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RT(config)# ntp peer peer-address` | To configure Symmetric Active mode on devices connected, use this command on both devices participating in peering. |
| `RT(config)# ntp master` | When configured with the `ntp master` command, a Cisco router/switch uses its internal device hardware to determine the time. |
| `RT(config)# ntp master ?<1-15>StratumNumlevel` | Enables the device to act as NTP master clock in the absence of a configured Reference Clock/Primary/Secondary NTP server. Basically, the device will use its Internal Clock as the Reference Clock. Routers and switches use the default stratum level of 8 for their internal reference clock based on the default setting of 8 for the stratum level in the `ntp master [stratum-level]` command. NTP considers 15 to be the highest useful stratum level, so any devices that calculate their stratum as 16 consider the time data unusable and do not trust the time. So, avoid setting higher stratum values on the `ntp master` command. |
| `RT(config)# ntp server {IP-addr | Hostname}` | NTP client/server mode—the device acts as both client and server. First, it acts as an NTP client, to synchronize time with a server specified by Ip-addr/Hostname. Once synchronized, the device can then act as an NTP server, to supply time to other NTP clients. |
| `RT(config)# ntp source interface-ID` | This command sets the specified interface as the source of its NTP messages to other connected devices locally. Therefore, other connected devices will use the device’s loopback interface as their NTP server. It’s recommended to use a loopback interface for High Availability. An NTP server will accept NTP messages arriving to any of its IPv4 addresses by default. However, the clients reference a specific IP address on the NTP server. That creates an availability issue. Using Physical Interfaces might lead to issues with NTP between other devices depending on this device as its NTP server, as such interfaces are prone to failures. What is needed is a way to send a packet, a way that is not tied to the state of any one interface. That is, as long as there is some path to send packets to the NTP server, allow NTP to keep working. The goal is to avoid the case in which a single interface failure on a router also causes NTP to fail. Cisco uses the router loopback interface to meet that exact need. A Loopback interface is a virtual interface on a router, independent of physical interfaces. It provides a consistent IP address to identify or reach the router. |
| `RT(config)# ntp update-calendar` | To synchronize/update the calendar with NTP. |
### NTP Authentication
NTP Authentication can be configured, although optional, it allows NTP clients to ensure they only sync to the intended servers. To configure NTP authentication, use:
```cli
NTP authenticate
NTP authentication-key key-number md5 key-string
NTP trusted-key key-number
NTP server ip-address key key-number
NTP peer ip-address key key-number
NTP uses only the UTC time zone, you must configure the appropriate timezone on each device. NTP doesn’t update the calendar (Hardware default time-source) by default, but updates the clock (Software Time-Source). The Hardware clock (time-source) tracks the date and time on a device between restarts or power loss. During a restart, a Hardware clock is usually the clock to initialize the software clock, meaning the software clock picks up time info from the hardware.
| Command | Description |
|---|---|
RT(config)# clock timezone name hours-offset [minutes-offset] | Configures the Timezone from Global Config Mode. Name (i.e., GMT, EST) and Hours-Offset from UTC. |
RT(config)# clock summer-time name recurring start end [offset] | Configures the DayLight Savings Time. The recurring keyword tells the device to spring forward an hour and fall back an hour automatically over the years. |
| `RT# clock set hh:mm:ss {day | month} {month |
| `RT# calendar set hh:mm:ss {day | month} {month |
RT# clock update-calendar | To Synchronize/update the calendar to the clock’s time. |
RT# clock read-calendar | To Synchronize the clock’s time to the calendar’s time. |
For good design, the enterprise NTP configuration ought to refer to at least two external NTP servers for redundancy. Additionally, just a few enterprise devices should refer to those external NTP servers and then act as both NTP client and server. The majority of the devices in the enterprise would act as NTP clients. In addition to referencing redundant NTP primary servers, some routers in the enterprise need to be ready to supply clock data if those NTP primary servers become unreachable. To overcome this potential issue, the routers can also be configured with the ntp master command, resulting in this logic:
ntp server command.ntp master stratum command.ntp master {stratum-level} command) to a higher (worse) stratum level than the Internet-based NTP servers.| Command | Description |
|---|---|
RT# show ntp associations | Displays all NTP servers discovered, with their reference clock. |
RT# show ntp status | Displays clock synchronization, Stratum level, Reference Clock IP address, Precision of Reference Clock, Offset from Reference clock in seconds, etc. |
RT# show clock | Displays the Clock Time (Software Clock) in UTC. |
RT# show calendar | Displays the Calendar Time (Hardware default time-source) in UTC. |
RT# show clock detail | Displays the time and the Time-Source. |
RT# show logging | This command displays the device logs (important for accurate timestamps). |
File Transfer Protocol (FTP) and Trivial File Transfer Protocol (TFTP). Both exist as TCP/IP protocols defined in RFCs. Both use a client and server model, in which the client connects to a server and then the client can copy files to the server or from the server.
FTP uses TCP as its transport protocol, relying on TCP to provide an error-free, in-order delivery of data so that the FTP application knows that each file transfer creates an exact copy of the file with no omissions. FTP reserves two well-known ports: port 21 for control connections and port 20 for data connections. However, due to changes to FTP over the years, FTP often uses other TCP ports for the TCP data connection.
A typical FTP process involves:
Summary of some of the FTP actions/functions:
While many OSs support command-line FTP clients, which require you to learn the various FTP commands and use those from the command line, most users instead use an FTP client app (like FileZilla) that issues the FTP commands behind the scenes. The FTP server can be a server application installed and managed by others, or you can install or enable an FTP server for your own use. A simple Internet search can show a variety of FTP server applications that run on the common desktop OSs. A practical view of the most common use of TFTP and FTP by network engineers while on the job is updating & Managing Cisco IOS Images with FTP/TFTP.
The choice of mode may impact whether the TCP client can or cannot connect to the server and perform normal functions. The user at the FTP client can choose which mode to use; FTP passive mode may be the more likely option to work. First, note that FTP uses two types of TCP connections:
When a client connects to an FTP server, the client first creates the FTP control connection. The server listens for new control connections on its well-known port 21; the client allocates any new dynamic port (e.g., 49222) and creates a TCP connection to the server.
FTP Active Mode Process to Create the Data Connection:
Active mode works well with both the FTP client and server sitting inside the same enterprise network. When within the same network, typically no NAT function and no firewall sits between the two. However, if the FTP client sits in an enterprise network, and the FTP server resides somewhere in the Internet, an active mode connection typically fails. Most firewalls do not allow Internet-based hosts/outside devices to initiate TCP connections to hosts inside the enterprise without a specific firewall rule allowing connections to a known port, and in this case, the FTP client allocates any available port number.
FTP Passive Mode Process to Create the Data Connection: Passive mode helps solve the firewall restrictions by “having the FTP client initiate the FTP data connection to the server”. However, passive mode does not simply cause the FTP client to connect to a well-known port on the server; it requires more exchanges of port numbers to use between the server and client, with these steps:
Over the years, several RFCs defined security improvements for FTP. Those new features include using digital certificates for authentication as well as using Transport Layer Security (TLS) to encrypt all data (including usernames/passwords). Fast forward to today and many of those features converge into what most FTP clients and servers support as FTP over TLS or as FTP Secure (FTPS). With FTPS, the client and server still use FTP commands and still use both a control and data connection. However, FTPS encrypts both the control and data connections with TLS, including the exchange of the usernames and passwords. FTPS includes a few variations, including the FTPS Explicit Mode Control and Data Connection Establishment process:
In contrast, the Implicit Mode process begins with a required TLS connection, with no need for an FTP AUTH command, using well-known ports 990 (for the control connection) and 989 (for the data connection).
Note: SSH File Transfer Protocol (SFTP) is a different protocol than FTPS. SFTP uses SSH to encrypt file transfers over an SSH connection.
TFTP uses UDP well-known port 69. Because it uses UDP, which is connectionless and unreliable, TFTP adds a Reliability feature to check each file for transmission errors by using a checksum process on each file after the transfer completes. Timers are used, and if an expected message isn’t received in time, the waiting device will re-send its previous message. Every TFTP data message is acknowledged by either Client/Server. TFTP uses “lock-step” communication. The client and server alternately send a message and then wait for a reply (retransmissions are sent as needed). TFTP file transfers have three Phases: Connection, Data Transfer, Termination.
The word "Trivial" in the name refers to its relatively small number of features, meant to be an advantage by making the tool lightweight. For instance, it supports far fewer commands than FTP (fewer functions), meaning that the code requires less space to install, which can be useful for devices with limited memory. TFTP can Get and Put files, but it includes no commands to change directories, create/remove directories, or even to list files on the server. TFTP does not support even simple clear-text authentication. In effect, if a TFTP server is running, it should accept requests from any TFTP client. No Authentication, No Encryption; all data is sent in plain text. TFTP has its best use as a temporary tool for quick file transfers in a controlled environment, particularly when the data itself does not have to be secure.
NAT Translation Process Flow:
Inside Local → Inside Global Translation:
Static NAT: One private IP permanently maps to one public IP (e.g., web servers)
Dynamic NAT: Private IPs dynamically allocated public IPs from pool on first-come basis
PAT (Port Address Translation): Multiple private IPs share one public IP using unique port numbers
NAT Table: Router maintains translation table mapping inside local addresses to inside global addresses
Return Traffic: Server responds to public IP; NAT router de-translates to private IP and forwards to internal host
NAT, as defined in RFC 3022, allows a host that does not have a valid, registered, globally unique IP address to communicate with other hosts through the Internet. The hosts might be using private addresses or addresses assigned to another organization. In either case, NAT allows these addresses that are not Internet-ready to continue to be used and still allows communication with hosts across the Internet.
NAT achieves its goal by using a valid registered Public IP address to advertise or represent the Private IP address to the rest of the Internet. The NAT function changes the private IP addresses to publicly registered IP addresses inside each IP packet. The router, performing NAT, changes the packet’s SOURCE IP address when the packet leaves the private organization. The router performing NAT also changes the destination address in each packet that is forwarded back into the private network.
This lecture discusses Source NAT, which is the type of NAT that allows enterprises to use private addresses and still communicate with hosts in the Internet. Within source NAT, Cisco IOS supports several different ways to configure NAT: Static NAT, Dynamic NAT, and PAT (Port Address Translation).
Static NAT creates a permanent, one-to-one mapping between a private (inside local) IP address and a public (inside global) IP address. Each static mapping between a local (private) address and a global (public) address must be configured. In addition, because NAT may be used on a subset of interfaces, the router must be told on which interfaces it should use NAT. Those same interface subcommands tell NAT whether the interface is inside or outside.
Configuration Steps:
ip nat inside command in interface configuration mode to configure interfaces to be in the inside part of the NAT design.ip nat outside command in interface configuration mode to configure interfaces to be in the outside part of the NAT design.ip nat inside source static {inside-local} {inside-global} command in global configuration mode to configure the static mappings.The static mappings are created using the ip nat inside source static command.
inside keyword means that NAT translates addresses for hosts on the inside part of the network.source keyword means that NAT translates the source IP address of packets coming into its inside interfaces.static keyword means that the parameters define a static entry, which should never be removed from the NAT table because of timeout.Configuration Commands Example (R1):
R1(config)#int g0/1
R1(config-if)#ip nat inside: Designates GigabitEthernet 0/1 as the interface connected to the internal network.R1(config)#int g0/0
R1(config-if)#ip nat outside: Designates GigabitEthernet 0/0 as the interface connected to the external network.R1(config)#ip nat inside source static 192.168.0.167 100.0.0.1: Creates a static mapping where the inside local IP 192.168.0.167 is translated to the inside global IP 100.0.0.1.R1(config)#ip nat inside source static 192.168.0.168 100.0.0.2: Creates another static mapping for 192.168.0.168 to 100.0.0.2.Key Takeaway: Static NAT provides a predictable and persistent mapping, often used for servers or devices that need to be consistently accessible from the outside.
Dynamic NAT sets up a pool of possible inside global addresses and defines matching criteria to determine which inside local IP addresses should be translated with NAT. The router assigns public IP addresses from a pool to internal hosts on a first-come, first-served basis. The mapping of an inside local address to an inside global address happens dynamically. NAT can be configured with more IP addresses in the inside local address list than in the inside global address pool. The router allocates addresses from the pool until all are allocated. The inside global pool of addresses needs to be as large as the maximum number of concurrent hosts that need to use the Internet at the same time—unless you use PAT.
clear ip nat translation command.Configuration Steps:
ip nat inside command in interface configuration mode to configure interfaces to be in the inside part of the NAT design.ip nat outside command in interface configuration mode to configure interfaces to be in the outside part of the NAT design.ip nat pool name start-ip end-ip {netmask subnet-Mask | prefix-length length} command in global configuration mode to configure the pool of public registered IP addresses. Dynamic NAT configures the pool of public (global) addresses with the ip nat pool command listing the first and last numbers in an inclusive range of inside global addresses.ip nat inside source list acl-number/acl-name pool pool-name command in global configuration mode to enable dynamic NAT. Note the command references the ACL (step 3) and pool (step 4) per previous steps. The logic for the ip nat inside source list X pool Y command in this example is as follows: Create NAT table entries that map between hosts matched by ACL called X, for packets entering any inside interface, allocating an inside global address from the POOL called Y.The NAT Overload feature, also called Port Address Translation (PAT), solves this problem of scaling. Overloading allows NAT to scale to support many clients with only a few public IP addresses. NAT overload (PAT) translates not only the address, but the port number when necessary, making what looks like many TCP or UDP flows from different hosts look like the same number of flows from one host. This allows multiple internal hosts to share a single public IP address by using different port numbers. When PAT creates the dynamic mapping, it selects not only an inside global IP address but also a unique port number to use with that address. The NAT router keeps a NAT table entry for every unique combination of inside local IP address and port, with translation to the inside global address and a unique port number associated with the inside global address. And because the port number field has 16 bits, NAT overload can use more than 65,000 port numbers, allowing it to scale well without needing many registered IP addresses—in many cases, needing only one inside global IP address.
Two variations of PAT configuration exist in IOS:
ip nat inside source list global command has an overload keyword added to the end.ip nat outside). Because NAT can support over 65,000 concurrent flows with a single inside global address, a single public IP address can support an entire organization’s NAT needs.Configuration Commands for PAT using a Pool:
ip nat inside command in interface configuration mode to configure interfaces to be in the inside part of the NAT design.ip nat outside command in interface configuration mode to configure interfaces to be in the outside part of the NAT design.ip nat pool name start-ip end-ip {netmask subnet-Mask | prefix-length length} command in global configuration mode to configure the pool of public registered IP addresses. Dynamic NAT/PAT (1) configures the pool of public (global) addresses with the ip nat pool command listing the first and last numbers in an inclusive range of inside global addresses.ip nat inside source list {acl-number|acl-name} pool pool-name {overload} command in global configuration mode to enable dynamic NAT.Configuration Commands for PAT using a Specified Interface:
ip nat inside command in interface configuration mode to configure interfaces to be in the inside part of the NAT design.ip nat outside command in interface configuration mode to configure interfaces to be in the outside part of the NAT design.ip nat inside source list {acl-number|acl-name} interface type/number {overload} global configuration command, referring to the ACL created in step 3 and to the interface whose IP address will be used for translations.
ip nat outside) only, so the NAT pool is not required.The OVERLOAD keyword is indeed the key differentiator that turns a dynamic NAT configuration (using a pool) into a Port Address Translation (PAT) configuration. The overload parameter means that overload is enabled. Without this parameter, the router does not perform overload, just dynamic NAT. Such configuration supports multiple internal hosts sharing the public IP range through PAT.
Here's how it works:
overload keyword (Basic Dynamic NAT with a Pool):
When you configure dynamic NAT with a pool of public IP addresses and map it to an ACL, the router aims for a one-to-one mapping of inside local IP addresses to inside global IP addresses from the pool. Each internal host that initiates an an outside connection will be assigned a unique public IP address from the available pool. If the NAT pool becomes exhausted (all public IPs are in use), any new internal hosts trying to establish an outside connection will be blocked because there are no more unique public IPs to assign.overload keyword (PAT):
The overload keyword fundamentally changes how the router utilizes the public IP addresses in the defined pool. Instead of aiming for a strict one-to-one IP mapping, it allows multiple inside local IP addresses to be translated to the same inside global IP address.
In essence, the overload keyword instructs the router to:
Therefore, the presence of the overload keyword in the ip nat inside source list <acl> pool <pool-name> overload command is the defining characteristic that distinguishes a basic dynamic NAT configuration (where the goal is a one-to-one IP mapping from a pool) from a PAT configuration (where the goal is to allow many internal hosts to share a smaller number of public IPs using port multiplexing).
The majority of NAT troubleshooting issues relate to getting the configuration correct. Source NAT has several configuration options—static, dynamic, PAT—with several configuration commands for each. You should work hard at building skills with the configuration so that you can quickly recognize configuration mistakes. The following troubleshooting checklist summarizes the most common source NAT issues, most of which relate to incorrect configuration.
ip nat inside and ip nat outside interface subcommands and that the commands are not reversed. With source NAT, only the inside interface triggers IOS to add new translations, so designating the correct inside interfaces is particularly important.ip nat inside source static command to ensure it lists the inside local address first and the inside global IP address second.show ip nat statistics command output can indicate this problem. Also, compare the configured pool to the list of addresses in the NAT translation table (show ip nat translations). Finally, if the pool is small, the problem may be that the configuration intended to use PAT and is missing the overload keyword (see the next item).overload option on the end of the ip nat inside source list command. PAT configuration is identical to a valid dynamic NAT configuration except that PAT requires the overload keyword. Without it, dynamic NAT works, but the pool of addresses is typically consumed very quickly. The NAT router will not translate nor forward traffic for hosts if there is not an available pool IP address for their traffic, so some hosts experience an outage.show ip nat translations) until some user traffic enters the NAT router on an inside interface, triggering NAT to do a translation. The NAT configuration can be perfect, but if no inbound traffic occurs that matches the NAT configuration, NAT does nothing.This section clearly defines the four types of IP addresses involved in NAT. Cisco uses the term inside local for the private IP addresses and inside global for the public IP addresses. Using NAT terminology, the enterprise network that uses private addresses, and therefore needs NAT, is the “inside” part of the network. The Internet side of the NAT function is the “outside” part of the network. A host that needs NAT has the IP address it uses inside the network, and it needs an IP address to represent it in the outside network. So, because the host essentially needs two different addresses to represent it, you need two terms. Cisco calls the private IP address used in the inside network the inside local address and the address used to represent the host to the rest of the Internet the inside global address.
Inside Local: IP of the internal host from the internal network's perspective (private IP). Local: Means not global; that is, local. It is the address used for that host while the packet flows in the local enterprise rather than the global Internet.
Inside Global: IP of the internal host as seen by the external network (public IP after NAT). Global: Means global as in the global Internet. It is the address used for that host while the packet flows in the Internet.
Outside Local: This term is not used with source NAT. With destination NAT, IP of the external host as seen by its internal network. The address used to represent the external host as packets pass through its local network.
Outside Global: IP of the external host as seen by the external network. Think of it as outside public, because the address is typically a public IPv4 address.
Important Note: It highlights that unless Destination NAT is used, the Outside Local and Outside Global addresses will often be the same.
IPv4 doesn't provide enough addresses for all devices that need an IP address in the modern world. The long-term solution is to switch to IPv6. There are three main short-term solutions:
RFC 1918 specifies the following IPv4 address ranges as private:
| IP Network Range | Class | Number of Networks |
|---|---|---|
10.0.0.0/8 (10.0.0.0 to 10.255.255.255) | A | 1 |
172.16.0.0/12 (172.16.0.0 to 172.31.255.255) | B | 16 |
192.168.0.0/16 (192.168.0.0 to 192.168.255.255) | C | 256 |
Summary of IPv4 Address Solutions:
| Feature | RFC(s) | Main Benefits |
|---|---|---|
| CIDR | 4632 | Assign more-specific public IPv4 address blocks to companies than Class A, B, and C networks. Aggregate routes to public IPv4 addresses based on worldwide address allocation plan. |
| NAT | 3022 | Enable approximately 65,000 TCP/UDP sessions to be supported by a single public IPv4 address. |
| Private Networks | 1918 | Enable the use of NAT for enterprise Internet connections, with private addresses used inside the enterprise. |
| Command | Description |
|---|---|
show ip nat translations {verbose} | Lists the static & dynamic NAT entries created in the configuration. |
show ip nat statistics | Lists statistics, including the number of currently active translation table entries. The statistics also include the number of hits, which increments for every packet for which NAT must translate addresses. The show ip nat statistics command lists some particularly interesting troubleshooting information with two different counters labeled “misses.” The first occurrence of this counter counts the number of times a new packet comes along, needing a NAT entry, and not finding one. At that point, dynamic NAT reacts and builds an entry. The second misses counter toward the end of the command output lists the number of misses in the pool. This counter increments only when dynamic NAT tries to allocate a new NAT table entry and finds no dynamically available addresses, so the packet cannot be translated—probably resulting in an end user not getting to the application. |
debug ip nat | Issues a log message describing each packet whose IP address is translated with NAT. This debug command causes the router to issue a message every time a packet has its address translated for NAT. |
| `clear ip nat translation {* | [inside global-ip local-ip] [outside local-ip global-ip]}` |
clear ip nat translation protocol inside global-ip global-port local-ip local-port [outside local-ip global-ip] | Clears some of the dynamic entries in the NAT table, depending on which parameters are used. |
Quality of Service (QoS) refers to tools that network devices can use to manage several related characteristics of what happens to a packet while it flows through a network. Specifically, these tools manage:
These tools balance the trade-offs of which types of traffic receive network resources and when, giving more preference to some traffic and less preference to others. QoS tools change the QoS characteristics of certain flows in the network, helping to control and avoid loss, often caused by device queues getting too full.
While QoS tools focus on managing bandwidth, delay, jitter, and loss, the user mainly cares about the quality of the overall experience. This is referred to as Quality of Experience (QoE), which is a term referring to users’ perception of their use of the application on the network. QoS tools directly impact bandwidth, delay, jitter, and loss, which then should have some overall good effect to influence the users’ QoE. You can use QoS tools to create a better QoE for more important traffic.
QoS tools define actions a device can apply to a packet between the time it enters the device until it exits the device. Such actions can delay, discard, or even change header fields. QoS defines these actions as per-hop behaviors (PHBs), which is a formal term to refer to actions other than storing and forwarding a packet. The device can choose different PHBs for different kinds of messages, improving the QoS behavior for some messages while worsening the QoS behavior for others.
Common per-hop behaviors for QoS include:
Overall, QoS refers to the tools that devices apply to provide differential treatment to packets as they traverse the network.
Network traffic can be broadly categorized, each with different QoS requirements:
Both applications have similar breakdowns of Interactive & Non-Interactive "Flows." A flow is all the data moving from one application to another over the network, with one flow for each direction.
Voice over IP (VoIP): Involves digitizing sound (e.g., 160 bytes with G.711 Codec for 20ms) and sending it in IP packets.
Video Applications: Similar to Voice but with much higher bandwidth requirements (per flow) and similar requirements for Delay, Jitter, and Loss.
"Classification" refers to a type of QoS tool that identifies and categorizes packets based on their header contents. This is the first step in applying differential treatment to traffic. To give priority to certain types of traffic, you have to identify which types of traffic to give priority to.
Methods of classification include:
Marking is a crucial QoS tool that follows classification. After a packet is classified, it can be marked by changing some bits in specific header fields. This allows subsequent network devices to process the packet based on its marking, without needing to perform complex re-classification.
Why Marking is Important: Applying complex matching of many header fields on every device and on most interfaces (both ingress and egress) requires extensive configuration and can degrade device performance. A better strategy, recommended by Cisco and RFCs, is to perform complex matching early in the packet's life (e.g., at the network edge) and then mark the packet. Devices downstream can then use simpler matching logic based on these marks.
Marking Fields:
IP DSCP (Differentiated Services Code Point):
Ethernet CoS (Class of Service) / PCP (Priority Code Point):
If the markings are trusted, the device will forward the packet without changing the markings, or they will change the markings according to the configured policy.
The Trust boundary refers to the point in the path of a packet flowing through a network at which the Network Engineer creating a QoS plan has to choose where to place the trust boundary for a network. That boundary typically sits on a device under the control of the IT staff.
At the trust boundary, the network devices decide whether to "trust" the QoS markings applied by an upstream device or end-host. If the markings are trusted, the network will honor those markings and apply the corresponding QoS policies. If not trusted, the network device might re-mark the packets or ignore the existing markings and apply its own classification.
For example, IP phones can typically be a trust boundary, instead of an Access layer switch. IP phones can set the CoS and DSCP fields of the packets created by the phone, as well as those forwarded from the PC through the phone. By trusting the markings from an IP phone, the network can ensure that voice and video traffic originating from or passing through the phone receives the appropriate QoS treatment from the moment it enters the network.
DiffServ (Differentiated Services) aims to create a consistent usage of DSCP (Differentiated Services Code Point) values across networks to enable product vendors to provide good default settings for their QoS features.
| Marking Value | DSCP (Decimal) | Description |
|---|---|---|
| Default Forwarding (DF) | 0 | Represents best-effort traffic. Packets are forwarded without any special QoS treatment. |
| Expedited Forwarding (EF) (RFC 3246) | 46 | Designated for traffic requiring low latency, low jitter, and low loss. Primarily used for voice payload. Cisco IP phones, by default, mark voice payload at EF. Voice signaling packets (messages to set up a call) are typically marked as CS3. |
| Assured Forwarding (AF) (RFC 2597) | Varies | Defines a set of 12 DSCP values used in concert. AF categorizes traffic into four separate queues and three levels of drop priority within each queue, for use with congestion avoidance algorithms. This requires 12 different DSCP markings (one for each combination of queue and drop priority). |
| Class Selector (CS) | Varies | Recreates eight DSCP values for backward compatibility with IP Precedence (IPP) values (a 3-bit field with 8 possible values). |
The DSCP to IPP (Class Selector) and AF Mapping:
| IPP | CS | DSCP | Drop Precedence (within a given AF queue) |
|---|---|---|---|
| 0 | CS0 | 0 | Best Effort - DF |
| 1 | CS1 | 8 | AF11 (10), AF12 (12), AF13 (14) - Worst Queue (Higher Drop Precedence) |
| 2 | CS2 | 16 | AF21 (18), AF22 (20), AF23 (22) |
| 3 | CS3 | 24 | AF31 (26), AF32 (28), AF33 (30) |
| 4 | CS4 | 32 | AF41 (34), AF42 (36), AF43 (38) - Best Queue (Lower Drop Precedence) |
| 5 | CS5 | 40 | (38, 40, 42) - Note: These DSCP values are often used for control plane traffic or network management. |
| 6 | CS6 | 48 | (48, 50, 52) - Note: Often used for network control traffic. |
| 7 | CS7 | 56 | (56, 58, 60) - Note: Often used for network control traffic. |
Cisco QoS Design Guides (based on RFC 4954 conventions): Cisco has adopted and extended RFC 4954, defining default marking conventions for various traffic types:
Queuing refers to the QoS tools for managing the queues that hold packets while they wait their turn to exit an interface.
Most networking devices can have a queuing system with Multiple Queues. To use multiple Queues, the queuing system needs:
Packet Flow with QoS: INGRESS $\rightarrow$ Classifier $\rightarrow$ Marking $\rightarrow$ QUEUES $\rightarrow$ Scheduler $\rightarrow$ Prioritization Algorithm $\rightarrow$ Shaping $\rightarrow$ Policing $\rightarrow$ Egress
Round-Robin scheduling: Cycles through the queues in order, taking turns with each queue.
Weighted Round-Robin: In each cycle, the Scheduler either takes one packet or takes a number of bytes from each queue by taking enough packet bytes to reach that number of bytes. Also included in the concept of "Weighting" - the Scheduler takes a different number of packets (bytes) from each queue, giving more preference to one queue over another. Routers use a tool called Class-Based Weighted Fair Queuing (CBWFQ).
Low Latency Queuing (LLQ):
Call Admission Control (CAC):
Round Robin: Not good for Voice & Video data traffic; typically applied to Best-Effort / less critical traffic Queues.
Shaping and Policing are two QoS tools often used on opposite ends of a link. Both tools manage bandwidth, delay, jitter, and loss by monitoring the bitrate of combined messages that flow through a device. Once enabled, a policer or shaper notes each packet that passes and measures the number of bits per second. Both attempt to keep the bitrate at or below the configured bandwidth, but by using different actions:
Congestion Avoidance attempts to reduce overall packet loss in TCP connections via a mechanism of flow control called Windowing. Each TCP receiver grants a Window to the Sender. The window is a field in the TCP header that defines the number of bytes the sender can send over the TCP connection before receiving a TCP ACK for at least some of those bytes. The window size is the number of unacknowledged bytes that the sender can send before the sender must simply stop and wait.
Without Congestion Avoidance, an event called Tail Drop causes the most drops in the network, which arises from TCP Global Window Size Synchronization.
Congestion Avoidance discards some TCP Segments before Queues fill, hoping that enough TCP connections will slow down, reducing Congestion and avoiding a much worse problem: the effects of queue overflow which leads to Tail-Drop (harmful because it leads to TCP Global Synchronization). To resolve this, we use Congestion avoidance.
The journey to deliver a seamless experience for real-time applications like voice and video is a fascinating progression of problem-solving:
Problem 1: Round-Robin is Bad for Voice & Video Traffic due to its cyclic nature of picking traffic bytes from Queues.
Solution to Problem 1: This led to the creation of Special Queues to give priority to Low Latency Queues (LLQ).
Problem 2: Which then led to yet another problem of Queue Starvation for normal data traffic.
Solution to Problem 2: To resolve this we introduced the concept of Policers which limit the amount of bandwidth placed into the LLQueues.
Problem 3: But this meant that excess traffic beyond the limit of the LLQueues Bandwidth were being discarded leading to tremendous LOSS.
Solution to Problem 3: Further resolved with other QoS tools $\rightarrow$ Call Admission Control (CAC).
The "Why" behind Policing vs. Shaping for LLQ:
The Role of CAC in the Overall QoS Strategy:
Port security allows you to control which source MAC address(es) are allowed to enter a switchport. If an unauthorized source MAC address enters a port, an action will be taken. The default action is ERR-Disabled.
When enabled, port security on an interface with the default settings allows one MAC address. You can manually configure the allowed MAC address or change the maximum number of MAC addresses allowed. A combination of statically configured and dynamically learned MAC addresses is possible.
Port security is useful because it allows network administrators to control which devices are allowed to access the network. By default, the switch will allow the first MAC address that enters the switchport interface. However, the network can be compromised with MAC address spoofing, which is why port security allows you to limit the MAC addresses allowed on each switchport. This can protect against attacks like spoofing and Man-in-the-Middle (MITM).
The default state for Cisco switchports is [Administrative mode: dynamic auto].
Important Considerations for Port Security:
Switchport mode access (✓)Switchport mode trunk (✓)Switchport mode dynamic desirable (X)Switchport mode dynamic auto (X)Configuration and Verification Commands:
switchport port-security: Enables port-security on the selected interface.show port-security interface [interface_id]: Displays port-security status of an interface.
shutdown. If an unauthorized frame enters the interface, it will be ERR-Disabled.Absolute > If a default Aging Timer is configured manually on inactivity.Max MAC Addr, Total MAC Addr, Configured Max Addr, Sticky MAC Addr, Latest Source Addr, Security Violation Counter, and Violation Mode.show port-security command is secure-shutdown. From show interface status, it is ERR-Disabled.To Recover from the ERR-Disabled State:
shutdown and then no shutdown the interface.errdisable recovery command.
show errdisable recovery: Displays an output of all possible reasons an interface will be in an ERR-Disabled state (e.g., arp-inspection, bpduguard, dtp-flap, Port Security, storm-control, unicast flood, stp-config mismatch, etc.).Errdisable Recovery Interval 180 (Default Time Out Interval: 300 seconds / 5 minutes). Every 5 minutes (by default timeout interval), all ERR-Disabled interfaces will be re-enabled if errdisable recovery has been enabled for the cause of the interface's disablement.errdisable recovery cause "Err Disable Reason": Manual recovery using re-enablement on the interface.Secure MAC Addresses:
DYNAMIC.STATIC.show mac-address-table secure: Displays output of all secure MAC addresses.There are 3 different violation modes that determine what the switch will do if an unauthorized frame enters an interface configured with port-security:
ERR-Disabled state.switchport port-security maximum "decimal": Configures the acceptable maximum number of learned MAC addresses.switchport port-security violation {restrict | protect | shutdown}: Command to configure the violation mode.switchport port-security mac-address 0000.0000.000c: Statically configures a secure MAC address.Secure MAC Address Aging: MAC addresses dynamically learned or statically configured on a port-security enabled port are called Secure MAC Addresses. By default, secure MAC addresses will not age out (Aging Time: 0 minutes). However, you can configure this timer:
switchport port-security aging time "minutes"switchport port-security aging type {absolute | inactivity}switchport port-security mac-address) is disabled by default; it can be enabled with switchport port-security aging static. The address would be removed from the MAC address table if it ages out.Sticky Secure MAC Address Learning:
switchport port-security mac-address sticky: When enabled on an interface, dynamically learned secure MAC addresses will be added to the running configuration like this: switchport port-security mac-address sticky 0009.000b.000c. These are considered both dynamic and static.copy run start) to make them truly permanent (else they will not be kept if the switch reboots).DHCP Snooping is a security feature of switches used to filter DHCP messages received on Untrusted ports. DHCP Snooping only filters DHCP messages; non-DHCP messages are not affected. All ports are untrusted by default.
In DHCP snooping, we manually define which ports are “trusted”.
DHCPOFFER, DHCPACK, DHCPNAK).DHCP Snooping filters messages by differentiating between DHCP Server Messages and DHCP Client Messages. With DHCP snooping enabled, any DHCP message received on an untrusted port is inspected and possibly discarded.
Check if it’s a DHCP server message (e.g., DHCPOFFER, DHCPACK, DHCPNAK):
Check if it’s a DHCP client message (e.g., DHCPDISCOVER, DHCPREQUEST, DHCPDECLINE, DHCPRELEASE) is received, DHCP snooping performs the following validations:
DISCOVER or REQUEST messages:
RELEASE or DECLINE messages:
A DHCP Snooping binding table is created when a client successfully leases an IP address from a DHCP server. This is a dynamically built list of:
This table is critical for verifying legitimate client behavior and for integration with features like IP Source Guard and Dynamic ARP Inspection (DAI).
DISCOVERY (Client $\rightarrow$ Server): Always Broadcast.
OFFER (Server $\rightarrow$ Client): Usually Broadcast (can be unicast under specific conditions).
REQUEST (Client $\rightarrow$ Server): Broadcast (ff:ff:ff:ff:ff:ff, 255.255.255.255 from client, though a DHCP server identifier field is filled in the DHCP packet).
ACKNOWLEDGEMENT (Server $\rightarrow$ Client): Either Broadcast or Unicast.
NAK (Negative Acknowledgment): Opposite of Acknowledgment, used to decline a client's request.RELEASE: Used to tell the server that the client no longer requires its IP address.DECLINE: Used to decline the IP address offered by the DHCP server.DHCP Snooping Configuration Scope: DHCP snooping is enabled per VLAN because:
Each VLAN can represent a separate broadcast domain and may have its own DHCP configuration.
The command ip dhcp snooping vlan <vlan-id> ensures that DHCP snooping inspects traffic only within that VLAN, not globally.
You must explicitly trust interfaces (e.g., uplinks).
ip dhcp snooping: Enables DHCP snooping globally.
ip dhcp snooping vlan [vlan_id]: Enables it on each VLAN (VLANs are segmented groups of switchport interfaces).
interface [interface_id] followed by ip dhcp snooping trust: Configures the selected interface as a trusted port. By default, all ports are untrusted. (Usually, the interface represents uplink ports.)
Note: DHCP snooping does not block static IP assignments by default. If a rogue client uses a static IP, that may bypass some controls unless you pair DHCP snooping with IP Source Guard. Always remember to enable DHCP snooping globally before enabling it on VLANs.
Rate Limiting DHCP Messages:
DHCPDISCOVER messages. This limits the allowed number of DHCP messages per second, which is plenty for normal clients but restricts spamming attempts.ip dhcp snooping limit rate "decimal": Prevents against DHCP Exhaustion Attack. DHCP Snooping rate limiting is disabled on all interfaces by default.show ip dhcp snooping binding: Displays the binding table - created after there's a DHCP entry.Error-Disabled State from DHCP Snooping Rate Limiting:
DHCP Snooping can limit the rate at which DHCP messages are allowed to enter a switchport interface. If the rate of DHCP messages crosses the configured limit, the interface is ERR-Disabled. Like port security, the interface can be manually re-enabled or automatically recovered with ERRDisable Recovery.
errdisable recovery is enabled for the specific reason: errdisable recovery cause dhcp-rate-limit.ERR-Disabled state manually: shutdown and then no shutdown.Address Resolution Protocol (ARP) is used to learn the MAC Address of another device with a known IP Address. For example, a PC will use ARP to learn the MAC address of its Default Gateway to communicate with external networks. ARP uses 2 messages: Request & Reply. A Gratuitous ARP (G.ARP) message is an ARP Reply that's sent without receiving any ARP Request. It allows other devices to learn the MAC address of the sending host without having to send ARP Requests. Some devices auto-send G.ARP messages when an interface is enabled, IP/MAC address is changed, etc.
DAI (Dynamic ARP Inspection) is a security feature of switches that is used to filter ARP messages received on untrusted ports. DAI doesn't inspect messages received on trusted ports; these ARP messages are forwarded normally. DAI only filters ARP messages; non-ARP messages aren't inspected or affected.
All ports are untrusted by default. Typically, all ports connected to other network devices (switches/routers) should be configured as TRUSTED, while interfaces connected to End Hosts should remain UNTRUSTED.
Similar to DHCP poisoning, ARP poisoning involves an attacker manipulating a target's ARP tables so traffic is sent to the attacker. To do this, the attacker can send Gratuitous ARP Replies using a spoofed device's IP address. This leads to other devices in the network receiving the G.ARP and updating their ARP tables, causing them to send traffic to the attacker instead of the target destination.
DAI prevents against such ARP poisoning attacks by inspecting the Sender/Source MAC & IP address fields of ARP messages received on untrusted ports and checks that there is a matching entry in the DHCP Snooping Binding Table. If there is a matching entry, the ARP message is forwarded; no matching entry means it is discarded.
DAI operations are usually reliant on DHCP snooping for its binding table feature to check entries. Another option is to use ARP ACLs, which can be manually configured to map IP Addresses to MAC Addresses for DAI to check entries. This is useful for hosts that don't use the DHCP Snooping security feature.
ARP ACLs match Layer 2 information: IP and MAC address pairs. They're used only by features like Dynamic ARP Inspection (DAI). Unlike Layer 3 ACLs (which match IP, ports, protocols), ARP ACLs are not used to filter routed traffic. ARP ACLs are a must for non-DHCP-bound static IP clients.
ARP ACL Configuration Example:
arp access-list DAI_LIST
permit ip host 192.168.1.10 mac host aabb.ccdd.eeff
deny ip any mac any
interface FastEthernet0/1
ip arp inspection filter DAI_LIST vlan 10
DAI operates at Layer 2, and VLANs define Layer 2 broadcast domains. Since ARP requests and replies are broadcast-based protocols, they only matter within the VLAN (the broadcast domain). That’s why:
ip arp inspection vlan [vlan_id]: Enables DAI on a VLAN/on each VLAN in case of multiple VLANs.interface [interface_id] or interface range [interface_range] followed by ip arp inspection trust: Manually configures a port as trusted.show ip arp inspection interfaces: Displays an output of interfaces and their trust state with rate.ip arp inspection limit rate X burst interval Y: Configures rate limiting at X packets in Y seconds.DAI Rate Limiting: Like DHCP Snooping, Dynamic ARP Inspection also supports Rate-limiting to prevent attackers from overwhelming the switches with ARP message frames. Even if the attacker's messages are blocked, they can overload the switch's CPU with ARP messages.
Additional Validation Checks for DAI:
The command ip arp inspection validate {src-mac | dst-mac | ip} is used in Dynamic ARP Inspection (DAI) to configure additional validation checks on ARP packets received on untrusted ports. While DAI's primary function is to compare ARP packets against the DHCP snooping binding table or static ARP ACLs, these validate options add more granular integrity checks to prevent specific types of ARP spoofing attacks.
You can combine these options in a single command, for example: ip arp inspection validate src-mac dst-mac ip
Error-Disabled State from DAI Rate Limiting:
If ARP messages are received faster than the specified rate, the switchport interface will be ERR-Disabled.
errdisable recovery is enabled for the specific reason: errdisable recovery cause arp-inspection.ERR-Disabled state manually: shutdown and then no shutdown.Network topologies describe the arrangement of elements (links, nodes, etc.) of a communication network. Common topologies include Mesh, Partial Mesh, Hybrid Mesh, and Star Topology.
The Two-Tier LAN Design consists of 2 hierarchical layers:
This design is also known as a collapsed core design because it omits a layer found in the Three-Tier Design.
Topology within a Two-Tier Design:
In larger networks with many Distribution Layer switches (e.g., separate building facilities in a campus or a research lab), the number of mesh connections required between Distribution L3 Switches grows rapidly, leading to scalability complications. Cisco recommends adding a Core Layer if there are more than 3 Distribution Layers in a single location. Each Distribution Layer switch then connects to a Core Layer, eliminating the need for full mesh interconnection between them.
The Three-Tier LAN Design consists of 3 hierarchical layers: Access, Distribution/Aggregation, and Core.
The Spine & Leaf Architecture is an advanced Two-Tier Design that provides better support for SDN Overlay Networks. Traditional data center designs used the Three-Tier Design, but it worked well when most traffic was North-South (traffic going in or out of the data center) and didn't function well for East-West Traffic (traffic between servers in the same part of the network).
With the precedence of virtual servers, applications are often deployed in a distributed manner, which increases the amount of East-West traffic in a data center. The traditional Three-Tier designs led to bottlenecks in bandwidth as well as variability in server-to-server latency depending on the path the traffic takes. To resolve this, Spine-Leaf Architecture has become prominent in data centers.
Key characteristics of Spine & Leaf Architecture:
The path taken by traffic is chosen randomly to balance the load, and each end host is separated by the same number of hops, providing consistent latency.
To extend networks over a large geographical area, we use WANs (Wide Area Networks). Although internal traffic can be considered WAN, the term WAN is typically used to refer to an enterprise's private connections that link their offices, data centers, and other sites together. Over a public or shared network like the Internet, VPNs (Virtual Private Networks) can be used to create private connections between multiple LANs to a centralized WAN in a star topology style known as Hub and Spoke Architecture.
Each LAN can be connected to the WAN data center via a Telco/Comms/Leased Line in a Star Topology. This is similar to how on-premise data centers/LANs connect to a Cloud Provider WAN, like ExpressRoute or Direct Connect.
A Leased Line is a dedicated physical link, typically connecting 2 sites, or multiple sites to a central hub. There are various standards that provide different speeds, and different standards are available in different countries. Leased lines use Serial Connections (Point-to-Point Protocol and High-Level Data Link Control - HDLC) Encapsulation. Due to the higher cost, higher installation lead time, and slower speeds of leased lines, Ethernet WAN technologies are becoming more popular. A leased line is dedicated, so there is no need for MPLS labels.
MPLS networks are shared infrastructure because many customers/enterprises connect to and share the same infrastructure to make WAN Connections. The Label Switching in the term MPLS allows VPNs to be created over the MPLS infrastructure through the use of LABELS. Labels are used to separate the traffic of different customers as it travels over the shared infrastructure, ensuring it doesn't mix or congest with traffic from other customers.
When frames are received on the PE Routers from the CE Routers, they add a label to the frame. This label is placed in-between the Layer 2 Ethernet Header and the Layer 3 IP layer (effectively, Layer 2.5). These labels are used to make forwarding decisions within the Service Provider Network. MPLS Routers use the MPLS Label to decide where to forward the packet rather than a Routing table. CE Routers do not use MPLS; it's only used by the Provider Edge and Provider Core Routers.
When using MPLS VPNs, the CE and PE Routers peer using OSPF to share routing information. The customer may even decide to use static routes with the PE Router as the next-hop.
A Layer 2 MPLS VPN could be used in place of OSPF. In this manner, the CE-PE do not form peers. The Service Provider network is entirely transparent to the CE Routers. In effect, or logically, it's like the 2 CE Routers are directly connected; their WAN Interfaces will be in the same subnet. If a routing protocol is used, the 2 CE Routers will peer directly with each other, making the PE/P Routers act as one big switch.
MPLS stands apart from other WAN Services due to its provision of effective QoS features. It provides a Layer 3 service to customers. MPLS itself is sometimes called a Layer 2.5 protocol because it adds the MPLS Header between the data-link header (Layer 2) & the IP header (Layer 3).
The SP's MPLS VPN Network (between the Provider Edge Routers - PE and the Provider Core Routers - P) will use a routing protocol to build routing protocol relationships with customer routers (CE). It will learn customer subnets/routes with those routing protocol relationships (e.g., OSPF, EIGRP, RIPv2). It will advertise a customer's routes with a routing protocol so that all routers that a customer connects to the MPLS VPN can learn all routes as advertised through the MPLS VPN Network.
All the Customer Edge Routers (CE) need to learn routes from the other CE routers. However, a CE Router does not form routing protocol neighbor relationships directly with other CE Routers. The process solely relies on the Provider Edge Routers (PE) and their PE-CE routing protocol neighborhood. To advertise the customer routes between the PE Routers, the PE Routers use another routing protocol along with a process called Route Redistribution. This happens when one router takes routes from one routing protocol process and injects them into another. Redistribution is needed when the PE-CE routing protocol is not BGP.
A Router PE.1 might sit in one Point of Presence (PoP) but connect to different customers. Likewise, Router PE.2 might connect to many of those same customers. These Routers use VRF (Virtual Routing and Forwarding) to facilitate turning one single router into multiple virtual routers, each with its own Routing Table. MP-BGP (Multiprotocol BGP) can mark which routes are from which customers so that only the correct routes are advertised to each CE router for that customer. WAN Routes on the CE Routers refer to the neighboring PE Router as the next-hop router, with each CE Router becoming a routing protocol neighbor with the SP's PE Router on the other end of the Access Link.
When it comes to Wide Area Network (WAN) connectivity, solutions based on Generic Routing Encapsulation (GRE) or Dynamic Multipoint VPN (DMVPN) that utilize the public internet as the transport network can suffer from unpredictable performance levels. Many organizations, especially in corporate settings, prefer Multi-Protocol Label Switching (MPLS) as a means of establishing private links with guaranteed service levels.
MPLS operates as an overlay network, meaning it can configure point-to-point or point-to-multipoint links between network nodes regardless of the underlying physical and data-link layer topologies. This makes it a very flexible and powerful solution for WAN providers.
Imagine you have two customer premises (CPE) routers at different sites, Site I and Site II, that need to communicate through an MPLS provider's cloud.
MPLS allows WAN providers to offer various robust solutions for enterprise networking requirements:
Metro Ethernet (MetroE) service uses Ethernet physical links to connect the customer's device to the service provider's device. The service is a Layer 2 service in that the WAN provider forwards Ethernet frames from one customer device to another, acting as though the WAN service was created by one Ethernet switch. Each Customer Edge device (be it a Router or Layer 3 Switch) connects to the service with (at least) one Ethernet link (preferably Fiber Ethernet standards) rather than connecting directly to other customer (enterprise) routers. The physical link between the customer and the SP is called an Access Link, or when using Ethernet, an Ethernet Access Link.
A network comprises nodes and links.
Intermediate system nodes perform a forwarding function (e.g., routers, switches).
End system nodes are those that send and receive traffic, classified either as clients or servers.
Server: A server makes network applications and resources available to other hosts.
Client: A client requests and consumes the services provided by the servers.
A network type refers primarily to its scope and size.
Local Area Network (LAN):
Wide Area Network (WAN):
Personal Area Network (PAN) and Wireless PAN (WPAN):
A network topology describes the physical or logical structure of the network in terms of nodes and links.
Point-to-Point Link:
Star Topology:
Mesh Topology:
Ring Topology:
Bus Topology:
Hybrid Topology:
A Hierarchical Star / Tree Topology establishes a parent/child relationship between layers in the hierarchy. Corporate networks are often designed using this overall hierarchy.
Links between nodes in the Tree are referred to as backbones or trunks because they aggregate and distribute traffic from multiple areas of the network.
Hierarchical Star - Mesh:
Star of Stars (or Hub-and-Spoke Topology):
Star with Rings:
Network topology significantly impacts a network's performance, reliability, and scalability:
In summary, choosing the right network type and topology, combined with appropriate Layer 1, 2, and 3 functions, is critical for designing a network that meets specific performance, reliability, security, and scalability requirements.
This chapter details various network troubleshooting and information-gathering tools, focusing on their functionality and typical use cases.
pingThe ping command is used to test network connectivity to a remote host. It sends ICMP ECHO_REQUEST packets (Type 8) and expects ICMP ECHO_REPLY packets (Type 0) in return.
ping <IP_Address>: To test connectivity to a specific IP address.ping <Hostname>: To test connectivity to a domain name, also implicitly testing DNS resolution.ping localhost or ping 127.0.0.1: Can be used to diagnose issues related to a network card failure. If successful, the network stack on the local machine is functioning.ping DomainName: Helps identify internet domain name resolution issues (DNS problems). If ping to IP works but to domain name fails, it indicates a DNS problem.ping displays the Round Trip Time (RTT) in milliseconds, indicating latency, and the Time-to-Live (TTL) value of the received packet.
ping response indicates how many hops the packet took to reach the destination.ipconfig (Windows) / ifconfig / ip (Linux/macOS)These commands display and sometimes configure network interface parameters.
ipconfig /all (Windows): Lists comprehensive TCP/IP configuration details, including IP address, subnet mask, default gateway, DNS servers, DHCP server, MAC address, and lease information.ifconfig (macOS, Linux - Legacy): Lists IP address and mask for specific interfaces or all interfaces.
ifconfig is largely superseded by the ip command from the iproute2 utility suite.networksetup -getinfo interface (Mac): Lists IP settings, including the default router.networksetup -getdnsservers interface (Mac): Lists DNS servers used.ip address (Linux): Lists IP address and mask information for interfaces; the Linux replacement for ifconfig. Often abbreviated as ip a.
ip addr show or ip a: Reports address configuration for all interfaces.ip addr show dev [interface_name]: Reports information for a single interface (e.g., ip addr show dev etho).ip -s link show: Displays status of interfaces and statistics.ip link set [interface_name] up/down: Enables or disables an interface.ip addr add [ip_address]/[prefix_length] dev [interface_name]: Used to add an IP address.ip addr del [ip_address]/[prefix_length] dev [interface_name]: Used to delete an IP address.ip commands by default modify only the running configuration, which is lost on reboot unless saved to persistent configuration files (e.g., /etc/network/interfaces or NetworkManager/systemd-network configurations).ipconfig /displaydns: To view the local DNS cache.ipconfig /flushdns: To purge the local DNS cache.ipconfig /all && nslookup command: To display Windows device DNS servers.netstatnetstat (Network Statistics) resolves and displays network statistics such as current network connections and port activities.
netstat -a: Shows all listening ports and established connections.netstat -at or netstat -au: List TCP or UDP protocols respectively.netstat -l: List ports in "listening" mode (open and ready to accept incoming connections). Can be combined with t or u (e.g., netstat -lt).netstat -s: List network usage statistics by protocol. Can be combined with -t or -u.netstat -tp: List connections with the service name and PID (Process ID) information.netstat -i: Shows interface statistics.netstat -ano (Windows)
-a: Display all sockets.-n: Do not resolve names (displays IP addresses and port numbers numerically).-o: Display timers (Windows specific, shows PID).netstat -rn (Windows, Mac, Linux): Lists the host's routing table, including a default route that uses the DHCP-learned default gateway.
ip route is the replacement for netstat -rn.arp / ip neighThe arp (Address Resolution Protocol) utility is used to manage the ARP cache, which stores mappings between IP addresses and MAC addresses on the local network.
arp -a (Windows, Mac, Linux): Displays the current ARP cache contents.arp -d [IP Address]: Deletes a specific entry from the ARP cache.arp -d: Deletes all entries from the ARP cache.arp -s [IP Address] [MAC Address]: Adds a static entry to the ARP cache.ip neigh (Linux - Modern): The replacement for arp in Linux, for managing the neighbor table (which includes ARP entries).traceroute / tracerttraceroute (Linux/macOS/Routers) or tracert (Windows) determines the path (route) that packets take to reach a destination host, showing each intermediate router (hop).
tracert uses ICMP Echo Reply, Unix traceroute typically uses ICMP Port Unreachable).traceroute <destination> (Linux)tracert <destination> (Windows)tracert uses ICMP. Unix traceroute uses UDP. Both can be configured to use the other protocol with switches (e.g., -I for ICMP in Linux traceroute).traceroute -6 or tracert -6 for IPv6 networks.*) indicates no response within the timeout period (e.g., router not responding, firewall blocking, packet looping).nslookup, dig, host)These tools are used to query DNS servers for information about domain names.
nslookup (Name Server Look Up)nslookup DOMAIN_NAME or nslookup -type=QUERY_TYPE DOMAIN_NAME SERVER
QUERY_TYPE: (e.g., A for IPv4, AAAA for IPv6, MX for mail exchange, NS for name server).DOMAIN_NAME: The domain you are querying.SERVER: Optional; the specific DNS server to query (e.g., 1.1.1.1, 8.8.8.8).dig (Domain Information Groper)nslookup.dig @server name type
@server: The name or IP address of the DNS server to query.name: The domain name or resource record to look up.type: The type of query (e.g., ANY, A, MX, SIG). If omitted, defaults to A record.hosthost {name} [server]
name: The domain name, IPv4, or IPv6 address to look up.server: Optional; the name or IP address of the DNS server to query instead of the default.whoissudo apt install whois on Debian-based systems).A Protocol Analyzer works in conjunction with a packet capture or sniffer tool.
tcpdumptcpdump is a command-line packet capture utility on Linux, providing a user interface to the libpcap library.
tcpdump -i eth0 (captures traffic on eth0).and, or, not). Complex filters should be enclosed in quotes and can use parentheses for grouping.
sudo tcpdump ip proto \\icmp -i interfaceName (listens specifically for ICMP traffic).tcpdump -i eth0 "src host 10.0.1.100 and (dst port 53 or dst port 80)"Ncat / Wireshark / TsharkNetFlow gathers metadata only (summarized traffic information, not the full packet payload) and reports it to a structured database. It can also use sampling to further reduce processing demands. NetFlow has been redeveloped as the IP Flow Information Export (IPFIX) IETF standard.
Components of a NetFlow deployment:
Effective network troubleshooting requires a systematic approach to problem-solving and clear communication with users/clients. The following best practice model provides a proven process:
This initial phase is about gathering as much information as possible to understand the issue.
Based on the information gathered, formulate hypotheses about what might be causing the problem.
Put your hypothesis to the test using diagnostic tools and techniques.
Once the cause is confirmed, plan the solution.
Execute your action plan.
After implementing the solution, thoroughly check that the problem is fixed and that no new issues have been introduced.
Documentation is crucial for knowledge management and future troubleshooting.
+3dB means doubling, -3dB means halving; +6dB means quadrupling, -6dB means quartering.A high SNR value means the signal strength is significantly greater than the noise present. A result closer to 0 dB indicates the link is subject to high error rates.
Electromagnetic Interference (EMI): Noise that should ideally be detected when the cable is installed. If it appears later, suspect a new source or a source not accounted for during initial testing.
Radio Frequency Interference (RFI): EMI that occurs in frequencies used for radio transmissions.
Crosstalk: Interference from nearby cables (also measured in dB). Usually indicates problems with bad wiring, poor quality cables, improper cable type for the application, or bad connectors/improper termination.
A typical Ethernet link for an office workstation includes:
Network Loopback Adapter: A specially wired RJ-45 plug with a stub of cable, used to test for bad ports and network cards. Wiring: pin 1 (Tx) to pin 3 (Rx) and pin 2 (Rx) to pin 6 (Tx), meaning packets sent by the NIC are received by itself.
LED Status Light Indicators (Link Lights): On the Host NIC and Switch/Router ports.
Verifying Port Settings (Auto-negotiation, Speed, Duplex):
Cable Installation and Types:
Cable Testers: Report detailed information on the physical and electrical properties of a cable.
Wiring Problems (Pin-out / Termination Issues):
Network Tone Generator / Probe (Fox and Hound): Used to trace a cable from end to end, which is necessary when cables are bundled and not properly labeled.
While fiber optic cables do not suffer from attenuation to the same extent as copper, there is still some signal loss due to microscopic imperfections in the glass fiber core or its edges, causing light to scatter or be absorbed.
0.5 dB/km to 3.5 dB/km, depending on fiber type and wavelength.
ipconfig /all/etc/resolv.confping the DNS servers by their IP addresses to check connectivity between the host and its DNS servers. If you can ping the IP but not resolve names, the issue is likely DNS-related.It's wise to rule out physical hardware failures and data link layer issues before diagnosing network layer or service issues. Intermittent problems are often the most challenging.
show interfaces).ipconfig / ifconfig / ip addr):
/24 instead of /26), it might cause packets to go via a router, placing unnecessary load on it.traceroute / tracert: Utilize these commands to identify where the network path fails.show ip route / show route): Use these commands to confirm the presence of specific IP network routes.traceroute): You can use traceroute to diagnose a routing loop by looking for IP addresses that appear multiple times in the output, as packets will traverse such routes more than once until TTL expires.Purpose: To verify exactly what is connected to the network and what is being communicated over it. Necessary to confirm that servers and clients are in the correct VLAN/subnet and to identify unauthorized machines ("rogue hosts").
IP Scanners: Tools that perform host discovery (determine if an IP address is "up") and can establish the overall topology of the network in terms of subnets and routers.
ping, arp, traceroute.Nmap (including Zenmap GUI) for host discovery, auditing, and penetration testing.netstat Command (Network Statistics): Allows you to check the state of ports on the "localhost."
-s: Show TCP connections.-u: Show UDP connections.-w: Show raw sockets.-a: Display all open ports, active ports, and listening ports.-l: Display listening ports only.-n: Display in numerical format (no name resolution).-4 or -6: Filter sockets by IPv4 or IPv6.-o: Shows the Process ID (PID) that opened that port.-b: Shows the process name.-p: Shows PID and process name.-i: Ethernet statistics.-r: Routing table display. (Note: In Linux, netstat is deprecated in favor of iproute2 commands like ip link, ip addr, ss for sockets, and ip route).-N: Suppress name resolution.Packet Analyzers (tcpdump, Wireshark, TShark): Crucial for verifying exactly what traffic is on the wire, inspecting headers, and understanding communication flows. (Refer to previous notes on Protocol Analyzers).
Collecting data and configuring alerts for interface system metrics is crucial for proactive network management and troubleshooting.
Key Interface Metrics:
Interface errors often indicate a misconfiguration problem at Layer 2 (Data Link Layer) or Layer 1 (Physical Layer).
802.1Q tag).802.1Q (VLAN tagging) framing but the other is not, frames will appear too large to the receiver, as 802.1Q adds 4 bytes to the header, making the max frame size 1522 bytes, which might not tally with the other end's expectation.If a client fails to obtain a DHCP lease, it defaults to using an APIPA (Automatic Private IP Addressing) address in the 169.254.0.0/16 range. Such a client will be limited to communication only with other APIPA hosts on the same network segment (broadcast domain).
Possible Reasons for a Host to Fail to Obtain a DHCP Lease:
A Rogue DHCP Server may be deployed accidentally (e.g., forgetting to disable a DHCP server in an access point/router) or by a malicious attacker to subvert the network.
To troubleshoot name resolution, you should establish the different ways a host can use to resolve a hostname/FQDN to an IP address. In general, the following methods are tried in order:
a. Check Local Cache: Individual applications (e.g., web browsers) and the operating system maintain their own caches of resolved names. Clear these caches for troubleshooting.
b. Check HOSTS File: The hosts file (%SystemRoot%\system32\drivers\etc\hosts on Windows) is a static list of hostname-to-IP address mappings. In most cases, the hosts file should not contain any entries other than the loopback address (127.0.0.1). Any static entries here could be the cause of a name resolution issue.
c. Query DNS Servers: A host uses the name servers defined in its IP configuration to resolve queries.
* Modified forms of DNS allow clients to perform name resolution on a local link without needing a server, such as Link-Local Multicast Name Resolution (LLMNR) and Multicast DNS (mDNS).
DNS Configuration Issues:
hosts file on the client and place the correct name-to-IP address record for the target host. If it then works, the issue is DNS.ping the resolver from affected clients).The most common reason for a certificate not to be trusted is that the Certificate Authority (CA) issuer is not trusted.
certmgr.msc console to manage user certificates and certlm.msc console to manage machine certificates (certificates used by the computer or its user accounts).Most network services, especially authentication and authorization mechanisms, depend upon each host using a synchronized time source. Inaccurate time sources can:
Clients must be able to access a time source over UDP port 123.
w32tm /query /configuration command can be used to check the current time synchronization configuration.Each VLAN is a discrete broadcast domain.
If you can rule out connectivity problems with a local client or subnet, the issue may be with an application server rather than the client. Unresponsive service issues usually manifest with multiple clients being unable to connect.
Underlying Causes to Consider:
ping or traceroute to check the latency experienced over the network path and compare it to a network performance baseline.BYOD is a smartphone/tablet provisioning model that allows users to select a personal device to interact with corporate network services and cloud applications. Allowing user selection of devices introduces numerous compatibility, support, and security challenges.
Licensing for servers and network appliances can be complex, and it's easy to make errors.
Wireless connectivity is a core feature of most network environments today, primarily because it supports users' need for mobility across various devices. The IEEE 802.11 standard defines the physical layer media by which data is encoded into a radio wave signal using various modulation schemes. Modulation changes one or more wave properties to encode a signal. Wi-Fi still uses different carrier methods to provide sufficient resistance to interference from noise and other radio sources.
A wireless transmitter (TX) and receiver (RX) operating within a particular range of frequencies with the same modulation scheme constitute a half-duplex shared access medium. Unlike wired Ethernet, which uses CSMA/CD (Carrier Sense Multiple Access/Collision Detection), Wi-Fi uses CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance) and a virtual carrier sense flow control mechanism to cope with contention and reduce the incidence of collisions.
Rather than detecting collisions after they occur, a wireless station indicates its intent to transmit by broadcasting a Request to Send (RTS) signal.
The original 802.11 Wi-Fi standard worked only at 1 Mbps. It has been revised many times, with each iteration specifying different signaling and transmission mechanisms. Products conforming to the various standards can be certified by the Wi-Fi Alliance.
The specific range of radio frequencies a wireless device operates on is referred to as a channel, within an overall frequency band of either 2.4 GHz or 5 GHz (and now 6 GHz with Wi-Fi 6E).
| Feature | 2.4 GHz Band | 5 GHz Band |
|---|---|---|
| Propagation | Better at propagating through solid surfaces, providing a longer signal range. | Less effective at penetrating solid surfaces, resulting in a shorter maximum signal range. |
| Channels & Congestion | Does not support a high number of channels and is often congested (channels overlap considerably). | Supports a higher number of individual channels, suffering less congestion (non-overlapping channels). |
| Interference & Data Rate | Increased risk of interference, achievable data rates are typically lower. | Less risk of interference, supports higher data rate transmission at shorter signal ranges. |
802.11b (Wi-Fi 1):
802.11a (Wi-Fi 2):
802.11g (Wi-Fi 3):
802.11n (Wi-Fi 4):
A x B:C notation (A = #Tx antennas, B = #Rx antennas, C = #simultaneous Tx/Rx streams, max 4x4:4).802.11ac (Wi-Fi 5):
802.11ax (Wi-Fi 6):
Independent Basic Service Set (IBSS) / Ad Hoc Mode:
Basic Service Set (BSS) / Infrastructure Mode:
Extended Service Set (ESS):
802.11r (fast roaming) is supported, it may use existing authentication status to generate security properties for the new association.Mesh Basic Service Set (MBSS) / Wireless Mesh Network (WMN):
Wireless clients go through a process to connect to an AP:
There are three main types of Wireless Deployment models: Autonomous, Lightweight (Controller-Based), and Cloud-Based.
Autonomous APs ("Fat APs"):
Lightweight APs ("Thin APs") with a Wireless LAN Controller (WLC):
Cloud-Based AP Architecture:
Designing a wireless network to meet requirements for multiple device types can be complex, ensuring that range and interference issues are accounted for. Wireless network devices are referred to as stations.
A site survey is a critical planning tool to ensure the WLAN delivers acceptable data rates to the supported number of devices in all expected physical locations.
Wireless networks, while offering mobility and convenience, pose considerable security risks if not properly secured with access controls. All clients must be authenticated before they can associate with an Access Point (AP). In corporate settings, a separate SSID (Service Set Identifier) with restricted access can be provided for guest Internet access, keeping them off the main corporate network.
Here are multiple ways to authenticate clients on a wireless network, broadly categorized by their approach:
EAP is an authentication protocol that defines a set of standards. It's integrated with IEEE 802.1X (Port-based Network Access Control - PNAC), which is used to limit network access for clients until they authenticate.
Three Main EAP Entities:
These are cryptographic protocols used for encryption and integrity in modern wireless security:
The choice of security settings depends on device support for various Wi-Fi encryption standards, the type of authentication infrastructure, and the purpose of the WLAN. These standards determine the cryptographic protocols supported, key generation methods, and available authentication methods.
Wireless security comes in two main flavors (and an "Open" category):
Personal (Pre-Shared Key - PSK / SAE):
Enterprise (IEEE 802.1X Authentication for WPA2 or WPA3):
Wireless network deployments can be complicated by various environmental and performance demands. A variety of tools and techniques are available to assess Wi-Fi performance and ensure a highly available network for all users.
Wireless issues can be broadly categorized into problems with:
Attenuation: The weakening of the signal as the distance between the station and the access point (AP) increases. Also referred to as Radio Frequency (RF) Attenuation or Free Space Loss.
Interference: Various interference sources collectively overlay a competing background signal, creating noise.
Measurement Units (dBm): Attenuation and signal strength are measured in decibels (dB). Signal strength is represented as a ratio of a measurement to 1 milliwatt (mW).
0 dBm = 1 mW.Power (dBm) = 10 * log10 (Power (mW) / 1 mW)Power (mW) = 1 mW, Power (dBm) = 0 dBm.Power (mW) = 10^(Power (dBm) / 10)-3 dBm is half a milliwatt). Positive values represent power more than 1 mW.Received Signal Strength Indicator (RSSI): The strength of the signal from the transmitting station at the client end.
-65 dBm is better performance than -80 dBm).-80 dBm to -90 dBm is likely to suffer packet loss or be dropped entirely.Signal-to-Noise Ratio (SNR): The comparative strength of the data signal to the background noise.
Antennas determine the propagation pattern (shape of radio waves transmitted/received).
Omnidirectional Antennas:
Unidirectional (Directional) Antennas:
Polarization: Refers to the orientation of the wave propagating from the antenna (e.g., vertical, horizontal).
Insufficient Wireless Coverage (Dead Spots):
Antenna Placement:
Antenna Cable Attenuation:
Effective Isotropic Radiated Power (EIRP) & Power Settings:
EIRP = Transmit Power (dBm) + Antenna Gain (dBi) - Cable/Connector Losses (dB)Channel Planning:
If a device is within the supported range but the signal is weak or there's no connection, interference or physical obstructions are likely.
Wireless connections pose considerable risks unless properly secured with access controls. Identifying different wireless security methods, their configuration requirements, and troubleshooting common issues is crucial.
General Considerations:
Troubleshooting Common Wireless Issues:
Following these guidelines will lead to more robust and easily manageable wireless networks.
802.11 beacon.Let's break down network types, characteristics, topology, and how they relate to performance, cabling, switching, and routing within the OSI model.
Traditional hub-and-spoke WAN designs with on-premises data centers often suffer from performance and reliability drawbacks. While moving services to cloud data centers or using colocation mitigates some issues by separating service integrity and availability from site accessibility, a new approach is needed for modern connectivity demands.
SD-WAN replaces the traditional hub-and-spoke design with more efficient, secure connectivity to corporate clouds, often at a lower expense compared to provisioning MPLS services to every remote location.
The SD-WAN is managed by a Controller and management software, which can be located in the corporate data center or a public cloud.
A data center is a site dedicated to provisioning server resources. It hosts network services (authentication, addressing, name resolution), application servers, and storage area networks (SANs). While many are purpose-built facilities, some concepts apply to on-premises server rooms.
Cloud services require the rapid provisioning and de-provisioning of server instances and networks, relying heavily on automation, orchestration, and the use of overlay networks to establish point-to-point links quickly and reliably.
This means that these infrastructure components must be fully accessible to scripting, representing the idea of Infrastructure as Code (IaC). Software-Defined Networking (SDN) serves as a model for these processes.
SDN is a model for how these IaC processes are used for provisioning and de-provisioning networks.
SDN architectures are typically divided into three logical layers, from top to bottom: Application, Control (or Management), and Infrastructure (or Data).
Application Layer (Top):
Control / Management Plane Layer (Middle):
Infrastructure / Data Plane Layer (Bottom):
Network automation provides many key benefits by using tools and methods to automate tasks.
Cisco SD-Access is Cisco's enterprise-level SDN solution for campus and branch networks.
Cisco DNA Center is the SDN Controller for SD-Access and has two main roles: