Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Linux Networking Lal Paul IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT IP Addressing & Routing By Lal Paul Systems Administrator.

Similar presentations


Presentation on theme: "1 Linux Networking Lal Paul IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT IP Addressing & Routing By Lal Paul Systems Administrator."— Presentation transcript:

1 1 Linux Networking Lal Paul IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

2 2 Linux Networking Lal Paul The Internet Protocol (IP) Provides delivery of packets from one host in the Internet to any other host in the Internet, even if the hosts are on different networks Internet packets are called “datagrams” and may be up to 64 kilobytes in length (although they are typically much smaller) Provides delivery of packets from one host in the Internet to any other host in the Internet, even if the hosts are on different networks Internet packets are called “datagrams” and may be up to 64 kilobytes in length (although they are typically much smaller)

3 3 Linux Networking Lal Paul 32 bits long Notation: Each byte is written in decimal in MSB order, separated by decimals 01101001.11111110.00010001.00000001 ( 105.254.17.1 – in decimal notation) 32 bits long Notation: Each byte is written in decimal in MSB order, separated by decimals 01101001.11111110.00010001.00000001 ( 105.254.17.1 – in decimal notation) IP Addresses

4 4 Linux Networking Lal Paul IP Address Classes Address Classes Class A, B, C, D, E Loopback Broadcast Address Classes Class A, B, C, D, E Loopback Broadcast

5 5 Linux Networking Lal Paul IP Address Classes 0Net 32 bits Type of Serv.Host 10NetHost 110Net Host 1110Multicast address 11110Reserved A B C D E Class

6 6 Linux Networking Lal Paul IP Address Classes Class A: For very large organizations 16 million hosts allowed : from 0xxx, or 1 to 126 decimal. Class B: For large organizations 65 thousand hosts allowed : from 10xx, or 128 to 191 decimal. Class C For small organizations 255 hosts allowed : from 110x, or 192 to 223 decimal Class A: For very large organizations 16 million hosts allowed : from 0xxx, or 1 to 126 decimal. Class B: For large organizations 65 thousand hosts allowed : from 10xx, or 128 to 191 decimal. Class C For small organizations 255 hosts allowed : from 110x, or 192 to 223 decimal

7 7 Linux Networking Lal Paul IP Address Classes (Cont’d) Class D  Multicast addresses  No network/host hierarchy : 1110, or 224 to 239 decimal. Class E  Future Use  begin with 1111, or 240 to 254 decimal.

8 8 Linux Networking Lal Paul Subnets Large Network Internet

9 9 Linux Networking Lal Paul Subnets Departments after subnetting 192.168.1.0192.168.2.0 192.168.3.0 192.168.4.0 A B C D

10 10 Linux Networking Lal Paul Subnet Masks A binary number used to compare the destination address to the local IP address and to determine whether those destinations are on the same subnet or not.

11 11 Linux Networking Lal Paul

12 12 Linux Networking Lal Paul

13 13 Linux Networking Lal Paul Subnet Masks Assume your machine is 192.168.1.1 and has a subnet mask 255.255.255.0 and a packet is send to 192.168.1.2 How to find whether the destination host is on the same subnet or not Anding the IP Address with the subnet mask will give the Network Address.Hence the both Ips are Anded and the system will determine the network address Assume your machine is 192.168.1.1 and has a subnet mask 255.255.255.0 and a packet is send to 192.168.1.2 How to find whether the destination host is on the same subnet or not Anding the IP Address with the subnet mask will give the Network Address.Hence the both Ips are Anded and the system will determine the network address

14 14 Linux Networking Lal Paul Ping 192.168.3.1 192.168.1.1 255.255.255.0 Net id 192.168.2.0 192.168.3.1 255.255.255.0 Net id 192.168.2.0 192.168.2.1 255.255.255.0 Net id 192.168.2.0 192.168.3.1 && 255.255.255.0 = 192.168.3.0 (Net id) Hence reject 192.168.3.1 && 255.255.255.0 = 192.168.3.0 (Net id) Hence Accept

15 15 Linux Networking Lal Paul 2.3 IP Routing ABCDWXYZ ? How do you get a packet from one network to another?

16 16 Linux Networking Lal Paul IP Routing (cont’d) ABCDWXYZ R Answer: with a router (or a series of routers) ABCDWXYZ RR Network Cloud Case 1: Single hop Case 2: Multi-hop

