Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

Today we will start studying routers. If you have completed my video course from the first to the 17th lesson, then you have already learned the basics of switches. Now we move on to the next device - the router. As you know from the previous video lesson, one of the topics of the CCNA course is called Cisco Switching & Routing.

In this series, we will not study Cisco routers, but will consider the concept of routing in general. We will have three topics. The first is an overview of what you already know about routers and how it can be applied in conjunction with the knowledge you gained while learning about switches. We must understand what the joint work of switches and routers is.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

Next, we'll look at what routing is, what it means, and how it works, and then we'll move on to the types of routing protocols. Today I am using the topology that you have already seen in the previous lessons.

We looked at how data moves over the network and how the TCP three-way handshake is performed. The first message sent over the network is a SYN packet. Let's look at how the three-way handshake happens when a computer with an IP address of 10.1.1.10 wants to contact the server 30.1.1.10, that is, it tries to establish an FTP connection.
In order to start the connection, the computer creates a source port with a random number of 25113. If you have forgotten how this happens, I advise you to review the previous video tutorials that dealt with this issue.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

It then puts the destination port number into the frame because it knows it should connect to port 21, then adds OSI layer 3 information, i.e. its own IP address and the destination IP address. The dashed data does not change until it reaches the end point. When they reach the server, they also do not change, but the server adds second-level information to the frame, that is, the MAC address. This is due to the fact that switches only accept OSI layer 2 information. In this scenario, the router is the only network device that looks at layer 3 information, of course, the computer also works with this information. So, the switch works only with information of the XNUMXnd level, and the router - of the XNUMXrd.

The switch knows the source MAC address XXXX:XXXX:1111 and wants to know the MAC address of the server that the computer is accessing. It compares the source IP address with the destination address, understands that these devices are located on different subnets, and decides to use the gateway to access a different subnet.

I'm often asked the question of who decides what the gateway's IP address should be. First, it is up to the network administrator to create the network and provide an IP address to each device. As an administrator, you can assign any address within your subnet's allowed address range to the router. This is usually the first or last valid address, but there are no hard and fast rules about assigning it. In our case, the administrator assigned the address of the gateway, or router, to 10.1.1.1 and assigned it to port F0/0.

When you set up a network on a computer with a static IP address of 10.1.1.10, you assign a subnet mask of 255.255.255.0 and a default gateway of 10.1.1.1. If you are not using a static address, then your computer is using DHCP, which assigns a dynamic address. Regardless of whether the computer uses a static or dynamic IP address, a gateway address must be available to reach another network.

Thus, computer 10.1.1.10 knows that it should send a frame to router 10.1.1.1. This transmission takes place inside the local network, where the IP address does not matter, only the MAC address matters here. Suppose that the computer has never contacted the router before and does not know its MAC address, so it must first send an ARP request that asks all devices on the subnet: β€œhey, which one of you has the address 10.1.1.1? Please tell me your MAC address!". Since ARP is a broadcast message, it goes to all ports of all devices, including the router.

Computer 10.1.1.12, having received ARP, thinks: β€œno, my address is not 10.1.1.1”, and discards the request, computer 10.1.1.13 does the same. The router, having received a request, understands that it is he who is being asked, and sends the MAC address of port F0 / 0 - and all ports have a different MAC address - to computer 10.1.1.10. Now, knowing the gateway address XXXX:AAAA, which in this case is the destination address, the computer adds it to the end of the frame addressed to the server. It also sets the frame header FCS/CRC, which is a transmission error checking mechanism.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

After that, the frame of the computer 10.1.1.10 is sent by wire to the router 10.1.1.1. After receiving the frame, the router removes the FCS/CRC using the same algorithm as the computer for verification. Data is nothing more than a collection of zeros and ones. If the data is corrupted, i.e. 1 becomes 0 or 0 becomes one, or there is a data leak that often occurs when using a hub, then the device must forward the frame again.

If the FCS/CRC check is successful, the router looks at the source and destination MAC addresses and removes them as they are layer 2 information and jumps to the frame body which contains layer 3 information. From it, he learns that the information contained in the frame is intended for a device with an IP address of 30.1.1.10.

The router somehow knows where this device is located. We did not discuss this issue when we considered the operation of switches, so we will consider it now. The router has 4 ports, so I added a few more connections to it. So how does the router know to send data for a device with an IP address of 30.1.1.10 on port F0/1? Why doesn't it send them through port F0/3 or F0/2?

