IP Routers Demo
Welcome back to the course on Computer Network and Internet Protocols.So, in the last class, we were discussing about IP routers, we have discussed about the different functionalities of the IP routers, and how a IP router look like.So, specifically what we have seen that in a basic architectural components of a router,we have two different components. We have the route processor at the top and that routeprocessor contains a memory and a CPU. And then we have a internal interconnectionnetwork bus with which the individual interface cards are connected and that interfacecard they work as the input-output for the routers.(Refer Slide Time: 01:04)So, in that continuation we have also seen that this entire router architecture is actuallydivided into two part, the control part and the data path part. In the control part, we havedifferent routing functionalities which are being implemented. So, in the later classes wewill see different types of routing protocols which are used to populate the routing table,you will see that there are routing protocols like distance vector routing, link staterouting, and in the internet scale you have a Border Gateway Protocol or BGP class ofroutings which are used to populate this intermediate routing table.So, in the router control part we have these routing functions or the routing protocolswhich are implemented. And those routing functions or the routing protocol that we willlook in subsequent lectures in details. They helps us in constructing the routing table.And then at the data path level, we do the per packet processing things. So, wheneveryou have certain input packets with that input packets, you look into the packet header;from the packet header you find out what is the destination IP address. Based on thedestination IP address, you need to make a match with the routing table find out whatshould be your next hop and accordingly forward the packet to the next hop, so that wasthe basic architecture of the data path.And we have briefly mentioned that this data path is need to be very fast, because at persecond you have to possibly process some thousands or sometime a millions of packets ifyou are in a high speed network. And, that is why this data path is normally implementedin a hardware that we call as Ternary Content Addressable Memory or TCAM kind ofmemory architecture. So, in general in a typical router, in the control path or the controlplane that is implemented as a part of the route software routing operating system whichis a internet scale operating system, we have mentioned that there are different kind ofinternet operating system like a Cisco IOS. So, that particular software moduleimplements your routing functionalities, your routing protocol, that softwarefunctionalities which need to be there to process a router and that construct the routingtable which is there.Now, we have seen that the data path need to be implemented in a faster hardware, weimplement it in the TCAM type of memory architecture and the snapshot of this routingtable is bring to the TCAM hardware in the form of Forwarding Information Base orFIB. So, that forwarding information base is basically looked up by the TCAM hardwareto forward the packet to the outgoing interface.So, we have the intermediate switch fabric that takes the input, make a match with theforwarding information base which is there in the TCAM hardware, and then it finds outwhat should be your destination interface along with the next hop. And that informationis passed to the data link layer for doing further processing and the packet is put to theoutgoing interface.(Refer Slide Time: 04:27)Now, we will briefly look into the architecture of this ternary content addressablememory or TCAM which is used to process your router. So, this TCAM is specifically aspecialized high speed memory which searches its entire content in a single clock cycle.So, we call it ternary because it stores and query the data using three different inputs,either it can be the 0 or an 1 or something called the x. So, that is a don’t care or wildcardcondition. So, that is why we name it as ternary content addressable memory becauseeverything is represent is either in 0, 1 or X that is the don’t care or wild card condition.Now, this searching in a ternary content addressable memory, it is based on patternmatching. So, one example is given here say for example, you want to find out 110x. So,you want to make a match with 1 followed by a match with 1, followed by a match with0; and the fourth bit you do not consider. So, both 1101 and 1100 will get matched withthis particular pattern.(Refer Slide Time: 05:35)So, if we compare between this content addressable memory and our normal randomaccess memory CAM and RAM, so this they are basically complimentary or they arekind of works in a inverse principle. So, RAM is accessed via the address where the datais stored. So, the operating system need to issue the address where the data is beingstored inside the RAM. And then it sends that particular address and fetch the data fromthat particular address. So, RAM is basically accessible via this address; and it works in akind of sequential address principle and at the same time at the random access principle.So, you can just pick up an address, go to that location, pick up the content from there.On the other hand, CAM can be addressed by performing a query for the content itself.So, in case of CAM, CAM you do not require the address rather it restricts the addresswhere the content is being found. So, here the search is based on the content itself not onthe address. So, in case of a RAM, we provide the address and the output is thecorresponding content at the data which is being stored at that address location. In thecase of CAM, it is just a reverse like you are providing the content there you aresearching the content there. If the content is found inside the CAM, then it will returnback with the corresponding address, so that way it is much faster than RAM and that iswhy we use it for this network processing for implemented the forwarding informationbased inside a router data path.(Refer Slide Time: 07:23)So, here is a basic architecture of TCAM with an example. So, this right side diagramshows the different components of the TCAM hardware. So, we have different blocksthat is the individual memory location, where the contents are being stored. So, here thein the top line the first block is storing as 1; the second block is storing as 0; the thirdblock is 1; and the fourth block is don’t care, so that is why because the fourth block is adon’t care. So, you can have a match with either 0’s or 1’s.Now, in a routing table, what we can do, we put the data in the format of prefix and maskthat we have seen earlier. Now, for the simplicity we just put here an example of theprefix in a 3-bit format and the corresponding masks. So, we to say your prefix is 101,and the mask is 3; that means, if something is if your destination IP has the first 3-bits orthe prefix has 101, then there will be a corresponding match. So, similarly we have aprefix of 111 with a mask 3, prefix of 10 with the mask 2, prefix of 0 with the mask 0.Now, if you remember in the route matching principle, it is like that if there is a match inthe first 3-bits that means, 101 and the remaining bits can be anything because this first3-bits the prefix part it denotes your network IP and the remaining part denotes the hostIP. So, during the routing procedure, we make a match with the network IP, so that iswhy we extract the network IP and make a match with that. So, in your 32-bit IP addressformat, you just need to look into the network address part, you do not need to look intothe host address part for doing the routing.The host address part is required to make the final forwarding at the last hop router whenit has received in the router where in the local area network where your machine is beinglocated. So, in the last hop router, you require the host address and in the previous caseyou just look into the network IP and based on the network IP you make look up. So,here your network IP contains the first 3 prefix bits. So, it is 101 followed by 3. Now, inthe TCAM format, if you just for the simplicity assume that my routing address is not 32bits my routing address is router address or the IP address is a 4-bit IP address well actualIP address is 32 bit, just for simplicity and for the explanation we are assuming that theaddress is for 4 bit address field.Now, if 3-bit denotes the prefix then in the TCAM format it will be 101X. So, the last bitis the don’t care condition and this last bit is actually you are denoting your host IP.Similarly for 111 and the mask tree in the TCAM format it will be 111 followed by X adon’t care condition. For a prefix of 10 with mask 2, the first two bit will be 10 and theremaining two bits will be XX. When the prefix is 0 as well as the mask 0 this entire partbelongs to the host part. We have a special meaning of this kind of addresses the TCAMformat will be XXXX.Now, whenever the things will get matched here in this TCAM format the things havebeen stored in this format here in the bottom, in the bottom most case we are storingXXXX, on top of that we are storing 10XX, then we are storing 1111 111X. And thenfinally, you are storing 101X, so that is my TCAM structure with these address formatand address space.Now, say we are we want to search a word of 1011 here. Now, how this search will bebeing done? So, we have this match lines this match line will trigger that whichparticular blocks need to be activated. So, if these four blocks are getting activated,during that time if you want a search word of 1011 that is a match with the last blockXXXX, because all are don’t care. So, whatever be the bits that will get accepted. Thenwe make a matching with the next block it is 10XX.Again we have a match because we have first 10, this 10 will get matched here, then thetwo parts are XX. So, whatever we are providing here, here we are providing 11 that willsee a match. The third one 111x that is not a match because, the second bit is 0, so here itis 1, so it is not a match. The fourth one is again a match. The fourth one is 1011, so 101there is a match. And then last one is X - the don’t care. So, there is a match there. So, wehave a three match here. The first match is at address location say 00; the second matchis address location 10; and the third match is at address location 11.Now, we have an encoder that will return my final address. So, if you remember that incase of a routing whenever we do a routing match we take the longest prefix match. So,if there are multiple matches, then we take the final output as the 1, where there is thelongest match. So, out of these four cases XX sorry the three cases where we have amatch XXXX, 11, 10XX, and 101X. The longest prefix in the last 101X, because here Ihave a match with three different bits and I have only one don’t care. So, the maximummatch is here. So, this encoder will return that particular address where you have themaximum match. So, the encoder circuit is to implement your longest prefix matchprinciple to return back the final address, so that way you will get the final address as 00indicating that the content is there. And in that particular address location the youwhatever is there, whatever be the next information there that will be used to fetch theinterface information, and the next hop information and there the packet will beforwarded. So, that is the idea of this TCAM hardware which makes the search based onthe content itself and not based on the RAM based on the RAM architecture whichmakes the search based on the hardware. So, that is the idea of the TCAM.(Refer Slide Time: 14:01)Now, we will look into several IP and route commands. Before going to that, let me showyou that how a typical router looks like. So, here I have a two routers, which are thereand which are connected with particular switch. So, you can look into this architecture.(Refer Slide Time: 14:31)OK. So, this architecture, in this architecture what we have done here we have two routerboards. So, this is one router board, and this is the second router board. And both of theserouter boards are connected to a layer two switch. So, this lower thing, this is a TP linkswitch which is a layer two switch. So, these two router hardwares they are connected tothe switch via the wire.Now, a particular router looks like this indeed this is a small prototype of a router. Theactual routers are even bigger than this one. So, here we have a four different chassis. So,you can see that this is one chassis; the second chassis; the third chassis and the fourthchassis. And every chassis has a four different interfaces. So, we have a 1, 2, 3 and 4interfaces. And with these interfaces they are connected with these RJ 45 cable.So, these RJ 45 cables are used to connect the wires with that router interface VT ormachine interface. So, these are the input-output interface which are there with each ofthese input output interface we have these interface processor, and here I have thisTCAM hardware and finally, the route processor. So, this is the route processor thatcontains the router software which is which need to be executed there and that routersoftware will help you to find out the routing protocol, run the routing protocol and dothe stuff.Indeed this particular router is a something called as software define networking router.In the next class onwards we will discuss about this concept of software definenetworking router. The idea of the software define networking router is that route controlpart the software part is not implemented or not kept inside the hardware rather you canconnect an external controller machine with this router, where the routing controlprotocols will run. And that will actually generate the forwarding rules and thoseforwarding rules will be implemented inside the TCAM hardware that is there inside therouter.And then whenever some input packet is coming to one of these input interfaces, it willmake a match with that TCAM hardware, and make the forwarding to the outgoinginterface where it wants to forward. So, here we have all these different forwardinginterfaces. So, among all these different forwarding interfaces, here we have fourinterfaces connected with every chassis. So, it is basically a 16 port router.So, this one as it is a 16 port router. This one is another 16 port router. And both the 16port routers are connected with this TP link switch, so which is a layer 2 switch. Now,normally what we do in case of our typical network architecture, we have this routersconnected with the layer 2 switch and from the layer 2 switch again we are taking anoutput which is finally, connected to the machines the desktops that we have.So, that way the packets come to the switch from the switch it comes to the router andthen router takes the forwarding decision based on the routing protocol which is runninginside. And after taking the forwarding decision, it sends the packet to the outgoinginterface. So, this is the typical router which looks like this way. So, you have theserouting boards which are connected into multiple chassis that we have briefly discussedin the last lecture. And finally, the input output interfaces through which the individualmachines are being connected; so, this is the typical look of a router. So, these entirechassis we nicely put inside a box and mount it somewhere.Now, let us come back to the slides where we were talking about different kind of IP androute commands to see different type of different type of tools that you can use to lookinto the IP related aspects of your machine, and at the same time the routing relatedaspects and configure your router. So, let us have a brief discussion about that.
IP Routers Demo- Part 2
So, the first command that we would like to see is something called IP address show. Soif you in a Linux based machine if you give the comment as IP address show, so you cansee that it will show you all the interfaces that you have in your machine. So, in thismachine, I have three different interfaces; one logical interface which we call as the loopback interface. So, if you remember that earlier during the socket programming, we werespecifying the host name as the local host, and that local host actually works on that loopback address. So, a loop back address, there the data is not going to some outsidemachine that means, it will work on the same machine.So, on the same machine you have both the sender and the receiver. So, during that time,you can utilize that loop back loop back interface. So, this loop back interfaces just tolook into whether the protocol stack of your machine is live or not; so, you can see thatthe loop back address as an IP address 127 dot 0 dot 9 dot 1 slash 8. So, that is the loopback IP address and the hardware address is all 0’s. So, then there are other parameters.So, you have this inet 127 dot 0 dot 0 dot 1 is the IPv4 address of the loop back interfaceand inet 6 is the IPv6 address of that loop back interface. Then the next interface that Ihave is eth0 that is the Ethernet interface the wired interface which is connected with thismachine that has an link address. So, you can see that link slash ether the hardwareaddress or the MAC address is 48 colon 0 f colon cf colon db colon e 0 colon 9 d that isthe hardware address and the broadcast hardware address are all fs, that means, all 1’s.And the IPv4 address of these machine is 10 dot 0 dot 0 dot 11 slash 24 broadcastaddress is 10 dot 0 dot 0 dot 255, and this does not configure with the IPv6 address onthe IPv4 address has been provided.Now, coming to this WLAN interface; the wireless LAN interface which is connectedwith this machine. So, this wireless LAN interface has a link or the ethernet address thehardware address as d 85 d e 210 ce 93, and broadcast address as all 1. Then it has a IPv4address which is 10 dot 146 dot 58 dot 130 slash 17 that is the IPv4 address which isassign to this WLAN 0 interface the wireless interface; and the broadcast address as 10dot 146 dot 127 dot 255. And it also has a IPv6 address which is written in the next lineinet 6, inet 6, fe 80.So, this is the IPv6 address for this machine, fe 80 colon colon colon colon. So, in IPv6discussion will discuss what does it mean. Then c 8 c colon c e 5 b colon c e 6 5 a colon7 c a 1 slash 64 and that is the IPv6 address of this. Now, all of this interface informationyou can also see that there is a parameter call mtu. So, if you look into the loop backcase, in the loopback case, it is written as lo; then loop back up lower up then it is writtenas mtu 65536.So, this mtu is the maximum transmission unit that means, the maximum number of bitsthat can be transmitted on that this particular interfaces in the form of a data packet. So,your data packets size your link layer packet size should not exceed more than 65536 forthis loopback address, loopback interface. For the Ethernet interface, you can see it iswritten as Ethernet no carrier BROADCAST MULTICAST UP then mtu 1500, so thatmeans, the mtu is 1500 bytes. So, you should not send more data than 1500 for a singlepacket in the Ethernet interface. Similarly, for the WLAN interface the mtu is 1500. So,you should not send the more than 1500 bytes of data in the wireless interface as well.So, this is the individual interface information that we have.(Refer Slide Time: 23:52)Now, the next say command that we want to learn is ip link show. So, this command iplink show it will show the similar kind of information, but it will show the link layerproperty of the individual interfaces. So, it will show the individual link property. So, forthe loopback interface, you can see that the link or it supports mtu of 65536. It usesqdisc, qdisc is a particular queuing protocol; then it does not have any queuinginterfaces. Its state is unknown, current state, the mode the link mode then whether somegroup is defined or not then the qlen.Then for the Ethernet interface, so actually in the loopback interface there is no suchdefault queue. So, your qlen is 1. So, whatever packet will come, it will immediatelysend that packet. So, there is no queue which is associated with this link. Now, in theEthernet interface you can see that it has this individual support parameters followed bya mtu of 1500; it uses qdisc and it uses the queue type of pfifo. So, this pfifo is thepriority pfifo queue with a first queuing state. It current state is down you have notconnected any Ethernet interface with this machine. So, the state is down its mode isdefault group default and the qlen is 1000. So, you can store 1000 packets of mtu 1500bytes inside the queue that it has. Similarly, for the WLAN, it supports BROADCASTMULTICAST, it is currently up. So, the mtu is 1500 bytes; the qdisc supports the queuetype is mq the something called a management queue for the WLAN IEEE 802.11network. So, this management queue is actually a four layer queue, it four differentquality of service classes, its current state is up. We are currently connected to thiswireless interface with this academic Wi-Fi router. So, this it is connected with theseacademic. So, that is why currently it is up its mode is dormant, mode is dormant meansthe every packet that you are currently sending to this particular machine it will be sendto this WLAN interface. The group is the default group. You have not defined any groupand a qlen is 1000 packet. So, you keep 1000 packets of maximum mtu 1500 inside themanagement queue that you have. So, this is about the link layer information that youcan get from the comment.(Refer Slide Time: 26:48)Then we will see some detailed statistics of individual interfaces. So, for that we issuethe command as ip minus s address show. So, earlier we have seen ip address show. Now,with that we are adding up this minus s option.(Refer Slide Time: 27:07)So, here you can see for the individual interfaces it gives the detail statistics. So, here thefor the loopback interface, the statistics is given, then the Ethernet 0 interface. So, theloop back is not coming here.(Refer Slide Time: 27:25)Just so if I if I, just because of the resolution if I make it more.(Refer Slide Time: 27:30)So, here you can see if initially the loop back information, the statistics for the loop backinformations are coming. So, it says you about the total amount of received bytes, totalamount of received packets, so whether some error has been occurred or not, how manypackets are been dropped, how many overrun packets, how many mutlicast packets.Similarly, for the transmit packets what is the total amount of bytes that are beentransmitted till now, till the interface was live, then the total number of packets, similarlythe error packets, the dropped packets, the carrier packets and the number of packets thathas experienced the collision. Similarly, for the Ethernet interfaces, you have theEthernet interfaces currently down we have not connected any Ethernet interface to thismachine, so that is why it is coming to be the receive and the transmit bytes all arecoming to be 0.(Refer Slide Time: 28:24)Now, for the WLAN you can see that it is having a amount of received bytes the amountof received packets from the time the WLAN interface became up. Similarly, thetransmit bytes and the transmit packets, so that gives you a detailed statistics about thelink.(Refer Slide Time: 28:40)Now, we will see the route related things. So, let us make the command as route minus n.So, this route minus n will show you the routing table which is there in this machine. So,you can see that the routing table contain this parameters the destination IP followed bythe gateway, the net mask, certain flag bit a metric of a individual paths, some referencebits some use bits, and the finally, interface where this particular destination isconnected.So, for example, if I will take say the destination IP as 10 dot 118 dot 2 dot 149 for thatmy default gateway is 10 dot 146 dot 0 dot 2 that is the next hop IP. And for that netmask is 255 dot 255 dot 255 dot 255 then the default interface is wlan 0. So that means,if you want to forward the packet to this particular IP, 10 dot 118 dot 2 dot 149 with a netmask of 255 dot 255 dot 255 dot 255, your interface will be wlan 0. You have to send itthrough wlan 0 interface, and your gateway will be 10 dot 146 dot 0 dot 2, so that means,my routing table.Now, say if I want to add the new routing entry to this route table, for that you can usethe command sudo ip route add, then you give the destination where you want to add upin the routing table, say I want to add 172 dot 16 dot 2 dot 30 dot 2 this particular ip. Andsay my interface is wlan 0 through which interface I want to connect it. So, dev eth 0, sothis dev eth0 so, what we are trying to do here, we are trying to add the new ip route inthis routing table. So, my destination is 172 dot 16 dot 30 dot 2 this particular IP addressI want to add. You can also provide the net mask in the form slash 24. If you are notproviding the net mask that means it will take the entire path the 32 bit as the net mask,based on your IP you can provide that net mask. So, the default interface is eth0 and thenI am providing the gateway the gateway address will be via, so via say 10 dot 146 dot 0dot 2. So, for that you can give the command as traceroute. So, if you make the command astraceroute as say let us try with both the IP addresses that we have added here 172 dot 16dot 30 dot 2, so it will try to find out the path for that machine. So, what you can seefrom here, it has reached to the first hop that we have added. So, in the first hop it is 10dot 146 dot 0 dot 3, the gateway address that we have given. After that gateway addressit is not finding any path to forward that machine, so because this particular machine iscurrently down. So, the path is not there.So, that is why whatever default gateway we are entering here, so it is using that defaultgateway to forward the packet to the final destination. So, that way you can actually - sothis entries produce the IP route that command which we are providing, they are thedefault entries, default routing entries. We call it as the static routing entry. So, we areincluding this static routing entries to dynamically configure or better to say staticallyconfigure the routing table and accordingly things are getting forwarded.So, what I suggest you is to play with this kind of tools and see what you are gettingwhile sending some packets or trying to ping some destination IP address. So, hope thisparticular lecture gives you an idea about in a Linux based system, how you can playwith different kind of a IP related tools and see different statistics from your machine.So, just try to explore that further.Thank you all for attending this class.
Log in to save your progress and obtain a certificate in Alison’s free Advanced Diploma in Computer Networks and Internet Protocol online course
Sign up to save your progress and obtain a certificate in Alison’s free Advanced Diploma in Computer Networks and Internet Protocol online course
Please enter you email address and we will mail you a link to reset your password.