17 17 Linux Networking Lal Paul Example N2N3N4 Actual routing table contains IP addresses, Flags indicating type of entries, net mask etc. (see Stevens pg. 113, sect 9.2) Routing table @ R2 N1 R1R2R3 N1 N2 N3 N4 R1 Deliver directly R3 DestNext hop

18 18 Linux Networking Lal Paul How packet travels 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0 192.168.3.0 255.255.255.0 ping 192.168.3.2 192.168.2.2 255.255.255.0 Gw:192.168.2.1 192.168.2.3 255.255.255.0 Gw:192.168.2.1 10.0.0.110.0.0.2 10.0.0.3 192.168.1.1 192.168.2.1 192.168.3.1 192.168.1.2 255.255.255.0 Gw:192.168.1.1 192.168.3.2 255.255.255.0 Gw:192.168.3.1 192.168.3.2 && 255.255.255.0 = 192.168.3.0 Packet sent to Gateway No route Packet send back

19 19 Linux Networking Lal Paul Routing 192.168.1.0 255.255.255.0 192.168.2.0 255.255.255.0 192.168.3.0 255.255.255.0 ping 192.168.3.2 192.168.3.2 255.255.255.0 Gw:192.168.3.1 192.168.2.2 255.255.255.0 Gw:192.168.2.1 192.168.2.3 255.255.255.0 Gw:192.168.2.1 Routing table 192.168.1.0 --> 10.0.0.1 192.168.3.0 --> 10.0.0.3 Routing table 192.168.1.0 --> 10.0.0.1 192.168.2.0 --> 10.0.0.2 10.0.0.110.0.0.2 10.0.0.3 192.168.1.1 192.168.2.1 192.168.3.1 Routing table 192.168.2.0 --> 10.0.0.2 192.168.3.0 --> 10.0.0.3 192.168.1.2 255.255.255.0 Gw:192.168.1.1 192.168.3.2 && 255.255.255.0 =192.168.3.0 Packet sent to Gateway

20 20 Linux Networking Lal Paul Ping Uses ICMP echo request/reply Source sends ICMP echo request message to the destination address Echo request packet contains sequence number and timestamp Destination replies with an ICMP echo reply message containing the data in the original echo request message Source can calculate round trip time (RTT) of packets If no echo reply comes back then the destination is unreachable Uses ICMP echo request/reply Source sends ICMP echo request message to the destination address Echo request packet contains sequence number and timestamp Destination replies with an ICMP echo reply message containing the data in the original echo request message Source can calculate round trip time (RTT) of packets If no echo reply comes back then the destination is unreachable

21 21 Linux Networking Lal Paul Ping (cont’d) R1R2R3 AB Time Echo request Echo reply

22 22 Linux Networking Lal Paul Traceroute Traceroute records the route that packets take A clever use of the TTL field When a router receives a packet, it decrements TTL If TTL=0, it sends an ICMP time exceeded message back to the sender To determine the route, progressively increase TTL Every time an ICMP time exceeded message is received, record the sender’s (router’s) address Repeat until the destination host is reached or an error message occurs Traceroute records the route that packets take A clever use of the TTL field When a router receives a packet, it decrements TTL If TTL=0, it sends an ICMP time exceeded message back to the sender To determine the route, progressively increase TTL Every time an ICMP time exceeded message is received, record the sender’s (router’s) address Repeat until the destination host is reached or an error message occurs

23 23 Linux Networking Lal Paul Traceroute (cont’d) R1R2R3 AB TTL=1, Dest = B, port = invalid TTL=2, Dest = B TTL=3, Dest = B TTL=4, Dest = B Te (R1) Te (R2) Te (R3) Pu (B) Time Te = Time exceeded Pu = Port unreachable

