0% found this document useful (0 votes)
7 views81 pages

CN Unit 4

Uploaded by

Jenish Jadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views81 pages

CN Unit 4

Uploaded by

Jenish Jadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

UNIT 4

Network Layer
Unit Covered
1. Internetworking 3. Forwarding :
– Need of Network Layer, – Forwarding Techniques,
– Internet as datagram n/w, – Forwarding Process,
– Internet as Connectionless n/w – Routing table
2. Delivery : 4. Routing protocols:
– Direct, – Distance vector routing,
– Indirect – Link state routing,
– Path vector routing

2
Internetworking

In this section, we discuss internetworking, connecting


networks together to make an internetwork or an
internet.

Topics discussed in this section:


 Need for Network Layer
 Internet as a datagram Network
 Internet as a Connectionless Network

4
Internetworking
• Physical and Datalink layer of a network operate locally.
• These two layer are jointly responsible for data delivery on
the network from one node to next.

5
Internetwork
• Internetwork made up of 5 networks :
– 4 LAN and 1 WAN
• If one host A need to send data packet to D
– Packet go 1st from A to R1(Switch or Router)
– R1 to R3
– R3 to Host D.
• Data packet passes through 3 link, in each 2 physical and 2
Datalink layer are involved.

6
Internetworking

7
Problem with Delivery through
several link
• When data arrive at interface f1 of R1, how does R1 know
that interface f3 is the outgoing interface?
• There is no provision in the data link (or physical) layer to help
R1 to make right decision.
• The frame does not carry any routing information.
• Frame contain MAC address of A as a source and R1 as
Destination.
• For a LAN or MAN, delivery means carrying the frame through
one link not beyond.
8
Need of Network Layer

To solve the problem of delivery through several link,


the Network layer ( internetwork layer ) was designed.

The network layer is responsible for


– Host – to – host delivery
– Routing a packets through the router or switches.

9
Network layer in an
Internetwork

10
Network Layer Functionality

• General Functionality of network layer at a

– Source

– Router

– Destination

11
Network Layer at Source

1. Creating packet from data coming from another protocol


– Such as transport layer protocol or routing protocol.

2. Header of packet contains information :


– Logical address of source and destination.

3. Checking its routing table to find out routing information


– Such as outgoing interface of packet
– Physical address of next node.

4. If packet is too large, the packet is fragmented.

12
Network Layer at Source

13
Network Layer At
Switch or Router
1. Responsibility for routing a packet.
2. When packet is arrive, router and switch consults it routing
table
– Find interface from which the packet must be sent.

3. After some changes in header, with routing information


– The packet is passed to the data link layer.

14
Network Layer At Destination

1. Responsible for address verification


– Make sure that the destination address on the packet is same
as address of the Host

2. If packet is fragmented
– The network layer wait until all fragments have arrived.

– Then reassembles them

– Deliver reassembled packet to transport layer.

15
Network Layer At Destination

16
Internet as a Datagram
Network
• The internet has chosen the datagram approach to switching
in network layer.
• It uses universal addresses defines in the network to route
packet from the source to destination.

Switching at the network layer in the


Internet uses the datagram approach to
packet switching

17
Datagram Approach

In a packet-switched network, there


is no resource reservation;
resources are allocated on demand.

18
Internet as a Datagram
Network
• The internet , at network layer is a packet – switched
network.
• Switching can be divided into 3 category
– Circuit Switching
– Packet Switching
• Virtual circuit
• Datagram
– Message Switching

19
Internet as a Connectionless
Network
• Delivery can be done by either connection oriented or
connectionless network service.
• Connection – Oriented Service:
– Source must make connection with destination before sending packet.
– And then sequence of packet from same source to destination one
after another.
– Packet is logically connected with each other.
– When all packets of message have been delivered, the connection is
terminated.
– Decision about route made only once, when connection is established.
– Switch do not recalculate route.

20
Connectionless service
• In this, Network layer treat each packet independently , with
each packet having no relationship to any other packet.
• Packet may not be travel the same path to their destination.
• This type of service is used in datagram approach.
• Reason :
– Internet is made up of so many heterogeneous network.
– Impossible to create connection from source to destination.

Communication at the network layer in


the Internet is connectionless.
21
Delivery

• The network layer supervises the handling of the packet by


the underlying physical network.

• We defines this handling as the delivery of a packet.

– Direct Delivery

– Indirect Delivery

