The Internet Protocol (IP) Part 1: Basics - - PDF document

the internet protocol ip part 1 basics
SMART_READER_LITE
LIVE PREVIEW

The Internet Protocol (IP) Part 1: Basics - - PDF document

COLE POLYTECHNIQUE FDRALE DE LAUSANNE The Internet Protocol (IP) Part 1: Basics Contents


slide-1
SLIDE 1
  • The Internet Protocol (IP)

Part 1: Basics

  • ÉCOLE POLYTECHNIQUE

FÉDÉRALE DE LAUSANNE

  • Contents

! "# $%&'(# )

*+!

,-. /# / 0&1- 23-4#4561 +#'

$. *.7*#

slide-2
SLIDE 2
  • 1. Why a network layer?

8(%(8 (!(# ."-'1(44 #(% 9 9 9 9 8': 37(%'# ; 7

'(%' '4(!% solution

  • Connectionless Network Layer
  • (%'<

'!% '< 4(#!46 #!46 #!46 #!46

  • router

R1 router R2 router R4 Host A.H1 Host B.D.H2 2 1 2 2 1 1 to output B.x 2 A.x 0 to output A.x 1 B.D.x 2 B.x 3 to output A.x 1 B.x 2 router R3 to output A.x 1 B.D.x 1 B.C.x 0 1 3 Host B.C.H2

slide-3
SLIDE 3
  • IP Principles

1## 1## 1## 1## =((%<( # 44 (=%(#4

  • *(

*( *( *(

  • (%

(% (% (% ' ' ' '7 (% <4'(!46 (%7'( ((%7 1!%#">; !44(# +#'7

<'?<' (% <4' (

  • 2. IP addresses

5=(;@ "$;7 192.78.32.2

146

"!46!7

prefix:host

464(%

4#(% A #

46'4#B%C

slide-4
SLIDE 4
  • Example

129.132 66.46 129.132.100.12 lrcsuns 128.178.156.24 08:00:20:71:0D:D4 lrcpc3 128.178.156.7 00:00:C0:B8:C2:8D in-inr 128.178.156.1 00:00:0C:02:78:36 128.178.79.1 00:00:0C:17:32:96 ed2-in 182.1 in-inj 128.178.182.3 182.5 128.178.100.3

LRC

15.221 Ring SIDI SUN

DI

ed0-swi 15.13 128.178.100.12 128.178.84.1 ed0-ext

EPFL-Backbone

sic500cs 128.178.84.130 Modem + PPP disun3 128.178.79.9 08:00:20:20:46:2E 128.178.84.133 stisun1 15.7 128.178.47.5 128.178.47.3 Switch ezci7-ethz-switch 129.132.35.1 130.59.x.x ed2-el 128.178.29.64 08:00:07:01:a2:a5

LEMA

128.178.156.23 08:00:07:01:a2:a5 ezci7-ethz-switch

Komsys ETHZ-Backbone

129.132.100.27 lrcmac4 lrcmac4

  • Binary, Decimal and Hexadecimal

D#BC7'#! BC '4!4' 5

7$) '7 676E"

.!!#'FG6 !76 #)'#

6E < 6" < 6E"<

.!!#'FG'

<0H/)H$H0H<$)

3!-

6 <<, 6 <<,,

slide-5
SLIDE 5
  • Representation of IP Addresses
  • 7#!';(

!4

6!7

  • 6!7
  • 6

6 6 676! 46@#

6!7

  • 6!7
  • '

' ' '7#4$'7;

6!7

  • 6!7
  • solution
  • A Subnet Prefix is written using one of two

Notations: masks / prefixes

5#%7H%7

6!700,/$%,,,,,,

%!4#47 !46;( (I%#!46 7!4600,/

6!72$2%,,,,,,2

97(!46: 97(':

solution

slide-6
SLIDE 6
  • Prefix Notation

!46A 700,/J)

)44'!4#;!

  • 7!4600,/

6#

00,/J)00,/J)00,/J)

6!7

97(2$2%,,,,,,2!46 97!4644:

J0;/J0;$J0;)0J0 ('4:

solution

  • IP Address Hierarchies

+!4644!46 !!###

6!7 006'!E 00,/ J )!*-E 00 J /!E 5('## +('4#(4 #4-&* #

  • +4A #

"#;!464(4' #('" ;!46(0;/-;)+ 4('!''@#'4( !46( (#@4(#+(( #!#@4( !46 (46!;! E0?/ E+1K+4;4;%; '

  • -(!(%+'; '

#%

slide-7
SLIDE 7
  • IP address classes

Examples: 128.178.x.x = EPFL host; 129.132.x.x = ETHZ host 9.x.x.x = IBM host 18.x.x.x = MIT host Class Range A B C D E 0.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 224.0.0.0 to 239.255.255.255 240.0.0.0 to 247.255.255.255

  • 6?(%4-;

%

0 Net Id 0 1 2 3… 8 16 24 31 10 Net Id 110 Net Id 1110 Multicast address 11110 Reserved Subnet Id Host Id Host Id class A class B class C class D class E Host Id Subnet Id

  • Address allocation

8-#

E!.E*E>-- "4"*>I*E>-- >""*> "#-"*> "4">-

  • 4--

193-195/8, 212-213/8, 217/8 4*E 199-201/8, 204-209/8, 216/8 4"*> 202-203/8, 210-211/8, 218/8 4">-

3!4#

!46 ### ' (% # % !46

slide-8
SLIDE 8
  • Address delegation

E!

/J0;0J0;2$2,J0;L 3

/,J/ 74

/,))0J,

7%

/,)),J)

3

2,))J) 7

2,)//J

7

2,)/)J

9 9 9 9"% 4 33? !

solution

  • Special case IP addresses
  • 1. 0.0.0.0

this host, on this network

  • 2. 0.hostId

specified host on this net (initialization phase)

  • 3. 255.255.255.255

limited broadcast (not forwarded by routers)

  • 4. subnetId.all 1’s

broadcast on this subnet

  • 5. subnetId.all 0’s

BSD used it for broadcast

  • n this subnet (obsolate)
  • 6. 127.x.x.x

loopback

  • 7. 10/8

reserved networks for 172.16/12 internal use (Intranets) 192.168/16

slide-9
SLIDE 9
  • Test Your Understanding (1)
  • 192.44.78.254
  • 192.44.77.254

192.44.77.2 __.__.__.1 __.__.__.__ 187.44.__.__ __.__.__.__ __.__.__.253

!

solution

  • Test your Understanding (2)

97"E#(?(!#; '&(# : 97(# 9$7!(

slide-10
SLIDE 10
  • 3. IP packet forwarding

+!%4(##4+-J4(' (!%4(+!7

*4#!%;

4!464' 4;'4 (#'#

#?%(BC (56 B*C (8( '; 6!+!#6? 4 4 4 4

  • IP packet forwarding algorithm

" < JMN MJ 4JMMJ 4JMMJ 4JMMJ 4JMMJ7

  • 64"

4''# 4 " <" 61! ?

4JMMJ 4JMMJ 4JMMJ 4JMMJ7" '(% '(% '(% '(% <% 7

4'!'4"%3. 4"I3. <" I3. '"?

4JM$MJ 4JM$MJ 4JM$MJ 4JM$MJ #'# #'# #'# #'#

4 #!46 #!46 #!46 #!46 4" 61! #'#'? JM!4;46MJ

JMMJ JMMJ JMMJ JMMJ

  • .#BC
slide-11
SLIDE 11
  • Example

974 !%4

  • 974

!%4

  • final destination

next hop 128.178.79.9 128.178.156.7 127.0.0.1 128.178.84.133 129.132.1.45 case number

  • Example

129.132 66.46 129.132.100.12 lrcsuns 128.178.156.24 08:00:20:71:0D:D4 lrcpc3 128.178.156.7 00:00:C0:B8:C2:8D in-inr 128.178.156.1 00:00:0C:02:78:36 128.178.79.1 00:00:0C:17:32:96 ed2-in 182.1 in-inj 128.178.182.3 182.5 128.178.100.3

LRC

15.221 Ring SIDI SUN

DI

ed0-swi 15.13 128.178.100.12 128.178.84.1 ed0-ext

EPFL-Backbone

sic500cs 128.178.84.130 Modem + PPP disun3 128.178.79.9 08:00:20:20:46:2E 128.178.84.133 stisun1 15.7 128.178.47.5 128.178.47.3 Switch ezci7-ethz-switch 129.132.35.1 130.59.x.x ed2-el 128.178.29.64 08:00:07:01:a2:a5

LEMA

128.178.156.23 08:00:07:01:a2:a5 ezci7-ethz-switch

Komsys ETHZ-Backbone

129.132.100.27 lrcmac4 lrcmac4

  • Example

129.132 66.46 129.132.100.12 lrcsuns 128.178.156.24 08:00:20:71:0D:D4 lrcpc3 128.178.156.7 00:00:C0:B8:C2:8D in-inr 128.178.156.1 00:00:0C:02:78:36 128.178.79.1 00:00:0C:17:32:96 ed2-in 182.1 in-inj 128.178.182.3 182.5 128.178.100.3

LRC

15.221 Ring SIDI SUN

DI

ed0-swi 15.13 128.178.100.12 128.178.84.1 ed0-ext

EPFL-Backbone

sic500cs 128.178.84.130 Modem + PPP disun3 128.178.79.9 08:00:20:20:46:2E 128.178.84.133 stisun1 15.7 128.178.47.5 128.178.47.3 Switch ezci7-ethz-switch 129.132.35.1 130.59.x.x ed2-el 128.178.29.64 08:00:07:01:a2:a5

LEMA

128.178.156.23 08:00:07:01:a2:a5 ezci7-ethz-switch

Komsys ETHZ-Backbone

129.132.100.27 lrcmac4 lrcmac4

  • Test Your Understanding (3)

9 9 9 98."-!4!% '..$:"4!%'.).$:.6 <

Router Ethernet Concentrator Ethernet Concentrator M1 p.h1 M2 p.h2 M3 q.h1 M8 q.1 M4 q.h3 M9 p.1 subnet p subnet q 1 2

solution

slide-12
SLIDE 12
  • Direct Packet Forwarding: ARP

3# <!%4(#

  • *=%(#4."-">

B!'C

+4'!44?64

  • (! '7('!'568(>+

#!

  • &."-#'4+=."-

4?(/(4 $ 8!!#."-FG!%"+.4' ) 5'!'+">E;8

">7"*

32 bit IP address 48 bit MAC address ARP

  • ARP Protocol

lrcsuns lrcpc1 lrcpc2 in-inr 128.178.156.24 08:00:20:71:0D:D4 128.178.156.31 00:00:C0:B3:D2:8D 128.178.156.1 00:00:0C:02:78:36 1 128.178.156.0

7lrcsuns !%128.178.156.31 (lrcpc1)

  • lrcsuns "*='

#<128.178.156.31 "*=' (% 4('

slide-13
SLIDE 13
  • ARP Protocol

lrcsuns lrcpc1 lrcpc2 in-inr 128.178.156.24 08:00:20:71:0D:D4 128.178.156.31 00:00:C0:B3:D2:8D 128.178.156.1 00:00:0C:02:78:36 1 2 128.178.156.0

7lrcpc1 #@

"*!'!%=# (."-

  • ARP Protocol

lrcsuns lrcpc1 lrcpc2 in-inr 128.178.156.24 08:00:20:71:0D:D4 128.178.156.31 00:00:C0:B3:D2:8D 128.178.156.1 00:00:0C:02:78:36 1 2 128.178.156.0 3

$7lrcsuns "*!';!%

lrcpc1

3'4"**E95E3+"44(;'!!#FG."- 44"**E95E3+;';'! 4(#'"*7 7 00,/) ."- 7 07777&7&) ";!("**E95E3+%(D"* #"**E95E3+4O+!!4! 4"*#4#' 4"**E95E3+ "4((;"**E; '' =+B!C 564'"*

slide-14
SLIDE 14
  • Test Your Understanding (3, cont’d)

978(!%4. .$4 4:

Router Ethernet Concentrator Ethernet Concentrator M1 p.h1 M2 p.h2 M3 q.h1 M8 q.1 M4 q.h3 M9 p.1 subnet p subnet q 1 2

solution

  • Look inside an ARP packet

Ethernet II Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff) Source: 00:03:93:a3:83:3a (Apple_a3:83:3a) Type: ARP (0x0806) Trailer: 00000000000000000000000000000000... Address Resolution Protocol (request) Hardware type: Ethernet (0x0001) Protocol type: IP (0x0800) Hardware size: 6 Protocol size: 4 Opcode: request (0x0001) Sender MAC address: 00:03:93:a3:83:3a (Apple_a3:83:3a) Sender IP address: 129.88.38.135 (129.88.38.135) Target MAC address: 00:00:00:00:00:00 (00:00:00_00:00:00) Target IP address: 129.88.38.254 (129.88.38.254)

slide-15
SLIDE 15
  • Proxy ARP

6'"*< ("*=44

6!7sic500cs 4! "(744!'(% !46 !'74#H#!44

97(,#4#: 976!(!!(!% 000)$$

  • ed2-in

15.221 15.13 128.178.84.1 ed0-ext

EPFL-Backbone

sic500cs 128.178.84.130 Modem + PPP 128.178.84.133 stisun1 15.7

  • 4. IP header
  • !"

#$%& '" % (%% ##)

  • *+,
  • $
  • .

+ P#P $4

Q (' )/44 !% 4 1@

! @ $(

/

slide-16
SLIDE 16
  • IP header

+'!4

' !'? ( '&443 &44 3 ' ! # 93

  • E6! (# E

@ ' R " (# " 4 ! ! !

5 ' ! (%

%@

'# ≤ /)S'?!' %.+5.6 +5 '4( !%4,/<,H/)' =44#

#

.7?4# 7!4#

T44

!44#! 40'

+++

  • (7 4!

7;4;! -. !% 44! -.;/ +-; 5&

  • %

'

  • IP Checksum

+% !6! 4 # (% 4(

  • = 4' #! '/(4=

4'; 6' T /( 8 8R- 6</R8R H/R 8RHL H/8 H 8 +%'</A A @( @<6 /A +!4' #' !> /< /A @<8R H8RHL H8 H 8 /A +# 7

! @<8R H8RHL H8 H 8 #! '%4/? 6O </RO 8ORO H/RO 8OROHL H/8O H 8O # ( 6O 46 @ /(

  • 7

"/A U O ! V + U !4'2 V ' 4 6; ( 2! '/A? 67$),/0 2<H$H)H,H/HH0 2<$, 2<$H, 2<0 3 *-/)4(!!( $

slide-17
SLIDE 17
  • Examples of IP Checksums

( 6 7 $ 8<$ 8< @< %'< 7 0100 F203 F4F5 F6F7 z = 0100 + F203 + F4F5 + F6F7 = checksum y = solution source: http://www.netfor2.com/checksum.html

  • Verifying a Checksum

& 8R L 8 ' 4 ( 78R HL H8 H'< /A &! O ! 4%# %4 4 /A E6!7 % $EE" 47 $HHEE"<√ % 0100 F203 F4F5 F6F7 210E 47 0100 + F203 + F4F5 + F6F7 + 210E <& 2 + FFFD <√

slide-18
SLIDE 18
  • IP header Options

T!

#

  • #
  • !
  • 'D.*3Q4!# !%
  • Look inside an IP packet

Ethernet II Destination: 00:03:93:a3:83:3a (Apple_a3:83:3a) Source: 00:10:83:35:34:04 (HEWLETT-_35:34:04) Type: IP (0x0800) Internet Protocol, Src Addr: 129.88.38.94 (129.88.38.94), Dst Addr: 129.88.38.241 (129.88.38.241) Version: 4 Header length: 20 bytes Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00) Total Length: 1500 Identification: 0x624d Flags: 0x04 Fragment offset: 0 Time to live: 64 Protocol: TCP (0x06) Header checksum: 0x82cf (correct) Source: 129.88.38.94 (129.88.38.94) Destination: 129.88.38.241 (129.88.38.241)

slide-19
SLIDE 19
  • Facts to Remember

(%' $ T!4 *('### 16#!%(

  • Solutions
slide-20
SLIDE 20
  • 1. Why a network layer?

8(%(8 (!(# ."-'1(44 #(% 9 9 9 9 8': " " " "

#+44#(%; 44 #4(#"# %!4' !%+@%! (!

37(%'# ; 7

'(%' '4(!% back

  • Representation of IP Addresses
  • 7#!';(

!4

6!7

  • 6!7
  • 6

6 6 676! 46@#

6!7

  • 6!7
  • '

' ' '7#4$'7;

6!7

  • 6!7

back

slide-21
SLIDE 21
  • A Subnet Prefix is written using one of two

Notations: masks / prefixes

6!72$2%,,,,,,2

97(!46:"72$2/) 97(':"7/) 7/

////// ////// // //// //////

  • 11

2 2 2 ////// ////// // ///////

  • 2

back

  • Prefix Notation

6!7

97(2$2%,,,,,,2!46 "72$2J/2$2/)J/ 97!4644:

J0;/J0;$J0;)0J0 "7'44);'44!46 ('4: "7)/

//// ////// //////// //////// //// ////// //////// //// / / / / / /

  • /

2 3

  • back
slide-22
SLIDE 22
  • Address delegation

E!

/J0;0J0;2$2,J0;L 3

/,J/ 74

/,))0J,

7%

/,)),J)

3

2,))J) 7

2,)//J

7

2,)/)J

9 9 9 9"% 4 33? ! " " " " 4% %! ;4 4 3 ## ! ' #'# *# ! 3'( 72,))J)/,)),J)

back

  • Test Your Understanding (1)
  • 4
  • 5
  • 192.44.78.254

6

192.44.77.254 192.44.78.2 192.44.77.1 187.44.1.2 187.44.1.1 187.44.1.254 192.44.78.253

"#$%&

back

slide-23
SLIDE 23
  • Test your Understanding (2)

97"E#(?(!#; '&(# : "7'#+(44!46 97(# "7;##! 9$7!( "7##!#!'(%!4 44 #H!# %

  • Example

974!%4lrcsuns 974!%4ed2-in

final destination next hop 128.178.79.9 128.178.156.7 127.0.0.1 128.178.84.133 129.132.1.45 128.178.156.1 128.178.156.7 loopback 128.178.156.1 128.178.156.1 case number 3 2 2 3 3 final destination next hop 128.178.79.9 128.178.156.7 127.0.0.1 128.178.84.133 129.132.1.45 128.178.182.3 128.178.182.5 loopback 128.178.15.13 128.178.100.12 case number 3 3 2 3 3

back

slide-24
SLIDE 24
  • Test Your Understanding (3)

978."-!4 !%'..$:"4!%'.).$:.6 < "7 7 W<!; W<=;."-<.; ."-<.2 7 W<!; W<=;."-<.0; ."-<.$ 7 W<=$; W<=;."-<.); ."-<.$

Router Ethernet Concentrator Ethernet Concentrator M1 p.h1 M2 p.h2 M3 q.h1 M8 q.1 M4 q.h3 M9 p.1 subnet p subnet q 1 2

back

  • Test Your Understanding (3)

978(!%4. .$44: "7"*=">=

Router Ethernet Concentrator Ethernet Concentrator M1 p.h1 M2 p.h2 M3 q.h1 M8 q.1 M4 q.h3 M9 p.1 subnet p subnet q 1 2

back

slide-25
SLIDE 25
  • Proxy ARP

97(, #4#:

"7! 000)$$

976!(!! (!% 000)$$

!%6 "*'64 #< 000)$$ ,!( ."- <,O."-

  • !%6

, , 4( 000)$$4 4(## %

ed2-in 15.221 15.13 128.178.84.1 ed0-ext

EPFL-Backbone

sic500cs 128.178.84.130 Modem + PPP 128.178.84.133 stisun1 15.7

  • Examples of IP Checksums

( 6 7 $ 8<$ 8< @<$H<, %'<A @<EE" 7 0100 F203 F4F5 F6F7 z = 0100 + F203 + F4F5 + F6F7 = 0002 DEEF z = 0002 + DEEF = DEF1 checksum y = FFFF - DEF1= 210E back source: http://www.netfor2.com/checksum.html