IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing...

30
IP PACKET ROUTING

Transcript of IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing...

IP PACKET ROUTING

Outline à Host routing decision à Prefixes and physical networks

à Prefix matching à Router operating principles and addressing scenarios

HOST ROUTING DECISION

Network Architecture

H2 H3

IP  net    1  

IP  net  3   IP  net  6  

IP  net  7  

IP  net  9  ATM  CDN  

H4  

Ethernet  

R5  

R4  

R3  xDSL  

xDSL  

Ethernet  WIFI  

Host  

Logical  subnet    

R1  

Router    (Gateway)  

Physical  network  

R2  

Physical Network

IP Packets can be delivered directly

à Usually a data link network

à E.g., Ethernet, WLAN

The  Prefix  is  the  Key  

Network    #2  

Network  #1  

Router  

LIS                        Physical  Network  

Default  Gateway  

Host  RouFng  Decision  

Same  prefix  

Different  prefixes  

Network    #2  

Network  #1  

Router  

PREFIXES AND PHYSICAL

NETWORKS

Classful  Prefixes  and  Physical  Networks  

200.2.1.0  

205.1.4.0  

205.1.4.0  

205.1.4.3   205.1.4.4  

205.1.4.1   205.1.4.2  

200.2.1.254  

205.1.4.253  

200.2.1.1   200.2.1.2  

Bridge  

Router  

Classless  Prefixes  and  Physical  Networks  

131.1.1.0  

131.1.4.0  

131.1.4.0  

131.1.4.3   131.1.4.4  

131.1.4.1   131.1.4.2  

131.1.1.254  

131.1.4.253  

131.1.1.1   131.1.1.2  

Netmask:  255.255.255.0  

Bridge  

Router  

Note:  same  netmask  in  a  whole  subnet  

Classless  Prefixes  and  Physical  Networks  

203.1.1.8  

203.1.1.0  

203.1.1.3  203.1.1.4  

203.1.1.9  

203.1.1.2  

Router  

203.1.1.10   203.1.1.14  

Netmask:  255.255.255.248  

Different  Netmasks  for  the  Same  Network  

203.1.1.16  255.255.255.248  

203.1.1.0  

255.255.255.240   203.1.1.8   203.1.1.3  

203.1.1.2   203.1.1.12  

203.1.1.17  

203.1.1.1  

203.1.1.18   203.1.1.20  

Bridge  

Router  

Host  RouFng  Decision  

Same  prefix  

Different  prefixes  

Network    #2  

Network  #1  

Router  

PREFIX MATCHING

Same  LIS:  Direct  CommunicaFon  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  0  0  0  0  0  1  

1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0  0  0  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  0  0  0  0  0  0  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  1  0  0  1  0  1  Source  address    192.168.10.65  

DesQnaQon  address    192.168.10.101  

Source    netmask  255.255.255.192  

Same  prefixèsame  LIS  direct  communicaFon  

192.168.10.64  192.168.10.64  

Bitwise  AND  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  0  0  0  0  0  0  

Different  LISes:  Involve  Router  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  0  0  0  0  0  1  

1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  0  0  0  0  0  0  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  0  0  0  0  0  0  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  1  0  0  Source  address    192.168.10.65  

DesQnaQon  address    192.168.10.132  

Different  prefixesèdifferent  LIS  communicaFon  through  router  

192.168.10.64  192.168.10.128  

Bitwise  AND  

1  1  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  1  0  1  0  1  0  0  0  0  0  0  0  

Source    netmask  255.255.255.192  

ROUTER OPERATING PRINCIPLES

AND ADDRESSING SCENARIOS

Routers must do what they are “famous” for

ROUTE PACKETS Choose a path leading to the destination

Prefix  Matching  for  Each  Interface  

203.1.1.8  

203.1.1.0  

203.1.1.3  203.1.1.4  

203.1.1.9  

203.1.1.2  Router  

203.1.1.10   203.1.1.14  

Netmask:  255.255.255.248  At  most  one  will  match  

What  If  None  Matches?  

H2 H3

IP  net  1  

IP  net  3   IP  net  6  

IP  net  7   IP  net  9  

H4  

130.192.1.0  

R1

R2

R5

R4

R3

190.3.7.1  

190.3.7.2  

190.3.1.1  

190.3.1.5  

190.3.9.2  

190.3.9.3  

190.3.6.2  

190.3.6.3  

190.3.6.8  

190.3.3.1  190.3.3.3  

190.3.3.2  

190.3.1.4  

190.3.6.3  

190.3.6.0  

150.1.0.0  255.255.0.0  

150.1.8.4  

190.3.7.0   190.3.9.0  