22
Direct Delivery
• In direct delivery, the final destination of a packet is a host
connected to the same physical network as the deliverer.
• Direct delivery occurs when
– The source and destination of packet are located on the same
physical network or
– Delivery is between the last router and destination host.

• The sender can easily determine if the delivery is direct.


– Compare N/W address of destination and address of N/W to which it
is connected.
– If Match is found, the delivery is Direct.
23
Direct Delivery

24
Indirect Delivery
• If the destination host is not on the same network as the
deliverer, the packet is delivered indirectly.
• In indirect Delivery :
– The packet goes from router to router until it reaches the
one connected to the same physical network as its final
destination.

Delivery always involves one direct delivery but


zero or more indirect deliveries.
Last delivery is always as Direct delivery.
25
Indirect Delivery

26
Forwarding
• Forwarding means to place the packet in its route to its
destination.
• Forwarding requires a host or a router to have a routing table.
• When a host has a packet to send or when a router has
received a packet to be forwarded, it looks at this table to find
the route to the final destination.
• Forwarding Include :
– Forwarding Techniques
– Forwarding Process
– Routing Table

27
Forwarding Technique
• Several technique can make the size of the routing
table manageable and also handle issue such as
security.
– Next – hop method versus Route Method
– Network – specific method versus Host – Specific Method

28
Next – hop method versus
Route Method
• One technique to reduce the content of a routing table is
called the Next-hop-method.
• The routing table holds only the address of the next hop
instead of information about the complete route (route
method).
• The entry of routing table must be consistent with one
another.

29
Route method versus
next-hop method

30
Network-specific Method
versus Host-specific Method
• A second technique to reduce the routing table and simplify the
searching process is called the Network-specific method.
• Here, instead of having an entry for every destination host
connected to the same physical network (host- specific)
– We have only one entry that defines the address of the
destination network itself.
• We treat all hosts connected to the same network as one single
entry.
• Example:
– If 1000 host are attached to the same network, only one entry exists in the
routing table.

31
Host-specific versus
network-specific method

32
Default Method

• Another technique to simplify routing is called default method.

• Host A is connected to the a Network with two router.

• Router R1 routes the packet to hosts connected to network N2.

• However for rest of the network R2 is used.

Instead of listing all networks in entire Internet,


Host A can just have one entry called
Default (0.0.0.0 = network address)

33
Default Method

34
Forwarding Process
• Host and routers uses classless addressing
– Because classful addressing is special case of classless addressing.
• In classless addressing, the routing table needs to have one
row of information for each block involved.
• The table need to be searched based on the network address.
• Destination address in the packet gives no clue about the
network address.
• To solve the problem, we need to include the mask(/n) in the
table.
– Extra column that includes the mask for the corresponding block.

35
Simplified forwarding module
in classless address

In classless addressing, we need at least four


columns in a routing table.

36
Example 22.1

• Make a routing table for router R1, using the


configuration in Figure 22.6.

37
Configuration of Example 22.1

38
Solution

• Table 22.1 shows the corresponding table.


Routing table for Router R1.

39
Example 22.2
Show the forwarding process if a packet arrives at R1 in Figure
22.6 with the destination address 180.70.65.140.
Solution
• The router performs the following steps:
1. The first mask (/26) is applied to the destination address. The
result is 180.70.65.192, which does not match the
corresponding network address.
2. The second mask (/25) is applied to the destination address.
The result is 180.70.65.128, which matches the corresponding
network address. The next-hop address and the interface
number m0 are passed to ARP for further processing.

40
Routing Table

• Host and router has routing table with entry for each
destination, or combination of destination , to route IP
packets.
• The routing table can be either
– Static
– Dynamic.

41
Static
• Static routing table contains information entered manually.
• The administrator enters the route for each destination into
routing table.
• When table is created, it can not update automatically when
there is change in Internet.
• The table must be manually altered.
• It can be used in small internet that does not change.
• It is poor strategy to use a static routing table in a big internet
as the Internet.

42
Dynamic Routing Table

• It is updated periodically by using one of the dynamic routing


protocol.
• Whenever there is change in Internet, it update all the table
in the router or host automatically.
• Router in Internet need to be updated dynamically for
efficient delivery of IP packets.

43
Format of Routing Table

• Mask : Mask apply for entry.


• Network Address : network address to which the packet is
finally delivered.
• Next-Hop-Address : address of next hop router to which the
packet is delivered.
• Interface : Name of the interface.

