SlideShare a Scribd company logo
Network layer
Network Layer Design Issues
• Network Layer is concerned with routing packets from
source to destination.
• To route packets it should know the topology of the
network.
• Then it should choose the path to route packet.
• If source and destination are on the different network,
the issue arises.
• These issues include the service provided to the
transport layer and the internal design of the network.
Store and Forward Packet switching:
• Routers are the devices used for routing packets and
these are connected by transmission lines.
• A host with a packet to send transmits it to the nearest
router, either on its own LAN or over a point-to-point link
to the ISP.
• The packet is stored there until it has fully arrived and the
link has finished its processing by verifying the checksum.
• Then it is forwarded to the next router along the path
until it reaches the destination host, where it is delivered.
• This mechanism is store-and-forward packet switching.
Services provided to the Transport Layer:
• The services need to be carefully designed with the
following goals in mind:
• The services should be independent of the router
technology.
• The transport layer should be shielded from the number, type,
and topology of the routers present.
• The network addresses made available to the transport layer
should use a uniform numbering plan.
• The discussion centers on whether the network layer should
provide connection-oriented service or connectionless service.
• It camp argues that the network service should be
connectionless, with primitives SEND PACKET and RECEIVE
PACKET and little else.
• No packet ordering and flow control should be done, because
the hosts are going to do that anyway and there is usually little
to be gained by doing it twice.
• The other camp (represented by the telephone companies)
argues that the network should provide a reliable, connection-
oriented service to support QoS to transfer
• Real time data such as audio and video.
Implementation of Connection-less service:
• If connectionless service is offered, packets are injected into
the network individually and routed independently of each
other.
• No advance setup is needed.
• In this context, the packets are frequently called datagrams
(in analogy with telegrams) and the network is called a
datagram network.
• If connection-oriented service is used, a path from the
source router all the way to the destination router must be
established before any data packets can be sent.
• This connection is called a VC (virtual circuit) in analogy with
the physical circuits set up by the telephone system, and the
network is called a virtual-circuit network.
• Suppose that the process P1 has a long message for P2.
• It hands the message to the transport layer, with
instructions to deliver it to process P2 on host H2.
• The transport layer adds header to the front of the
message and hands the result to the network layer.
• Let us assume that the message is four times longer than
the maximum packet size.
• So network layer has to break it into four packets, 1, 2, 3,
and 4, and send each of them in turn to router A using
some point-to-point protocol.
• At A, packets 1, 2, and 3 are stored briefly, having arrived
on the incoming link and had their checksums verified.
• Then each packet is forwarded according to A’s routing
table, onto the outgoing link to C.
• A decided to send packet 4 via a different route than that of
the first three packets.
• As it has learned of a traffic jam somewhere along the ACE
path and updated its routing table, as shown under the
label ‘‘later.’’
• The algorithm that manages the tables and makes the
routing decisions is called the routing algorithm.
• Each packet carries a destination IP address that routers use
to individually forward each packet.
• The addresses are 32 bits in IPv4 packets and 128 bits in
IPv6 packets.
Implementation of Connection oriented service:
• For connection-oriented service, we need a virtual-circuit
network.
• The idea behind virtual circuits is to avoid having to choose
a new route for every packet sent.
• When a connection is established, a route from the source
machine to the destination machine is chosen and stored
in tables inside the routers.
• That route is used for all traffic flowing over the
connection, exactly the same way that the telephone
system works.
• When the connection is released, the virtual circuit is also
terminated.
• With connection-oriented service, each packet carries an
identifier telling which virtual circuit it belongs to.
• Consider that host H1 has established connection 1 with
host H2.
• This connection is remembered as the first entry in each of
the routing tables.
• The first line of A’s table says that if a packet bearing
connection identifier 1 comes in from H1, it is to be sent to
router C and given connection identifier 1.
• Similarly, the first entry at C routes the packet to E, also
with connection identifier 1.
• If H3 also wants to establish a connection to H2, it chooses
a connection with identifier 2 as it should distinguish data
from H1 and H3.
Routing Algorithms
• The routing algorithm is a part of the network layer
software.
• It is responsible for deciding which output line an incoming
packet should be transmitted on.
• If the network uses datagrams internally, this decision must
be made for every arriving data packet since the best route
may have changed since last time.
• If the network uses virtual circuits internally, routing
decisions are made only when a new virtual circuit is being
set up.
• Thereafter, data packets just follow the already established
route.
• The latter case is sometimes called session routing because
a route remains same for an entire session.
• A router has two processes inside it.
• One of them handles each packet as it arrives, looking up
the outgoing line to use for it in the routing tables. This
process is forwarding.
• The other process is responsible for filling in and updating
the routing table.
Properties of Routing Algorithm:
• Regardless of whether routes are chosen independently for
each packet sent or only when new connections are
established, certain properties are desirable in a routing
algorithm.
• Correctness, Simplicity, Robustness, Stability, Fairness, and
Efficiency.
Correctness:
• Routing algorithm must provide results correctly.
Simplicity:
• Routing algorithm must be simple and easy to understand.
Efficiency:
• Algorithm must be efficient.
Stability:
• A stable algorithm reaches equilibrium and stays there.
• It should converge quickly too, since communication may
be disrupted.
Fairness and Robustness:
• Algorithm must take decisions fair and robust.
Types of Routing Algorithm:
• Adaptive
• Non-Adaptive
Non-Adaptive Routing Algorithms:
• Routing decision is not based on current topology and
traffic.
• Choice of the route to use is computed in advance, off-line,
and downloaded to the routers when the network is
booted.
• This procedure is called static routing.
• It does not respond to failures.
• Static routing is mostly useful for situations in which the
routing choice is clear.
Adaptive Routing Algorithms:
• Adaptive algorithms, change their routing decisions to
reflect changes in the topology, and sometimes changes
in the traffic as well.
• These dynamic routing algorithms differ in where they
get their information (e.g., locally, from adjacent routers,
or from all routers) when they change the routes.
The Optimality Principle:
• It gives general statement about optimal routes without
regard to network topology or traffic.
• It states that if router J is on the optimal path from
router I to router K, then the optimal path from J to K
also falls along the same route.
• Let us suppose that part of the route from I to J as r 1
and the rest of the route as r 2.
• If a route better than r 2 existed from J to K, it could be
concatenated with r 1 to improve the route from I to K,
contradicting our statement that r 1r 2 is optimal.
Sink Tree:
• The set of optimal routes from all sources to a given
destination form a tree rooted at the destination.
Such a tree is called a sink tree.
• The goal of all routing algorithms is to discover and
use the sink trees for all route.
• A sink tree is a tree, it does not contain any loops, so
each packet will be delivered within a finite and
bounded number of hops.
• Optimality principle and the sink tree provide a benchmark
against which other routing algorithms can be measured.
Example of Static Routing Algorithms :
<<1. Shortest Path Routing>> <<Refer Text Book: Tanenbaum>>
2. Flooding:
• When a routing algorithm is implemented, each router
must make decisions based on local knowledge, not the
complete picture of the network.
• A simple local technique is flooding, in which every
incoming packet is sent out on every outgoing line except
the one it arrived on.
Disadvantage:
• Flooding generates vast numbers of duplicate packets.
Solution1:
• To have a hop counter contained in the header of each
packet.
• It is decremented at each hop and the packet will be
discarded when the counter reaches zero.
• The hop counter should be initialized to the length of the
path from source to destination.
• If the sender does not know how long the path is, it can
initialize the counter to the worst case, namely, the full
diameter of the network.
• Hop count can produce an exponential number of
duplicate packets .
Solution2:
• To have routers keep track of which packets have been
flooded, to avoid sending them out a second time.
• This can be achieved by having a sequence number in each
packet put by source router when it receives from its hosts.
• Each router then needs a list per source router telling
which sequence numbers originating at that source have
already been seen.
• If an incoming packet is on the list, it is not flooded.
• To prevent the list from growing without bound, each list
should be augmented by a counter, k, meaning that all
sequence numbers through k have been seen.
• When a packet comes in, it is easy to check if the packet
has already been flooded by comparing its sequence
number ; if so, it is discarded.
Disadvantages:
• Flooding is not practical for sending most packets.
• This may be wasteful if there is a single destination that needs
the packet, but it is effective for broadcasting information.
Advantages:
• Flooding is tremendously robust and requires only a small set
up.
• Flooding is the building block for other routing algorithms.
• Flooding always chooses the shortest path from every possible
path.
Dynamic Routing Algorithms:
• Computer networks generally use dynamic routing algorithms
• These are more complex than flooding, but more efficient
because they find shortest paths for the current topology.
• Two dynamic algorithms which are popular include distance
vector routing and link state routing.
Distance Vector Routing
• A distance vector routing algorithm operates by having each
router maintains a table (i.e., a vector).
• It gives the best known distance to each destination and the link to
use to get there.
• These tables are updated by exchanging information with the
neighbours.
• Eventually, every router knows the best link to reach each
destination.
• The distance vector routing algorithm is also called Bellman-Ford
routing algorithm.
• Each router maintains a routing table and has one entry for each
router in the network.
• This entry has two parts: the preferred outgoing line to use for
that destination and an estimate of the distance to that destination.
• The distance might be measured as the number of hops or using
another metric can be chosen.
• Example: Assume that delay is used as a metric and that the
router knows the delay to each of its neighbours.
• <<Refer Text Book for Example>>
Link State Routing
• Distance vector routing was replaced by link state routing as the
algorithm took too long to converge after the network topology
changed.
• The routing algorithms are most widely used inside large networks
and the Internet today.
• The algorithm can be stated as five parts.
• Each router must do the following things to make it work:
– Discover its neighbours and learn their network
addresses.
– Set the distance or cost metric to each of its neighbours.
– Construct a packet using this information.
– Send this packet to and receive packets from all other
routers.
– Compute the shortest path to every other router.
• The complete topology is distributed to every router. Then
Dijkstra’s algorithm can be run at each router to find the shortest
path to every other router.
Learning about the Neighbours:
• When a router is booted, its first task is to learn who its
neighbours are.
• It accomplishes this goal by sending a special HELLO packet on
each point-to-point line.
• The router on the other end is expected to send back a reply
giving its name.
• Name must be globally unique.
• When two or more routers are connected by a broadcast
link (e.g., a switch, ring, or classic Ethernet), the situation
is slightly more complicated.
• It increases the size of the topology and leads to wasteful
messages.
• A better way to model the LAN is to consider it as a node
itself.
• One designated router on the LAN is selected to play the
role of N in the routing protocol.
Setting Link Costs:
• The link state routing algorithm requires each link to have a
distance or cost metric for finding shortest paths.
• The cost to reach neighbours can be set automatically, or
configured by the network operator.
• A common choice is to make the cost inversely
proportional to the bandwidth of the link.
• For example, 1-Gbps Ethernet may have a cost of 1 and
100-Mbps Ethernet a cost of 10.
• Delay of the link also incurs cost.
• The most direct way to determine this delay is to send over
the line a special ECHO packet.
• The other side is required to send back the ECHO packet
immediately.
• By measuring the round-trip time and dividing it by two,
the sending router can get a reasonable estimate of the
delay.
Building Link State Packets:
• Once the information needed for the exchange has been
collected, the next step is for each router to build a packet
containing all the data.
• The packet starts with the identity of the sender, followed
by a sequence number and age and a list of neighbours.
• Building the link state packets is easy.
• The hard part is determining when to build them.
• One possibility is to build them periodically, that is, at
regular intervals.
• Another possibility is to build them when some significant
event occurs.
• Eg: A line or neighbour going down or coming back up
again or changing its properties appreciably.
Distributing the Link State Packets:
• The fundamental idea is to use flooding to distribute the link
state packets to all routers.
• To keep the flood in check, each packet contains a sequence
number that is incremented for each new packet sent.
• When a new link state packet comes in, it is checked
whether it is new, it is forwarded on all lines except the one
it arrived on.
• If it is a duplicate, it is discarded.
• If a packet with a sequence number lower than the highest
one seen so far ever arrives, it is rejected as being obsolete
as the router has more recent data.
Problems in using sequence number:
• Router should decide when the sequence number should
wrap.
• If a router crashes, it will lose track of its sequence number.
If it starts again at 0, the next packet it sends will be rejected
as a duplicate.
• If a sequence number is corrupted and 65,540 is received
instead of 4 (a 1-bit error), packets 5 through 65,540 will be
rejected as obsolete.
• The solution to all these problems is to include the age of
each packet after the sequence number and decrement it
once per second.
• When the age hits zero, the information from that router is
discarded.
• To guard against errors on the links, all link state packets are
acknowledged.
• The table records where the packet originated, its sequence
number and age, and the data.
• In addition, there are send and acknowledgement flags for each of
B’s three links (to A, C, and F, respectively). The send flags mean
that the packet must be sent on the indicated link. The
acknowledgement flags mean that it must be acknowledged there.
• The send flags mean that the packet must be sent on the indicated
link. The acknowledgement flags mean that it must be
acknowledged there.
Computing the New Routes:
• Once a router has accumulated a full set of link state
packets, it can construct the entire network graph because
every link is represented.
• The shortest-path computations may then find different
paths from router A to B than from router B to A.
<<Traffic Management in Networking>>
• Congestion
• Approaches to Congestion Control
• Refer Text Book
Internetworking
• internetwork is the interconnection of various networks.
• If these networks are homogenous, they use same protocols for
communication.
• If the networks are different such as Ethernet, Mobile Network,
etc., then the following issues may arise.
– Scaling is the issue as the internetwork grows larger
– Heterogeneity is another issue as the packet format, modulation
techniques, maximum packet size used by one network may differ
from other network.
– If one network has strong QoS and the other offers best effort
service, it is impossible to make bandwidth and delay guarantees
for real-time traffic end to end.
– Security mechanisms are problematic.
How Networks differ?
Differences Description
Service offered Connectionless versus connection oriented
Addressing Different sizes, flat or hierarchical
Broadcasting Present or absent (also multicast)
Packet size Every network has its own maximum
Ordering Ordered and unordered delivery
Quality of service Present or absent; many different kinds
Reliability Different levels of loss
Security Privacy rules, encryption, etc
Parameters Different timeouts, flow specifications, etc.
Accounting By connect time, packet, byte, or not at all
How Networks can be connected?
• Two basic choices
– Build a device that translates packets from one network into
another network
– Building a common layer on top of the different networks
• IP provides a universal packet format that all routers recognize
and that can be passed through almost every network.
• Repeaters and hubs just move bits from one wire to another.
• Bridges and switches operate at the link layer. They can be used
to build networks.
• Routers operate at the network layer used to interconnect
devices.
• Consider that there are three dissimilar networks, 802.11,
MPLS Network, Ethernet.
• 802.11 is connection less, MPLS is connection oriented,
Ethernet.
• In MPLS, a virtual circuit must be set up to cross that
network.
• Once the packet has travelled along the virtual circuit, it will
reach the Ethernet network.
• Since 802.11 can work with larger frames than Ethernet, the
packet may be too large to be carried,.
• To handle this problem, the packet is divided into fragments,
and each fragment is sent separately.
• When the fragments reach the destination, they are
reassembled.
• Then the packet has completed its journey.
Network and Link Layer Protocol Processing:
• The source (802.11)accepts data from the transport layer
and generates a packet with IP header in Network Layer.
• IP header has destination address which is used to determine
that the packet must be sent via the first router.
• IP packet is encapsulated in 802.11 frame and sent to the
router.
• At the router, the packet frame is removed.
• The router now examines the IP address in the packet and
looks up this address in its routing table.
• Based on this address, it decides to send the packet to the
second router next.
• At this part , an MPLS virtual circuit must be established to
the second router.
• IP packet must be encapsulated with MPLS headers and
routed.
• At the far end, the MPLS header is discarded and the
network address is again verified to find the next network
layer hop.
• It is the destination itself.
• Since the packet is too long to be sent over Ethernet, it is
split into two portions.
• Each of these portions is put into the data field of an
Ethernet frame and sent to the Ethernet address of the
destination.
• At the destination, the Ethernet header is removed from each
of the frames, and the contents are reassembled.
• Internetworking has been very successful at building large
networks, but it only works when there is a common network
Tunneling:
• Making two different networks interwork is more difficult.
Example:
• Consider that an international bank is with an IPv6 network in
Paris, an IPv6 network in London.
• These two offices are connected via the IPv4 Internet.
• The solution to this problem is a technique called tunneling.
• To send an IP packet to a host in the London office, a host in the
Paris office constructs the packet containing an IPv6 address in
London.
• It sends it to the multiprotocol router that connects the Paris
IPv6 network to the IPv4 Internet.
• The router puts a (IPv6) packet inside a (IPv4) packet.
• When this wrapped packet arrives, the London router removes
IPv4 packet.
• The original IPv6 packet is sent to the destination host.
• The path through the IPv4 Internet can be seen as a big
tunnel extending from one multiprotocol router to the other.
• The IPv6 packet travels from one end of the tunnel to the
other, snug in its nice box.
Example:
• Consider a person driving her car from Paris to London.
• Within France, the car moves under its own power until it
hits the English Channel.
• Cars are not permitted to drive through the Channel.
• It is loaded onto a high-speed train and transported through
railroad carriage to England.
• Effectively, the car is being carried as freight, as depicted in
figure.
• At the far end, the car is let loose on the English roads and
once again continues to move under its own power.
• Tunneling of packets through a foreign network works the
same way.
Internetwork Routing:
• The networks may internally use different routing
algorithms.
• Networks run by different operators and they have different
ideas about routing.
• One may need shortest path, other may need inexpensive
route etc.,
• one operator may not want another operator to know the
details of the paths in its network as they are sensitive.
• All of these considerations lead to a two-levels of routing
algorithms.
• Within each network, an intra domain or interior gateway
protocol is used for routing. (RIP, OSPF)
• Across the networks that make up the internet, an inter
domain or exterior gateway protocol is used. (BGP).
Packet Fragmentation:
• Maximum payloads for Ethernet are 1500 bytes and 2272
bytes for 802.11. IP is more generous, allows for packets as
big as 65,515 bytes.
• If packets are larger, it reduces packet overheads such as
bandwidth wasted on header bytes.
• If packets are smaller, overhead is high.
• A source does not usually know the path a packet will take
through the network to a destination,.
• So it certainly does not know how small packets must be to
get there.
• This packet size is called the Path MTU (Path Maximum
Transmission Unit).
• Even if the source knows the path MTU, packets are routed
independently in a connectionless network such as the
Internet.
• This routing means that paths may suddenly change, which
can unexpectedly change the path MTU.
• The solution to the problem is to allow routers to break up
packets into fragments, sending each fragment as a separate
network layer packet.
Types of Fragmentation:
– Transparent Fragmentation
– Non transparent Fragmentation
• Transparent Fragmentation allows the packet to be
fragmented and reassembled at every router.
• Each fragment is addressed to the same destination.
• Exit router must know when it has received all the pieces, so
either a count field or an ‘‘end of packet’’ bit must be provided.
• Non transparent Fragmentation does not allow recombining
fragments at any intermediate routers.
• Once a packet has been fragmented, each fragment is treated
as original packet.
• The routers pass the fragments, and reassembly is performed
only at the destination host.
Example:
• Fragmentation when the elementary data size is 1 byte.
• Original packet contains 10 data bytes.
• It is fragmented into two packets of size 8, 2 bytes when
passing through a network which supports MTU of 8 bytes.
• It is fragmented into two packets of size 5 bytes each when
passing through a network which supports MTU of 5 bytes.
• Each Fragment has packet number, Number of first Elementary
fragments, End of packet bit.
Solution to get rid of Fragmentation:
• It is called Maximum Transmission Unit (MTU) Path Discovery
• Each IP packet is sent with its header bits set to indicate that no
fragmentation is allowed to be performed.
• If a router receives a packet that is too large, it generates an
error packet, returns it to the source, and drops the packet.
• When the source receives the error packet, it uses the
information inside to refragment the packet into pieces that
are small enough for the router to handle.
Advantages:
• Source knows what length packet to send.
• If the routes and path MTU change, new error packets will
be triggered and the source will adapt to the new path.
• Fragmentation is needed between the source and the
destination unless the higher layers learn the path MTU.
Disadvantages:
• Start up delays added
• Better design needed to truncate packets at each router when
MTU exceeds.

