Routing and Switching
Instructor: Dr. Saleem ullah
Department of Computer Science
KFUEIT – Rahim Yar Khan
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Routing and Switching- Recommended Material
Recommended Book:
Official Cert Guide, CCNA Routing and Switching by Wendel Odom, ISBN-13: 978-1587205798
Recommended Web Links
https://www.computernetworkingnotes.com/ccna-study-guide/
https://www.practicalnetworking.net/index/ccna/
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Lecture # 1 Contents
• Scope
• Introduction
• Layer 1 Devices
• Layer 2 Devices
• Layer 3 Devices
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Scope and Career Opportunities
Network Scope The technique of transferring and sharing data between nodes in an information
system through a common media is known as computer networking. The field includes network
construction, design, and usage, as well as network infrastructure, software, and policy
maintenance, administration, and operation. It is a critical component of every organization since
it encompasses both hardware and software networking.
• Network/System Administrator
• Network Analyst
• Network Engineer
• Network Manager
• IT Manager
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
What is Routing and Switching
Routing and switching are the basic functions of
network communication. Routing and Switching are
different functions of network communications.
The function of Switching is to switch data packets
between devices on the same network (or
same LAN - Local Area Network). The function of
Routing is to Route packets between different
networks (between different LANs - Local Area
Networks).
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Basic Comparison
• Routing deals with moving packets between different networks.
• Routers operate at layer 3 of the OSI model.
• A router can find where to send a packet using Network ID within the network
layer header.
• It will use the routing table to determine the route to the destination host.
• Switching deals with moving packets between devices on the same network.
• A switch operates at layer 2 of the OSI model.
• A switch is also referred to as Multi-Port Bridge, It allows us to find where the
packet should be sent by examining the MAC Address within the data link header
of the packet.
• A switch maintains a database of MAC Addresses and which port they are
connected to.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Layer 1 Devices
Layer 1 is the first layer of the Open Systems Interconnect (OSI)
Model. Layer 1 consists of the various networking hardware and
transmission technologies being employed by networks. The type of
equipment involved in Layer 1 uses little to no logic when operating:
copper ethernet cables, fiber optic cables, and ethernet hubs. This is
not only limited to physical cables though. The physical transmission
aspects of Wi-Fi, Bluetooth, Microwave, and other over the air
technologies fall under this layer.
Layer 1 devices include Passive Hubs, Repeaters(Active Hubs),
Intelligent Hubs, Bridge, Cables, Connectors. These are the basic
devices that are used at the physical layer to transmit data through a
given physical medium which is suitable as per the network need.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Networking Hubs
Types of Network Hubs:
Networks hubs are of the following three types:
1.Passive Hub: Passive hubs are simply used to connect signals from different network
cables as they do not have any computerized element. They simply connect the wires of
different devices in the star topology. Passive hubs do not do any processing or signal
regeneration and that’s why do not require electricity the most they can do is they can
copy or repeat the signal. It can’t clean the message, and it can’t amplify or strengthen the
signal. It doesn’t have its own power supply unit(AC/DC).
2.Active Hub: They have a power supply for regenerating, and amplifying the signals.
When a port sends weak signaled data, the hub regenerates the signal and strengthens
it, then send it further to all other ports. Active hubs are expensive in costs as compared
to passive hubs.
3.Intelligent Hub: Intelligent hubs as the name suggests are smarter than active and
passive hubs. The intelligent hub comprises a special monitoring unit named a
Management Information Base (MIB). This is software that helps in analyzing and
troubleshooting network problems. Intelligent hubs work similarly to active hubs but with
some management features. Like it can monitor the traffic of the network and the
configuration of a port.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Summary of Hubs
Features of Hubs:
Hubs are the hardware device that operates in the physical layer of the OSI model.
•It supports half-duplex transmission
•It works with shared bandwidth and broadcasting.
•It can detect collisions in the network and send the jamming signal to each port.
•It is unable to filter the data and hence transmit or broadcast it to each port.
•It cannot find the best route/ shortest path to send any data, which makes it an inefficient device.
Advantages of Network Hubs:
• Less expensive.
• Does not impact network performance.
• Support different network media.
• Easily connects with different media.
Disadvantages of Network Hubs:
• It cannot find the best/ shortest path of the network.
• No mechanism for traffic detection.
• No mechanism for data filtration.
• Not capable of connecting to different network topologies like token, ring, ethernet, etc.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Layer 2 Devices
Layer 2 refers to the data link layer of the network. This is how data moves across the physical links in your
network. It's how switches within your network talk to one another. Installing Layer 2 on your infrastructure
gives you high-speed connectivity between devices. It can also provide you with improved network
performance.
Devices used on a Layer 2 Ethernet network include network interface cards, bridges and switches.
Ethernet devices use 'burned in' MAC addresses to identify each host. These addresses are attached to
network interface cards and cannot be changed.
• It has configuration files (Running (RAM) and Startup (NVRAM)).
• It has Operating System (IOS), installed in Flash memory.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
How Switch Works
The Switch is a network device that is used to segment the networks into different
subnetworks called subnets or LAN segments. It is responsible for filtering and forwarding
the packets between LAN segments based on MAC address.
Switches have many ports, and when data arrives at any port, the destination address is
examined first and some checks are also done and then it is processed to the devices.
Different types of communication are supported here like unicast, multicast, and broadcast
communication.
Features of Network Switches
•It operates in Data Link Layer in OSI Model.
•It performs error checking before forwarding data.
•It transfers the data only to the device that has been addressed.
•It operates in full duplex mode.
•It uses Unicast (one-to-one), multicast (one-to-many), and broadcast (one-to-all)
transmission modes.
•Switches have a more significant number of ports.
•https://www.computernetworkingnotes.com/ccna-study-guide/how-switch-learns-the-
mac-addresses-explained.html
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Layer 3 Devices
If two devices have different network IDs, they can not communicate directly. To move
information between devices that have different network IDs, a router is used. A router
connects different networks. It switches data packets between different networks in a
process called routing.
When a device sends a data packet to another device, it attaches the IP address of that
device to the data packet and gives it to the default gateway router. A default gateway router
connects the network segment to the network. When it receives a data packet from the
segment, it reads the destination IP address written on the data packet, takes the routing
decision based on its routing table, and forwards the packet to the destination network.
Routers save route information in routing tables. When it receives a data packet, it compares
the data packet's destination address with the routing table to find the route information. If it
finds a route for the destination address, it uses that route to forward the packet to the
destination. If it does not find a route in the routing table, it discards the packet. This process
is called a routing decision. Routers take routing decisions for all packets it receives.
• It has configuration files (Running (RAM) and Startup (NVRAM)).
• It has Operating System (IOS), installed in Flash memory.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Why Multiple Addresses??
Reason to Have Both IP and MAC Addresses.
The reason for having both IP and MAC addresses lies in the way the Internet works, specifically in the structure of the OSI Model. This model is
a conceptual framework that describes how data is sent and received over a network. It’s divided into seven layers, each performing specific
functions.
•Layer 2 uses MAC addresses and is responsible for packet delivery from hop to hop.
•Layer 3 uses IP addresses and is responsible for packet delivery from end to end.
Layer 2 (Data Link Layer) uses a MAC (Media Access Control) address. These are unique identifiers assigned to network interfaces for
communications at the data link layer. The primary function of MAC addresses is to manage how data is transported from one network node to
another on a direct, physical basis – this is also referred to as “hop to hop” delivery.
On the other hand, Layer 3 ( Network Layer ) uses an IP (Internet Protocol) address. These IP addresses are used to identify devices on a
network and to route traffic between networks. The IP addresses ensure that the data gets from its original source reaches its final destination
and it is also called “end-to-end” delivery of data.
When a computer sends data, it first wraps it in an IP header, which includes the source and destination IP addresses. This IP header, along with
the data, is then encapsulated in a MAC header, which includes the source and destination MAC addresses for the current “hop” in the path.
As the data travels from one router to the next, the MAC address header is stripped off and a new one is generated for the next hop. However,
the IP header, which was generated by the original computer, remains intact until it reaches the final destination. This process illustrates how the
IP header manages the “end to end” delivery, while the MAC headers handle the “hop to hop” delivery.
So, Both IP and MAC addresses are essential for the functioning of the Internet. While MAC addresses facilitate the direct, physical transfer of
data between network nodes, IP addresses ensure that the data reaches its final destination.
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk