Chapter 1_(0)
Chapter 1_(0)
1
Overview of Network Device Conf.
A network device refers to any hardware component that plays a role in the
communication and management of network traffic.
They perform various functions such as routing data, switching packets, and
enabling communication between devices on a network.
Most common networking devices:
• Network configuration involves setting up the network
✓ Router
devices and systems, ensuring they communicate properly,
✓ Switch and maintaining optimal network performance.
✓ Gateway • This configuration process involves both hardware and software
✓ Hub components and can include:
• IP Addressing (Static & DHCP Configuration)
✓ Aps
• Routing Configurations
✓ Modem • VLAN Configurations
✓ Firewall • DNS Configurations
✓ Bridge • Firewall Configurations
✓ Security- • Wireless Settings
• VPN Configuration & Security Configurations
cameras
• Proper network configuration ensures that devices can communicate
effectively, traffic is routed correctly, and the network is secure and
2
reliable. It's an essential part of network administration and mgt.
Routers Configurations
Introduction to Routers
• What is a router?
• In today's digital age, routers and servers are essential
components of modern computer networks.
• The interfaces are the physical or logical connections that link the
router to other devices or networks.
9
ROM
• ROM is a form of permanent storage.
• Devices use ROM to store:
▪ The bootstrap instructions
▪ Basic diagnostic software
▪ Scaled-down version of IOS
Flash Memory
• Flash memory is nonvolatile router memory that can be
electrically stored and erased.
• Flash is used as permanent storage for the operating system.
• In most models of routers, the IOS is permanently stored in flash
memory and copied into RAM during the bootup process.
NVRAM
• NVRAM (Nonvolatile RAM) does not lose its information when
power is turned off.
• Used by the IOS as permanent storage for the startup
configuration file (startup-config).
10
11
• IOS is a multitasking operating system that is integrated with routing,
switching, internetworking, and telecommunications functions.
• An IOS image is a file that contains the entire IOS for the router.
• IOS has its own user interface.
• The command line interface (CLI) is a much more common method of
configuring routers.
• Upon boot up, the startup-configuration file in NVRAM is copied into RAM
and stored as the running-configuration file.
• IOS executes the configuration commands in the running-configuration.
• The router belongs to the third layer of the OS I model-the network layer.
• It can guide data transmission from one network segment to another, and
it can also guide data transmission from one network to another.
12
Router interfaces
• A router is a multi-port device that can connect to local and wide area networks
with different transmission rates and run in various environments, and it can also
use different protocols.
• Router interfaces are the connection points on a router that allow it to connect to
other networks and devices. They are physical or logical ports that can be
configured to forward packets between networks.
• Management Ports- used to manage the router. Not used for packet
forwarding. (Such as Console, Auxiliary, VTY…..)
• Routers have multiple interfaces that are used to connect to multiple networks.
• Every interface on the router is a member or host on a different IP network.
• Router interfaces can be divided into two major groups:
– LAN interfaces - such as Ethernet and Fast Ethernet
• A router Ethernet interface usually uses an RJ-45 jack that supports unshielded
twisted-pair (UTP) cabling.
– WAN interfaces - such as serial, ISDN, and Frame Relay
• WAN interfaces are used to connect routers to external networks, usually over a
larger geographical distance.
• The Layer 2 encapsulation can be of different types, such as PPP, Frame Relay, and
HDLC (High-Level Data Link Control) 13
• Each WAN interface has its own IP address and subnet mask.
Router interfaces
• Management Ports
and ports
Console port
Console port: Provides local access to the router using a console terminal
▪ Terminal
▪ PC running terminal emulator software
• No need for network access
• Used for initial configuration
• Used for local access to a router using a console terminal
• Can be accessed using a rollover cable or serial console server
• Used to access the device when physically present with it
Auxiliary (AUX) port
Auxiliary port: Provides remote access to the router using a modem
• Not all routers have auxiliary ports.
▪ At times, can be used similarly to a console port
▪ The AUX port can be used for remote router management, such as dialing in to the
router to troubleshoot
▪ The AUX port is similar to a console port, but it's separate to accommodate routers that
need both local and remote access.
▪ A router's auxiliary (AUX) port is a serial terminal that allows remote access through a
modem.
▪ Accessing a router with auxiliary ports through a modem allows remote access to the
router.
▪ This is useful when a router is off the network or inaccessible through the normal
production network.
15
Router interfaces
16
Routers Configurations Includes
Router Initial configuration
– Setting hostname, configuring interfaces, and IP
addressing
• Enabling and configuring Routing Protocols
– RIP v1 & v2 (Routing Information Protocol)
– OSPF (Open Shortest Path First)
– EIGRP (Enhanced Interior Gateway Routing Protocol)
– BGP (Border Gateway Protocol)
Router Security
– Password protection and user authentication
– Access Control Lists (ACLs)
– Securing router interfaces (SSH, console, VTY access) 17
Router command modes
18
• How to configure a router?
• To configure a router, you need to access its web-
based interface, which is usually done by typing its
IP address in a web browser.
• The default IP address and login credentials vary
depending on the router model and manufacturer,
but they are usually printed on the router label or in
the user manual.
• Once you log in, you can change the router settings
such as the network name (SSID) and password, as
well as security mode and encryption for protecting
your network from unauthorized access and data
theft. 19
• How to configure a router?
• To The recommended mode is WPA2 and the
recommended encryption is AES.
• You can also configure the firewall and port
forwarding features to control incoming and
outgoing traffic on your network.
• Additionally, updating the firmware can improve the
router performance, security, and compatibility.
20
Basic router configuration
• When configuring a router, certain basic tasks are
performed including:
▪ Naming the router
▪ Setting passwords
▪ Configuring interfaces
▪ Configuring a banner
▪ Saving changes on a router
▪ Verifying basic configuration and router operations
21
Basic router configuration
• Router> User EXEC mode
• Router>enable
Router# Privileged EXEC mode
• Router#config t
• Router(config)# Global configuration mode
• Router(config)#hostname R1
R1(config)#
22
Basic router configuration
• Next, configure the console and Telnet lines with the
password cisco being on global configuration mode.
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
• Configuring a Banner being on global configuration
mode.
R1(config)#banner motd #!! Unauthorized Access
Prohibited!!# to give WARNING message 23
Cont.…
• Router Interface Configuration
• You will now configure the individual router interfaces with IP
addresses and other information.
Being in a global configuration mode:
R1(config)#interface Serial0/0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#description R1 LAN
R1(config-if)#no shutdown
R1(config-if)#exit
29
Best Path and Metric
• Best path - The evaluation of multiple paths to the
same destination network and selecting the optimum
or "shortest" path.
• The best path is selected by a routing protocol based
on the value or metric it uses to determine the
distance to reach a network.
• A metric is the quantitative value used to measure the
distance to a given route.
• Two metrics that are used by some dynamic routing
protocols are:
– Hop count-is the number of routers that a packet must
travel through before reaching its destination
– Bandwidth-is the data capacity of a link, sometimes
referred to as the speed of the link.
30
Best Path and Metric, cont
Equal Cost metric
• When a routing table has two or more paths with
the same metric to the same destination network.
Equal Cost Load Balancing
• The router will forward packets using the multiple
exit interfaces listed in the routing table.
Unequal cost load balancing
• A router can send packets over multiple networks
even when the metric is not the same.
31
Path Determination
In Path determination functions
– is the process of how the router determines which path to
use when forwarding a packet.
– the router searches its routing table for a network address
that matches the packet's destination IP address.
– After determining the best path the router do the
following:
– For Directly Connected Network - If the destination IP
address of the packet belongs to a device on a network that
is directly connected to one of the router's interfaces, that
packet is forwarded directly to that device.
– For Remote Network - If the destination IP address of the
packet belongs to a remote network, then the packet is
forwarded to another router.
– For No Route Determined - If the destination IP address of
the packet does not belong to either a connected or remote
network, and if the router does not have a default route,
32
then the packet is discarded.
Best/shortest Path Determination
We may be asked:-
Calculate shortest path/least cost path/optimum path and
shortest distance?
33
Best/shortest Path Determination
1. Dijkstra algorithms
• Dijkstra’s algorithm is a well-known algorithm used to find the
shortest paths between nodes in a graph.
• It works with both weighted graphs and positive edge weights.
• It is widely used in routing protocols and network optimization. Network
optimization is a process that improves a network's performance and reliability.
• Key Characteristics:
• Type: Single-source shortest path algorithm.
• Graph Type: Works on directed and undirected graphs with non-negative edge
weights.
• Greedy Algorithm: Dijkstra’s algorithm follows a greedy approach, where it builds
the shortest path incrementally by selecting the closest node to the source at each
step.
• It computes the shortest distance and lowest cost path from one particular
source node to all other remaining nodes of the graph.
The cost of the link may be a function of
➢ Distance, Bandwidth
➢ Avg traffic, Communication cost, Delay etc. 34
Conditions-
It is important to note the following points regarding Dijkstra
• Dijkstra algorithm works only for those graphs that do not
contain any negative weight edge.
• Dijkstra algorithm works only for connected graphs.
• It only provides the value or cost of the shortest paths.
• Dijkstra algorithm works for directed as well as undirected
graphs.
• Dijkstra’s algorithm is equally valid when used backwards
through a network.
• The algorithm repeatedly operates only for unvisited
vertices. Not for the visited nodes
• It is single source shortest path finding
• You can consider any vertex as a source 35
Steps to compute optimal path using Dijkstra algorithm
Step 1: Label the start vertex as 0.
Step 2: Box this number (permanent label).
Step 3: Label each vertex that is connected to the start
vertex with its distance (temporary label).
Step 4: Box the smallest number.
Step 5: From this vertex, consider the distance to each
connected vertex.
Step 6: If a distance is less than a distance already at this
vertex, cross out this distance and write in the new
distance. If there was no distance at the vertex, write down
the new distance.
Step 7: Repeat from step 4 until the destination vertex is
boxed
36
Simple Steps for Dijkstra
➢ Step1: Initialize the graph
distance [source]=0
all remaining distance [v]=infinity
➢ Step 2: relax edges repeatedly---relaxing edges refers to the process of updating
the shortest path to a neighboring node from the vertex if a shorter path is found through
the current node by checking its adjacent vertices.
if d[u]+c[ u, v]<d[v]
then d[v]=d[u]+c[ u, v] else d[v]=d[v]
predecessor(the coming selected vertex) [v]=u
If the calculated [d] is less than the distance already at that vertex then
cross out the previous [d] & write the new [d].
➢ Step 3: select a vertex of smallest distance from unvisited vertices
and relax again until all vertices are visited.
➢ Step 4: determine shortest distance from source to every node and
lowest cost path 37
Examples
1.Find shortest distance & best path from A to D on the network below
consider vertex A as a source
38
Finding the route
▪ Find the shortest distance and best route or path from A to J
39
Assignment from 15% and you will show me in your industrial project group
1.Find shortest distance & best path from node A to node J on a
network (graph), you can use Dijkstra's algorithm in Python.
2.Find the shortest distance from A to H on the network below you can
use Dijkstra's algorithm in Python
40
Bellman-Ford Algorithm
▪ It is a graph search algorithm that finds the shortest path b/n a
given source vertex to all other vertices in the network.
▪ Bellmann ford algorithm is used for finding solutions for single
source shortest path problems. If the graph has no negative cycles
that are reachable from the source then the algorithm produces
the shortest paths and their weights.
▪ Bellmann Ford algorithm returns true if the graph does not have
any negative weight cycles and returns false when the graph has
negative weight cycles.
▪ The for loop in the Bellmann Ford Algorithm gets executed for V-1
times. After making V-1 passes, the algorithm checks for a negative
weight cycle and returns appropriate Boolean value.
▪ After initialization, the algorithm makes v-1 passes over the edges
of the graph. Each pass is one iteration of the for loop and consists
of relaxing each edge of the graph once. Then it checks for the
negative weight cycle and returns an appropriate Boolean value. 41
Bellman-Ford Algorithm
▪ Distance vector routing algorithm---each router maintain routing
table giving the best known distance to each destination.
▪ Don’t work for bandwidth or cost it only works delay metrics of
queue length or hop count.
▪ Relaxation methods which are also called as iterative methods in
which an approximation to the correct distance is replaced
progressively by more accurate values till an optimum solution is
found.
▪ Bellmann Ford Algorithm can be applied for all directed and
weighted graphs. The weight function in the graph may either be
positive or negative.
▪ It can be used on both weighted and unweighted graphs.
42
Steps to do Bellmann-Ford algorithm
➢ Step1: Initialize the graph
distance [v]=infinity
predecessor [v]=null
distance [source]=0
➢ Step 2: relax edges repeatedly
if d[u]+c[u,v]<d[v]
then d[v]=d[u]+c[u,v]
predecessor [v]=u
➢ Step 3: determine shortest distance from source to every node and
lowest cost path
➢ Relaxation is done for n-1 times where n is number of vertices in
the network graph
➢ During the relaxation if changing stops no need to continue until n-1
times
➢ We should put all list of edges from source 43
Bellman-Ford Algorithm
Examples
Use Bellmann-ford algorithm and determine the shortest distance
from the source of vertex 1 in both networks A and B.
A) B)
44
Use Bellman-Ford Algorithm and determine shortest distance for ech vertex in
the graph
45
Use Bellman-Ford Algorithm exception
After n-1 iteration there should not be any change in the algorithm but if there is
a change that is exception draw back of belmman for algorithm
Called negative weight cycle.
46
• The diffusing update algorithm (DUAL) is a computer network algorithm
that helps routers find the best path for data to travel.
• A DUAL finite state machine contains decision information used by the
algorithm to determine the least-cost route (which considers distance and
whether a destination path is loop-free).
• It's used in Cisco's Enhanced Interior Gateway Routing Protocol (EIGRP).
• How it works
– Finds the best path: DUAL scans all routes to find the most efficient path for data to
travel.
– Manages backup paths: DUAL keeps a list of backup paths in case the primary path is
unavailable.
– Adjusts routing tables: DUAL automatically adjusts the routing tables of the router
when there are changes in the routing topology.
– Prevents routing loops: DUAL recalculates routes globally whenever it might cause a
routing loop.
• Why it's important
– DUAL helps to prevent routing loops.
– DUAL helps to ensure that data is sent efficiently.
– DUAL helps to quickly switch to a backup path if a route is blocked or changed.
47
The END of Chap-1
48