Top Banner
IP PACKET ROUTING
30

IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Jan 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

IP PACKET ROUTING

Page 2: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Outline à Host routing decision à Prefixes and physical networks

à Prefix matching à Router operating principles and addressing scenarios

Page 3: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

HOST ROUTING DECISION

Page 4: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 5: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Physical Network

IP Packets can be delivered directly

à Usually a data link network

à E.g., Ethernet, WLAN

Page 6: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

The  Prefix  is  the  Key  

Network    #2  

Network  #1  

Router  

LIS                        Physical  Network  

Default  Gateway  

Page 7: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Host  RouFng  Decision  

Same  prefix  

Different  prefixes  

Network    #2  

Network  #1  

Router  

Page 8: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

PREFIXES AND PHYSICAL

NETWORKS

Page 9: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 10: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 11: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 12: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 13: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Host  RouFng  Decision  

Same  prefix  

Different  prefixes  

Network    #2  

Network  #1  

Router  

Page 14: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

PREFIX MATCHING

Page 15: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 16: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 17: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

ROUTER OPERATING PRINCIPLES

AND ADDRESSING SCENARIOS

Page 18: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Routers must do what they are “famous” for

ROUTE PACKETS Choose a path leading to the destination

Page 19: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 20: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 21: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 22: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 23: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 24: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 25: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

How is it used?

à Bitwise AND of destination address and netmask

Page 26: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 27: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 28: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

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  

Page 29: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

Routing Sequence In Summary

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

à Default route

Page 30: IP PACKET ROUTINGnetgroup.polito.it/courses/Didattica/CN/ICMP_E_A_3x.pdf · Outline ! Host routing decision ! Prefixes and physical networks ! Prefix matching ! Router operating principles

A VERY Important Takeaway

à Address format à Address assignment

Addressing and routing (performance) are strictly related