Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT Linux Networking 1 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) Linux Networking 2 Lal Paul IP Addresses 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) Linux Networking 3 Lal Paul IP Address Classes Address Classes Class A, B, C, D, E Loopback Broadcast Linux Networking 4 Lal Paul IP Address Classes Class 32 bits A 0 B 10 C 110 D 1110 E 11110 Linux Networking Net Type of Serv. Host Net Host Net Host Multicast address Reserved 5 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 Linux Networking 6 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. Linux Networking 7 Lal Paul Subnets Large Network Internet Linux Networking 8 Lal Paul Subnets Departments after subnetting B A 192.168.1.0 C 192.168.2.0 192.168.4.0 192.168.3.0 D Linux Networking 9 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. Linux Networking 10 Lal Paul Linux Networking 11 Lal Paul Linux Networking 12 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 Linux Networking 13 Lal Paul 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 Accept 192.168.3.1 && 255.255.255.0 = 192.168.3.0 (Net id) Hence reject Linux Networking 14 192.168.1.1 255.255.255.0 Net id 192.168.2.0 Ping 192.168.3.1 Lal Paul 2.3 IP Routing How do you get a packet from one network to another? ? A Linux Networking B C D W 15 X Y Z Lal Paul IP Routing (cont’d) Answer: with a router (or a series of routers) Case 1: Single hop R A B C D Case 2: Multi-hop Network Cloud R A Linux Networking W B C D X Y Z R W 16 X Y Z Lal Paul Example R1 N1 R2 R3 N2 N3 N4 Dest Next hop N1 N2 N3 N4 Routing table @ R2 R1 Deliver directly Deliver directly R3 Actual routing table contains IP addresses, Flags indicating type of entries, net mask etc. (see Stevens pg. 113, sect 9.2) Linux Networking 17 Lal Paul How packet travels 192.168.1.1 192.168.1.0 255.255.255.0 192.168.1.2 255.255.255.0 Gw:192.168.1.1 10.0.0.1 192.168.2.1 No route Packet10.0.0.2 send back 10.0.0.3 192.168.2.2 255.255.255.0 Gw:192.168.2.1 192.168.2.0 255.255.255.0 192.168.2.3 255.255.255.0 Gw:192.168.2.1 ping 192.168.3.2 192.168.3.1 192.168.3.2 255.255.255.0 Gw:192.168.3.1 Linux Networking 192.168.3.0 255.255.255.0 192.168.3.2 && 255.255.255.0 = 192.168.3.0 Packet sent to Gateway 18 Lal Paul Routing Routing table 192.168.2.0 --> 10.0.0.2 192.168.3.0 --> 10.0.0.3 192.168.1.1 192.168.2.1 192.168.2.0 255.255.255.0 192.168.1.0 255.255.255.0 192.168.1.2 255.255.255.0 Gw:192.168.1.1 192.168.2.2 255.255.255.0 Gw:192.168.2.1 10.0.0.1 10.0.0.2 10.0.0.3 192.168.2.3 255.255.255.0 Gw:192.168.2.1 ping 192.168.3.2 Routing table 192.168.1.0 --> 10.0.0.1 192.168.3.0 --> 10.0.0.3 192.168.3.2 255.255.255.0 Gw:192.168.3.1 Linux Networking 192.168.3.1 192.168.3.0 255.255.255.0 19 192.168.3.2 && 255.255.255.0 =192.168.3.0 Packet sent to Gateway Routing table 192.168.1.0 --> 10.0.0.1 192.168.2.0 --> 10.0.0.2 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 Linux Networking 20 Lal Paul Ping (cont’d) A R1 R2 R3 B Echo request Time Echo reply Linux Networking 21 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 Linux Networking 22 Lal Paul Traceroute (cont’d) Te = Time exceeded Pu = Port unreachable A R1 R2 B R3 TTL=1, Dest = B, port = invalid Te (R1) TTL=2, Dest = B Time Te (R2) TTL=3, Dest = B Te (R3) TTL=4, Dest = B Pu (B) Linux Networking 23 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) Linux Networking 67.892 ms * 67.818 ms 24 Lal Paul