The fact is that the router works with the routing table. Each router has such a table that allows you to decide which port to transmit a particular frame through.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

In this case, port F0/0 is set to IP address 10.1.1.1, which means that it is connected to the network 10.1.1.10/24. Similarly, port F0/1 is configured to address 20.1.1.1, that is, it is connected to the network 20.1.1.0/24. The router knows both of these networks because they are directly connected to its ports. Thus, the information that traffic for the 10.1.10/24 network should go through the F0/0 port, and for the 20.1.1.0/24 network through the F0/1 port is known by default. How does the router know through which ports to work with other networks?

We see that network 40.1.1.0/24 is connected to port F0/2, network 50.1.1.0/24 is connected to port F0/3, and network 30.1.1.0/24 connects the second router to the server. The second router also has a routing table, which says that the network 30. is connected to its port, let's denote it 0/1, and it is connected to the first router through port 0/0. This router knows that its port 0/0 is connected to network 20 and its port 0/1 is connected to network 30 and knows nothing else.

Similarly, the first router knows about networks 40. and 50. connected to ports 0/2 and 0/3, but knows nothing about network 30. The routing protocol provides routers with information that they do not own by default. The mechanism by which these routers communicate with each other is the basis of routing, and there are dynamic and static routing.

Static routing is that the first router is given information: if you need to contact the network 30.1.1.0/24, then you need to use port F0/1. However, when the second router receives traffic from a server that is destined for computer 10.1.1.10, it does not know what to do with it, because its routing table contains only information about network 30. and 20. Therefore, this router also needs to register static routing : if it receives traffic for network 10., then it must send it through port 0/0.

The problem with static routing is that I have to manually configure the first router to work with network 30 and the second router to work with network 10. It's easy if I have only 2 routers, but when I have 10 routing takes a lot of time. In this case, it makes sense to use dynamic routing.
So, having received a frame from the computer, the first router looks into its routing table and decides to send it through port F0 / 1. In doing so, it adds the source MAC address XXXX.BBBB and the destination MAC address XXXX.CCCC to the frame.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

Upon receiving this frame, the second router "truncates" the MAC addresses related to the second OSI layer and proceeds to the information of the 3rd layer. It sees that the destination IP address 30.1.1.10 belongs to the same network as the router's port 0/1, adds the source MAC address and the destination MAC address to the frame, and sends the frame to the server.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

As I said, then the same process is repeated in the opposite direction, that is, the second stage of the handshake is carried out, in which the server sends back a SYN ACK message. Before that, it discards all unnecessary information and leaves only the SYN packet.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

Having received this packet, the second router considers the received information, supplements it and sends it further.

So, in the previous lessons, we studied how the switch works, and now we have learned how routers work. Let's answer the question, what is routing in the global sense. Suppose you come across such a road sign at a roundabout. You can see that the first branch leads to the Royal Air Force Base Fairfax, the second to the airport, the third to the south. If you take the fourth exit, you will reach a dead end, and through the fifth you can drive through the city center to Braxby Castle.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

In general, routing is what makes the router decide where to route traffic. In this case, you, as the driver, must decide which exit from the intersection to take. In networks, routers have to make decisions about where to send packets or frames. You must understand that routing allows you to create tables based on which routers make these decisions.

As I said, there are static and dynamic routing. Consider static routing, for which I will draw 3 devices connected to each other, with the first and third device connected to networks. Suppose one network 10.1.1.0 wants to contact network 40.1.1.0, and networks 20.1.1.0 and 30.1.1.0 are located between the routers.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

In this case, the ports of the routers must belong to different subnets. Router 1, by default, only knows about networks 10. and 20. and knows nothing about other networks. Router 2 only knows about networks 20. and 30. because they are connected to it, and router 3 only knows about networks 30. and 40. If network 10. wants to contact network 40., I have to tell router 1 about network 30 .and that if he wants to send a frame to network 40., he must use the interface for network 20. and send the frame over the same network 20.

I have to assign 2 routes to the second router: if it wants to transfer a packet from network 40. to network 10., then it must use network port 20., and to transfer a packet from network 10. network 40. - network port 30. Similarly, I must provide router 3 with information about networks 10. and 20.

If you have small networks, then static routing is very easy to set up. However, the more the network grows, the more problems arise with static routing. Let's imagine that you have created a new connection that directly links the first and third routers. In this case, the dynamic routing protocol will automatically update the routing table of router 1, indicating the following: "if you need to contact router 3, use the direct route"!

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

