Professional Documents
Culture Documents
Unit-3
Network Layer
Point to point networks:
Point-to-point is a form of network providing a direct route from one fixed point to another.
In this type of communication, there exists a dedicated link between two nodes. In this point to
point communication, there is one transmitter and one receiver which collectively refers to this
type of communication system.
In this type of system, the smallest distance has utmost importance to reach the receiver
terminal. Here, the communication gives security and privacy to the transmitted signal because
the channel of communication is not shared.
An example is a telephone call, in which one telephone is connected to another, and only the
other can hear what is said by one caller. This is contrasted with a topology of point-to -
multipoint or communication broadcast, in which many nodes can receive information
transmitted by one node. Many examples of point-to - point communications networks include
leased wires, microwave relay links and two-way radio. Radio and television broadcasting are
examples of point to multipoint communication systems.
The Point to Point Protocol (PPP) is used to create direct communication between two nodes in
the network. It authenticates the connections, compresses them and transmits them after
encryption, thus giving privacy. PPP is designed primarily to link two networks and to carry IP
packets between the two. The connections are able to have bidirectional functions
simultaneously, transmitting data packets in a particular order. This protocol is a growing
solution for connecting various types of hosts, bridges, and routers with ease.
Note: A point-to-point link is a dedicated communication connection between two systems or
processes. Only think of a wire that links two devices directly. The devices solely use the wire
for contact. Broadcasting is the opposite of point-to - point communication, where one device
transmits to many.
Network Layer:
• Network layer is responsible for host to host delivery and for routing mechanism.
• It adds a logical address that is source and destination address as a part of IP header to the
segment coming from above Transport Layer.
Logical Addressing:
The logical addresses added by Network layer are known as IP address, it can be either IPv4 or
IPv6.
IPv4 Addresses:
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a
device. These addresses are unique in the sense that each address defines one, and only one,
connection to the internet.
Address Space:
It defines the range of addresses used by the protocol. Each networking devices will get a
address from this address space.
Since IPv4 address is a 32 bit in size, hence the total number of address possible is: 232 =
4,294,967,296. This means theoretically 4 billion devices can be connected to internet, but
practically this number is way less because of some restrictions.
In this format, an IP address is represented as 4 octet, each octet of 8 bits(1 bytes) and are
separated with a decimal point(dot).
Example:
192.168.0.1
Binary Notation:
Example:
Classful Addressing:
• Classful Addressing, the address space is divided into five classes: A, B, C, D and E. Each class
has has some part of the address space.
• Class A, B, C are mostly used for unicast communication where as class D is for multicast
communication and class E is reserved.
Range of each class of IP address:
Subnet Mask:
It is also 32 bit address which is used to distinguish the host part and network part of an IP
address.
Class B: 255.255.0.0
Class C: 255.255.255.0
Class D: 255.255.255.255
Example1: If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the
maximum number of hosts per subnet?
Solution:
255.255.248.0 = 11111111.11111111.11111000.00000000
Since 11 bit(number of 0) as a host id given, then number of IP Address are available =211
We can find
• Connectivity
• Reliability
• Network Management
• Flexibility
Protocols present in Internetworking:
• IP(Internet Protocol)
The Internet Protocol (IP) is a protocol, or set of rules, for routing and addressing packets of
data so that they can travel across networks and arrive at the correct destination. Data
traversing the Internet is divided into smaller pieces, called packets. IP information is attached
to each packet, and this information helps routers to send packets to the right place. Every
device or domain that connects to the Internet is assigned an IP address, and as packets are
directed to the IP address attached to them, data arrives where it is needed.
Working of IP:
An IP address is a unique identifier assigned to a device or domain that connects to the
Internet. Each IP address is a series of characters, such as '192.168.1.1'. Via DNS resolvers,
which translate human-readable domain names into IP addresses, users are able to access
websites without memorizing this complex series of characters. Each IP packet will contain both
the IP address of the device or domain sending the packet and the IP address of the intended
recipient, much like how both the destination address and the return address are included on a
piece of mail.
Routing metrics and costs are used for determining the best route to the destination. The factors
used by the protocols to determine the shortest path, these factors are known as a metric.
Metrics are the network variables used to determine the best route to the destination. For some
protocols use the static metrics means that their value cannot be changed and for some other
routing protocols use the dynamic metrics means that their value can be assigned by the system
administrator.
The most common metric values are given below:
o Hop count: Hop count is defined as a metric that specifies the number of passes through
internetworking devices such as a router, a packet must travel in a route to move from
source to the destination. If the routing protocol considers the hop as a primary metric
value, then the path with the least hop count will be considered as the best path to move
from source to the destination.
o Delay: It is a time taken by the router to process, queue and transmit a datagram to an
interface. The protocols use this metric to determine the delay values for all the links
along the path end-to-end. The path having the lowest delay value will be considered as
the best path.
o Bandwidth: The capacity of the link is known as a bandwidth of the link. The bandwidth
is measured in terms of bits per second. The link that has a higher transfer rate like gigabit
is preferred over the link that has the lower capacity like 56 kb. The protocol will
determine the bandwidth capacity for all the links along the path, and the overall higher
bandwidth will be considered as the best route.
o Load: Load refers to the degree to which the network resource such as a router or
network link is busy. A Load can be calculated in a variety of ways such as CPU utilization,
packets processed per second. If the traffic increases, then the load value will also be
increased. The load value changes with respect to the change in the traffic.
o Reliability: Reliability is a metric factor may be composed of a fixed value. It depends on
the network links, and its value is measured dynamically. Some networks go down more
often than others. After network failure, some network links repaired more easily than
other network links. Any reliability factor can be considered for the assignment of
reliability ratings, which are generally numeric values assigned by the system
administrator.
Types of Routing
Routing can be classified into three categories:
o Static Routing
o Default Routing
o Dynamic Routing
Static Routing
o Static Routing is also known as Non adaptive Routing.
o It is a technique in which the administrator manually adds the routes in a routing table.
o A Router can send the packets for the destination along the route defined by the
administrator.
o In this technique, routing decisions are not made based on the condition or topology of
the networks
Advantages of Static Routing
Following are the advantages of Static Routing:
o No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the cheaper
router can be used to obtain static routing.
o Bandwidth: It has not bandwidth usage between the routers.
o Security: It provides security as the system administrator is allowed only to have control
over the routing to a particular network.
Disadvantages of Static Routing:
Following are the disadvantages of Static Routing:
o For a large network, it becomes a very difficult task to add each route manually to the
routing table.
o The system administrator should have a good knowledge of a topology as he has to add
each route manually.
Default Routing
o Default Routing is a technique in which a router is configured to send all the packets to
the same hop device, and it doesn't matter whether it belongs to a particular network or
not. A Packet is transmitted to the device for which it is configured in default routing.
o Default Routing is used when networks deal with the single exit point.
o It is also useful when the bulk of transmission networks have to transmit the data to the
same hp device.
o When a specific route is mentioned in the routing table, the router will choose the specific
route rather than the default route. The default route is chosen only when a specific route
is not mentioned in the routing table.
Dynamic Routing
o It is also known as Adaptive Routing.
o It is a technique in which a router adds a new route in the routing table for each packet
in response to the changes in the condition or topology of the network.
o Dynamic protocols are used to discover the new routes to reach the destination.
o In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
o If any route goes down, then the automatic adjustment will be made to reach the
destination.
The Dynamic protocol should have the following features:
o All the routers must have the same dynamic routing protocol in order to exchange the
routes.
o If the router discovers any change in the condition or topology, then router broadcast this
information to all other routers.
Advantages of Dynamic Routing:
o It is easier to configure.
o It is more effective in selecting the best route in response to the changes in the condition
or topology.
Disadvantages of Dynamic Routing:
o It is more expensive in terms of CPU and bandwidth usage.
o It is less secure as compared to default and static routing.
Forwarding:
When a packet arrives at a router’s input link, the router must move the packet to the
appropriate output link. For example, a packet arriving from Host H1 to Router R1 must be
forwarded to the next router on a path to H2. Forwarding refers to the router-local action of
transferring packet from an input link interface to the appropriate output link interface.
Routing
The network layer must determine the route or path taken by packets as they flow from a
sender to a receiver. The algorithms that calculate these paths are referred to as routing
algorithms. A routing algorithm would determine, for example, the path along which packets
flow from H1 to H2. Routing refers to the network-wide process that determines the end-to-
end paths that packets take from source to destination.
Every router has a forwarding table. A router forward a packet by examining the value of a field
in the arriving packet’s header, and then using this header value to index into the router’s
forwarding table. The value stored in the forwarding table entry for that header indicates the
router’s outgoing link interface to which the packet is to be forwarded.
Depending on the network layer protocol, the header value could be the destination address of
the packet or an indication of the connection to which the packet belongs.
Figure below provides an example.
In the above figure, a packet with a header field value of 0111 arrives to a router. The router
indexes into its forwarding table and determines that the output link interface for this packet is
interface 2. The router then internally forwards the packet to interface 2.
You might be wondering how the forwarding tables in the routers are configured. This is a
critical issue, one that exposes the important interplay between routing and forwarding.
As shown in the figure above, the routing algorithm determines the values that are inserted
into the routers’ forwarding tables. The routing algorithm may be centralized (e.g. with an
algorithm executing on a central site and downloading routing information to each of the
routers) or decentralized (i.e. with a piece of the distributed routing algorithm running in each
router). In either case, a router receives routing protocol messages, which are used to configure
its forwarding table. The distinct and different purposes of the forwarding and routing functions
can be further illustrated by considering the hypothetical (and unrealistic, but technically
feasible) case of a network in which all forwarding tables are configures directly by human
operators physically present at the routers. In this case, no routing protocols would be
required! Of course, the human operators would need to interact with each other to ensure
that the forwarding tables were configured in such a way that packets reached their intended
destinations. It’s also likely that human configuration would be more error-prone and much
slower to respond to changes in the network topology than a routing protocol. We’re thus
fortunate that all networks have both a forwarding and a routing function!
Routing Algorithm:
A routing algorithm is a procedure that lays down the route or path to transfer data packets
from source to the destination. They help in directing Internet traffic efficiently. After a data
packet leaves its source, it can choose among the many different paths to reach its destination.
Routing algorithm mathematically computes the best path, i.e. “least – cost path” that the
packet can be routed through.
Types of Routing Algorithms
Routing algorithms can be broadly categorized into two types, adaptive and non adaptive
routing algorithms. They can be further categorized as shown in the following diagram –
Adaptive Routing Algorithms:
Adaptive routing algorithms, also known as dynamic routing algorithms, makes routing decisions
dynamically depending on the network conditions. It constructs the routing table depending
upon the network traffic and topology. They try to compute the optimized route depending upon
the hop count, transit time and distance.
The three popular types of adaptive routing algorithms are −
• Centralized algorithm − It finds the least-cost path between source and destination nodes
by using global knowledge about the network. So, it is also known as global routing
algorithm.
• Isolated algorithm − This algorithm procures the routing information by using local
information instead of gathering information from other nodes.
• Distributed algorithm − This is a decentralized algorithm that computes the least-cost path
between source and destination iteratively in a distributed manner.
Imagine a bucket with a small hole in the bottom.No matter at what rate water enters the
bucket, the outflow is at constant rate.When the bucket is full with water additional water
entering spills over the sides and is lost.
Similarly, each network interface contains a leaky bucket and the following steps are involved
in leaky bucket algorithm:
1) When host wants to send packet, packet is thrown into the bucket.
2) The bucket leaks at a constant rate, meaning the network interface transmits
packets at a constant rate.
3) Bursty traffic is converted to a uniform traffic by the leaky bucket.
4) In practice the bucket is a finite queue that outputs at a finite rate.
Token bucket Algorithm:
• The leaky bucket algorithm has a rigid output design at an average rate independent
of the bursty traffic.
• In some applications, when large bursts arrive, the output is allowed to speed up. This
calls for a more flexible algorithm, preferably one that never loses information.
• Therefore, a token bucket algorithm finds its uses in network traffic shaping or rate-
limiting.
• It is a control algorithm that indicates when traffic should be sent. This order comes
based on the display of tokens in the bucket.
• The bucket contains tokens. Each of the tokens defines a packet of predetermined
size. Tokens in the bucket are deleted for the ability to share a packet.
• When tokens are shown, a flow to transmit traffic appears in the display of tokens.
• No token means no flow sends its packets. Hence, a flow transfers traffic up to its
peak burst rate in good tokens in the bucket.