44
Intra and interdomain routing
• Autonomous System :
– Group of network and router
under the authority of single
administrator.
• Intradomain Routing
– Routing inside autonomous
system .
• Interdomain Routing
– Routing between autonomous
system .

45
Cont…
A routing protocol is a combination of rules and procedures that
lets routers in the Internet inform each other for changes.

46
Optimization
• When router receive packet, to which network should it pass
the packet?
• The decision based on optimization :
– Which of the available pathways is the optimal pathway?

– Optimality depend on various factor

• Cost metrics (RIP)

• Shortest path (OSPF)

• Policy (BGP)

47
Optimization Protocol
• RIP : Routing information protocol
– Treat all network are equal and cost of passing through
network is same.
– It is a Intradomain routing protocol used inside an
autonomous system.
– RIP used Hop Count metrics .
• The number of link to reach destination is called hop
count.

48
Optimization Protocol

• OSPF : Open shortest Path First.


– Assign cost based on types of service required.
– Example : Link state protocol.
• BGP : Border Gateway Protocol
– It is based on policy set by administrator.
– Policy define what paths should be chosen.
– Example : Path vector protocol.

49
Distance Vector Routing

• The least cost route between any two nodes is the route with
minimum distance.
• In this protocol , as the name implies, each node maintain
vector (table) of minimum distance to every node.
• The table at each node also guides the packet to the desired
node by showing the next stop in the route.

50
Distance Vector Routing Table

51
• The tables (Vectors) are stable.
• Each node knows how to reach any other node and the cost.
• 3 steps for dynamic routing table
– Initialization
• Each node can know only the distance between itself and its
immediate neighbor.
• The distance for any entry that is not a neighbor is marked as infinite.
– Sharing
• Sharing of information between neighbors.
– Updating
• When node receive a two column routing table from neighbor, it
needs its routing table.
52
Initialization of tables in
distance vector routing

53
Note

In distance vector routing, each node shares its


routing table with its
immediate neighbors periodically and when
there is a change.

54
Updating in distance
vector routing

55
When to share

• When node share it’s routing table to other?


– Periodic Update
• Sends it routing table, normally every 30 second.
– Triggered Update
• Node sends it two column routing table to its neighbor
when there is change in routing table.

56
Link State Routing
• It has different philosophy than distance vector routing.
• In link state routing

– If each node in the domains has entire topology of


domain(list of node and links), how they are connected
including the type, cost and condition(UP or Down).

– Node can use Dijskstra’s algorithm to build routing table.


– A group of computers and devices on a network that are administered as a unit with
common rules and procedures. Within the Internet. All devices sharing a common part of
the IP address are said to be in the same domain.
57
Concept of link state routing

58
• Each node uses the same topology to create a routing table.
• But routing table for each node is unique.
– Because the calculation based on different interpretation of topology.
• It is similar to city map in which each person may have the
same map
– Each need to take a different route to reach their specific destination.
• Topology must be dynamic.
– Representing the latest state of each node and each link.
– If there are changes in any point in the network, topology must be
updated for each node.

59
Link state knowledge
• Whole topology can be compiled from the partial knowledge of
each node.
Figure indicating part of knowledge belonging to each node.

60
Building Routing Table

1. Creation of state of links by each node – link state packet(LSP)

2. Dissemination of LSPs to every other router, called flooding.

3. Formulation of a shortest path tree for each node.

4. Calculation of routing table based on the shortest path tree.

61
Step 1
• Creation of Link State Packet (LSP)
– It carry minimum amount of data like
• Node Identity and List of link : To make the topology.

• Sequence Number : Facilitates flooding and distinguishes new LSP


form OLD one.

• Age : Prevent old LSP from remaining in the domain from long time.
– LSP Generated on 2 occasion
• When there is a change in the topology of the domain

• On the Periodic Update ( 60 min or 2 h).

62
Step 2
• Flooding of LSPs
– After node has prepared an LSP, it must disseminated to all
other node. This process is called flooding.
– Flooding based on following
• Creating node sends a copy of LSP out of each interface.
• Receiving node compares LSP with copy that already have.
– If old one, then discard LSP.
– If newer, discard old LSP and keep new one.
» Sends copy to each interface except the one from which
the packet is arrived.
63
Step 3
• Formulation of Shortest Path
– Tree is a graph of nodes and links: one node is called Root.
– Dijkstra algorithm creates shortest path.
– It divides node in to 2 parts.
• Permanent
• Tentative
– It find the neighbor of current node, make them tentative,
examine them and if they pass the criteria, make them
permanent.