More Related Content

PPTX
Module 3 Part B - computer networks module 2 ppt
anushaj46
 
PDF
4af46e43-4dc7-4b54-ba8b-3a2594bb5269 j.pdf
mrcopyxerox
 
PPTX
Network Layer
reshmadayma
 
PPTX
NETWORK LAYER PRESENTATION IP ADDRESSING UNIT-3.pptx
troqia
 
PPTX
Computer networks for cse Unit-3 (1).pptx
pkumarnptl
 
PPT
Network Layer
Ghaffar Khan
 
PPTX
Network layer new
reshmadayma
 
PPTX
Network Layer
reshmadayma
 
Module 3 Part B - computer networks module 2 ppt
anushaj46
 
4af46e43-4dc7-4b54-ba8b-3a2594bb5269 j.pdf
mrcopyxerox
 
Network Layer
reshmadayma
 
NETWORK LAYER PRESENTATION IP ADDRESSING UNIT-3.pptx
troqia
 
Computer networks for cse Unit-3 (1).pptx
pkumarnptl
 
Network Layer
Ghaffar Khan
 
Network layer new
reshmadayma
 
Network Layer
reshmadayma
 

Similar to Computer Networks-Network layer Concepts (20)

PPT
Unit-3-Part-1 [Autosaved].ppt
Ramya Nellutla
 
