ip addressing & routing by lal paul systems administrator cirm, cusat

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

Upload: judd

Post on 03-Feb-2016

52 views

Category:

Documents


0 download

DESCRIPTION

IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT. 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

1Linux Networking Lal Paul

IP Addressing & Routing

By

Lal PaulSystems Administrator

CIRM, CUSAT

Page 2: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

2Linux 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)

Page 3: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

3Linux 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)

IP Addresses

Page 4: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

4Linux Networking Lal Paul

IP Address Classes Address Classes

Class A, B, C, D, E Loopback Broadcast

Page 5: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

5Linux Networking Lal Paul

IP Address Classes

0 Net

32 bits

Type of Serv. Host

10 Net Host

110 Net Host

1110 Multicast address

11110 Reserved

A

B

C

D

E

Class

Page 6: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

6Linux 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

Page 7: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

7Linux Networking Lal Paul

IP Address Classes (Cont’d)

•Class DMulticast addressesNo network/host hierarchy : 1110, or 224 to 239 decimal.

•Class EFuture Usebegin with 1111, or 240 to 254 decimal.

Page 8: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

8Linux Networking Lal Paul

Subnets Large Network

Internet

Page 9: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

9Linux Networking Lal Paul

Subnets Departments after subnetting

192.168.1.0 192.168.2.0

192.168.3.0 192.168.4.0

A B

CD

Page 10: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

10Linux 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.

Page 11: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

11Linux Networking Lal Paul

Page 12: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

12Linux Networking Lal Paul

Page 13: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

13Linux 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

Page 14: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

14Linux Networking Lal Paul

Ping 192.168.3.1

192.168.1.1255.255.255.0

Net id192.168.2.0

192.168.3.1255.255.255.0

Net id192.168.2.0

192.168.2.1255.255.255.0

Net id192.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

Page 15: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

15Linux Networking Lal Paul

2.3 IP Routing

A B C D W X Y Z

?

How do you get a packet from one network to another?

Page 16: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

16Linux Networking Lal Paul

IP Routing (cont’d)

A B C D W X Y Z

R

Answer: with a router (or a series of routers)

A B C D W X Y Z

R RNetworkCloud

Case 1:Single hop

Case 2:Multi-hop

Page 17: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

17Linux Networking Lal Paul

Example

N2N2 N3N3 N4N4

Actual routing table contains IP addresses, Flags Actual routing table contains IP addresses, Flags indicating type of entries, net mask etc. (see Stevens pg. indicating type of entries, net mask etc. (see Stevens pg. 113, sect 9.2)113, sect 9.2)

Routing table @ R2Routing table @ R2

N1N1

R1 R2 R3

N1N2N3N4

R1Deliver directlyDeliver directlyR3

Dest Next hop

Page 18: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

18Linux Networking Lal Paul

How packet travels

192.168.1.0255.255.255.0

192.168.2.0255.255.255.0

192.168.3.0255.255.255.0

ping 192.168.3.2

192.168.2.2255.255.255.0

Gw:192.168.2.1

192.168.2.3255.255.255.0

Gw:192.168.2.1

10.0.0.1 10.0.0.2

10.0.0.3

192.168.1.1 192.168.2.1

192.168.3.1

192.168.1.2255.255.255.0

Gw:192.168.1.1

192.168.3.2255.255.255.0

Gw:192.168.3.1

192.168.3.2&&

255.255.255.0=

192.168.3.0Packet sent to Gateway

No routePacket send back

Page 19: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

19Linux Networking Lal Paul

Routing

192.168.1.0255.255.255.0

192.168.2.0255.255.255.0

192.168.3.0255.255.255.0

ping 192.168.3.2

192.168.3.2255.255.255.0

Gw:192.168.3.1

192.168.2.2255.255.255.0

Gw:192.168.2.1

192.168.2.3255.255.255.0

Gw:192.168.2.1

Routing table192.168.1.0 -->

10.0.0.1192.168.3.0 -->

10.0.0.3 Routing table192.168.1.0 -->

10.0.0.1192.168.2.0 -->

10.0.0.2

10.0.0.1 10.0.0.2

10.0.0.3

192.168.1.1 192.168.2.1

192.168.3.1

Routing table192.168.2.0 -->

10.0.0.2192.168.3.0 -->

10.0.0.3

192.168.1.2255.255.255.0

Gw:192.168.1.1

192.168.3.2 && 255.255.255.0=192.168.3.0Packet sent to Gateway

Page 20: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

20Linux 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

Page 21: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

21Linux Networking Lal Paul

Ping (cont’d)

R1 R2 R3A B

Time

Echo request

Echo reply

Page 22: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

22Linux 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

Page 23: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

23Linux Networking Lal Paul

Traceroute (cont’d)

R1 R2 R3A BTTL=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 exceededPu = Port unreachable

Page 24: IP Addressing & Routing By Lal Paul Systems Administrator CIRM, CUSAT

24Linux 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-hill012-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 ms10 dnvr-kscy.abilene.ucaid.edu (198.32.8.13) 40.823 ms 41.181 ms 41.076 ms11 snva-dnvr.abilene.ucaid.edu (198.32.8.1) 65.436 ms 66.068 ms 65.569 ms12 198.32.249.161 (198.32.249.161) 65.673 ms 65.771 ms 66.006 ms13 BERK--SUNV.POS.calren2.net (198.32.249.13) 67.183 ms 67.131 ms 66.858 ms14 pos1-0.inr-000-eva.Berkeley.EDU (128.32.0.89) 67.192 ms 66.749 ms 67.720ms15 vlan198.inr-201-eva.Berkeley.EDU (128.32.0.194) 67.373 ms 67.067 ms 67.821 ms16 fast8-0-0.inr-210-cory.Berkeley.EDU (128.32.255.122) 67.634 ms 68.735 ms68.413 ms17 GE.cory-gw.EECS.Berkeley.EDU (169.229.1.46) 67.575 ms 68.222 ms 67.772 ms18 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