Presentation is loading. Please wait.

Presentation is loading. Please wait.

Router and Routing Basics

Similar presentations


Presentation on theme: "Router and Routing Basics"— Presentation transcript:

1 Router and Routing Basics
V1.2

2 Objectives Understand the function of router
Know the basic conception in routing Know the working principle of router Understand IP routing process Understand the route between VLANs Upon the completion of this course, you will be able to Understand the function of router Know the basic conception in routing Know the working principle of router Understand IP routing process Uunderstand the route between VLANs

3 Contents Router definition and function Basic conception
Working principle of router IP routing process VLAN route This course have 5 parts Router definition and function Basic conception Working principle of router IP routing process VLAN route Now we go ahead to discuss the 1st part-- Router definition and function

4 Router definition(1) Router——A kind of computer device used to interconnect networks Router must have the following features: Multiple network layer interfaces to interconnect different networks Implement the protocols up to the network layer Have the function of storing、forwarding、path-finding A router is a special computer device used to connect different networks. It forwards data units between different networks. The major features of a router is to interconnect different networks and to forward data units between them. To forward data units between different networks, the router must satisfy the following conditions. First, multiple Layer 3 interfaces of the router should be connected to different networks. Each of them is connected to a logical network segment. The Layer 3 interface here may be a physical interface, a logic interface or a sub-interface. a router protocol should be implemented at least at a network layer. This is because the router works at the network layer and forwards data according to a destination network address. Finally, the router must be capable of storing, forwarding and routing.

5 Router functions(2) The core function of router is interconnecting networks and data forwarding. routing:building route table and refreshing switching:forwarding packet between networks. Insulate broadcast packets,define access rule. Connecting different kinds of networks. Rate adapting between networks. The key functions of the router are explained as follows: • Routing: to establish, maintain and search routing tables. • Switching function: The switching function of a router differs from that performed by an Ethernet switch. The former refers to the process of forwarding packet data between networks. In this process, the router receives data frames from a receiving interface, decapsulates them and processes packets correspondingly. Then, it searches for the routing table according to a destination network, determines the forwarding interface, and completes new data link layer encapsulation. • Insulate broadcast and specify access rules: A router prevents broadcast passing. Besides, you can set Access Control List (ACL) for flow control. • Interconnection of heterogeneous networks: A router supports different data link layer protocols and can be connected with heterogeneous networks. • Rate adaptation between subnets: A router has multiple interfaces with different rates. It needs to employ cache and flow control protocols for rate adaptation.

6 Contents Router definition and function Basic conception
Working principle of router IP routing process VLAN route OK, now we go head to discuss the basic concepts in router and routing, after we know all these concepts, it will be ready for us to learn the working principle of router.

7 Route table The information that router need to forward data is stored in a table, called ’route table’ Router check the destination address of the packet, and choose the next hop based on the information in route table. Route table is stored in RAM One function of a router is to find the optimal transmission path for each data frame that passes through the router so that this data can be effectively transferred to a destination site. A router saves related various information of transmission paths in a route table. Normally, the router checks with the route table and determines the forward-path according to the destination network segment address of the received IP packet. Routing tables are stored on the RAM of a router. This means that the router needs sufficient RAM to maintain routing information. Besides, once the router is restarted, all the original routing information in the RAM will disappear.

8 Route table composition
Destination address (Dest) Mask (Mast) Next hop address (Gw) Forwarding physical interface (interface) Source of the information (Owner) Route priority (pri) metric(metric) Route table composition. A typical route entry has the following parts: Destination address (Dest) Mask (Mast) Next hop address (Gw) Forwarding physical interface (interface) Source of the information (Owner) Route priority (pri) metric(metric) In this 7 parts, the first 4 parts are used guide the packet transferring, the last 3 parts are used for route information selection to route table. Destination address (Dest)and Mask (Mast)are used to uniquely describe a destination. IP packet is transferred hop by hop in IP network. So an IP route, every router need to find out a nexthop to the destination. After router find the nexthop, then the interface for send the packet out to the nexthop will also be found due to the nexthop IP address. Because each interface in the router must belong different network, so the nexthop IP address can identify the corresponding out going interface. The route information to the same destination may come form different source, we need mark its owner and then decide the route comes from which source/owner should be put into route table. Here we use a priority system to do the selection. Every type of route, for example, the routes come from muanually config/OSPF/RIP are assigned a route priority due the analysis and experience that which source always gives better routes then others. Metric is used inside a source of route information. When several route to the same destination are found in the same owner, this owner will use a metric system to decide it recommend which route to the route table. Different source of route/owner has different metric system. For example, ospf uses the path cost as a metric, a cost value is relative to the bandwidth of a link. The lowest cost route is the best route. While RIP uses hops as a metric. The lest hops route is the best. When route information to one destination is generated, each source may generate more than one route, so it will use the metric to select and recommend to route table. Before the route go to route table, it need to compare the priority with routes from other sources. Then the highest priority route can go to the route table.