190.3.3.0  

Netmask:    255.255.255.0  

E.g.,  R5  rouFng  a  packet  to  H4  

RouFng  Table  

DesQnaQon    Next  hop    190.3.1.0  255.255.255.0  190.3.3.2  190.3.7.0  255.255.255.0  190.3.3.2  190.3.9.0  255.255.255.0  190.3.6.8  150.1.0.0  255.255.0.0  190.3.6.8  

R5’s  Directly  connected  

H2   H3  

H4

190.3.1.0  

190.3.6.3  190.3.6.8  

190.3.3.1  

190.3.3.2  

190.3.6.0  

150.1.0.0  255.255.0.0  

190.3.7.0   190.3.9.0  

190.3.3.0  

Netmask:    255.255.255.0  

R5  

R1  

R2  

R5  

R4  

R3  

190.3.1.0  255.255.255.0                                          190.3.3.2  190.3.7.0  255.255.255.0                                          190.3.3.2  190.3.9.0  255.255.255.0                                          190.3.6.8  150.1.0.0  255.255.0.0                                                    190.3.6.8  

H2 H3

H4 R1

R2

R5

R4

R3 190.3.6.8  190.3.3.2  

190.3.6.0

150.1.0.0 255.255.0.0

190.3.7.0 190.3.9.0

190.3.3.0

190.3.1.0  255.255.255.0  

R1  

R2  

R5  

R4  

R3  

190.3.6.0  255.255.255.0  

150.1.0.0  255.255.0.0  

190.3.9.0  255.255.255.252  

190.3.3.0  255.255.255.0  

190.3.9.4  255.255.255.252  

R5  

Variable  Subne[ng  

190.3.9.1   190.3.9.5  

190.3.6.3  

190.3.1.0  255.255.255.0  190.3.3.2  190.3.9.0  255.255.255.252  190.3.3.2  190.3.9.4  255.255.255.252  190.3.6.8  150.1.0.0  255.255.0.0  190.3.6.8  

H2   H3  

H4  

H2   H3  

H4  

190.3.1.0  

R1  

R2  

R5  

R4  

R3  190.3.6.3  

190.3.6.8  

190.3.3.1  

190.3.3.2  

190.3.6.0  

150.1.0.0  255.255.0.0  

190.3.7.0   190.3.9.0  

190.3.3.0  

Netmask:    255.255.255.0  

What  If  MulFple  Entries  Match?  190.3.9.1  

R5   190.3.0.0  255.255.240.0  190.3.3.2  

190.3.9.0  255.255.255.0  190.3.6.8  150.1.0.0  255.255.0.0  190.3.6.8  

How is it used?

à Bitwise AND of destination address and netmask

Longest  Prefix  Matching  

H2   H3  

H4  

190.3.1.0  

190.3.6.3  190.3.6.8  

190.3.3.1  

190.3.3.2  

190.3.6.0  

150.1.0.0  255.255.0.0  

190.3.7.0   190.3.9.0  

190.3.3.0  

Netmask:    255.255.255.0  

R5   190.3.0.0  255.255.240.0  190.3.3.2  

190.3.9.0  255.255.255.0  190.3.6.8  150.1.0.0  255.255.0.0  190.3.6.8  

R1  

R2  

R5  

R4  

R3  

H2   H3  

H4  

190.3.1.0  

190.3.6.3  190.3.6.8  

190.3.3.1  

190.3.3.2  

190.3.6.0  

150.1.0.0  255.255.0.0  

190.3.7.0   190.3.9.0  

190.3.3.0  

Netmask:    255.255.255.0  

R1  

R2  

R5  

R4  

R3  

Default  Net  Route  

R5   190.3.0.0  255.255.0.0  190.3.3.2  

190.3.9.0  255.255.255.0  190.3.6.8  150.1.0.0  255.255.0.0  190.3.6.8  

H2   H3  

H4  

190.3.1.0  

190.3.6.3  190.3.3.1  

190.3.3.2  

190.3.6.0  

150.1.0.0  255.255.0.0  

190.3.7.0   190.3.9.0  

190.3.3.0  

Netmask:    255.255.255.0  

R1  

R2  

R5  

R4  

R3  

R5   190.3.0.0  255.255.0.0  190.3.3.2  

190.3.9.0  255.255.255.0  190.3.6.8  0.  0.0.0  0.0.0.0  190.3.6.8  

Default  Route  

R5  

180.1.0.0  255.255.255.0  

Routing Sequence In Summary

à Connected networks à Specific entries à Less specific, aggregated entries

à Default route

A VERY Important Takeaway

à Address format à Address assignment

Addressing and routing (performance) are strictly related