IP Routing:
- Routing is needed to go to a different broadcast domain
- Factors affecting path taken:
- Number of hops
- Congestion
- Bandwidth- Cost/Metric
- Link/Node failure
- Multiple Links
- For choosing the least cost path:
- Administrative Distance
- Cost/Metric
- STATIC ROUTING:
- Manual configuration
- Routes must be configured both the ways .ie. for both sending data and receiving data
- Static has a lower administrative distance of 1. Thus, static route will be preferred.
- If any router fails, then, there will be no path. Thus, static fails
- Also, congestion will happen on a specific route if lot of traffic is being sent. Still, static route is taken
- In Production, static routes are used as backup
- DYNAMIC ROUTING:
- Automatic selection of routes using algorithms
- Algorithms may be dynamic, where the routers make decisions based on information they gather, and the routes change over time, adaptively.
- Default route means we just send all traffic to the default router which becomes the next hop. Using default route is useful since it saves memory (instead of giving a next router for all routes) and also it helps to send packets to unknown router using the default router
--------------------------------------------------------------------------------------------------------------------------------
IP Addressing
- Why we need IP Address?
- We need it to send information to devices throughout the world
- Qualities:
- It is 32-bit binary number (same length)
- Dotted decimal system
- Division based on size- Class A, B, C, D, E
- To find the device: we need identification and location. The identification is the host id. The location is the network id.
- If we have more users, we need more host bits.
- Class A- 8 n/w bits and 24 host bits (0-126) (127 is used for loopback, so can’t be used for hosts)
- Class B- 16 n/w bits and 16 host bits (128-191)
- Class C- 24 n/w bits and 8 host bits (192-223)
- Class D-multicast (224-239)
- Class E- experimental (240-255)[a]
- Class:
- Class A: We have 8 n/w bits. But, the first bit is fixed as 0. Thus, we have only (2^7) networks possible. No of hosts= (224)-2 .
- Class B: We have 16 n/w bits. But, the first bit is fixed as 10. Thus, we have only (2^14) networks possible. No of hosts= (216)-2
- Class C: We have 24 n/w bits. But, the first bit is fixed as 110. Thus, we have only (2^21) networks possible. No of hosts= (28)-2[b]
Note: the (-2) in no. of hosts is because one address is for n/w address and another one is for broadcast address
- Subnet Mask is used to tell the number of bits for network part.
- Eg) 10.0.0.0?- is class A. Therefore, subnet mask is 255.0.0.0. The first host address is 10.0.0.1 and the last host address is 10.255.255.254.
- Eg) 172.16.0.0 ?- Class B therefore subnet mask is 255.255.0.0 . First host address is 172.16.0.1 and last is 172.16.255.254
- Eg) 192.168.1.0 ?-is class C. hence, subnet mask is /24. First host ID is 192.168.1.1 and last is 192.168.1.254. The broadcast address is 192.168.1.255
- Each Class has some range for private IP address:
- Class A- 10.0.0.0 to 10.255.255.255
- Class B- 172.16.0.0 - 172.31.255.255
- Class C- 192.168.0.0 - 192.168.255.255[c]
- Zero Subnet:It is the first subnet obtained when subnetting the network address. Eg) 192.168.1.0/24 is the zero subnet for class C. Nowadays, we can assign this IP address to hosts also since we use classless IP instead of classful IP addressing.
- Public IP address must be unique and is assigned by the ISP
--------------------------------------------------------------------------------------------------------------------------------
Subnetting:
- If we use only classes, then, either we have a lot of hosts or a lot of networks. Thus, IP addresses are wasted. Hence, we use variable length subnets.
- In subnetting, we borrow the bits from the host part.
- Eg) 10.0.0.0/8.
- Here, the n/w part is 10.
- Host part is 0.0.0. We borrow bits from here. Let us take 2 bits. SO, host part starts with (XX000000.)b
- Thus, we get 4 subnets 10.0.0.0/10, 10.64.0.0/10, 10.128.0.0/10, 10.192.0.0/10
- Hint: The subnets will be in multiples of the first subnet. Eg) 64*1=61, 64*2=128, 64*3=192
- If we use /31, then, we will have only one host in the subnet (if we consider broadcast address) or 2 hosts if we don’t consider broadcast. Since a point to point (between 2 routers on end of the n/w) doesn't really need a broadcast address, /31 can be used here.
- CIDR- using only subnets instead of classes
No comments:
Post a Comment