9 Route table composition
Example Dest Mask Gw Interface Owner pri metric fei_1/ static Destination network address Destination network mask Next hop address fei_1/ Route learning interface and forwarding interface static how does router learns this entry route priority Metric Here shows one piece of routing information in a routing table. In this routing information: “ ” is the destination network address or subnet address is the mask of the destination logical network or subnet. “ ” is a next hop logical address. “fei_0/1.1” is the interface used to obtain this route information and forward data. Static is the mode in which a router obtains this route. In this example, the routing information is learned by means of manual configuration. “1” is the route management distance of this route. “0” is the Metric of this route.

10 Route table establishing and refreshing
How is route established at the beginning? How to maintain the route table after it is established? We already know the structure of a route table entry. How can all these route entries be filled in into the route table? Before we explain the mechanism of this please try ask youself the following questions and try to answer them, see if that the later explanations are the same as you expected. How is route established at the beginning? How to maintain the route table after it is established?

11 Directly connected route
Route Types Directly connected route Static route Dynamic route According to the modes and features of routing information generation, that is, how a route is generated, routes can be classified into direct routes, static routes and dynamic routes. Directly connected route is studied by router itself when interfaces status is up and IP address is configured. The route will be learn by router immediately when router is startup or configuration over the interface is changed. Directly connected route, as its name, can not tell the router the route to the network which is not directly connected to this router. Static route is manually set by the network administrator. The network administrator study the network topology and tell the router the route to the network which is not directly connected to this router. Dynamic route is generated by the routing protocol processes, it’s used to study the network topology and tell the router the route automatically, without human or manually study and configuration. Dynamic route is able automatic updated due to the topology change. It is suitable for large-scale and complex network applications. For all these 3 types, Directly connected route has the highest priority, Static route has 2nd highest priority and Dynamic route has lower priority.

12 Directly connected route
/24 /30 e1_1 fei_1/1 A /24 /30 B IPv4 Routing Table: Dest Mask Gw Interface Owner pri metric fei_1/ direct fei_1/ address e1_ direct e1_ address Directly connected route. When network address is configured and the status of the interface is valid, the network configured on this network will appear in the route table and associated with this interface,the route will change with the status of the interface. Directly connected route always get 2 entries appear in the route table in the same time. Direct route and address route, Direct route is used to forward the packets to the network. Address route is used to forward the packets when these packets’ destination is the router (router interface address) itself Directly connected route has the highest priority among all types of route, and its GW or nexthop is the IP address of its own interface. Directly connected route When network address is configured and the status of the interface is valid, the network configured on this network will appear in the route table and associated with this interface,the route will change with the status of the interface.

13 Static Route The route manually set by the network administrator is not updated automatically with the change of network topology. The route table takes effect under the condition that the next hop is reachable. Advantage: It does not occupy the network resources or system resources. Disadvantage: It needs to be configured by the administrator manually one by one, and does not automatically adjust with the change of network status. The route manually set by the network administrator is not updated automatically with the change of network topology. The route table takes effect under the condition that the next hop is reachable. That means, if the nexthop of the static route is not directly connected to any interface of this router, in other words, if the IP address of the nexthop is not in the same network with any interface of this router, then this route is invalid, this route will not appear and takes effect in the route table even you configured it. Advantage: It does not occupy the network resources or system resources. Disadvantage: It needs to be configured by the administrator manually one by one, and does not automatically adjust with the change of network status.