PPT
Network layer
TharuniDiddekunta
 
PDF
Computer Network Unit IV - Lecture Notes - Network Layer
Murugan146644
 
PPTX
CN-UNIT-3 __Network Layer (2).pptx
BhagyasriAppana
 
PPT
network layer full chapter_ready.ppt
ajithkumar996503
 
PPT
Network Layer,Computer Networks
guesta81d4b
 
PPTX
Network layer u3
IndrajaMeghavathula
 
PPT
NETWORK LAYER.ppt
DrTThendralCompSci
 
PDF
CN R16 -UNIT-5.pdf
Joshuaeeda1
 
PDF
Network layer (Unit 3) part1.pdf
BharatiPatelPhDStude
 
PDF
COMPUTER NETWORKS CHAPTER 3 NETWORK LAYER NOTES CSE 3RD year sem 1
aishwaryaarrao3
 
PPTX
VY NETWORK LAYER 66j6jPART 1 3r324 25.pptx
darade4651
 
PPT
routing algorithms in computer Networks.ppt
richagairola2
 
PPT
Routing
Amit Pandey
 
PPTX
Network layer
Hasib Shaikh
 
PPT
B21DA0201_03.ppt
DrPreethiD1
 
PPT
QSpiders - Good to Know Network Concepts
Qspiders - Software Testing Training Institute
 
