Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
UNIT 5
Switching is process to forward packets coming in from one port to a port leading towards the
destination. When data comes on a port it is called ingress, and when data leaves a port or goes
out it is called egress. A communication system may include number of switches and nodes. At
broad level, switching can be divided into two major categories:
Connectionless: The data is forwarded on behalf of forwarding tables. No previous handshaking is
required and acknowledgements are optional.
Connection Oriented: Before switching data to be forwarded to destination, there is a need to pre-
establish circuit along the path between both endpoints. Data is then forwarded on that circuit. After
the transfer is completed, circuits can be kept for future use or can be turned down immediately.
Circuit Switching
When two nodes communicate with each other over a dedicated communication path, it is
called circuit switching.There 'is a need of pre-specified route from which data will travels and
no other data is permitted.In circuit switching, to transfer the data, circuit must be established so
that the data transfer can take place.
Circuits can be permanent or temporary. Applications which use circuit switching may have to
go through three phases:
Establish a circuit
Transfer the data
Disconnect the circuit
Message Switching
This technique was somewhere in middle of circuit switching and packet switching. In message
switching, the whole message is treated as a data unit and is switching / transferred in its
entirety.
A switch working on message switching, first receives the whole message and buffers it until
there are resources available to transfer it to the next hop. If the next hop is not having enough
resource to accommodate large size message, the message is stored and switch waits.
This technique was considered substitute to circuit switching. As in circuit switching the whole
path is blocked for two entities only. Message switching is replaced by packet switching.
Message switching has the following drawbacks:
Every switch in transit path needs enough storage to accommodate entire message.
Because of store-and-forward technique and waits included until resources are available, message
switching is very slow.
Message switching was not a solution for streaming media and real-time applications.
Packet Switching
Shortcomings of message switching gave birth to an idea of packet switching. The entire
message is broken down into smaller chunks called packets. The switching information is added
in the header of each packet and transmitted independently.
It is easier for intermediate networking devices to store small size packets and they do not take
much resources either on carrier path or in the internal memory of switches.
Packet switching enhances line efficiency as packets from multiple applications can be multiplexed
over the carrier. The internet uses packet switching technique. Packet switching enables the user to
differentiate data streams based on priorities. Packets are stored and forwarded according to their
priority to provide quality of service.
NETWORKING AND INTERNETWORKING DEVICES
1. Repeater – A repeater operates at the physical layer. Its job is to regenerate the signal over the
same network before the signal becomes too weak or corrupted so as to extend the length to
which the signal can be transmitted over the same network. An important point to be noted about
repeaters is that they do not amplify the signal. When the signal becomes weak, they copy the
signal bit by bit and regenerate it at the original strength. It is a 2 port device
2. Hub – A hub is basically a multiport 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, collision domain of all hosts connected through Hub remains one. Also, they do not have
intelligence to find out best path for data packets which leads to inefficiencies and wastage.
Types of Hub
Active Hub:- These are the hubs which have their own power supply and can clean,
boost and relay the signal along with the network. It serves both as a repeater as well as
wiring centre. These are used to extend the maximum distance between nodes.
Passive Hub :- These are the hubs which collect wiring from nodes and power supply
from 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.
3. Bridge – A bridge operates at data link layer. A bridge is a repeater, with add on the
functionality of filtering content by reading the MAC addresses of 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 source
station and the frame specifies which route to follow. The hot can discover frame by
sending a special frame called discovery frame, which spreads through the entire network
using all possible paths to destination.
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, that makes it very
efficient as it does not forward packets that have errors and forward good packets selectively to
correct port only. In other words, switch divides collision domain of hosts, but broadcast domain
remainssame
5. Routers – A router is a device like a switch that routes data packets based on their IP
addresses. Router is mainly a Network Layer device. Routers normally connect LANs and
WANs together and have a dynamically updating routing table based on which they make
decisions on routing the data packets. Router divide broadcast domains of hosts connected
through it.
6. Gateway – A gateway, as the name suggests, is a passage to connect two networks together that may
work upon different networking models. They basically work as the messenger agents that take data from
one system, interpret it, and transfer it to another system. Gateways are also called protocol converters
and can operate at any network layer. Gateways are generally more complex than switch or router.
ROUTING ALGORITHMS
A Routing Algorithm is a method for determining the routing of packets in a node. For each node of a
network, the algorithm determines a routing table, which in each destination, matches an output line. The
algorithm should lead to a consistent routing, that is to say without loop. This means that you should not
route a packet a node to another node that could send back the package.
There are three main types of routing algorithms:
1. Distance Vector (distance-vector routing);
2. To link state (link state routing);
3. Path to vector (path-vector routing).
1. Distance Vector Routing.
A distance-vector routing (DVR) protocol requires that a router inform its neighbors of topology changes
periodically. Historically known as the old ARPANET routing algorithm. Each router maintains a
Distance Vector table containing the distance between itself and ALL possible destination nodes.
Distances, based on a chosen metric, are computed using information from the neighbors’ distance
vectors.
Information kept by DV router -
Each router has an ID
Associated with each link connected to a router,
there is a link cost (static or dynamic).
Intermediate hops
Distance Vector Table Initialization -
Distance to itself = 0
Distance to ALL other routers = infinity number.
Consider 3-routers X, Y and Z as shown in figure. Each router have their routing table. Every routing
table will contain distance to the destination nodes.
Consider router X , X will share it routing table to neighbors and neighbors will share it routing table to it
to X and distance from node X to destination will be calculated using bellmen- ford equation.
As we can see that distance will be less going from X to Z when Y is intermediate node(hop) so it will be
update in routing table X.
Similarly for Z also
Finally the routing table for all –
Advantages of Distance Vector routing –
It is simpler to configure and maintain than link state routing.
Disadvantages of Distance Vector routing –
It is slower to converge than link state.
It is at risk from the count-to-infinity problem.
For larger networks, distance vector routing results in larger routing tables than link state since
each router must know about all other routers.
Link State Routing
Link state routing is the second family of routing protocols. While distance vector routers use a
distributed algorithm to compute their routing tables, link-state routing uses link-state routers to exchange
messages that allow each router to learn the entire network topology. Based on this learned topology,
each router is then able to compute its routing table by using a shortest path computation.
Features of link state routing protocols –
Link state packet – A small packet that contains routing information.
Link state database – A collection information gathered from link state packet.
Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the database
results into shortest path
Routing table – A list of known paths and interfaces.
Calculation of shortest path –
To find shortest path, each node need to run the famous Dijkstra algorithm. This famous algorithm uses
the following steps:
Step-1: The node is taken and chosen as a root node of the tree, this creates the tree with a single node,
and now set the total cost of each node to some value based on the information in Link State Database
Step-2: Now the node selects one node, among all the nodes not in the tree like structure, which is nearest
to the root, and adds this to the tree.The shape of the tree gets changed .
Step-3: After this node is added to the tree, the cost of all the nodes not in the tree needs to be updated
because the paths may have been changed.
Step-4: The node repeats the Step 2. and Step 3. until all the nodes are added in the tree
Link State protocols in comparison to Distance Vector protocols have:
1. It requires large amount of memory.
2. Shortest path computations require many CPU circles.
3. If network use the little bandwidth ; it quickly reacts to topology changes
4. All items in the database must be sent to neighbors to form link state packets.
5. All neighbors must be trusted in the topology.
6. Authentication mechanisms can be used to avoid undesired adjacency and problems.
7. No split horizon techniques are possible in the link state routing.