There are two types of routing protocols: Inner Gateway Protocol (IGP) and Outer Gateway Protocol (EGP). The first protocol operates on a separate, autonomous system known as the routing domain. Imagine that you have a small organization with only 5 routers. If we are talking only about the connection between these routers, then we mean IGP, but if you use your network to connect to the Internet, as ISP providers do, then you use EGP.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

IGP uses 3 popular protocols: RIP, OSPF and EIGRP. The CCNA curriculum only mentions the last two protocols because RIP is obsolete. This is the simplest of the routing protocols and is still used in some cases, but does not provide the necessary network security. This is one of the reasons Cisco removed RIP from the curriculum. However, I will tell you about it anyway, because studying it contributes to understanding the basics of routing.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

Protocol Classification EGP uses two protocols: BGP and the EGP protocol itself. When studying the CCNA course, we will only consider BGP, OSPF and EIGRP. You can consider the story about RIP as bonus information, which will be reflected in one of the video tutorials.
There are 2 more types of routing protocols: Distance Vector protocols and Link State routing protocols.

Cisco Training 200-125 CCNA v3.0. Day 18 Routing Basics

The first puncture considers distance and direction vectors. For example, I can establish a connection directly between the router R1 and R4, or I can connect along the path R1-R2-R3-R4. If we are talking about routing protocols using the distance vector method, then in this case the connection will always be made along the shortest path. It does not matter that this connection will have a minimum speed. In our case, this is 128 kbps, which is much slower than the connection along the route R1-R2-R3-R4, where the speed is 100 Mbps.

Consider the distance vector protocol RIP. I will draw network 1 in front of router R10, and network 4 behind router R40. Suppose that there are many computers in these networks. If I want to connect between network 10. R1 and network 40. R4, then I will assign R1 a static routing like: "if you need to connect to network 40., use a direct connection to R4 router." At the same time, on all 4 routers, I must manually configure RIP. Then the R1 routing table will automatically tell you that if network 10. wants to contact network 40., a direct R1-R4 connection should be used. Even if the detour is faster, the Distance Vector protocol will still choose the shortest path with the shortest transmission distance.

OSPF is a link state routing protocol that always looks at the state of the network sections. In this case, it evaluates the speed of the channels, and if it sees that the traffic rate on the R1-R4 channel is very low, then it chooses a path with a higher speed R1-R2-R3-R4, even if its length exceeds the shortest path. Thus, if I configure OSPF on all routers, when I try to connect network 40. to network 10., traffic will be sent along the route R1-R2-R3-R4. So, RIP is a distance vector protocol, and OSPF is a link state routing protocol.

There is another protocol - EIGRP, Cisco's proprietary routing protocol. If we talk about network devices from other manufacturers, for example, Juniper, then they do not support EIGRP. This is an excellent routing protocol that is much more efficient than RIP and OSPF, but it can only be used on networks based on Cisco devices. Later I will tell you more about why this protocol is so good. For now, I note that EIGRP combines the features of distance vector protocols and link state routing protocols, representing a hybrid protocol.

In the next video tutorial, we will come close to examining Cisco routers, I will tell you a little about the Cisco IOS operating system, which is designed for both switches and routers. I hope that on the lessons of the 19th or 20th day we will begin to study routing protocols in detail, and I will show how to configure Cisco routers using the example of small networks.


Thank you for staying with us. Do you like our articles? Want to see more interesting content? Support us by placing an order or recommending to friends, 30% discount for Habr users on a unique analogue of entry-level servers, which was invented by us for you: The whole truth about VPS (KVM) E5-2650 v4 (6 Cores) 10GB DDR4 240GB SSD 1Gbps from $20 or how to share a server? (available with RAID1 and RAID10, up to 24 cores and up to 40GB DDR4).

Dell R730xd 2 times cheaper? Only here 2 x Intel TetraDeca-Core Xeon 2x E5-2697v3 2.6GHz 14C 64GB DDR4 4x960GB SSD 1Gbps 100 TV from $199 in the Netherlands! Dell R420 - 2x E5-2430 2.2Ghz 6C 128GB DDR3 2x960GB SSD 1Gbps 100TB - from $99! Read about How to build infrastructure corp. class with the use of Dell R730xd E5-2650 v4 servers worth 9000 euros for a penny?

Source: habr.com

Add a comment