PDF
Ip protocol tedting
H K
 
PPTX
routing in computer networks for btech.pptx
RohanRathi17
 
PPTX
Computer networks network layer,routing
Deepak John
 
Unit-3-Part-1 [Autosaved].ppt
Ramya Nellutla
 
Network layer
TharuniDiddekunta
 
Computer Network Unit IV - Lecture Notes - Network Layer
Murugan146644
 
CN-UNIT-3 __Network Layer (2).pptx
BhagyasriAppana
 
network layer full chapter_ready.ppt
ajithkumar996503
 
Network Layer,Computer Networks
guesta81d4b
 
Network layer u3
IndrajaMeghavathula
 
NETWORK LAYER.ppt
DrTThendralCompSci
 
CN R16 -UNIT-5.pdf
Joshuaeeda1
 
Network layer (Unit 3) part1.pdf
BharatiPatelPhDStude
 
COMPUTER NETWORKS CHAPTER 3 NETWORK LAYER NOTES CSE 3RD year sem 1
aishwaryaarrao3
 
VY NETWORK LAYER 66j6jPART 1 3r324 25.pptx
darade4651
 
routing algorithms in computer Networks.ppt
richagairola2
 
Routing
Amit Pandey
 
Network layer
Hasib Shaikh
 
B21DA0201_03.ppt
DrPreethiD1
 
