The main function of an IP is IP routing. This function provides a mechanism for routers to connect several different physical networks. A device can function as a host or a router.
There are 2 types of IP routing, namely: direct and indirect.
1. Routing Type
1.1. Direct Routing
If our host and the destination are in 1 network. Then our data when sent to the destination will be sent directly by encapsulating the IP datagram on the physical layer. This is called Direct Routing.
1.2. Indirect Routing
If we want to send data to another destination, where the destination is on a different network from us. So for that, 1 more IP address is needed which is used as the IP gateway. The address on the first gateway (first hop) is called an indirect route in the IP routing algorithm. The address of the first gateway is only needed by the sender to send data to a destination that is on a different network.
Figure 4.2 shows the differences between direct and indirect routing.
[
Figure 4.2 Direct and Indirect Route – Host C has a direct route to Hosts B and D, and has an indirect route to host A via gateway B.
2. Routing Table
Determining the direction of various direct routes can be seen from the interface list. While the list of networks and gateways can be configured later. The list is used for IP routing facilities. The information is stored in a table called the direction table (Routing Table).
The types of information contained in the routing table include:
- Direct route obtained from the installed interface
- Indirect route which can be reached through one or more gateways
- Default route, which is the final direction if you cannot connect via direct or indirect route.
Figure 4.3 Routing Table Scenario
Figure 4.3 shows an example of a network. The routing table of host D will contain:
Destination Router Interface
129.7.0.0 E Lan0
128.15.0.0 D Lan0
128.10.0.0 B Lan0
Default B Lan0
127.0.0.1 Loopback Lo
Host D is connected to the 128.15.0.0 network, so a direct route is used for this network. To connect to the 129.7.0.0 and 128.10.0.0 networks, an indirect route is required via E and B. While the routing table for host F contains:
Destination Router Interface
129.7.0.0 F Wan0
Default E Wan0
127.0.0.1 Loopback Lo
Since networks other than 129.7.0.0 must be reached via E, host F simply uses the default route via E.
3. IP routing algorithm
The routing algorithm is depicted in Figure 4.4.
Figure 4.4 Routing Algorithm
Understanding Routing Protocols
One of the functions of the IP protocol is to form connections from various different forms of interfaces. The system that performs this task is called an IP router. This type of device is installed with two or more forms of interfaces and forwards datagrams between networks.
When sending data to a destination, a host will pass through a router first. Then the router will forward the data to its destination. The data flows from one router to another until it reaches its destination host. Each router selects a path to go to the next hop.
[
Figure 6.1 Routing operations on IP
Figure 6.1 shows a network where host C forwards data packets between network X and network Y.
The routing table on each device is used to forward data packets on each network segment.
Routing protocols have the ability to build information in the routing table dynamically. If there is a change in the network, the routing protocol is able to update the routing information.
Autonomous System
The definition of Autonomous System (AS) is part of understanding Routing Protocol. AS is a logical part of a large IP Network. AS is usually owned by a network organization. AS is administered by an official management. AS can be connected to other AS, both public and private. An illustration of AS can be seen in Figure 6.2.
[
Figure 6.2 Autonomous System
Some routing protocols are used to determine paths in an AS system. Others are used to interconnect a set of autonomous systems, namely:
- Interior Gateway Protocol (IGP): with IGP routers can exchange routing information between AS. Examples of this protocol include Open Shortest Path First (OSPF) and Routing Information Protocol (RIP).
- External Gateway Protocol (EGP): with EGP routers can exchange final results (summaries) between AS. Examples of this protocol include Border Gateway Protocol (BGP).
Routing Process in UNIX System
In addition to using the Router machine. Routing protocols can also be run on UNIX systems with the help of several applications, including:
- RouteD : supports interior routing by implementing RIP
- GateD : supports interior and exterior routing by implementing OSPF, RIPv2, BGP-4
- Quagga: supports interior and exterior routing by implementing OSPFv3, RIPv1, RIPv2, RIPng, BGP4.
Understanding IP Datagrams
The unit sent in an IP network is an IP datagram. In which there is a header and data related to the layer above it.
Figure 4.6 IP Datagram Format
Where:
- VERS : version of the IP used. Version 4 means using IPv4, 6 means IPv6.
- HLEN : length of IP header
- Service: serial number quality of service (QoS)
- Total Length : number of IP datagrams
- ID: data number from the sender if fragmentation occurs
- Flags : fragmentation markers
- Fragment offset: the sequence number of the fragment data can be the data that has been fragmented.
- Time to Live (TTL): the length of time data can be on the network, in seconds.
- Protocol: number of the protocol type used
- Checksum header: used to check if data is damaged
- Source IP address : 32 bit sender address
- Destination IP Address : 32 bit destination address
- IP options: used if data requires additional processing
- Padding: used to round the number of IP options columns to 32.
- Data: data sent including the header in the layer above it.
Fragmentation
On its way to its destination, data will pass through various different interfaces. Where each interface has a different ability to send data frames. This ability is called the Maximum Transfer Unit (MTU). The maximum limit of data that can be placed in 1 frame.
IP can separate the sent data into MTU sizes. This separation process is called fragmentation.
Understanding Private IP
The need for IP addresses goes hand in hand with the increasing use of the internet. Because the number of IP addresses used is increasingly running out. To overcome this problem, the use of Private IP is carried out.
This Private IP is regulated in RFC 1918 -- Address allocation for Private Internets. This RFC explains the use of IP addresses that must be globally unique. And the use of some parts of the IP address that are used not to connect directly to the internet. This IP address is used for intranet paths. These IP addresses are:
- 10.0.0.0 : used for class A networks
- 172.16.0.0 -- 172.31.0.0 : used for class B networks
- 192.168.0.0 -- 192.168.255.0 : used for class C networks.
Networks using these addresses will not be routed within the internet.
Understanding IP X.25 Encapsulation
IP encapsulation over X.25 is documented in RFC1356. X.25 is an interface between hosts and packet switching, and is widely used in ISDN.
Layers in X.25:
Physical o Is the interface between the station and the node.
DTE on user device
DCE on node o Using X.21
It is a sequence of frames
- Link o Link Access Protocol Balance (LAPB), is part of HDLC
- Packet o Is an external virtual circuit
It is a logical circuit between subscribers.
The use of X.25 can be seen in Figure 3.20.
Figure 3.20 X.25 Usage
Frame Relay
Frame Relay is a development of X.25.
Frame relay characteristics:
- Call Control is performed on logical connections.
- Multiplexing and switching are done at layer 2.
- There is no flow control and error control at each hop.
- Flow control and error control are performed in the upper layers.
- Using a single data frame.