24 24 Linux Networking Lal Paul Traceroute Examle 1 lcsr-gw (128.6.13.21) 1.206 ms 0.973 ms 0.782 ms 2 rucs-gw (165.230.212.129) 0.697 ms 0.569 ms 0.571 ms 3 transition2-gw (165.230.12.145) 2.786 ms 0.994 ms 0.769 ms 4 rutgers-gw.Rutgers.EDU (198.151.130.209) 1.726 ms 2.048 ms Vl1000-sr02-hil l012-svcs.Rutgers.EDU (198.151.130.14) 1.278 ms 5 rutgers-gw.Rutgers.EDU (198.151.130.209) 1.755 ms 1.241 ms 1.828 ms 6 198.151.130.226 (198.151.130.226) 2.748 ms 3.070 ms 2.640 ms 7 clev-nycm.abilene.ucaid.edu (198.32.8.29) 15.162 ms 14.619 ms 14.663 ms 8 ipls-clev.abilene.ucaid.edu (198.32.8.25) 21.220 ms 22.497 ms 21.450 ms 9 kscy-ipls.abilene.ucaid.edu (198.32.8.5) 30.257 ms 30.604 ms 30.969 ms 10 dnvr-kscy.abilene.ucaid.edu (198.32.8.13) 40.823 ms 41.181 ms 41.076 ms 11 snva-dnvr.abilene.ucaid.edu (198.32.8.1) 65.436 ms 66.068 ms 65.569 ms 12 198.32.249.161 (198.32.249.161) 65.673 ms 65.771 ms 66.006 ms 13 BERK--SUNV.POS.calren2.net (198.32.249.13) 67.183 ms 67.131 ms 66.858 ms 14 pos1-0.inr-000-eva.Berkeley.EDU (128.32.0.89) 67.192 ms 66.749 ms 67.720 ms 15 vlan198.inr-201-eva.Berkeley.EDU (128.32.0.194) 67.373 ms 67.067 ms 67.82 1 ms 16 fast8-0-0.inr-210-cory.Berkeley.EDU (128.32.255.122) 67.634 ms 68.735 ms 68.413 ms 17 GE.cory-gw.EECS.Berkeley.EDU (169.229.1.46) 67.575 ms 68.222 ms 67.772 ms 18 gig8-1.snr1.CS.Berkeley.EDU (169.229.3.66) 67.454 ms 67.988 ms 67.177 ms 19 now.CS.Berkeley.EDU (128.32.44.96) 67.892 ms * 67.818 ms 1 lcsr-gw (128.6.13.21) 1.206 ms 0.973 ms 0.782 ms 2 rucs-gw (165.230.212.129) 0.697 ms 0.569 ms 0.571 ms 3 transition2-gw (165.230.12.145) 2.786 ms 0.994 ms 0.769 ms 4 rutgers-gw.Rutgers.EDU (198.151.130.209) 1.726 ms 2.048 ms Vl1000-sr02-hil l012-svcs.Rutgers.EDU (198.151.130.14) 1.278 ms 5 rutgers-gw.Rutgers.EDU (198.151.130.209) 1.755 ms 1.241 ms 1.828 ms 6 198.151.130.226 (198.151.130.226) 2.748 ms 3.070 ms 2.640 ms 7 clev-nycm.abilene.ucaid.edu (198.32.8.29) 15.162 ms 14.619 ms 14.663 ms 8 ipls-clev.abilene.ucaid.edu (198.32.8.25) 21.220 ms 22.497 ms 21.450 ms 9 kscy-ipls.abilene.ucaid.edu (198.32.8.5) 30.257 ms 30.604 ms 30.969 ms 10 dnvr-kscy.abilene.ucaid.edu (198.32.8.13) 40.823 ms 41.181 ms 41.076 ms 11 snva-dnvr.abilene.ucaid.edu (198.32.8.1) 65.436 ms 66.068 ms 65.569 ms 12 198.32.249.161 (198.32.249.161) 65.673 ms 65.771 ms 66.006 ms 13 BERK--SUNV.POS.calren2.net (198.32.249.13) 67.183 ms 67.131 ms 66.858 ms 14 pos1-0.inr-000-eva.Berkeley.EDU (128.32.0.89) 67.192 ms 66.749 ms 67.720 ms 15 vlan198.inr-201-eva.Berkeley.EDU (128.32.0.194) 67.373 ms 67.067 ms 67.82 1 ms 16 fast8-0-0.inr-210-cory.Berkeley.EDU (128.32.255.122) 67.634 ms 68.735 ms 68.413 ms 17 GE.cory-gw.EECS.Berkeley.EDU (169.229.1.46) 67.575 ms 68.222 ms 67.772 ms 18 gig8-1.snr1.CS.Berkeley.EDU (169.229.3.66) 67.454 ms 67.988 ms 67.177 ms 19 now.CS.Berkeley.EDU (128.32.44.96) 67.892 ms * 67.818 ms


Download ppt "1 Linux Networking Lal Paul IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT IP Addressing & Routing By Lal Paul Systems Administrator."

Similar presentations


Ads by Google