14 Static Route Configuration
Stub Network SO B A B Network We configure static routes by using the ip route command. One static route configuration command should include the following elements Destination address: Used to identify the destination address or destination network of an IP packet & Network mask: It, together with a destination address, identifies the destination network. Next hop IP address: Describes the next IP address to which an IP packet is routed. Static route is used in a routing table when next hop is reachable. That is, the network segment of the next hop address of this route is reachable to a router. As shown in Fig. the static routes of Router A are configured as follows: The packets are sent to the network They will be routed to the router with the address : ZXR10(config)#ip route l Please look at white board. The interface from which an IP packet is transmitted can be found automatic by router through the Next hop IP address. One next hop IP address is map to one interface of a router because the interface and directly connected network segment are one on one mapped in a router. While knowing the outgoing interface, the router can’t tell what is the nexthop address because it may have serveral next hop due to the topology. ip route This is a unidirectional route, there should be an opposite route configured on the counterpart router.

15 Default Route The default route is a route in the route table, used to transfer the data packets in the route table that does not have a specific route entry. The default route can be a static route set by the administrator, or be automatically generated by the dynamic route protocol. Advantage: It dramatically reduces the number of route entries in the route table. Disadvantage: If the default route is not configured correctly, it will cause the route loop, or not the optimal route. The default route is a route in the route table, used to transfer the data packets in the route table that does not have a specific route entry. The default route can be a static route set by the administrator, or be automatically generated by the dynamic route protocol. For example, a router with its Stub area configured with the OSPF routing protocol will dynamically generate a default route. Advantage: It dramatically reduces the number of route entries in the route table. Disadvantage: If the default route is not configured correctly, it will cause the route loop, or not the optimal route.

16 Default Route Configuration
Example Stub Network SO Network A B In a routing table, the default route is to be the route to the network (the mask is also , it represent all the networks). You can check its information by using the Show ip route command. If the destination address of a packet cannot match any item of a routing table, then this packet will select the default route. This slide exemplifies a manually configured default route. The sub network is a network which has only one exit to other networks. In this situation, we can configure a default route. All IP packets from the network , which are not matched by route entries with explicit destination addresses, are transferred to the default gateway ip route

17 Dynamic route OSPF RIP OSPF RIP
/8 /8 /8 Routing protocol is a software process running on the router. It will exchange routing information with other routers,studying route information of network not directly connected and adjusting the route information when topology changes. Routing protocol is a software process running on the router. It will exchange routing information with other routers,studying route information of network not directly connected and adjusting the route information when topology changes. Look at the picture, after a dynamic routing protocol like ospf has been configured, its process runs on the router and generates and maintains the routing table by exchanging routing information. Only the same routing protocol processes will exchanging routing information. Here ospf will exchanging information with ospf, RIP will exchanging information with RIP.

18 Route priority RIP OSPF
Select the route that has the highest priority to the route table。 RIP OSPF /16 fei_1/1 /16 fei_1/3 Multiple routing protocols (source/ower) can be used on the same router. Different routing protocols (source/ower) have their own standards for route calculation (Some use next hop times, some use bandwidth and others use delay. Generally, Metric is used for quantification in routing data). Besides, each routing protocol recommends its optimal route to a routing table. Thus, there may be multiple different routes to the same destination address, which are provided by different routing protocols. A router must select the best path calculated by one routing protocol and add it to a routing table. In this case, we need to choose the optimal route and use it to forward packets. Look at fig, two routing protocols, RIP and OSPF, run on the same router. Both RIP and OSPF detect and calculate the optimal path to the same network /16. The system selects different paths due to different routing algorithms. Because OSPF (the smaller value) has a higher route priority than RIP, the router will add the route of OSPF to the routing table. Notice: the comparison of route priority must be between identical routes. /16 fei_1/3 Route table Notice: the comparison of route priority must be between identical routes.

19 Default route priority
Route Source Default priority Connected interface Static route 1 External BGP 20 OSPF 110 IS-IS 115 RIP v1, v2 120 Internal BGP 200 Special (For inner process) 255 Different routing protocols have different route priorities. When the priority value is the smallest, it means the highest priority. If there are multiple routes to the same destination address, we may select the route with the smaller priority value as the optimal route. The table shows the default priority of each routing protocol or source. Range for route priority: The default route priority is assigned based on following principles: A direct route has the highest priority; a manually set static route entry has a higher priority than a dynamically set route entry. In actual practice, we give the highest route priority to the best route due to the experience and analysis of all kinds of sources.

