routerswitchlab-blog
routerswitchlab-blog
Router And Switch Blog
6 posts
Don't wanna be here? Send us removal request.
routerswitchlab-blog · 7 years ago
Text
Route - Directly connected routes
The job of every router is to connect 2 or more different networks. Its default behavior is to automatically create directly connected routes. In Cisco routers, once you configure an IP address to its interface, the device will auto generate a route base on the IP address network mask.
Directly connected routes has an administrative distance of “0″.
have a look on the sample video.
youtube
On a layer 3 switch, to enable inter-valn routing. Just issue " ip routing ” command on cisco switch. The switch will act as router at the same time.
0 notes
routerswitchlab-blog · 7 years ago
Text
Route - Routing Table
 - it is sometimes referred to RIB (Routing Information Base)
- a table of information use by router to reach the target address (network address) 
Routing table consist of
Network address 
Gateway (exit interface or next-hop router)
Administrative Distance and metric (or cost)
These 2 questions below are in my mind when I study routing table. 
How router creates it’s routing table?
every router automatically creates directly connected routes once you configure IP address on its interface.
The rest are base from routing protocols (and we will discuss this later)
How router selects the best path to forward the traffic?
Router will lookup on the routing table to reach the target address,  if the network address is not present, The router will forward it to default gateway (if configured) else it will send an ICMP UNREACHABLE to the source host as reply.
the longest prefix match is more preferred to all other route information. Example: /29 is more preferred than /25 prefix. Please note also, that if the network address is not present on the routing table, The router will send it to default gateway (if configured) else it will send an ICMP UNREACHABLE to the source host as reply.
if same prefix, look for the lowest distance (Administrative Distance)
if the prefix and distance are equal, look for the lowest metric or cost
if prefix, distance and metric are the same. Then load balance the traffic.
RIB vs FIB
“I must confess that this is the first time I learned about this. And here’s what I found.”
RIB (Routing Information Base) is the routing table itself. The “show ip route” command will show you the RIB information. RIB is not use to forward traffic. Why? because some next hop address are not directly connected to the router like in BGP.
FIB (Forwarding Information Base) is a table use by router on how he can reach the target address (network address). It contains interface id and next hop router for each target address. Use “show ip cef” to  see the table
1 note · View note
routerswitchlab-blog · 7 years ago
Text
Route - IP addressing (part 2)
Subnetting
NOTE:This decimal converted binary value will be use through out this post. 128  64  32  16  8  4  2  1
Before we go to subnetting process. Let us review the IP address and network mask. Let us site an example.
Given 192.168.200.0 /24 ip address block. Let's try to interpret how network device will read this.
Tumblr media
Take a look on Network Mask (binary value). Just remember that all
Tumblr media
Also, remember that each address should have network address, usable host range and broadcast address. For the network device (such as router) to properly locate the specific host or target.
Let us get started.
Looking at the example above. How do we identify the network,host and broadcast address?
To compute for Network ID (or network address) - we use Logical AND (or we should I say multiply) IP address (binary value) to Network Mask (binary value)
Tumblr media
To compute for Broadcast address - Bring down the network address + convert binary host portion to 1
Tumblr media
To define the Usable address - the number start after NETWORK ID and it ends before BROADCAST ID. The number of usable address can be computed also by 2n - 2; where "n" = number of host bits.
Tumblr media
I hope above information encourage you to know subnetting :). Now let us tackle subnetting.
Subnetting
is the process to create small group of network to maximize the use of IP address block buy borrowing a binary bit/s (called subnet ID) from the host portion (in binary value).
“On this post I will try to explain the proper procedure and the shortcut that I know. It is on your decision which procedure is more convenient for you.”
Subnetting - Proper Method
Procedure:
1. Determine the classful network mask if the prefix is not define. 2. Determine how many subnet bits needed for the required number of networks. Use this formula  2 raise to subnetid = number of required networks. And look for the new network mask (called subnet mask) 3. Determine the Delta (sometimes called Increment); where Delta = to the decimal value of the right most binary 1. 4. Plot the network, usable and broadcast address and its subnet mask
Example1:
Tumblr media
Given: 192.168.35.0 How many networks do I need for above diagram? The Answer is 4. (Remember in CCNA each router interface is 1 broadcast domain) What are the IP address I can assign to each router interface and to hosts?
Let us use the procedure above.
1. Determine the classful network mask if the prefix is not define. Answer is 255.255.255.0 (since the given address is part of Class C)
2.Determine how many subnet bits needed for the required number of networks. Use this formula  2 raise to subnetid = number of required networks. And look for the new network mask (called subnet mask)
Needed networks = 4
Tumblr media
We are after really about subnet bits.
Tumblr media
Therefore;
Tumblr media Tumblr media
3. Determine the Delta (sometimes called Increment); where Delta = to the decimal value of the right most binary 1.
Tumblr media
The right most  binary 1 is located on the Octet 4. Using 128  64  32  16  8  4  2  1  value, Delta = 64
Subnet mask = 255.255.255.192 (/26)
4. Plot the network, usable and broadcast address using value of Delta and its subnet mask
4.a. plot the Network address;  Delta = 64
Tumblr media
4.b. plot the Broadcast address. The last address before the next Network address is  a broadcast address.
Tumblr media
4.c. plot the Usable address. These are the adress range between Network Address and Broadcast Address.
Tumblr media
Please NOTE that we are not assigning Network and broadcast address to any devices.
Let us assign the IP address to each network device interfaces.
Tumblr media
Subnetting - Shortcut method 
( Aha! so may shortcut pala! ) Actually you just need to memorize the procedure, formula and by practice.
Procedure (Looking for numberof network address)
1. Using our hand to compute the subnet bits. Using this Formula 2 4 8 16 32 64 128 256 512 1024 and so on...
2. Look Delta and subnet mask
3. Plot the network address
Example:
Given 192.168.20.0  : Required 16 network.
1. Using our hand to compute the subnet bits. Using this Formula 2 4 8 16 32 64 128 256 512 1024 and so on...
The formula I'm using is counting this on using my starting from  2  4  8  16  32 64 128 256 512 1024 and so on... since I need 16 network, using the formula above how many finger I used.
Tumblr media
Above information - means that we need 4 subnet bits to create 16 network.
2. Look Delta and subnet mask
Tumblr media
Delta = 16
Subnet Mask = 255.255.255.240 (/28)
Remember that Delta is the right most binary bit 1 (in decimal form) of a new netmask which is 16
For Subnet Mask - 128+64+32+16 = 240
3. Plot the network address
Tumblr media
The increment of each subnet is 16 as we seen above. I only look for the NETID (network address) because from there we can identify the usable address and broadcast address.
Network Address for network1            = 192.168.20.0 /28 Usable address for network1           = 192.168.20.(1 - 14) /28 Broadcast address of network1       = 192.168.20.15 /28
Another example: Given: 172.16.0.0 /16 : Required network is 32 Formula: 2 4 8 16 32 64 128 256 512 1024 Answer: Subnet bits = 5
Tumblr media Tumblr media
Procedure (Looking for number of host address)
1. Counting again by hand and using this formula again 2 4 8 16 32 64 128 256 512 1024..so on (minus 2 )
2. Plot the host portion
3. Look Delta and subnet mask
4. Plot the network address
Example: 192.168.0.0 ; required 16 hosts per subnet.
1. Counting again by hand and using this formula again 2 4 8 16 32 64 128 256 512 1024..so on (minus 2 )
Using this formula again 2 4 8 16 32 64 128 256 512 1024..so on (minus 2 ) Here, we should focus on the host portion. Means how many host bits (0) do we need to cater 16 hosts per subnet?
Tumblr media
This example is tricky! Is it correct that we only need 4 host bits? Answer is NO. Remember, IP address block should have network and broadcast address. That is the reason why we need to subtract 2. because 16 -2  = 14 host only. We need to add another host bit.
And the correct answer should be below.
Tumblr media
Host bits = 5 which is 32 -2 = 30 hosts per subnet.
2. Plot the host portion
OK! Now I know the host bits. How will i know the subnet mask ,   and NET ID for each subnet.
Check the given again. 192.168.0.0 is part of class C. Means that the default nework mask is /24 (or 255.255.255.0) Meaning we cannot modify the first 3 octet. Because subnetting is borrowing subnet bits from the host portion. In Class C network. the host portion is Octet4. Procedure here is to plot the "0s" from right to left. The rest make "1s".
Tumblr media
3. Look Delta and subnet mask
From above table, we can now determine the other subnetting requirements.
Tumblr media
4. Plot the network address
Tumblr media
Another example: (This time try to use your mind to get the answer) Given: 10.16.0.0 /8; Required 100 users per subnet.
Tumblr media
VLSM (Variable Length Subnet Mask)
This subnetting technique is commonly used by networks today to maximize the use of IP  address block by creating different subnet size. If you will notice, subnetting can divide classful network. But they still found out some waste of usable address. For example we have a IP block with a prefix of /25 - meaning 126 address are the usable address and for point-to-pint connection only 2 address are needed and the rest will be unused. And most of the time engineers are focus on usable address for each block when doing this.
Giving an example:
Tumblr media
NOTE:
For VLSM - always create the subnet the largest first to smallest network requirement. The rest are the same with subnetting procedure. Let us start by defining the required network from largetst to smallest.
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
So we finish the VLSM table. Let us know assign these addresses to our network design above.
Tumblr media
In practical world, VLSM is commonly use but you need to give allowance on your computation for your company future expansion. That is the reason, why large company uses class A (10.X.X.X) for their internal network communication.
Try to follow my example until you become familiar with the computation.
Supernetting / CIDR / Route summarization
I would say Supernetting is most commonly use by engineers for route summarization. It is a summarization of a multiple subnets under a common network prefix - also known as CIDR (Classles Inter Domain Routing). Procedure: 1. Plot the network address  in binary value. 2. On all of the network address, look for the significant bit which is common to all network address bits. Count the number of common bits 3. Find the summarize network address prefix and subnetmask
Example: On the diagram below, R1 wants to see a summarize network for each company. In order to provide the requirement. R2 and R3 needs to advertise their summarize network towards R1.
Tumblr media
1. Plot the network address  in binary value.
Tumblr media
2. On all of the network address, look for the significant bits which is common to all network address bits. Count the number of common bits
Tumblr media
3. Find the summarize network address prefix and subnet mask.
Tumblr media Tumblr media
Using the value we got above, we can now use it for R2 and R3 to advertise their summarize attached networks towards R1
Tumblr media
In R1 routing table, it should be like this 192.168.0.0 / 19 via R2 directly connected address 172.16.0.0 /17 via R3 directly connected address
Please hit like and follow my blog if this helps you.
2 notes · View notes
routerswitchlab-blog · 7 years ago
Text
Route - IP addressing (part 1)
On this post, we are going to discuss
IP address
Classful and classless
Subnetting / VLSM
Supernetting /CIDR / Route summarization
IP Address
There are tons of explanation in the internet describing what is an IP address ,  On this section, I will try to simplify it for you to understand it more clearly. what is IP address ? - it is a 32-binary bits address that can be assign uniquely to a host - 32 binary bit means 4 octets divided by a dot "."  (machine language) - in human readable - ip address is in a form of 4 decimal value divided by a dot "."
example:
Tumblr media
This binary arithmetic should be easy to those who finish their CCNA course. You will see tons of explanation on the internet to compute this. On this blog I will show you how I compute this. Trying to make it more easy and faster. I memorize below value (a decimal converted value from binary) and this value are computed the same to all octets.
128  64  32  16  8  4  2  1
Setting an example. Converting Octet 2 on IP address sample above. Only look for "1s" on the binary bits and add the decimal value
Tumblr media
Computation for Octet 2
Tumblr media
Lets take Octet 4 for another example
Tumblr media
Computation for Octet 4
Tumblr media
NOTE: We will be using this decimal convertion value to the rest of IP addressing. So please take note of these value.
128  64  32  16  8  4  2  1
Classful IPv4 address
Classful adress are IP address ranges that are FIX and terms of network mask and divided into two (2) parts - network bits and host bits. For some, they called it as network portion and host portion. - It is divided into five (5) classes -- A, B, C, D, E class A , B, C - commonly  use for  host or device addressing. class D - for multicasting class E - for experimental use
So how do we determine the Classful network. First thing, we need to  know the network mask of each type. Remember that IP address is consist of 4 octet binary bits like below.
Octet1 .   Octet2  .  Octet3    .  Octet4
The rule here is to make all "1" on each octet. And sum all "1" using decimal convertion  as explain above. Please take a look also that I am indicating the Network portion and Host portion.
Tumblr media
class D and E - network mask is not applicable.
In a classful network, these network mask value in a classful address are FIX.
Tumblr media
So how do we know if the ip address is part of  which type? how do we compute the IP address range of each classess. The answer is revealed on this "1st Octet rule" 1st Octet rule - is the process to modify the left most (high-order bits) of octet 1. Where X  (on this example) is variable and each class has its constant value.
Tumblr media Tumblr media
Computing the number of Network and Host of each class
Below is the table how to compute the number of usable network and host address on each class.
Tumblr media
Take a look on class A (total # of Network) why the computation become 2raise to 7 - 2 (with -2). The reason behind this is that we are removing network 0.0.0.0 and 127.0.0.0. 0 - is use as default. Some says it is used for broadcast. 127 - is reserved for loopback address
Now have a look on Total # of host. Why do we subtract 2 on each class. The reason behind that; each IP address block has NetworkID - Host ID.  And we cannot use these as usable address. Why we cannot use it. Each IP address block consist of Nework ID   - used by router to where the packet should it forward Usable Host ID - an address that can be use by hosts or devices Broadcast ID - use for broadcast. Normally to create MAC adn ARP table to reach the target host.
To give you a clear picture. Let us say we have 192.168.100.0 /24 we now know that this is a Class C given that the first octet is 192 and the network mask is 255.255.255.0 (/24). 192.168.100.0 - is network ID or address use by router to reach below usable address. 192.168.100. 1 -- 254 - is the usable address 192.168.100.255 - is the broadcast ID or address to locate the specific host via MAC or ARP table.
Summarizing everything above we should come up with below table. You dont need to memorize this as long you know how to compute this values. Trying read again above information and compute it for yourself. ("I understand you - medyo boring ito :)"
Tumblr media
Private IP Address
Tumblr media
Above are the ranges can be use by any company for their internal network communication. And if they want to reach internet they need to use NAT or web proxy application. These are define under RFC 1918 to conserve IPv4 addresses.
They also introduce IPv6 address to provide sufficient unique address across the globe. (I will try to read about IPv6 addressing and will post on this blog about what I learned.)
Classful vs Classless Network
We already discuss about classful networks above. These are the networks that uses FIX network mask. To review:
Tumblr media
Classless So what is classless networks? These are the networks derive from classful network to create small group of networks by borrowing binary bits from the host portion. This bit is called Subnet bit or subnet ID. The process of doing this is called Subnetting. Too give you an idea please have a look on below table.
Tumblr media
Before moving to Subnetting, VLSM, and supernetting (IP Addressing - part 2). We need to understand this information first.
Please hit like or follow this if this information helps you. You may also leave a message for any inquiries.
0 notes
routerswitchlab-blog · 7 years ago
Text
Route - Basic Routing
Router  - a device that that forwards ip packets from one network to another.              - It always look for the target host or network once he receives the packets.              - It select best path or lower metric going to destination using routing protocols.
Lets create a simple network with router in place (Figure 1). Please take a look on each MAC and IP addresses.
Figure 1 - Physical connection
Tumblr media
From above diagram, is PC1 will be able to reach PC2?
If you still undetermined about the question above. Let us know how router process when he receives a packet based on below flowchart shown on Figure 2.
Figure 2 - Routing decision
Tumblr media
Now let's go back to Figure 1 and to the question. is PC1 will be able to reach PC2? How? On PC1 - will be planning to issue a PING command to 192.168.200.1. Do not ping yet. Let us say R6 recieved a packet destined to 192.168.200.1 (which is PC2). Using the flowchart on Figure 2 and R6 routing table (Figure 3) lets decide if the target is reachable or not.
Figure 3 - R6 routing table
Tumblr media
Is 192.168.200.1 able to reach from my directly connected routes? Answer: Yes. 192.168.200.1 is a host part of 192.168.200.0/24 reachable via FastEthernet0/1 Therefore we can conclude that PC1 is able to reach PC2 (192.168.200.1).
Let us do a ping test. Figure 4 - ping
Tumblr media
Shown on Figure 4 that we have a successful ping towards PC2.
Moving forward, I will create a lab that will tackle this into more details like ARP, encapsulation / decapsulation process and packet capture via wireshark.
Please hit like and follow my blog if this information helps you understand basic routing.
0 notes
routerswitchlab-blog · 7 years ago
Text
Setting up Home Network Lab environment
First thing, we need to set up our lab environment. We will be going to use tools and software that is available from internet.
Required tools and software.
Please take of note of the PC requirements required by these applications.
GNS3 1.3.13
Cisco Router and switch IOS Softwares
Procedures
Install GNS3 1.3.13 to your local machine
Import CIsco IOS to GNS3
I recommend to get the recommended idle PC for each device before using.
Verify the device by powering it on and make sure you are able to console it.
All of this instruction can be found on the internet but hopes this helps. You may also leave a message if you encountered any error during installation
0 notes