QSpiders - Good to Know Network Concepts
Qspiders - Software Testing Training Institute
 
Ip protocol tedting
H K
 
routing in computer networks for btech.pptx
RohanRathi17
 
Computer networks network layer,routing
Deepak John
 
Ad

Recently uploaded (20)

PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
CDH. pptx
AneetaSharma15
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Ad

Computer Networks-Network layer Concepts

  • 2. Network Layer Design Issues • Network Layer is concerned with routing packets from source to destination. • To route packets it should know the topology of the network. • Then it should choose the path to route packet. • If source and destination are on the different network, the issue arises. • These issues include the service provided to the transport layer and the internal design of the network. Store and Forward Packet switching: • Routers are the devices used for routing packets and these are connected by transmission lines.
  • 3. • A host with a packet to send transmits it to the nearest router, either on its own LAN or over a point-to-point link to the ISP. • The packet is stored there until it has fully arrived and the link has finished its processing by verifying the checksum. • Then it is forwarded to the next router along the path until it reaches the destination host, where it is delivered. • This mechanism is store-and-forward packet switching. Services provided to the Transport Layer: • The services need to be carefully designed with the following goals in mind: • The services should be independent of the router technology.
  • 4. • The transport layer should be shielded from the number, type, and topology of the routers present. • The network addresses made available to the transport layer should use a uniform numbering plan. • The discussion centers on whether the network layer should provide connection-oriented service or connectionless service. • It camp argues that the network service should be connectionless, with primitives SEND PACKET and RECEIVE PACKET and little else. • No packet ordering and flow control should be done, because the hosts are going to do that anyway and there is usually little to be gained by doing it twice. • The other camp (represented by the telephone companies) argues that the network should provide a reliable, connection- oriented service to support QoS to transfer
  • 5. • Real time data such as audio and video. Implementation of Connection-less service: • If connectionless service is offered, packets are injected into the network individually and routed independently of each other. • No advance setup is needed. • In this context, the packets are frequently called datagrams (in analogy with telegrams) and the network is called a datagram network. • If connection-oriented service is used, a path from the source router all the way to the destination router must be established before any data packets can be sent. • This connection is called a VC (virtual circuit) in analogy with the physical circuits set up by the telephone system, and the network is called a virtual-circuit network.
  • 6. • Suppose that the process P1 has a long message for P2. • It hands the message to the transport layer, with instructions to deliver it to process P2 on host H2. • The transport layer adds header to the front of the message and hands the result to the network layer. • Let us assume that the message is four times longer than the maximum packet size. • So network layer has to break it into four packets, 1, 2, 3, and 4, and send each of them in turn to router A using some point-to-point protocol. • At A, packets 1, 2, and 3 are stored briefly, having arrived on the incoming link and had their checksums verified. • Then each packet is forwarded according to A’s routing table, onto the outgoing link to C.
  • 7. • A decided to send packet 4 via a different route than that of the first three packets. • As it has learned of a traffic jam somewhere along the ACE path and updated its routing table, as shown under the label ‘‘later.’’ • The algorithm that manages the tables and makes the routing decisions is called the routing algorithm. • Each packet carries a destination IP address that routers use to individually forward each packet. • The addresses are 32 bits in IPv4 packets and 128 bits in IPv6 packets. Implementation of Connection oriented service: • For connection-oriented service, we need a virtual-circuit network.
  • 8. • The idea behind virtual circuits is to avoid having to choose a new route for every packet sent. • When a connection is established, a route from the source machine to the destination machine is chosen and stored in tables inside the routers. • That route is used for all traffic flowing over the connection, exactly the same way that the telephone system works. • When the connection is released, the virtual circuit is also terminated. • With connection-oriented service, each packet carries an identifier telling which virtual circuit it belongs to. • Consider that host H1 has established connection 1 with host H2.
  • 9. • This connection is remembered as the first entry in each of the routing tables. • The first line of A’s table says that if a packet bearing connection identifier 1 comes in from H1, it is to be sent to router C and given connection identifier 1. • Similarly, the first entry at C routes the packet to E, also with connection identifier 1. • If H3 also wants to establish a connection to H2, it chooses a connection with identifier 2 as it should distinguish data from H1 and H3.
  • 10. Routing Algorithms • The routing algorithm is a part of the network layer software. • It is responsible for deciding which output line an incoming packet should be transmitted on. • If the network uses datagrams internally, this decision must be made for every arriving data packet since the best route may have changed since last time. • If the network uses virtual circuits internally, routing decisions are made only when a new virtual circuit is being set up. • Thereafter, data packets just follow the already established route. • The latter case is sometimes called session routing because a route remains same for an entire session.
  • 11. • A router has two processes inside it. • One of them handles each packet as it arrives, looking up the outgoing line to use for it in the routing tables. This process is forwarding. • The other process is responsible for filling in and updating the routing table. Properties of Routing Algorithm: • Regardless of whether routes are chosen independently for each packet sent or only when new connections are established, certain properties are desirable in a routing algorithm. • Correctness, Simplicity, Robustness, Stability, Fairness, and Efficiency.
  • 12. Correctness: • Routing algorithm must provide results correctly. Simplicity: • Routing algorithm must be simple and easy to understand. Efficiency: • Algorithm must be efficient. Stability: • A stable algorithm reaches equilibrium and stays there. • It should converge quickly too, since communication may be disrupted. Fairness and Robustness: • Algorithm must take decisions fair and robust.
  • 13. Types of Routing Algorithm: • Adaptive • Non-Adaptive Non-Adaptive Routing Algorithms: • Routing decision is not based on current topology and traffic. • Choice of the route to use is computed in advance, off-line, and downloaded to the routers when the network is booted. • This procedure is called static routing. • It does not respond to failures. • Static routing is mostly useful for situations in which the routing choice is clear.
  • 14. Adaptive Routing Algorithms: • Adaptive algorithms, change their routing decisions to reflect changes in the topology, and sometimes changes in the traffic as well. • These dynamic routing algorithms differ in where they get their information (e.g., locally, from adjacent routers, or from all routers) when they change the routes. The Optimality Principle: • It gives general statement about optimal routes without regard to network topology or traffic. • It states that if router J is on the optimal path from router I to router K, then the optimal path from J to K also falls along the same route.
  • 15. • Let us suppose that part of the route from I to J as r 1 and the rest of the route as r 2. • If a route better than r 2 existed from J to K, it could be concatenated with r 1 to improve the route from I to K, contradicting our statement that r 1r 2 is optimal. Sink Tree: • The set of optimal routes from all sources to a given destination form a tree rooted at the destination. Such a tree is called a sink tree. • The goal of all routing algorithms is to discover and use the sink trees for all route. • A sink tree is a tree, it does not contain any loops, so each packet will be delivered within a finite and bounded number of hops.
  • 16. • Optimality principle and the sink tree provide a benchmark against which other routing algorithms can be measured. Example of Static Routing Algorithms : <<1. Shortest Path Routing>> <<Refer Text Book: Tanenbaum>> 2. Flooding: • When a routing algorithm is implemented, each router must make decisions based on local knowledge, not the complete picture of the network. • A simple local technique is flooding, in which every incoming packet is sent out on every outgoing line except the one it arrived on. Disadvantage: • Flooding generates vast numbers of duplicate packets.
  • 17. Solution1: • To have a hop counter contained in the header of each packet. • It is decremented at each hop and the packet will be discarded when the counter reaches zero. • The hop counter should be initialized to the length of the path from source to destination. • If the sender does not know how long the path is, it can initialize the counter to the worst case, namely, the full diameter of the network. • Hop count can produce an exponential number of duplicate packets . Solution2: • To have routers keep track of which packets have been flooded, to avoid sending them out a second time.
  • 18. • This can be achieved by having a sequence number in each packet put by source router when it receives from its hosts. • Each router then needs a list per source router telling which sequence numbers originating at that source have already been seen. • If an incoming packet is on the list, it is not flooded. • To prevent the list from growing without bound, each list should be augmented by a counter, k, meaning that all sequence numbers through k have been seen. • When a packet comes in, it is easy to check if the packet has already been flooded by comparing its sequence number ; if so, it is discarded. Disadvantages: • Flooding is not practical for sending most packets.
  • 19. • This may be wasteful if there is a single destination that needs the packet, but it is effective for broadcasting information. Advantages: • Flooding is tremendously robust and requires only a small set up. • Flooding is the building block for other routing algorithms. • Flooding always chooses the shortest path from every possible path. Dynamic Routing Algorithms: • Computer networks generally use dynamic routing algorithms • These are more complex than flooding, but more efficient because they find shortest paths for the current topology. • Two dynamic algorithms which are popular include distance vector routing and link state routing.
  • 20. Distance Vector Routing • A distance vector routing algorithm operates by having each router maintains a table (i.e., a vector). • It gives the best known distance to each destination and the link to use to get there. • These tables are updated by exchanging information with the neighbours. • Eventually, every router knows the best link to reach each destination. • The distance vector routing algorithm is also called Bellman-Ford routing algorithm. • Each router maintains a routing table and has one entry for each router in the network. • This entry has two parts: the preferred outgoing line to use for that destination and an estimate of the distance to that destination.
  • 21. • The distance might be measured as the number of hops or using another metric can be chosen. • Example: Assume that delay is used as a metric and that the router knows the delay to each of its neighbours. • <<Refer Text Book for Example>>
  • 22. Link State Routing • Distance vector routing was replaced by link state routing as the algorithm took too long to converge after the network topology changed. • The routing algorithms are most widely used inside large networks and the Internet today. • The algorithm can be stated as five parts. • Each router must do the following things to make it work: – Discover its neighbours and learn their network addresses. – Set the distance or cost metric to each of its neighbours. – Construct a packet using this information. – Send this packet to and receive packets from all other routers. – Compute the shortest path to every other router.
  • 23. • The complete topology is distributed to every router. Then Dijkstra’s algorithm can be run at each router to find the shortest path to every other router. Learning about the Neighbours: • When a router is booted, its first task is to learn who its neighbours are. • It accomplishes this goal by sending a special HELLO packet on each point-to-point line. • The router on the other end is expected to send back a reply giving its name. • Name must be globally unique.
  • 24. • When two or more routers are connected by a broadcast link (e.g., a switch, ring, or classic Ethernet), the situation is slightly more complicated. • It increases the size of the topology and leads to wasteful messages. • A better way to model the LAN is to consider it as a node itself. • One designated router on the LAN is selected to play the role of N in the routing protocol. Setting Link Costs: • The link state routing algorithm requires each link to have a distance or cost metric for finding shortest paths. • The cost to reach neighbours can be set automatically, or configured by the network operator.
  • 25. • A common choice is to make the cost inversely proportional to the bandwidth of the link. • For example, 1-Gbps Ethernet may have a cost of 1 and 100-Mbps Ethernet a cost of 10. • Delay of the link also incurs cost. • The most direct way to determine this delay is to send over the line a special ECHO packet. • The other side is required to send back the ECHO packet immediately. • By measuring the round-trip time and dividing it by two, the sending router can get a reasonable estimate of the delay.
  • 26. Building Link State Packets: • Once the information needed for the exchange has been collected, the next step is for each router to build a packet containing all the data. • The packet starts with the identity of the sender, followed by a sequence number and age and a list of neighbours. • Building the link state packets is easy. • The hard part is determining when to build them. • One possibility is to build them periodically, that is, at regular intervals. • Another possibility is to build them when some significant event occurs. • Eg: A line or neighbour going down or coming back up again or changing its properties appreciably.
  • 27. Distributing the Link State Packets: • The fundamental idea is to use flooding to distribute the link state packets to all routers. • To keep the flood in check, each packet contains a sequence number that is incremented for each new packet sent. • When a new link state packet comes in, it is checked whether it is new, it is forwarded on all lines except the one it arrived on. • If it is a duplicate, it is discarded. • If a packet with a sequence number lower than the highest one seen so far ever arrives, it is rejected as being obsolete as the router has more recent data.
  • 28. Problems in using sequence number: • Router should decide when the sequence number should wrap. • If a router crashes, it will lose track of its sequence number. If it starts again at 0, the next packet it sends will be rejected as a duplicate. • If a sequence number is corrupted and 65,540 is received instead of 4 (a 1-bit error), packets 5 through 65,540 will be rejected as obsolete. • The solution to all these problems is to include the age of each packet after the sequence number and decrement it once per second. • When the age hits zero, the information from that router is discarded.
  • 29. • To guard against errors on the links, all link state packets are acknowledged. • The table records where the packet originated, its sequence number and age, and the data. • In addition, there are send and acknowledgement flags for each of B’s three links (to A, C, and F, respectively). The send flags mean that the packet must be sent on the indicated link. The acknowledgement flags mean that it must be acknowledged there. • The send flags mean that the packet must be sent on the indicated link. The acknowledgement flags mean that it must be acknowledged there.
  • 30. Computing the New Routes: • Once a router has accumulated a full set of link state packets, it can construct the entire network graph because every link is represented. • The shortest-path computations may then find different paths from router A to B than from router B to A. <<Traffic Management in Networking>> • Congestion • Approaches to Congestion Control • Refer Text Book
  • 31. Internetworking • internetwork is the interconnection of various networks. • If these networks are homogenous, they use same protocols for communication. • If the networks are different such as Ethernet, Mobile Network, etc., then the following issues may arise. – Scaling is the issue as the internetwork grows larger – Heterogeneity is another issue as the packet format, modulation techniques, maximum packet size used by one network may differ from other network. – If one network has strong QoS and the other offers best effort service, it is impossible to make bandwidth and delay guarantees for real-time traffic end to end. – Security mechanisms are problematic.
  • 32. How Networks differ? Differences Description Service offered Connectionless versus connection oriented Addressing Different sizes, flat or hierarchical Broadcasting Present or absent (also multicast) Packet size Every network has its own maximum Ordering Ordered and unordered delivery Quality of service Present or absent; many different kinds Reliability Different levels of loss Security Privacy rules, encryption, etc Parameters Different timeouts, flow specifications, etc. Accounting By connect time, packet, byte, or not at all
  • 33. How Networks can be connected? • Two basic choices – Build a device that translates packets from one network into another network – Building a common layer on top of the different networks • IP provides a universal packet format that all routers recognize and that can be passed through almost every network. • Repeaters and hubs just move bits from one wire to another. • Bridges and switches operate at the link layer. They can be used to build networks. • Routers operate at the network layer used to interconnect devices.
  • 34. • Consider that there are three dissimilar networks, 802.11, MPLS Network, Ethernet. • 802.11 is connection less, MPLS is connection oriented, Ethernet. • In MPLS, a virtual circuit must be set up to cross that network. • Once the packet has travelled along the virtual circuit, it will reach the Ethernet network. • Since 802.11 can work with larger frames than Ethernet, the packet may be too large to be carried,. • To handle this problem, the packet is divided into fragments, and each fragment is sent separately. • When the fragments reach the destination, they are reassembled. • Then the packet has completed its journey.
  • 35. Network and Link Layer Protocol Processing: • The source (802.11)accepts data from the transport layer and generates a packet with IP header in Network Layer. • IP header has destination address which is used to determine that the packet must be sent via the first router. • IP packet is encapsulated in 802.11 frame and sent to the router. • At the router, the packet frame is removed. • The router now examines the IP address in the packet and looks up this address in its routing table. • Based on this address, it decides to send the packet to the second router next. • At this part , an MPLS virtual circuit must be established to the second router.
  • 36. • IP packet must be encapsulated with MPLS headers and routed. • At the far end, the MPLS header is discarded and the network address is again verified to find the next network layer hop. • It is the destination itself. • Since the packet is too long to be sent over Ethernet, it is split into two portions. • Each of these portions is put into the data field of an Ethernet frame and sent to the Ethernet address of the destination. • At the destination, the Ethernet header is removed from each of the frames, and the contents are reassembled. • Internetworking has been very successful at building large networks, but it only works when there is a common network
  • 37. Tunneling: • Making two different networks interwork is more difficult. Example: • Consider that an international bank is with an IPv6 network in Paris, an IPv6 network in London. • These two offices are connected via the IPv4 Internet. • The solution to this problem is a technique called tunneling. • To send an IP packet to a host in the London office, a host in the Paris office constructs the packet containing an IPv6 address in London. • It sends it to the multiprotocol router that connects the Paris IPv6 network to the IPv4 Internet. • The router puts a (IPv6) packet inside a (IPv4) packet. • When this wrapped packet arrives, the London router removes IPv4 packet.
  • 38. • The original IPv6 packet is sent to the destination host. • The path through the IPv4 Internet can be seen as a big tunnel extending from one multiprotocol router to the other. • The IPv6 packet travels from one end of the tunnel to the other, snug in its nice box. Example: • Consider a person driving her car from Paris to London. • Within France, the car moves under its own power until it hits the English Channel. • Cars are not permitted to drive through the Channel. • It is loaded onto a high-speed train and transported through railroad carriage to England. • Effectively, the car is being carried as freight, as depicted in figure.
  • 39. • At the far end, the car is let loose on the English roads and once again continues to move under its own power. • Tunneling of packets through a foreign network works the same way. Internetwork Routing: • The networks may internally use different routing algorithms. • Networks run by different operators and they have different ideas about routing. • One may need shortest path, other may need inexpensive route etc., • one operator may not want another operator to know the details of the paths in its network as they are sensitive.
  • 40. • All of these considerations lead to a two-levels of routing algorithms. • Within each network, an intra domain or interior gateway protocol is used for routing. (RIP, OSPF) • Across the networks that make up the internet, an inter domain or exterior gateway protocol is used. (BGP). Packet Fragmentation: • Maximum payloads for Ethernet are 1500 bytes and 2272 bytes for 802.11. IP is more generous, allows for packets as big as 65,515 bytes. • If packets are larger, it reduces packet overheads such as bandwidth wasted on header bytes. • If packets are smaller, overhead is high.
  • 41. • A source does not usually know the path a packet will take through the network to a destination,. • So it certainly does not know how small packets must be to get there. • This packet size is called the Path MTU (Path Maximum Transmission Unit). • Even if the source knows the path MTU, packets are routed independently in a connectionless network such as the Internet. • This routing means that paths may suddenly change, which can unexpectedly change the path MTU. • The solution to the problem is to allow routers to break up packets into fragments, sending each fragment as a separate network layer packet.
  • 42. Types of Fragmentation: – Transparent Fragmentation – Non transparent Fragmentation • Transparent Fragmentation allows the packet to be fragmented and reassembled at every router. • Each fragment is addressed to the same destination. • Exit router must know when it has received all the pieces, so either a count field or an ‘‘end of packet’’ bit must be provided. • Non transparent Fragmentation does not allow recombining fragments at any intermediate routers. • Once a packet has been fragmented, each fragment is treated as original packet. • The routers pass the fragments, and reassembly is performed only at the destination host.
  • 43. Example: • Fragmentation when the elementary data size is 1 byte. • Original packet contains 10 data bytes. • It is fragmented into two packets of size 8, 2 bytes when passing through a network which supports MTU of 8 bytes. • It is fragmented into two packets of size 5 bytes each when passing through a network which supports MTU of 5 bytes. • Each Fragment has packet number, Number of first Elementary fragments, End of packet bit. Solution to get rid of Fragmentation: • It is called Maximum Transmission Unit (MTU) Path Discovery • Each IP packet is sent with its header bits set to indicate that no fragmentation is allowed to be performed. • If a router receives a packet that is too large, it generates an error packet, returns it to the source, and drops the packet.
  • 44. • When the source receives the error packet, it uses the information inside to refragment the packet into pieces that are small enough for the router to handle. Advantages: • Source knows what length packet to send. • If the routes and path MTU change, new error packets will be triggered and the source will adapt to the new path. • Fragmentation is needed between the source and the destination unless the higher layers learn the path MTU. Disadvantages: • Start up delays added • Better design needed to truncate packets at each router when MTU exceeds.