20 Float static route fei_1/1 10M Network DDN Routes can be backed up based on routing selection mechanism. Users may configure multiple routes to the same destination according to actual conditions. The link on work has the highest priority and other backup links with lower priorities. With this configuration, a router normally forwards data through the work link. When the work link is failed, the backup one will forward data instead. When the work link is recovered, data transmission is automatically switched to the work link. The route record in the routing table will be properly adjusted according to link status. As shown in fig, in normal cases, all data will be routed to the external networks through the fei_1/1 interface. When the FE link connected to this interface is unavailable, the routes in the routing table will automatically be redirected to the interface of DDN. How to configure static route when there are redundant links?

21 Float static route ZXR10(config)#ip route 10.0.0.0 255.0.0.0 177.1.1.1
fei_1/1 10M Network DDN ZXR10(config)#ip route ZXR10(config)#ip route tag 200 How should we set a backup link in a router? We may configure the backup link by using a floating static route. As shown in the table, the routes reach the external network through different interfaces. The priority of the static route of the active link uses the default value 1. In the old version routers, the priority of the static route of the backup link is configured as 5 as ip route Now the ZTE router support load balance, so we use tag No. The tag No. range is The default tag No. is 150, if you configure a different tag No., like tag 200 here, both route will appear in the route table. The packets will be forward by load balance among all these links. When one link is failed, the packets will be automatic transmitted by other links.

22 Longest Prefix Match principle
ZXR10#show ip route IPv4 Routing Table: Dest Mask Gw Interface Owner pri metric fei_1/ direct fei_1/ address fei_1/ direct fei_1/ address fei_1/ direct fei_1/ address fei_1/ ospf fei_1/ static fei_1/ rip fei_1/ static In a router, route search follows the longest prefix matching principle. “Longest prefix matching” means to use route with the longest network mask in a routing table for the same destination during route searching. As shown in the route table, as compared with the above-mentioned packet to , three routes in the routing table, that is, , and , can be used to forward this packet. According to the longest matching principle, the entry is of 24 prefix bits as required. The packets sent to are forwarded by using the route records of That is, they are forwarded through the interface fei_1/3. ?

23 Contents Router definition and function Basic conception
Working principle of router IP routing process VLAN route after we learn the concepts of routing, now we can go ahead to discuss the Working principle of router

24 Router working principle
Routing function: Study and exchange the network topology information or route information, Produce and maintain route table. Forwarding function: Data transferring and processing procedure. (Receiving data on one interface, then choose an appropriate interface to send it out, including the work of frame encapsulation and decapsulation.) Routing function: Study and exchange the network topology information or route information, Produce and maintain route table. The router is responsible for maintaining routing tables. Forwarding function: Data transferring and processing procedure (Receiving data on one interface, then choose an appropriate interface to send it out, including the work of frame encapsulation and decapsulation). The switching/forwarding function of a router is different from the switching function of an Ethernet switch. It means how data are moved and processed inside the router: Data are received at a router interface and forwarded at a proper interface.

25 Routing function The functions of routing is to create and maintain route table, make it ready for the LPM check in the forwarding process. It requires several basic steps: What kind of protocols to route? Is the destination network address in the route table? What is the next hop address? Which interface to send out the packet? Study and exchange the route information or network topology information and produce and maintain route table. This mechanism is regarded as the function of routing. In another words, the functions of routing is to create and maintain route table, make it ready for the LPM check in the forwarding process. It requires several basic steps (Please try to answer these questions by yourself use the knowledge we learn from last several chapters.): What kind of protocols to route? Is the destination network address in the route table? What is the next hop address? Which interface to send out the packet?

