Routing via IP address

IP is a connectionless protocol In a connectionless service, the network layer protocol treats each packet independently. The packets may or may not travel the same path to their destination. In a connectionless service, the decision about the route of packet is made individually by each router.

occurs when the source and destination of a packet are located in the same physical network or if the delivery is between the last router and the destination host.

the packet goes from router to router until it reaches the one connected to the same physical network as its final destination. In an indirect delivery, the sender uses the destination IP address and the routing table to find the IP address of the next router to which the packet should be delivered. In an indirect delivery the address mapping between the IP address of the next router and the physical address of the next router is done by the .

Host-specific method: The destination host address is given in th routing table. (too large) Network-specific method: Instead of having an entry for every destination host connected to the same physical network. We have only one entry that defines the address of the destination network itself. (much smaller) Default routing method: There is still too much networks to fit into a routing table. Router R1 route the packet to host connected to network N2. For the rest of the Internet router R2 is used instead of using all networks in the entire Internet, Host A can just have one entry called

Problem: IP address in the packet is of the destination Host, Routing table only stores some network address. Next-hop address is IP address Most times hop is a router

Forwarding with classful addressing:

Routing in Classful address

Figure above shows an imaginary part of the Internet. Show the routing tables for router R1. Figure above shows the three tables used by router R1. Note that some entries in the next-hop address column are empty because in these cases, the destination is in the same network to which the router is connected (direct delivery). In these cases, the next-hop address used by ARP is simply the destination address of the packet.

Forwarding with subnetting: Subnetting happens inside the organization. The model for fixed length subnetting:

  1. The model extract the destination address of the packet from the Header.(without the mask!)
  2. The destination address and the mask are used to extract the subnet address.
  3. The table is searched using your subnet address to find the next hop address and the interface number. If no match is found the default is used. If the column is empty, it means the next hop is the destination Host.
  4. The next hop address and the interface number are given to ARP.

Routing for classless addressing

In Classless Addressing We need at least four columns. Mask, Network address, Next-hop address, Interface: Sort the mask from the longer to shorter. The last one will be default. For each row, mask is applied to the destination address, get the result, compare the result with the network address in the row. If it matches, we can get the next-hop address and interface and do ARP. If not matches, we need to go to the next row.

Address Aggregation: To reduce the size of routing table, the idea of address aggregation was introduced. The blocks of addresses for many organization are aggregated into one larger block.

Routing in classless addressing uses . The routing table is sorted from the longest mask to the shortest mask.

Hierarchical routing with ISPs ISP: Internet service provider. Regional ISP -> Local ISP -> Small ISP Large block => Small blocks

To Solve the problem of Gigantic routing tables we can create a sense of Hierarchical in the routing tables.

Searching in classful address The routing table is divided into three tables (Called “Buckets”) one for each class. When a packet arrives, the router applies the default mask to find the corresponding bucket(A,B,C) the router then searches the corresponding bucket.

Searching in classless address The routing table is divided into “Buckets”, one for each prefix, the router first tries the longest prefix. If the destination address is found in this bucket, the search is complete. If the address is not found, the next prefix is searched.

static routing table

It contains information entered manually. The administrator enters the route for each destination into the table. When the table is created, it can not update automatically, when there is a change in the internet.

Dynamic Routing Table

It is updated periodically using one of the dynamic routing protocols whenever there is a change in the internet, such as shut down of a router or breaking of a link. The dynamic routing protocols update the tables in the router.