Routing. Data link layer routing. Directly Connected IP Networks. ifconfig command

. Basic setup Directly connected Not directly connected Addressing and routing commands Route selection Routing Basic principles Karst Koymans Math...
1 downloads 2 Views 61KB Size
.

Basic setup Directly connected Not directly connected Addressing and routing commands Route selection

Routing Basic principles Karst Koymans

Mathematical representation Informatics Institute University of Amsterdam

Routing in the Internet

(version 15.2, 2016/02/22 10:48:53)

Tuesday, February 23, 2016 Different routing mechanisms

.

.

Data link layer “routing”

Directly Connected IP Networks



Traditional configuration under Unix with ifconfig command



Packets can be delivered immediately by the data link (layer 2 software)



No explicit route commands needed under Linux, because ifconfig sets a route automatically

Only outgoing interface and layer 2 address is needed



Packet is (selectively) flooded by layer 2



Bridges and switches use a lookup table to map layer 2 addresses to outgoing interfaces Spanning tree protocol takes care of loops



ifconfig command



ifconfig netmask [broadcast ] ifconfig inet6 add /

.



.

Newer protocols like TRILL and SPB can handle topologies with loops

.

Routing Table

Global routing



netstat -r ▶

▶ ▶

Not directly connected networks need a gateway (next hop) Recursive lookup ▶ ▶ ▶

Route flags

In practice this is only one level deep Hence the gateway needs to be directly connected In theory a deeper recursion level would be possible and useful

Flag G H S

Set route needs gateway route to host route added statically (mostly by admin)

Unset route is directly connected route to network route added dynamically (by a protocol)

.

.

arp command

route command

▶ ▶



Syntax varies between systems On Linux systems1 ▶



Used to interact with the arp table Read the arp table ▶



route add default

Adding a static host route ▶





Adding a static default route ▶



Adding a static network route



Exercise: Rewrite the first two entries as instances of the last

.

arp -s

arp only works for IPv4 ▶

1

arp -d

Add a static entry to the arp table ▶

route add -net netmask gw

arp

Delete an entry from the arp table ▶

route add -host gw



.

is the traditional command to show the routing table

For IPv6 use the ip [-6] command

.

ip subcommands

ip command

ip . . . ▶

Introduced in the Linux iproute2 package



General interface to kernel addressing and routing



Replaces ifconfig, route and arp (almost) completely



Has support for IPv6, routing policies and multiple routing tables

Subcommand link address neighbor route rule

.

.

Mathematical representation

Route selection







Longest prefix match ▶

Graphs (undirected, labeled) ▶

Host routes are preferred over network routes



Default route has shortest prefix ▶ ▶

Nodes are routers and hosts Edges are (point to point) connections ▶

Route of last resort Cannot be used in the Internet core ▶

▶ ▶

Why?



.

Network nodes are not necessary because of this restriction

Labels represent “cost” of using an edge in your route Undirected edges imply a restriction to ▶

.

Meaning layer 2 interface settings (MAC) layer 3 interface settings (IP) arp cache data routing table data routing table selection

two-way communication paths with the same cost in both directions

.

Broadcast networks (square)

Broadcast networks (triangle)

R

R

R

R

R

N

R.

R

R

N

R.

R

R

R

R

.

.

Internet Routing (1)

Node reduction

▶ ▶

LAN with O(N) routers or hosts



Full mesh of O(N2 ) edges



Reduced with only 1 extra node to O(N) edges Works for LANs, but also for NBMA networks



▶ ▶

.

R



Based on top level structure defined by Autonomous Systems (AS) Each AS has administrative control over a collection of ▶ ▶

Routers (and hosts) Networks

Definition (AS — Autonomous System (from RFC 1930))

In many situations But not always (take care)

An AS (Autonomous System) is a connected group of one or more IP prefixes run by one or more network operators which has a single and clearly defined routing policy.

.

.

Internet Routing (3)

Internet Routing (2)



Edge routers inside an AS can be directly connected to edge routers in another AS ▶ ▶



Used for inter-AS routing Using an exterior routing (or gateway) protocol (EGP) ▶ ▶

▶ ▶

Example: BGP4 No other protocols in use (except variants of BGP)

Intra-AS routing Using an interior routing (or gateway) protocol (IGP) ▶

Examples: RIP, OSPF, IS-IS

.

.

Distance Vector Routing

Routing Protocol Classification



Static ▶ ▶ ▶





A “human” protocol Explicit commands like “route add” or “ip route add” Side effect of a script (“semi-automatic/semi-human”)

▶ ▶

Distance vector algorithm ▶ ▶

Dynamic (automatically by a routing protocol) ▶

.

Routers within the boundary of a single AS communicate with each other to provide

Distance Vector (for instance RIP) Path Vector (for instance BGP) Link State (for instance OSPF or IS-IS)

.

Bellman-Ford (1957) Distributed shortest path



Original ARPANET routing algorithm



Decentralised



Asynchronous



No choice of root like in STP

.

Link State Routing

Path Vector Routing







Instead of the distance to the destination the complete path – on AS level – is specified



Decentralised. . . ▶



Link state algorithm ▶

The algorithm is still ▶





Like distance vector routing, but. . .

. . . but there is an informal notion of tiers

Asynchronous

The algorithm may depend on explicit or implicit policies

.

.

.

.

Dijkstra (1959) Single source shortest path



Complete knowledge is distributed to all nodes in an area



Knowledge about the local network topology is flooded to all participants in an area



Every node executes the shortest path algorithm and draws the same conclusions

Suggest Documents