26 Forwarding Function = = = Packet encapsulation and forwarding =
Frame checking and cache the packet Coming interface Associate destination address with the next hop interface Route table Maintained by routing function Create the frame head with the physical address ARP cache (LAN) Maintained by ARP or RARP process Mapping list (WAN) Data are received at a router interface and forwarded at a proper interface. When a data frame reaches a port, the port will perform the CRC to the frame. In this way, the port checks to ensure the destination data link layer address of the frame is consistent with this configuration of this port. If the frame passes the check, the port will decapsulate the packet and read the destination address information in this IP packet. The packet will be stored in the cache. Then, it queries a routing table and determines the forwarding interface and next hop address. Upon obtaining the information of forwarding interface and next hop address, a router will search information necessary for the encapsulation of data link layer at an outgoing interface. For an Ethernet interface, the router will get the MAC address corresponding to the next hop IP address through ARP; for a WAN interface, the router will get corresponding Layer 2 address information by manual or automatic mapping. Then, the router performs new data link layer encapsulation and send frame out. Packet encapsulation and forwarding Out interface

27 Router working process summary
Search entry in route table Based on destination address Add route based on route priority Routing process Routing process Routing process Routing process Route table Forwarding process Longest match principles By learning the above, we summarize the working process of a router like this. The routing process on a router may find all paths to a destination network, the router adds the optimal path to a routing table after compare of the routing source with the highest route priority. During the forwarding, a router may find multiple qualified routes in route search (different destinations, but all suitable for a packet to use). In this case, the router will forward data according to the longest prefix matching principle. That is, it forwards data by selecting the route with the matched route with longest mask. Routing protocol study possible route, select the best route based on metric

28 Contents Router definition and function Basic conception
Working principle of router IP routing process VLAN route We will go ahead to talk the working principle of a group of routers after we study a single router’s working principle.

29 Communication in the same network—ARP Request
Suppose A will communicate with B A judges that it is on the same network segment with B A searches for the MAC address of B in ARP table A sends the ARP request packet to find the MAC address of B MAC Port 00:20:af:00:00:01 fei_1/1 Switch Dest MAC: ff:ff:ff:ff:ff:ff Source MAC:00:20:af:00:00:01 Dest IP: Source IP: ARP request Fei_1/3 Fei_1/1 Fei_1/2 This chapter describes the communication of IP routing. We start with the simplest problem: Communication inside the same network. In an Ethernet two hosts can communicate with each other through a switch. Suppose A will communicate with B. Host A obtains its own network segment by using its own IP address and subnet mask. It compares its IP address with that of Host B. It finds that the two hosts are in the same network segment. And then it searches its own ARP cache for the MAC address of Host B. If there is no MAC address of Host B in the ARP cache list, Host A will enable ARP to query the MAC address of Host B by means of the ARP broadcast on a local network. A B C IP: MAC: 00:20:AF:00:00:03 IP: MAC: 00:20:AF:00:00:01 IP: MAC: 00:20:AF:00:00:02

30 Communication in the same network—ARP Response
MAC Port 00:20:af:00:00:01 fei_1/1 00:20:af:00:00:02 fei_1/2 Switch Fei_1/3 Fei_1/1 Fei_1/2 Dest MAC:00:20:af:00:00:01 Source MAC:00:20:af:00:00:02 Dest IP: Source IP: ARP reply Host B will send back a ARP reply back to Host A. A B C IP: MAC: 00:20:AF:00:00:03 IP: MAC: 00:20:AF:00:00:01 IP: MAC: 00:20:AF:00:00:02

31 Communication in the same network—Packet Transfer
MAC Port 00:20:af:00:00:01 fei_1/1 00:20:af:00:00:02 fei_1/2 Switch Dest MAC:00:20:af:00:00:02 Source MAC:00:20:af:00:00:01 Dest IP: Source IP: Fei_1/3 Fei_1/1 Fei_1/2 Upon obtaining the MAC address of Host B, Host A will save it into the ARP cache list, perform the data link layer encapsulation and start data transmission. A B C IP: MAC: 00:20:AF:00:00:03 IP: MAC: 00:20:AF:00:00:01 IP: MAC: 00:20:AF:00:00:02

