Module 4
Module 4
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
• Internetworking devices are the building blocks that allow different computers and devices to
communicate and share resources on a network
What is a Repeater?
• Repeaters are defined as a networking device that is used to amplify and generate the incoming
signal. Repeaters work at the physical layer of the OSI model. The main aim of using a repeater is to
increase the networking distance by increasing the strength and quality of signals. The performance
of Local Area Networks (LANs) and Wide Area Networks (WANs) repeaters are used. Using repeaters
helps to reduce error, and loss of data and provides with delivery of data at specified locations only.
The major advantage of using a repeater is that it provides with transfer of data with more security
and over a long distance.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
• Features of Repeaters
• Repeater can regenerate the signal without modifying it.
• Repeaters can be used in analog signals and digital signals.
• Repeaters can extend the range of networks.
• Dynamic networking is supported by repeater.
• Use of Repeaters reduces error and loss of data.
• Power is required for working of repeaters.
• Using repeater can add complexity in the network.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
2. Hub – A hub is a basically multi-port repeater. A hub connects multiple wires coming from different
branches, for example, the connector in star topology which connects different stations. Hubs cannot
filter data, so data packets are sent to all connected devices. In other words, the collision domain of
all hosts connected through Hub remains one. Also, they do not have the intelligence to find out the
best path for data packets which leads to inefficiencies and wastage.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
Types of Hub
• Active Hub:- These are the hubs that have their power supply and can clean, boost, and relay the
signal along with the network. It serves both as a repeater as well as a wiring center. These are used
to extend the maximum distance between nodes.
• Passive Hub:- These are the hubs that collect wiring from nodes and power supply from the active
hub. These hubs relay signals onto the network without cleaning and boosting them and can’t be
used to extend the distance between nodes.
• Intelligent Hub:- It works like an active hub and includes remote management capabilities. They also
provide flexible data rates to network devices. It also enables an administrator to monitor the traffic
passing through the hub and to configure each port in the hub.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
3. Bridge – A bridge operates at the data link layer. A bridge is a
repeater, with add on the functionality of filtering content by reading
the MAC addresses of the source and destination. It is also used for
interconnecting two LANs working on the same protocol. It has a
single input and single output port, thus making it a 2 port device.
Types of Bridges
• Transparent Bridges:- These are the bridge in which the stations are
completely unaware of the bridge’s existence i.e. whether or not a
bridge is added or deleted from the network, reconfiguration of the
stations is unnecessary. These bridges make use of two processes i.e.
bridge forwarding and bridge learning.
• Source Routing Bridges:- In these bridges, routing operation is
performed by the source station and the frame specifies which route
to follow. The host can discover the frame by sending a special frame
called the discovery frame, which spreads through the entire
network using all possible paths to the destination.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
4. Switch – A switch is a multiport bridge with a buffer and a design
that can boost its efficiency(a large number of ports imply less traffic)
and performance. A switch is a data link layer device. The switch can
perform error checking before forwarding data, which makes it very
efficient as it does not forward packets that have errors and forward
good packets selectively to the correct port only. In other words, the
switch divides the collision domain of hosts, but the broadcast
domain remains the same.
• Switches may operate at one or more layers of the OSI model. They
may operate in the data link layer and network layer; a device that
operates simultaneously at more than one of these layers is known
as a multilayer switch.
• A Switch can check the errors before forwarding the data, which
makes it more efficient and improves its performance. A switch is
the better version of a hub. It is a multi-port bridge device.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
Types of Switch
1. Unmanaged switches: These switches have a simple plug-and-play design and do not offer advanced
configuration options. They are suitable for small networks or for use as an expansion to a larger
network.
2. Managed switches: These switches offer advanced configuration options such as VLANs, QoS, and
link aggregation. They are suitable for larger, more complex networks and allow for centralized
management.
3. Smart switches: These switches have features similar to managed switches but are typically easier to
set up and manage. They are suitable for small- to medium-sized networks.
4. Layer 2 switches: These switches operate at the Data Link layer of the OSI model and are responsible
for forwarding data between devices on the same network segment.
5. Layer 3 switches: These switches operate at the Network layer of the OSI model and can route data
between different network segments. They are more advanced than Layer 2 switches and are often
used in larger, more complex networks.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
5. Routers – A router is a device like a switch that routes data packets based on their IP addresses. The
router is mainly a Network Layer device. Routers normally connect LANs and WANs and have a
dynamically updating routing table based on which they make decisions on routing the data packets. The
router divides the broadcast domains of hosts connected through it.
• Routers are small physical devices that operate at the network layer to join multiple networks together.
• A router is a device like a switch that routes data packets based on their IP addresses.
• Routers normally connect LANs and WANs and have a dynamically updating routing table based on
which they make decisions on routing the data packets.
• A Router divides the broadcast domains of hosts connected through it.
• Routers perform the traffic directing functions on the Internet. A data packet is typically forwarded
from one router to another through the networks that constitute the internetwork until it reaches its
destination code.
• Routers may also be used to connect two or more logical groups of computer devices known as
subnets, each with a different subnetwork address. The subnet addresses recorded in a router do not
necessarily map directly to the physical interface connections.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
Two types of routers −
1. Static routers – Static routers are configured manually and route data packets based on the
information in a router table.
2. Dynamic routers – Dynamic routers use adaptive routing which is a process where a router can
forward data by a different route.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Internetworking & devices: Repeaters, Hubs,
Bridges, Switches, Router, Gateway
A gateway is a device that can connect networks that use different protocols. It acts as a translator
between different networks. A gateway is an internetworking capable of joining together two networks
that use different base protocols.
• A network gateway can be implemented completely in software, hardware, or a combination of both,
depending on the types of protocols they support.
• A network gateway can operate at any level of the OSI model. A broadband router typically serves as
the network gateway, although ordinary computers can also be configured to perform equivalent
functions.
• A gateway is a router or proxy server that routes between networks.
• A gateway belongs to the same subnet to which the PC belongs.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
IP ADDRESSES
• The total number of addresses used by the protocol. If a protocol uses N bits to define
an address, the address space is 2N because each bit can have two different values (0 or 1) and N bits
can have 2N values.
• The address space of IPv4 is 232 or 4,294,967,296.
• The address space of IPv6 is 2128 or 40,282,366,920,938,463,463,374,607,431,768,211,456.
2. NOTATIONS
Solution
We replace each group of 8 bits with its equivalent decimal number and add dots for
separation
Example
Change the following IPv4 addresses from dotted-decimal notation to binary notation.
Solution
We replace each decimal number with its binary equivalent
Example
Find the error, if any, in the following IPv4 addresses.
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal notation is not allowed.
3. Classful addressing
1. Unicast
Transmitting a packet from one source node to one destination node is called as unicast.
We can say, it is a one to one transmission.
CASTING AND ITS TYPES CONTD…
2. Broadcast
In Broadcasting, Packet is send to all residing host in the same or different network,
depending on its types.
It is a one to all transmission.
Broadcasting is of two types [Limited Broadcast, Direct Broadcast]
CASTING AND ITS TYPES CONTD…
3. Multicast
Transmitting data packet from one source Node to a particular group of Nodes is known
as Multicast.
It is also an example of one to many transmission.
CLASSFUL ADDRESSING CONTD…
Mask
Although the length of the netid and hostid (in bits) is predetermined in classful
addressing, we can also use a mask (also called the default mask)
32-bit number made of contiguous 1’s followed by contiguous 0’s. The masks for classes
A, B, and C. The concept does not apply to classes D and E.
The mask can help us to find the netid and the hostid.
Example
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class Aaddress.
b. The first 2 bits are 1; the third bit is 0. This is a class C address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
4. Classless addressing
To overcome address depletion and give more organizations access to the Internet,
classless addressing was designed and implemented.
Here are no classes, but the addresses are still granted in blocks.
Address Blocks
In classless addressing, when an entity, small or large, needs to be connected to the
Internet, it is granted a block (range) of addresses.
The size of the block (the number of addresses) varies based on the nature and size of
the entity.
Classless addressing contd…
Restriction: To simplify the handling of addresses, the Internet authorities impose three
restrictions on classless address blocks:
1.The addresses in a block must be contiguous, one after another.
2.The number of addresses in a block must be a power of 2 (I, 2, 4, 8, ... ).
3.The first address must be evenly divisible by the number of addresses.
CLASSLESS ADDRESSING CONTD…
Mask
A better way to define a block of addresses is to select any address in the block and the
mask.
A mask is a 32-bit number in which the n leftmost bits are I’s and the 32 - n rightmost
bits are 0’s.
However, in classless addressing the mask for a block can take any value from 0 to 32. It is
very convenient to give just the value of n preceded by a slash (CIDR notation)
i. /n [denotes the prefix length]
ii. /(n-32) [denotes the suffix length]
Example
A block of addresses is granted to a small organization. We know that one of the addresses is
205.16.37.39/28. What is the first address in the block?
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or 205.16.37.32.
Example
Find the last address for the block
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or 205.16.37.47
Internet Protocol version 6 (IPv6)
IPv6 was developed by Internet Engineering Task Force (IETF) to deal with the
problem of IPv4 exhaustion.
IPv6 is a 128-bits address having an address space of 2128, which is way bigger than
IPv4.
IPv6 use Hexa-Decimal format separated by colon (:) .
Internet Protocol version 6 (IPv6)
Unicast
Multicast
Anycast
Unicast Address
Unicast Address identifies a single network interface. A packet sent to a unicast address
is delivered to the interface identified by that address.
Addressing methods
Multicast Address
Anycast Address
Definition It happens when a router utilizes a manually specified It is a method in which a router may transmit data via
routing entry rather than information from dynamic a different route or to a specific destination based on
routing traffic. the current state of the network's communication
circuits.
Configuration Technique The routing tables are manually updated in static The tables are automatically updated in dynamic
routing. routing.
Routes Routes are specified by the administrative. The routes are updated according to the modifications
in the network.
Routing Algorithms It doesn't utilize any complicated routing algorithms. It utilizes complicated routing algorithms.
Link Affect When a link fails in static routing, it interrupts the The link failure doesn't affect rerouting in dynamic
other routing path. routing.
Bandwidth It needs less bandwidth. It needs more bandwidth.
Security It offers high security. It offers less security.
Network Infrastructure Its network infrastructure is minimal. Its network infrastructure is large.
Routing Protocols It doesn't utilize any protocol. It employs protocols such as eigrp, arp, and others to
calculate the routing process.
Additional Resources It doesn't need any extra resources. It needs extra resources to hold the information.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Routing algorithms: shortest path algorithm
Dijkstra’s Algorithm
• The Dijkstra’s Algorithm is a greedy algorithm that is used to find the minimum distance between a node and all
other nodes in a given graph. Here we can consider node as a router and graph as a network. It uses weight of
edge .ie, distance between the nodes to find a minimum distance route.
• Algorithm:
1: Mark the source node current distance as 0 and all others as infinity.
2: Set the node with the smallest current distance among the non-visited nodes as the current node.
3: For each neighbor, N, of the current node:
Calculate the potential new distance by adding the current distance of the current node with the weight of the
edge connecting the current node to N.
If the potential new distance is smaller than the current distance of node N, update N’s current distance with the
new distance.
4: Make the current node as visited node.
5: If we find any unvisited node, go to step 2 to find the next node which has the smallest current distance and
continue this process.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Routing algorithms: shortest path algorithm
Dijkstra’s Algorithm
• Example: Now,we will start normalising graph one by one starting from
• Consider the graph G: node 0.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Routing algorithms: shortest path algorithm
Dijkstra’s Algorithm
Step 2:-Nearest neighbour of 0 are 2 and 1 so we will normalize them first .
Step4:- Similarly we will normalize other node
considering it should not form a cycle and will keep track
in visited nodes.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Routing algorithms: shortest path algorithm
• Bellman Ford’s Algorithm
• The Bell man Ford’s algorithm is a single source graph search algorithm which help us to find the shortest path
between a source vertex and any other vertex in a give graph. We can use it in both weighted and unweighted
graphs. This algorithm is slower than Dijkstra’s algorithm and it can also use negative edge weight.
• Algorithm
• 1: First we Initialize all vertices v in a distance array dist[] as INFINITY.
• 2: Then we pick a random vertex as vertex 0 and assign dist[0] =0.
• 3: Then iteratively update the minimum distance to each node (dist[v]) by comparing it with the sum of the
distance from the source node (dist[u]) and the edge weight (weight) N-1 times.
• 4: To identify the presence of negative edge cycles, with the help of following cases do one more round of edge
relaxation.
• We can say that a negative cycle exists if for any edge uv the sum of distance from the source node (dist[u]) and
the edge weight (weight) is less than the current distance to the largest node(dist[v])
• It indicates the absence of negative edge cycle if none of the edges satisfies case1.
• Example: Bellman ford detecting negative edge cycle in a graph.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Routing algorithms: shortest path algorithm
• Consider the Graph G:
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Routing algorithms: shortest path algorithm
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Distance vector routing,
Step-01:
• Each router prepares its routing table. By their local knowledge. each router knows about
• All the routers present in the network
• Distance to its neighboring routers
Step-02:
• Each router exchanges its distance vector with its neighboring routers.
• Each router prepares a new routing table using the distance vectors it has obtained from its neighbors.
• This step is repeated for (n-2) times if there are n routers in the network.
• After this, routing tables converge / become stable.
• Distance Vector Routing Example-
• Consider-
• There is a network consisting of 4 routers.
• The weights are mentioned on the edges.
• Weights could be distances or costs or delays.
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Distance vector routing
Step-01:
• Each router prepares its routing table using its local knowledge.
• Routing table prepared by each router is shown below-
At Router A- At Router B- At Router C-
At Router D-
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Distance vector routing
Step-02:
• Each router exchanges its distance vector obtained in Step-
01 with its neighbors.
• After exchanging the distance vectors, each router prepares
a new routing table.
This is shown below-
At Router A-
Router A receives distance vectors from its neighbors B and D.
Router A prepares a new routing table as-
Department of Computer Science & Engineering, Amity School of Engineering and Technology, Amity University, Gwalior, Madhya Pradesh, India
Distance vector routing
• Explanation For Destination B
• Router A can reach the destination router B via its neighbor B or neighbor D.
• It chooses the path which gives the minimum cost.
• Cost of reaching router B from router A via neighbor B = Cost (A→B) + Cost (B→B)= 2 + 0 = 2
• Cost of reaching router B from router A via neighbor D = Cost (A→D) + Cost (D→B) = 1 + 7 = 8
• Since the cost is minimum via neighbor B, so router A chooses the path via B.
• It creates an entry (2, B) for destination B in its new routing table.
• Similarly, we calculate the shortest path distance to each destination router at every router.
• Thus, the new routing table at router A is-
Distance vector routing
• Router B-
• Router B receives distance vectors from its neighbors A, C and D.
• Router B prepares a new routing table as-
•
Thus, the new routing table at router B is-
Distance vector routing
Router C-
• Router C receives distance vectors from its neighbors B and D.
• Router C prepares a new routing table as-
Bandwidth required is less due to local sharing, small packets and Bandwidth required is more due to flooding and sending of
1.
no flooding. large link state packets.
Based on local knowledge, since it updates table based on Based on global knowledge, it have knowledge about entire
2.
information from neighbours. network.
Converges slowly i.e, good news spread fast and bad news spread
5. Converges faster.
slowly.
7. Persistent looping problem i.e, loop will be there forever. No persistent loops, only transient loops.
8. Practical implementation is RIP and IGRP. Practical implementation is OSPF and ISIS.
Link State Routing
S.No. Distance Vector Routing Link State Routing
Bandwidth required is less due to local sharing, small packets and Bandwidth required is more due to flooding and sending of
1.
no flooding. large link state packets.
Based on local knowledge, since it updates table based on Based on global knowledge, it have knowledge about entire
2.
information from neighbours. network.
Converges slowly i.e, good news spread fast and bad news spread
5. Converges faster.
slowly.
7. Persistent looping problem i.e, loop will be there forever. No persistent loops, only transient loops.
8. Practical implementation is RIP and IGRP. Practical implementation is OSPF and ISIS.
Protocols: ARP,RARP, IP, ICMP
• Network Layer is responsible for the transmission of data or communication from one host to another host
connected in a network. Rather than describing how data is transferred, it implements the technique for efficient
transmission.
• The data is being grouped into packets or in the case of extremely large data it is divided into smaller sub packets.
Each protocol used has specific features and advantages.
ARP
• ARP stands for Address Resolution Protocol.
• It is used to associate an IP address with the MAC address.
• Each device on the network is recognized by the MAC address imprinted on the NIC. Therefore, we can say that
devices need the MAC address for communication on a local area network. MAC address can be changed easily.
For example, if the NIC on a particular machine fails, the MAC address changes but IP address does not change.
ARP is used to find the MAC address of the node when an internet address is known.
Note: MAC address: The MAC address is used to identify the actual device.
IP address: It is an address used to locate a device on the network.
Protocols: ARP,RARP, IP, ICMP
RARP
• RARP stands for Reverse Address Resolution
Protocol.
• If the host wants to know its IP address, then it
broadcast the RARP query packet that contains its
physical address to the entire network. A RARP
server on the network recognizes the RARP
packet and responds back with the host IP
address.
• The protocol which is used to obtain the IP
address from a server is known as Reverse
Address Resolution Protocol.
• The message format of the RARP protocol is
similar to the ARP protocol.
• Like ARP frame, RARP frame is sent from one
machine to another encapsulated in the data
portion of a frame.
Protocols: ARP,RARP, IP, ICMP
ICMP
• ICMP stands for Internet Control Message Protocol.
• The ICMP is a network layer protocol used by hosts and routers to send the notifications of IP
datagram problems back to the sender.
• ICMP uses echo test/reply to check whether the destination is reachable and responding.
• ICMP handles both control and error messages, but its main function is to report the error but not
to correct them.
• An IP datagram contains the addresses of both source and destination, but it does not know the
address of the previous router through which it has been passed. Due to this reason, ICMP can only
send the messages to the source, but not to the immediate routers.
• ICMP protocol communicates the error messages to the sender. ICMP messages cause the errors to
be returned back to the user processes.
• ICMP messages are transmitted within IP datagram.
The messages in ICMP are divided into two types. They are given below:
1. Error Message: Error message states about the issues or problems that are faced by the host or
routers during processing of IP packet.
2. Query Message: Query messages are used by the host in order to get information from a router or
another host.
Protocols: ARP,RARP, IP, ICMP
IGMP
• IGMP stands for Internet Group Message Protocol.
• The IP protocol supports two types of communication:
• Unicasting: It is a communication between one sender and one receiver. Therefore, we can say that it is
one-to-one communication.
• Multicasting: Sometimes the sender wants to send the same message to a large number of receivers
simultaneously. This process is known as multicasting which has one-to-many communication.
• The IGMP protocol is used by the hosts and router to support multicasting.
• The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that are the members of a
group.
• IGMP is a part of the IP layer, and IGMP has a
fixed-size message.
• The IGMP message is encapsulated within an IP
datagram.
•
Protocols: ARP,RARP, IP, ICMP
How Does IGMP Work?
• Devices that can support dynamic multicasting and multicast groups can use IGMP.
• The host has the ability to join or exit the multicast group using these devices. It is
also possible to add and remove customers from the group using these devices.
• The host and local multicast router use this communication protocol. Upon creation
of a multicast group, the packet’s destination IP address is changed to the multicast
group address, which falls inside the class D IP address range.
•