Date : 4th Aug 03

Scribe : Jaya Kawale

Routing is the process of determining which output line an incoming packet should be transmitted on.

Routing Protocols
1) Link State Routing - Each node announces its link state (i.e. the delay or cost to each of its neighbours) to the entire network.
Local information is shared globally.

2) Distance Vector Routing - Each node announces its knowledge about the best known distance to each destination to its neighbours.
Global information is shared locally.
Problem - Count to Infinity Problem.

3) Path Vector Routing - In distance vector routing each node will say its cost to all the nodes in the graph.A <- C(n) announced.

In path vector in addition to the cost you announce the entire path to the neighbours.For eg. in the above figure if you need to send packets from 2 to 4, distance vector routing will say that the distance is 2, whereas in path vector along with the distance the actual path is also sent.
Path vector avoids count to infinity problem and looping because it sends the entire path.

4) Hierarchical Routing - Routers are divided into regions.Each router knows the details of how to route packets to destinations within its own region, but knows nothing about the internal structure of other regions.
Routing within the region is different from routing across the regions.

Problem - You may not have the exact optimal path.

Network Adresses
IPv4 addresses consist of 32 bits. Class A networks have network addresses ranging from through The network number is the first octet and it uniquely identifies the class A destination network. The rest of the address uniquely identify the machine in the network.Similarly, we have class B, Class C, Class D and class E networks. Network address classes are not an efficient way to allocate IP addresses as there is a significant amount of wastage. Hence the concept of classless addresses emerged.

Internet Service Providers
Internet is divided into multiple domains and these domains are connected. In 95' Internet was commercialized so the concept of ISP imerged. ISP is Internet Service Provider.Eg -VSNL. If u use a dialup connection you are given a dyanamic IP address and you get connectivity.
How does the connectivity happen ?
ISPs have business realtionship in which money and data are exchanged.
There are 2 kinds of business relationship
1) Peer to Peer
2) Transit (Provider Customer)

Peering means ISPs reciprocally provide to each other connectivity. For eg. in the above fig. customers of A can reach customers of B. Peering is however non-transitive. So while customers of B can reach customers of A they cannot reach customers of C.
In Provider-Customer, one ISP sells access to all destinations in its routing table. For eg. - if B agrees to be the transit for its customers. So B will provide routing tables to its customers, if A and C are its customers.

Reasons to peer
1) Cost - Inorder to avoid cost of buying transit. In Provider-Customer, the customer has to pay.

Reasons not to peer
1) Traffic Asymmetry - If A and B try to peer and there is a lot of traffic from A to B and not the other way then B will not benefit as much as A.
2) Peering consumes resources.
3) No service level guarantee - You cannot ask for a particular service as in the case of Provider-Customer.

ISP and AS
AS stands for Autonomous Systems. A large ISP may consist of many Autonomous System. Autonomous System term is used in Routing and ISP term is used in business. ISP can have many autonomous system within and can be geographically very spread out.
Hierarchy of ISP relationships -

If you draw graph with the AS you get the Internet.Within the Autonomous System, Interior Gateway Protocol is used and outside Exterior Gateway Protocol.

Border Gateway Protocol
Border Gateway Protocol is a routing protocol commonly used between autonomous systems. Data path is the reverse of control path. BGP uses policy based routing. In Link State Routing it is difficult to implement policies. Border router will exchange BGP routing messages. BGP implemented on top of TCP. BGP has to deal with Internet Routing which is the function of the IP layer. TCP is on top of IP.

So how is BGP on top of TCP ? To exchange data you don't need the entire routing information. BGP routing messages are exchanged reliably.TCP connection will not follow the control path.

BGP messages
4 kinds
1) OPEN - For Initialization, exchange of AS numbers. Each Autonomous System is assigned a number. The Internet Authority provides the AS numbers.
2)UPDATE - When you want to announce a route to it would be announced through BGP. Once an announcement happens there are no soft states. In Distance Vector Routing you periodically announce your state. So if your state changes( eg. if the network gets partioned) you don't have to do anything.In BGP you need to explicitly withdraw. Update is used to route announcements and withdrawls.
3) NOTIFICATION - Before closing a connection, the information must be explicitly send to the others using the Notification message.
4) KEEP-ALIVE - Since you have to explicitly withdraw you need to know about your neighbourhood. Keep alive is a dummy message that helps in keeping the BGP session alive.

Path Attributes
1) Origin -
Different ways to find out the route to prefix are -
a) Interior Gateway Protocol - for within the same AS
b) Internal BGP - In a large autonomous system, the border routers will exchange information among themselves.
c) External BGP - from some other BGP router
2) As-Path - contains the actual path you will send
3) Next-hop - What is the next hop IP address that the packets have to take on the reverse path i.e. the data path
4) Multi-Exit-Discriminator - When 2 Autonomous Systems are linked to each other using more than 2 links then MED attribute will be used in finding the preferred route. For eg. in the fig. , AS2 will announce the route to AS3 in 2 different places. If it announces only in one place and that link goes down then there would be a problem. So, it announces in both the places and says that it prefers one over the other with the MED attribute.

5) Local Preference - The local preference attribute is used to prefer an exit point from a local Autonomous System. The local preference attribute is propogated throughout the local AS.