32 Communication between different networks
Suppose A will communicate with B 1 A judges that B is on a different network segment 2 A searches for the MAC address of GW in ARP table 3 A sends packet to B, with the destination MAC address of the GW Dest network interface fei_1/1 fei_1/2 fei_1/3 Router fei_1/3: /30 MAC:00:20:AF:00:00:05 fei_1/1: /30 MAC:00:20:AF:00:00:04 Dest MAC:00:20:af:00:00:04 Source MAC:00:20:af:00:00:01 Dest IP: Source IP: fei_1/2: /30 MAC:00:20:AF:00:00:05 Communication between different networks, here the PCs are connected by a router. Please observe carefully on the IP address on computer A,B and C. The IP address , and are in different networks, because of the 30 bits long network mask. Suppose A will communicate with B 1 A judges that B is on a different network segment 2 A searches for the MAC address of GW in ARP table. Please note here, it’s the MAC address of GW, not the computer B’s MAC. So computer A will check the ARP table and may send ARP request packet to the GW. The router will response to this request and give the MAC address of GW on interface fei_1/1 to computer A. 3 After A get MAC address of the GW , A sends data packet to B, with the destination MAC address of the GW. A B C IP: /30 G: MAC:00:20:AF:00:00:01 IP: /30 G: MAC:00:20:AF:00:00:02 IP: G: MAC:00:20:AF:00:00:03

33 Communication between different networks
Dest MAC:00:20:af:00:00:02 Source MAC:00:20:af:00:00:05 Dest IP: Source IP: Dest network interface fei_1/1 fei_1/2 fei_1/3 Router fei_1/3: /30 MAC:00:20:AF:00:00:05 fei_1/1: /30 MAC:00:20:AF:00:00:04 fei_1/2: /30 MAC:00:20:AF:00:00:05 The router receives the data packet, then it will check its route table, and forward the packet to interface fei_1/2. Router here will also request the MAC of B, after the ARP procedure, the packet is encapsulated with the B’ MAC and forward to B. You can see that after the packet transfer through the router, the MAC of the frame header is changed. A B C IP: /30 G: MAC:00:20:AF:00:00:01 IP: /30 G: MAC:00:20:AF:00:00:02 IP: G: MAC:00:20:AF:00:00:03

34 Communication process
Get peer IP address Whether in the same network with peer Is the peer MAC address in ARP table? Data link layer encapsulation YES YES NO NO Get peer MAC Address by ARP Send data at physical layer Is gateway configured? Is the gateway MAC address in ARP? Data link layer encapsulation YES the source host performs network data communication in following flow: First, the source host obtains the IP address of the remote host. Then, it judges whether it is in the same network segment with the remote host. That is, it obtains its own network segment by using its own IP address and subnet mask. Then it compares its own IP address with that of the Host B. If the remote host is in the same network segment as the source host, the source host will check the ARP table for the MAC address of the remote host. If the MAC address can be found, the source host will directly encapsulate the data link layer (the destination MAC is the remote MAC address). If the MAC address cannot be found, the source host will obtain it by means of ARP and encapsulate it. Finally, the source host sends data through the physical layer. If the remote host and the source host are in different network segments, the source host will check the ARP table for the MAC address of the default gateway. If the MAC address can be found, the source host will directly encapsulate the data link layer (the destination MAC is the remote MAC address). If the MAC address cannot be found, the source host will obtain it by means of ARP and encapsulate it. Finally, the source host sends data via the physical layer. If the remote host and the source host are in different network segments, but the source host is configured without a default gateway, communication will be terminated and an error message is returned. YES NO NO End Get gateway MAC address by ARP Send error message

35 IP communication process
IP communication process KEY features: IP communication is hop by hop communication Source IP and destination IP address is unchanged Every time the packet passed a data link layer, there will be a new encapsulation of the packet The return path is not related to the forwarding path IP communication process KEY features: IP communication is hop by hop communication The router doesn’t care the next next hop, so it will make it more easy to create route information and build route table, but the router can’t control the whole path of a packet forwarding, that means router can’t control the quality of this forwarding. So hop by hop IP packets forwarding is suitable to transfer data, but not suitable for real-time service like VOIP or IPTV. Source IP and destination IP address is unchanged (Given that no NAT has been set) , If the destination IP address is changed, the packet will go to a wrong place. If the source IP address is changed, the reply packet will go to a wrong place. Every time the packet passed a data link layer, there will be a new encapsulation of the packet As we see in last page, every time the packet is passed to another network segment, we need to get the nexthop MAC and redo the encapsulation. The return path is not related to the forwarding path The path is based on the route table. The return path may be the same as the forwarding path, may be different compare to the forwarding path.