64
Example of formulation of
shortest path tree

65
Tracing

Permanent List Tentative List

Permanent list: empty Tentative List A(0)

Permanent list: A(0) Tentative List B(5),C(2), D(3).

Permanent list: A(0 ),C(2) Tentative List B(5), D(3), E(6)

Permanent list: A(0 ), C(2), D(3) Tentative List B(5),E(6)

Permanent list: A(0 ),B(5) C(2), D(3) Tentative List E(6)

Permanent list: A(0 ),B(5) C(2), D(3), E(6) Tentative List Empty

66
Routing Table for node A

67
OSPF
• Intradomain routing protocol.
• Its Domain is also autonomous.
• To handle routing efficiently and timely manner.
– OSPF divides the system in to areas.
• Area is a collection of network, host and router all contained
within autonomous system.
• Router inside an area flood the area with routing information.
• At the border of an area, special router called area border
router.
– It summarize the information about area and send it to
other area.
68
Areas in an
autonomous system

69
Path Vector Routing

• Distance vector and link state routing are both Intradomain


routing protocol.
– They can be used inside an autonomous system, but not between
autonomous system.
• Path vector routing is useful for Interdomain routing.

Principle : We assume that there is one node in each autonomous


system that act on behalf of the entire autonomous system.
That Node is called as Speaker Node.

70
• Speaker node in an AS creates the routing table and advertises
it to speaker node in neighboring ASs.
• Idea is same as distance vector
– But only speaker node in each AS can communicate with each
other.
– Speaker node advertises the path, not the metric of each node.
• Three steps to follow
– Initialization
– Sharing
– Updating
71
Initialization
• At the beginning each node can knows only the reachability
of nodes inside its autonomous system.
• Initial table for each speaker node.
• Node A1 is a speaker of AS1, B1 for AS2, C1 for AS3 and D1
for AS4.
• Node A1 creates an initial table that shows A1 to A5 are
located in AS1 and can be reached through it. And so on.

72
Initial routing table in
path vector routing

73
Sharing

• Speaker in an Autonomous system shares its table with


immediate neighbors.

– A1 shares its table with node B1 and C1.

– C1 Shares its table with node D1, B1, A1.

– B1 Shares its table with Node C1 and A1.

– D1 shares it table with C1.

74
Updating
• When speaker receive 2 column table from neighbor, it
updates its own table by adding the nodes that are not in a
routing table.
– Adding its own AS and AS that sent the system.
• That table gives information about how to reach each node in
other As.
• Example :
– If node A1 receive a packet to for D1, it know that packet should
go from AS1 to AS2 and then AS4.
– D1 receive packet for Node A2, it knows it should go through
AS4 to AS3 and AS1.
75
Stabilized tables for three
autonomous systems

76
Loop Preservation

• Instability of distance vector routing and creation of loop can


be avoided in path vector routing.

• When router receives a message, it checks to see if its


autonomous system is in the path to its destination.

• If it is, looping is involve and message is ignored.

77
Policy Routing

• Policy routing can be easily implemented through path vector


routing.
• When router receive a message, it can check path.
• If one of the AS listed in the path is against its policy, it can
ignore that path and that destination.
• It does not update its routing table with this path, and it does
not send this message to its neighbor.

78
Optimal Path

• What is optimal path in path vector routing?


– Looking for best path
• It based on different criteria.
– RIP use hop count metric.
– OSPF use minimum delay as the metric.
• In previous organization each AS may have more than one
path to a destination.
– Path from AS1 to AS4 can be AS4-AS3-AS3-AS1, AS4-AS3-AS1.
– Chose the one that had the smaller number of AS.
– Other criteria : security, safety and reliability.

79
BGP
• Border Gateway Protocol is a Intradomain routing protocol.
• Types of AS : As is divides into 3 category.
– Stub AS :
• Has only one connection to another AS.
• Data traffic can not pass through a stub AS.
– Multihomed AS
• Has more than one connection to other As.
• It can send data traffic to more than one AS, but there is no
temporary traffic.
– Transit AS
• A transit AS is a Multihomed AS that also allows transient traffic.
80
Internal and external
BGP sessions

81

You might also like