Upload
others
View
10
Download
0
Embed Size (px)
Citation preview
Department of Computer Science
DCS
COMSATS Institute of Information Technology
Routing at Network Layer
Advanced Computer Networks
Rab Nawaz Jadoon
Assistant Professor
COMSATS University, Lahore
Pakistan
Department of Computer Science 22
IPv6
An IPv6 address is 128 bits long. An IPv6 address consists of 16 bytes (octets).
Hexadecimal Colon Notation To make addresses more readable, IPv6 specifies
hexadecimal colon notation.
128 bits is divided into eight sections, each 2 bytes in length.
Two bytes in hexadecimal notation requires four hexadecimal digits.
Therefore, the address consists of 32 hexadecimal digits, with every four digits separated by a colon,
Department of Computer Science 3
Network Layer
IPv6 address in binary and hexadecimal colon notation,
Department of Computer Science 4
Network Layer Abbreviation
IP address in hexadecimal is too long, most of the digits may be zero.
To overcome this problem we can abbreviate the address.
The leading zeros of a section (four digits between two colons) can be omitted.
Department of Computer Science 5
Network Layer
Example:
Expand the address 0:15::1:12:1213 to its original.
Department of Computer Science 6
Network Layer
Address space
IPv6 has a much larger address space; 2128
addresses are available.
IPv6 divided the address into several categories.
A few leftmost bits, called the type prefix, in each address define its category.
The type prefix is variable in length.
It is designed such that no code is identical to the first part of any other code.
when an address is given, the type prefix can easily be determined.
Department of Computer Science 7
Network Layer
Table 19.5 shows the prefix for each typeof address.
Department of Computer Science 8
Cont…
Department of Computer Science 9
Network Layer
Unicast Addresses IPv6 defines two types of unicast addresses
Geographically based ( it is left for future use)
Provider-based. (The provider-based address is generally used by a normal host as a unicast address).
Department of Computer Science 10
Fields for the provider-based address
Type identifier.
This 3-bit field defines the address as a provider-based address.
Registry identifier
This 5-bit field indicates the agency that has registered the address.
Currently three registry centers have been defined.
INTERNIC (code 11000) is the center for North America;
RIPNIC (code 01000) is the center for European registration;
APNIC (code 10100) is for Asian and Pacific countries.
Department of Computer Science 11
Network Layer Provider identifier.
identifies the provider for Internet access (such as an ISP).
A 16-bit length is recommended for this field.
Subscriber identifier.
When an organization subscribes to the Internet through a provider, it is assigned a subscriber
identification.
A 24-bit length is recommended for this field.
Department of Computer Science 12
IPv6
Subnet identifier.
Each subscriber can have many different subnetworks, and each subnetwork can have an
identifier.
A 32-bit length is recommended for this field.
Node identifier.
The last field defines the identity of the node
connected to a subnet.
A length of 48 bits is recommended for this field to make it compatible with the 48-bit link (physical) address used by Ethernet.
Department of Computer Science 13
Network Layer
Multicast Addresses
Multicast addresses are used to define a group of hosts instead of just one.
A packet sent to a multicast address must be delivered to each member of the group.
A permanent group address is defined by the Internet authorities and can be accessed at all times.
A transient group address, on the other hand, is used only temporarily. E.g. Systems engaged in a teleconference
Department of Computer Science 14
Network Layer
Anycast Addresses
An anycast address, like a multicast address, also
defines a group of nodes.
An anycast address is delivered to only one of the members of the anycast group.
Reserved Addresses
These addresses start with eight Os (type prefix is
0000 0000).
Department of Computer Science 15
Reserved Addresses
Department of Computer Science 16
Example Unspecified address
An unspecified address is used when a host does not know its own address and sends an inquiry to find its
address.
Loopback address
A loop back address is used by a host to test itself
without going into the network.
Compatible address
Used during the transition from IPv4 to IPv6.
Mapped address
A mapped address is also used during transition.
Department of Computer Science 17
Reserved Addresses
Local Addresses These addresses are used when an organization wants to use IPv6 protocol without being connected to the global Internet. In other words, they provide addressing for private networks.
Department of Computer Science 18
Transition from IPv4 to IPv6
The transition from IPv4 to IPv6 cannot happen suddenly.
It takes a considerable amount of time before every system in the Internet can move from IPv4 to IPv6.
The transition must be smooth to prevent any problems between IPv4 and IPv6 systems.
Three strategies have been devised by the IETF to help the transition.
Duel Stack
Tunneling
Header Translation
Department of Computer Science 19
Network Layer
Three transition strategies
Department of Computer Science 20
Network Layer Dual Stack
It is recommended that all hosts, before migrating completely to version 6, have a dual stack of protocols.
A station must run IPv4 and IPv6 simultaneously until all the Internet uses IPv6.
Department of Computer Science 21
Network Layer
Tunneling
Tunneling is a strategy used when two computers using IPv6 want to communicate with each other and the packet must pass through a region that uses IPv4.
IP within IP is the actual concept of tunneling.
Department of Computer Science 22
Network Layer
Header Translation Header translation is necessary when the majority of
the Internet has moved to IPv6 but some systems still use IPv4.
The sender wants to use IPv6, but the receiver does not understand IPv6.
Tunneling does not work in this case
The header format must be totally changed through header translation.
The header of the IPv6 packet is convened to an IPv4 header
Department of Computer Science 23
Header translation strategy
Note
Header translation uses the mapped address to translate an IPv6 address to an IPv4 address.
The 1Pv6 mapped address is changed to an lPv4 address by
extracting the rightmost 32 bits.
Department of Computer Science 24
INTERNETWORKING
The physical and data link layers of a network operate locally.
Responsible for HOP to HOP delivery.
This internetwork is made of five networks: four LANs and one WAN.
If host A needs to send a data packet to host D, the packet needs to go first from A to R1 (a switch or router), then from R1 to R3, and finally from R3 to host D.
Department of Computer Science 25
Network Layer
The data packet passes through three links.
In each link, two physical and two data link layers are involved.
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 make the right decision.
Department of Computer Science 26
Network Layer
Network layer in an internetwork
Department of Computer Science 27
Network Layer
Functionality of the Network Layer
The general idea of the functionality of the network layer at a source, at a router, and at the destination is,
The network layer at the source is responsible for creating a packet from the data coming from another protocol upper layer)
The network layer is responsible for checking its routing table to find the routing information.
The network layer at the switch or router is responsible for routing the packet.
Department of Computer Science 28
Network Layer
When a packet arrives, Consult the routing table
Find the interface over which the packet is sent over.
Changes in the packet header regarding routing information.
Then passed to Data Link Layer.
The network layer at the destination, Responsible for address verification;
If the packet is a fragment, The network layer waits until all fragments have arrived.
Then reassembles them and delivers them to transport layer.
Department of Computer Science 29
Network Layer
Department of Computer Science 30
Network Layer
Internet as a Connectionless Network
Communication at the network layer in the Internet is connectionless.
The network layer protocol treats each packet independently, with each packet having no relationship to any other packet.
The packets in a message may or may not travel the same path to their destination.
Department of Computer Science 31
Network Layer
Main reason of connectionless services at the internet,
The reason for this decision is that the Internet is made of so many heterogeneous networks that it is almost impossible to create a connection from the source to the destination without knowing the nature of the networks in advance.
Department of Computer Science 32
Network Layer
Position of lPv4 in TCP/IP protocol suite
Note:
IPv4 is an unreliable and connectionless datagramprotocol
Department of Computer Science 33
IPv4 datagram
Datagram
IPv4 datagram format
Department of Computer Science 34
IPv4 Header
Version (VER). This 4-bit field defines the version of the IPv4 protocol.
Header length (HLEN). This 4-bit field defines the total length of the datagram header
in 4-byte words.
The length of the header is variable (between 20 and 60 bytes).
Services. 8-bit field.
TOS
Differentiated services
Note:
Rest of the information in header you may read it from the book.
Department of Computer Science 35
IPv4 Header
TOS First 3 bits are called precedence bits.
The next 4 bits are called type of service (TOS) bits.
The last bit is not used.
Precedence Precedence is a 3-bit subfield ranging from 0 (000 in binary)
to 7 (111 in binary).
Used in congestion control
Some datagrams in the Internet are more important than others.
For example, a datagram used for network management is much more urgent and important than a datagram containing optional information for a group.
Department of Computer Science 36
IPv4 Header
TOS bits
4-bit subfield with each bit having a special meaning.
The bit patterns and their interpretations are given in Table
Department of Computer Science 37
IPv4 Header
Differentiated Services
In this interpretation, the first 6 bits make up the codepoint subfield, and the last 2 bits are not used.
The codepoint subfield can be used in two different ways.
When the 3 rightmost bits are Os, the 3 leftmost bits are interpreted the same as the precedence bits in the service type interpretation.
When the 3 rightmost bits are not all Os, the 6 bits define 64 services based on the priority assignment by the Internet or local authorities
Department of Computer Science 38
IPv4 Header
Total length. This is a 16-bit field that defines the total length
(header plus data) of the IPv4 datagram in bytes.
Length of data = total length - header length
Time to live. Today, this field is used mostly to control the
maximum number of hops (routers) visited by the datagram. (e.g 16 hops)
Protocol. This 8-bit field defines the higher-level protocol that
uses the services of the IPv4 layer.
Department of Computer Science 39
IPv4 Header
An IPv4 datagram can encapsulate data from several higher-level protocols such as TCP, UDP, ICMP, and IGMP.
This field specifies the final destination protocol to which the IPv4 datagram is delivered.
this field helps the receiving network layer know to which protocol the data belong
Department of Computer Science 40
IPv4 Header
The value of this field for each higher-level protocol is shown in Table
Checksum
Source address.
This 32-bit field defines the IPv4 address of the source.
Destination address.
This 32-bit field defines the IPv4 address of the destination.
Department of Computer Science 41
ICMP Internet Control Message Protocol
IP provides unreliable and connectionless datagram delivery.
The IP protocol is a best-effort delivery service that delivers a datagram from its original source to its final destination. It has two deficiencies:
Lack of error control and lack of assistance mechanisms
No flow control Mechanism
The IP protocol also lacks a mechanism for host and management queries. A host sometimes needs to determine if a router or another
host is alive.
Department of Computer Science 42
ICMP
The Internet Control Message Protocol (ICMP) has been designed to compensate for the above two deficiencies.
It is a companion to the IP protocol.
Types of Messages ICMP messages are divided into two broad
Categories: Error-reporting messages and Query messages
Error Reporting Messages The error-reporting messages report problems that a router
or a host (destination) may encounter when it processes an IP packet.
Department of Computer Science 43
ICMP
The query messages
These occur in pairs, help a host or a network manager get specific information from a router or another host.
For example, nodes can discover their neighbors.
Also, hosts can discover and learn about routers on their network, and routers can help a node redirect its messages.
Department of Computer Science 44
ICMP
Message Format
An ICMP message has an 8-byte header and a variable-size data section.
The first 4 bytes are common to all.
General format of lCMP messages is as under,
Department of Computer Science 45
ICMP
ICMP Type It defines the type of the message
ICMP Code It specifies the reason for the particular message
type.
Checksum The last common field is the checksum field.
The data section in error messages carries information for finding the original packet that had the error.
Department of Computer Science 46
ICMP Error Reporting
One of the main responsibilities of ICMP is to report errors.
ICMP does not correct errors--it simply reports them.
Error messages are always sent to the original source because the only information available in the datagram about the route is the source and destination IP addresses.
ICMP uses the source IP address to send the error message to the source (originator) of the datagram.
Department of Computer Science 47
Types of Error handled by ICMP
Five types of errors are handled:
Department of Computer Science 48
ICMP
The following are important points about ICMP error messages: No ICMP error message will be generated in
response to a datagram carrying an ICMP error message.
No ICMP error message will be generated for a fragmented datagram that is not the first fragment.
No ICMP error message will be generated for a datagram having a multicast address.
No ICMP error message will be generated for a datagram having a special address such as 127.0.0.0 or 0.0.0.0
Department of Computer Science 49
ICMP
Note All error messages contain a data section that
includes the IP header of the original datagram plus the first 8 bytes of data in that datagram.
The original datagram header is added to give the original source, which receives the error message, information about the datagram itself.
The 8 bytes of data are included b/c, Provide information about the port numbers (UDP and TCP)
and sequence number (TCP).
ICMP forms an error packet, which is then encapsulated in an IP datagram
Department of Computer Science 50
ICMP
Contents of data field for the error messages
IP Header 8 BytesRest of
The IP Data
ICMPHeader
IP Header 8 Bytes
ICMPHeader
IP Header 8 BytesIP Header
Received Datagram
ICMP Message
Sent IP Datagram
Department of Computer Science 51
ICMP Error Messages
Destination Unreachable
When a router cannot route a datagram or a host cannot deliver a datagram, the datagram is discarded and the router or the host sends a destination-unreachable message back to the source host that initiated the datagram.
Source Quench
IP does not have a flow control mechanism embedded in the protocol.
The lack of flow control can create congestion in routers or the destination host.
The source-quench message in ICMP was designed to add a kind of flow control to the IP. When a router or host discards a datagram due to congestion, it sends a source-quench message to the sender of the datagram.
Department of Computer Science 52
ICMP Error Messages
Source Quench message has two purposes. First, it informs the source that the datagram has
been discarded.
Secondly inform the source should slow down (quench) the sending process.
Time Exceeded When a datagram visits a router, the value of this
field is decremented by 1. When the time-to-live value reaches 0, after decrementing, the router discards the datagram.
Second, a time-exceeded message is also generated when not all fragments that make up a message arrive at the destination host within a certain time limit.
Department of Computer Science 53
ICMP Error Messages
Parameter Problem If a router or the destination host discovers an
ambiguous or missing value in any field of the datagram, it discards the datagram and sends a parameter-problem message back to the source.
Redirection When a router needs to send a packet destined for
another network, it must know the IP address of the next appropriate router.
Department of Computer Science 54
ICMP Query Messages
Query Messages
In addition to error reporting, ICMP can diagnose some network problems.
four different pairs of messages,
Encapsulation of lCMP query messages
Department of Computer Science 55
ICMP Query Messages
Echo Request and Reply
The echo-request and echo-reply messages are designed for diagnostic purpose.
echo-request and echo-reply messages determines whether two systems (hosts or routers) can communicate with each other.
Today, most systems provide a version of the ping command that can create a series (instead of just one) of echo-request and echo-reply messages, providing statistical information.
Department of Computer Science 56
ICMP Query Messages
Timestamp Request and Reply
Two machines (hosts or routers) can use the timestamp request and timestamp reply messages to determine the round-trip time needed for an IP datagram to travel between them.
Also used for synchronizing the clocks between hosts.
Address-Mask Request and Reply
To obtain its mask, a host sends an address-mask-request message to a router on the LAN.
Address-mask-reply message, providing the necessary mask for the host.
Department of Computer Science 57
ICMP Query Messages
Router Solicitation and Advertisement A host that wants to send data to a host on another
network needs to know the address of routers connected to its own network.
Also, the host must know if the routers are alive and functioning.
A host can broadcast (or multicast) a router-solicitation message.
The router or routers that receive the solicitation message broadcast their routing information using the router-advertisement message.
Note that when a router sends out an advertisement, it announces not only its own presence but also the presence of all routers on the network of which it is aware.
Department of Computer Science 58
Debugging Tools
C:\Documents and Settings\rabnawaz>ping 172.16.2.69
Pinging 172.16.2.69 with 32 bytes of data:
Reply from 172.16.2.69: bytes=32 time=60ms TTL=128Reply from 172.16.2.69: bytes=32 time<1ms TTL=128Reply from 172.16.2.69: bytes=32 time<1ms TTL=128Reply from 172.16.2.69: bytes=32 time<1ms TTL=128
Ping statistics for 172.16.2.69:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 60ms, Average = 15ms
•Debugging Tools•Ping•Traceroute
Department of Computer Science 59
Internet Group Management Protocol
IGMP
The IP protocol can be involved in two types of communication: Unicasting
One source and destination
Multicasting. One source multiple destinations
IGMP is not a multicasting routing protocol; it is a protocol that manages group membership.
In any network, there are one or more multicast routers.
The IGMP protocol gives the multicast routers information about the membership status of hosts (routers) connected to the network.
Department of Computer Science 60
Group Management
A multicast router may receive thousands of multicast packets every day for different groups.
If a router has no knowledge about the membership status of the hosts, it must broadcast all these packets.
This creates a lot of traffic and consumes bandwidth. A better solution is to keep a list of groups in the
network for which there is at least one loyal member.
IGMP helps the multicast router create and update this list.
Department of Computer Science 61
IGMP
Note
IGMP is a group management protocol. It helps a multicast router create and update a list of loyal members related to each router interface.
Department of Computer Science 62
IGMP
IGMP Messages
IGMPv2 has three types of messages:
Query
Membership report
Leave report.
There are two types of query messages:
general and special
Department of Computer Science 63
IGMP
Message Format
Type.
This 8-bit field defines the type of message,
Department of Computer Science 64
IGMP
Maximum Response Time.
This 8-bit field defines the amount of time in which a query must be answered.
The value is in tenths of a second; for example, if the value is 100, it means 10 s.
Checksum.
This is a 16-bit field carrying the checksum. The checksum is calculated over the 8-byte message.
Group Address
The value of this field is 0 for a general query message.
The value defines the groupid (multicast address of the group) in the special query,
Department of Computer Science 65
IGMP Operation
IGMP Operation
IGMP operates locally.
A multicast router connected to a network has a list of multicast addresses of the groups with at least one loyal member in that network.
List of groups having loyal members
To another network
To another network
To another network
Network
Department of Computer Science 66
IGMP Operation
For each group, there is one router that has the duty of distributing the multicast packets destined for that group. Router R distributes packets with the multicast
address of 225.70.8.20.
A host or multicast router can have membership in a group.
When a host has member ship, it means that one of its processes (an application program) receives multicast packets from some group.
When a router has membership, it means that a network connected to one of its other interfaces receives these multicast packets.
Department of Computer Science 67
IGMP Operation
Joining a Group A host or a router can join a group.
A host maintains a list of processes that have membership in a group.
When a process wants to join a new group, It sends its request to the host.
The host adds the name of the process and the name of the requested group to its list.
If this is the first entry for this particular group, the host sends a membership report message.
Else
No problem (don’t send membership report)
Department of Computer Science 68
IGMP Operation
In IGMP, a membership report is sent twice, one after the other.
Leaving a Group
When a host sees that no process is interested in a specific group, it sends a leave report.
When a router sees that none of the networks connected to its interfaces is interested in a specific group, it sends a leave report about that group.
When a multicast router receives a leave report, it cannot immediately purge that group from its list because the report comes from just one host or router; there may be other hosts or routers that are still interested in that group.
Department of Computer Science 69
IGMP Operation
To make sure, the router sends a special query message and inserts the groupid, or multicast address, related to the group.
The router allows a specified time for any host or router to respond.
Monitoring Membership
Consider the situation in which there is only one host interested in a group, but the host is shut down or removed from the system.
The multicast router will never receive a leave report.
How is this handled?
The multicast router is responsible for monitoring all the hosts or routers in a LAN to see if they want to continue their membership in a group.
Department of Computer Science 70
IGMP Operation
The router periodically (by default, every 125 s) sends a general query message.
Department of Computer Science 71
Network Layer
Department of Computer Science 72
Routing
Delivery
Delivery refers to the way a packet is handled by the underlying networks under the control of the network layer.
Forwarding
Forwarding refers to the way a packet is delivered to the next station.
Routing
Routing refers to the way routing tables are created to help in forwarding.
Department of Computer Science 73
Routing
Direct and indirect delivery
Direct Delivery Indirect and Direct Delivery
Department of Computer Science 74
Routing at Network Layer
Forwarding 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 Techniques Several techniques can make the size of the routing
table manageable, Next-Hop Method vs Route Method
Network-Specific vs Host specific method
Department of Computer Science 75
Routing at Network Layer
Department of Computer Science 76
Routing at Network Layer
Host-specific versus network-specific method
Department of Computer Science 77
Routing at Network Layer
Default Method
Host A is connected to a network with two routers.
Router R1 routes the packets to hosts connected to network N2.
So instead of listing all networks in the entire Internet, host A can just have one entry called the default
Department of Computer Science 78
Routing at Network Layer
Routing Table
Static Routing Table
(A static routing table contains information entered manually)
Dynamic Routing Table
A dynamic routing table is updated periodically by using one of the dynamic routing protocols such as RIP, OSPF, or BGP.
Automatic updating of routing tables.
Department of Computer Science 79
Unicast routing protocols
Routing tables need to be updated when a router is down, and they need to be updated whenever a better route has been found. Routing protocols have been created in response to
the demand for dynamic routing tables.
A routing protocol is a combination of rules and procedures that lets routers in the internet inform each other of changes.
It allows routers to share whatever they know about the internet or their neighborhood.
The routing protocols also include procedures for combining information received from other routers.
Department of Computer Science 80
Routing at Network Layer
Optimization
A router is usually attached to several networks.
When it receives a packet, to which network should it pass the packet?
The decision is based on optimization: optimum route selection.
One approach is to assign a cost for passing through a network, called metric.
The metric assigned to each network depends on the type of protocol.
Department of Computer Science 81
Routing
Intra- and Interdomain Routing
Today, an internet can be so large that one routing protocol cannot handle the task of updating the routing tables of all routers.
For this reason, an internet is divided into autonomous systems (AS).
An autonomous system (AS) is a group of networks and routers under the authority of a single administration.
Department of Computer Science 82
Routing at Network Layer
Intradomain
Routing inside an autonomous system is referred to as intradomain routing.
Interdomain
Routing between autonomous systems is referred to as interdomain routing.
Department of Computer Science 83
Autonomous system
Department of Computer Science 84
Routing Protocols
Popular routing protocols
Department of Computer Science 85
Distance Vector Routing
Distance Vector Routing
In distance vector routing, the least-cost route between any two nodes is the route with minimum distance.
Each node maintains a vector (table) of minimum distances to every node.
Routing tables maintains the next hop entry to forward the packet.
Department of Computer Science 86
Distance Vector Routing
----C
---A-
-AA-A
---A-
C--C-
Department of Computer Science 87
Distance Vector Routing
In distance vector routing, each node shares its routing table with its immediate neighbors periodically and when there is a change.
Initialization
Department of Computer Science 88
Distance Vector Routing
Table Updating
Department of Computer Science 89
Distance Vector Routing
When to Share?
Periodic Update
A node sends its routing table, normally every 30 s, in a periodic update.
Triggered Update
Anytime there is a change in its routing table.
Department of Computer Science 90
Distance Vector Routing
Two-Node Loop Instability
X 6 AX-6-AX-2-
X-6-AX-ὲ-
X-10-A X-6-A
X-10-A X-14-A
X-ὲ- X-ὲ-
Department of Computer Science 91
Distance Vector Routing
Some solution
Defining infinity
Split Horizon
Split Horizon and Poison Reverse
Department of Computer Science 92
RIP
RIP (Routing Information Protocol)
An Interdomain routing protocol used inside an autonomous system.
Based on distance vector routing.
RIP implements distance vector routing directly with some consideration
In an autonomous system, we are dealing with routers and networks (links). The routers have routing tables; networks do not.
The destination in a routing table is a network, which means the first column defines a network address.
Department of Computer Science 93
RIP
The metric in RIP is called a hop count.
Infinity is defined as 16, which means that any route in an autonomous system using RIP cannot have more than 15 hops.
The next-node column defines the address of the router to which the packet is to be sent to reach its destination.
Department of Computer Science 94
RIP
Example of a domain using RIP
Department of Computer Science 95
Link State Routing
In link state routing, each node in the domain has the entire topology of the domain. The node can use Dijkstra's algorithm to build a
routing table.
Department of Computer Science 96
Link State Routing
Each node uses the same topology to create a routing table, but the routing table for each node is unique because the calculations are based on different interpretations of the topology.
This is analogous to a city map.
Each person may have the same map, each needs to take a different route to reach her specific destination.
Department of Computer Science 97
Link State Routing
If there are changes in any point in the network, The topology must be updated for each node.
Building Routing Tables In link state routing, four sets of actions are required
Routing table showing the least-cost node to every other node. Creation of the link state packet (LSP).
Flooding of LSPs
Formation of a shortest path tree for each node.
Calculation of a routing table based on the shortest path tree.
Department of Computer Science 98
Link State Routing
LSPs are generated on two occasions:
When there is a change in the topology of the domain.
On a periodic basis.
The period is much longer than Distance vector.
Flooding of LSPs
The creating node sends a copy of the LSP out of each interface.
Older LSPs are discarded, new are kept. This is done through sequence numbers included in LSP.
Flood the information out of each interface except the one from which the packet arrives.
This ensures that flooding stop somewhere in domain.
Department of Computer Science 99
Link State Routing
Formation of Shortest Path Tree: Dijkstra Algorithm
After receiving all LSPs, each node will have a copy of the whole topology.
A shortest path tree is needed.
A tree is a graph of nodes and links; one node is called the root.
A shortest path tree is a tree in which the path between the root and every other node is the shortest.
Department of Computer Science 100
Link State Routing
Department of Computer Science 101
Link State Routing
Calculation of Routing Table from Shortest Path Tree
Each node uses the shortest path tree protocol to construct its routing table.
The routing table shows the cost of reaching each node from the root.
Department of Computer Science 102
OSPF
Open shortest Path First An intradomain routing protocol based on link state
routing.
Areas An area is a collection of networks, hosts, and routers all
contained within an autonomous system.
An autonomous system can be divided into many different areas.
Routers inside an area flood the area with routing information.
At the border of an area, special routers called area border routers summarize the information about the area and send it to other areas.
Department of Computer Science 103
OSPF
Among the areas inside an autonomous system is a special area called the backbone;
All the areas inside an autonomous system must be connected to the backbone.
the backbone serves as a primary area.
The routers inside the backbone are called the backbone routers.
a backbone router can also be an area border router.
Each area has an area identification.
The area identification of the backbone is zero.
Department of Computer Science 104
OSPF
Area in Autonomous system
Department of Computer Science 105
OSPF
Metric The OSPF protocol allows the administrator to assign
a cost, called the metric, to each route.
The metric can be based on a type of service (minimum delay, maximum throughput, and so on).
Types of Links In OSPF terminology, a connection is called a link.
Four types of links, Point to point
Transient
Stub
virtual
Department of Computer Science 106
OSPF
Point to point link
4 4
Transient link
A
C
B
E D
Department of Computer Science 107
OSPF
If we want to show the neighborhood of previous figure the relationship in this situation,
A
C
B
E
D
Unrealistic representation
Department of Computer Science 108
OSPF
Realistic representation
A
C
B
E
D
Designated Router
Department of Computer Science 109
OSPF
Stub link
A stub link is a network that is connected to only one router.
The data packets enter the network through this single router and leave the network through this same router.
This is a special case of the transient network. We can show this situation using the router as a node and using the designated router for the network.
Department of Computer Science 110
OSPF
Virtual Link
When the link between two routers is broken, the administration may create a virtual link between them, using a longer path that probably goes through several routers.
Department of Computer Science 111
Interdomain Routing
Path Vector Routing
In path vector routing, we assume that there is one node called speaker node in each autonomous system that acts on behalf of the entire autonomous system.
The speaker node in an AS creates a routing table and advertises it to speaker nodes in the neighboring ASs.
The idea is the same as for distance vector routing except that only speaker nodes in each AS can communicate with each other.
Department of Computer Science 112
Path Vector Routing
The advertisement is also different in this case,
A speaker node advertises the path, not the metric of the nodes, in its autonomous system or other autonomous systems.
Initialization
At the beginning, each speaker node can know only the reachability of nodes inside its autonomous system.
Department of Computer Science 113
Path Vector Routing
Initial routing tables in path vector routing
Speaker NodeA1 for AS1B1 for AS2C1 for AS3D1 for As4
Department of Computer Science 114
Path Vector Routing
Sharing In path vector routing, a speaker in an autonomous
system shares its table with immediate neighbors.
When a speaker node receives a two-column table from a neighbor, it updates its own table by adding the nodes that are not in its routing table and adding its own autonomous system and the autonomous system that sent the table.
According to the figure, if router A1 receives a packet for nodes A3, it knows that the path is in AS1 (the packet is at home);
But if it receives a packet for D1, it knows that the packet should go from AS 1, to AS2, and then to AS3.
Department of Computer Science 115
Path Vector Routing
Stabilized tables for three autonomous systems
Department of Computer Science 116
BGP
Border Gateway Protocol
Border Gateway Protocol (BGP) is an interdomain routing protocol using path vector routing.
It first appeared in 1989 and has gone through four versions.
We can divide autonomous systems into three categories:
Stub
Multihomed
Transit.
Department of Computer Science 117
BGP
Stub AS A stub AS has only one connection to another AS.
Multihomed AS. A multihomed AS has more than one connection to
other Ass.
It does not allow data coming from one AS and going to another AS to pass through.
It does not allow transient traffic.
Transient AS A transit AS is a multihomed AS that also allows
transient traffic.
E.g. national and international ISPs (Internet backbones).
Department of Computer Science 118
BGP Session
External and Internal BGP
BGP can have two types of sessions:
External BGP (E-BGP)
The E-BGP session is used to exchange information between two speaker nodes belonging to two different autonomous systems.
Internal BGP (I-BGP)
It is used to exchange routing information between two routers inside an autonomous system.
A1B1AS1 AS2
--- I-BGPE-BGP
Department of Computer Science 119