36 Routing process example
R1 route table e1_1/1.1 direct 0 0 fei_1/1 direct 0 0 e1_1/1.1 rip e1_1/1.1 rip e1_1/1.1 rip /24 fei_1/1 R2 e1_2/1.1 e1_1/1.1 /24 /24 e1_1/1.1 e1_1/1.1 R3 R1 The picture describes packet routing by taking for example the communication between two hosts across several network segments. Here we introduce how RIP studies the not directly connected network route information. RIP process runs on R1 will exchange the route info (at beginning only directly connected route) to R2 and R2 exchange the route info on it route table to R1, so R1 studies the 1.0 and 6.0 network route from R2 and metric (hops) is 1. R3 also exchange the route info (include directly connected route 3.0 network) to R2, and then R2 exchange this route info to R1. so in R1 you can see 3.0 network route and metric (hops) is 2. First, Host A sends data to Host B. According to its own IP address and subnet mask, Host A obtains its own network address. Then, it compares its own address with the address of Host B. It finds that Host B is not in the same network segment as itself. Therefore, Host A sends data to the default gateway--- the local interface of a router: IP address of the interface fei-1/1 of R1. R1 checks the destination IP address in the IP packet. Then it finds that it does not match the IP address of any other router interface. It is required to forward this packet. Therefore, the router searches a routing table for the complete matched record according to the destination address and forwards this packet according to this entry. In this example, R1 finds the routing information of the destination network segment and decides to forward this packet through the interface e1-1. Before this packet is forwarded, the system should perform corresponding Layer 3 processing to this packet and then conduct data link layer encapsulation. Destination address: fei_1/1 fei_1/1 /24 /24 B A

37 Routing process example
R2 route table e1_1/1.1 direct 0 0 e1_2/1.1 direct 0 0 fei_1/1 direct 0 0 e1_1/1.1 rip e1_2/1.1 rip /24 fei_1/1 R2 e1_2/1.1 e1_1/1.1 /24 /24 Destination Address: e1_1/1.1 e1_1/1.1 R3 After this packet has been forwarded to R2, it will be processed in the same way as in R1. R2 searches its routing table for the destination network segment and decides to forward this packet through the interface e1_2/1.1 R1 fei_1/1 fei_1/1 /24 /24 1.Destination address:

38 Routing process example
R3 route table fei_1/1 direct 0 0 e1_1/1.1 direct 0 0 e1_1/1.1 rip e1_1/1.1 rip e1_1/1.1 rip /24 fei_1/1 R2 e1_2/1.1 e1_1/1.1 /24 /24 Destination address: e1_1/1.1 Return path? e1_1/1.1 R3 R1 Likewise, when this packet is forwarded to R3, it will be processed as in R1 and R2. R3 searches its routing table for the destination network segment and finds that the destination network segment is a directly connected. Finally, this packet is forwarded to the destination Host B fei_1/1 fei_1/1 /24 /24

39 Contents Router definition and function Basic conception
Working principle of router IP routing process VLAN route VLAN is a very important concept in Layer 2 network, it’s used to separate the broadcast domain. We now need to learn the inter-VLAN routing after we know the principles of IP routing process.

40 Route Between VLANs Method 1: Normal route Method 2: One-arm route
fei_1/1 fei_1/1.1 fei_1/1.2 fei_1/1.3 VLAN one VLAN two VLAN three 802.1Q trunk encapsulation fei_1/2 fei_1/3 VLAN three VLAN three VLAN one VLAN two VLAN one VLAN two VLAN is a Layer 2 based technology. If information transfer is necessary between VLANs, Layer 3 routing of VLAN will be employed. In this chapter, we will learn how to implement Layer 3 routing of VLAN. As we know, when one network is isolated by a VLAN into multiple broadcast domains, mutual access between various VLANs is impossible. To enable the communication between VLANs, you need to configure a L3 device like a router between them. Among different VLANs, the router actually acts as the gateway of each VLAN. At present, routing between VLANs has following modes: Mode 1: Normal routing Mode 2: one-arm routing Mode 3: Layer 3 switch Method 1: Normal route Method 2: One-arm route Method 3: L3 switch

41 Method 1: Normal Route Feature: Several router physical interfaces are required; high cost; poor flexibility and expandability fei_1/1 fei_1/2 fei_1/3 Configuration: On the several physical interfaces of the router, configure the default gateway IP addresses of different VLANs. The port of the switch is configured as ACCESS PORT. VLAN two VLAN three VLAN one In normal route method, the routing interfaces of the router keep up a correspondence to their physical interfaces in one-to-one mode, the VLANs also keep up a correspondence to routing interfaces in one-to-one mode. In routing between VLANs, the router needs to forward packets from one routing interface to another. This means that it forwards packets from one physical interface to other physical interfaces. Feature: Several router physical interfaces are required; high cost; poor flexibility and expandability Configuration: On the several physical interfaces of the router, configure the default gateway IP addresses of different VLANs. The port of the switch is configured as ACCESS PORT, belonging to different VLANs.

42 Method 2: One-arm Route ZXR10(config)#interface fei_1/1.1
ZXR10(config-subif)#encapsulation dot1Q 1 ZXR10(config-subif)#ip add ZXR10(config)#interface fei_1/1.2 ZXR10(config-subif)#encapsulation dot1Q 2 ZXR10(config-subif)#ip add ZXR10(config)#interface fei_1/1.3 ZXR10(config-subif)#encapsulation dot1Q 3 ZXR10(config-subif)#ip add fei_1/1.1 fei_1/1.2 fei_1/1.3 802.1Q trunk encapsulation VLAN three VLAN one VLAN two If the Ethernet interface of a router supports 802.1Q encapsulation, one-arm routing can be implemented. This technology enables multiple VLANs to share a physical connection for traffic transmission. The traffics of various VLANs are distinguished by the labeled frames inside one physical connection. Feature: Only one router physical interface is required; low cost, good expandability; the router needs to support the trunk encapsulation. Configuration: On one physical interface of the router, configure several sub-interfaces, and encapsulate them by 802.1Q. Different sub-interfaces configure the default gateway IP addresses of different VLANs. The port of the switch is configured as 802.1Q trunk. Feature: Only one router physical interface is required; low cost, good expandability; the router needs to support the trunk encapsulation. Configuration: On one physical interface of the router, configure several sub-interfaces, and encapsulate them by 802.1Q. Different sub-interfaces configure the default gateway IP addresses of different VLANs. The port of the switch is configured as 802.1Q trunk.

43 Method 3: L3 Switch ZXR10(config)#interface vlan 1
ZXR10(config-if)#ip add ZXR10(config)#interface vlan 2 ZXR10(config-if)#ip add ZXR10(config)#interface vlan 3 ZXR10(config-if)#ip add VLAN one VLAN two VLAN three Feature: One device integrates the routing and switching functions. The visible interfaces are all L2 ports, and the L3 interfaces needs to be created to be associated with VLAN. Configuration: Each VLAN needs to be configured with the logical interface. Its IP address is the default gateway address of the corresponding VLAN. L3 switch has integrated the network functions of a Layer 2 switch or router in a hardware device. Any created Layer 3 interface is a VLAN-based logic interface, to which all the members of a VLAN can directly gain access. Feature: One device integrates the routing and switching functions. The visible interfaces are all L2 ports, and the L3 interfaces needs to be created to be associated with VLAN. Configuration: Each VLAN needs to be configured with the logical interface. Its IP address is the default gateway address of the corresponding VLAN.

44 Review Definition of router Router’s functions
Basic concepts in routing Working principle of a router IP routing process within the same network IP routing process between different network Inter VLAN routing This course is accomplished, now we have a review of this course. Definition of router Router’s functions Basic concepts in routing Working principle of a router IP routing process within the same network IP routing process between different network Inter VLAN routing

45 Questions What’s the two main functions of router?
How is the route table established? What is the standard when a router is selecting the route to route table? When forwarding IP packet, If there are many matches, what will router do? Describe the encapsulation and decapsulation during the process of IP routing . To make sure that you understand clearly the content of this course, pls try answer the following questions: What’s the two main functions of router? How is the route table established? What is the standard when a router is selecting the route to route table? When forwarding IP packet, If there are many matches, what will router do? Describe the encapsulation and decapsulation during the process of IP routing.

46 Thank you for listening this course.


Download ppt "Router and Routing Basics"

Similar presentations


Ads by Google