IP Routing

advertisement
IP Routing
CST 415
3/23/2016
CST 415 - Computer Networks
1
Topics
•
•
•
•
•
•
Problem Definition
Packet Delivery
Table Driven Routing
Next Hop Routing
Default and Host Specific Routes
Routing Algorithm
3/23/2016
CST 415 - Computer Networks
2
Question…
ARP resolves IP addresses to physical
addresses.
How can a packet be addressed to go to a
destination that is not on the same network
segment?
How can a packet be addressed to go to a
destination that is on a “very distant”
network?
3/23/2016
CST 415 - Computer Networks
3
Problem Definition
• The Internet is an abstraction away from the
physical network.
• The IP layer sits on top the MAC/Physical
layers.
• Packets are routed between IP peers.
• It is these IP peers that make up the Internet.
3/23/2016
CST 415 - Computer Networks
4
Problem Definition
• Packets need to be routed from the
originating host to a router (for Internet
based delivery).
• The router needs to move the packet across
to a separate network, possibly of a different
technology and conforming to different
policies.
• Networks need to internally route packets
using a homogeneous technology.
3/23/2016
CST 415 - Computer Networks
5
Problem Definition – The Players
From host to router:
Typically static route tables. These tables may be
updated dynamically via ICMP.
ICMP – Internet Control Messaging Protocol.
ICMP allows routers to talk back to host
computers for reporting packet transmission
problems.
3/23/2016
CST 415 - Computer Networks
6
Problem Definition – The Players
From “subnet” router to “subnet” router:
Routing tables dynamically updated “at the whim” of the
subnet connection controlling router.
EGP – Exterior Gateway Protocol
BGP – Boundary Gateway Protocol.
BGP allows a primary subnet router to negotiate services
with other primary subnet routers. BGP allows a router
to “hide” the details of it’s network.
When we trace a route to a network, but the host cannot be resolved,
it is BGP that is protecting the identity of it’s internal networks
and nodes.
3/23/2016
CST 415 - Computer Networks
7
Problem Definition – The Players
From “internal subnet” router to “internal subnet”
router (host computers need not apply):
Routing tables dynamically updated based on the routing
protocol supported by the internal network.
IGP – Interior Gateway Protocol
RIP – Routing Information Protocol.
OSPF – Open Shortest Path First Protocol.
Internal networks will speak either RIP or OSPF. They will
not typically speak both. In either case, routing
information is exchanged using these protocols.
3/23/2016
CST 415 - Computer Networks
8
Packet Delivery
Internet Protocol – Defines unreliable,
connectionless delivery of packets.
– Unreliable – send it and forget it.
– Connectionless – the route of the packet
will be defined “on-the-fly” by the
network itself (e.g. routers between the
source and destination).
3/23/2016
CST 415 - Computer Networks
9
Packet Delivery
The physical machines that make up the
Internet IP web fall into two categories
– Hosts and Routers.
• Hosts and Routers both must be
capable of originating an IP packet.
• Routers must implement forwarding
algorithms.
• Hosts are not required to forward
packets.
3/23/2016
CST 415 - Computer Networks
10
Packet Delivery
Two types of packet delivery need to be
considered:
1. Direct Delivery – The packet is delivered
directly to a peer machine located on the same
physical network.
2. Indirect Delivery – The packet is delivered to
an intermediary (router).
–
–
3/23/2016
The intermediary is responsible for passing the
packet along to the packets destination.
The intermediary will deliver the packet either
directly or indirectly.
CST 415 - Computer Networks
11
Operations
involved in
IP routing.
3/23/2016
CST 415 - Computer Networks
12
Packet Delivery
•
The MAC layer will pass the IP packet up to the
IP layer (based on the packet type field in the
MAC header.
The IP layer looks at the IP address and
determines the destination of the packet.
•
–
–
–
3/23/2016
The network address of the IP address is inspected.
If the network address is the same as the network
address of the router, the packet is delivered directly.
If the network address is different than the address of
the router, the packet is delivered indirectly.
CST 415 - Computer Networks
13
Packet Delivery
Question of the day:
How does a router know where to send a packet
given any particular IP address?
3/23/2016
CST 415 - Computer Networks
14
Table Driven Routing
• The router contains a table of network
address associations (n,r)
– n : IP address of the destination network
– r : IP address of the next router
• When a packet arrives at the router, this
table is consulted.
• The packet is sent along to the next
router based on the table look-up.
3/23/2016
CST 415 - Computer Networks
15
Next Hop Routing
• In the IP routing table, keep the
associations of network address and
router.
• Only keep router associations for
routers that can be reached across a
single network connection.
3/23/2016
CST 415 - Computer Networks
16
3/23/2016
CST 415 - Computer Networks
17
Next Hop Routing
• Only the network address is maintained
in the routing table.
• All traffic destined for a specific
network will take the same path.
• Only the final router along the path can
determine if a host actually exist.
• “To” and “From” paths may not be the
same.
3/23/2016
CST 415 - Computer Networks
18
Default Routes
• Each network is assigned a default
router.
• IP packets destined for networks not in
the routing table will be sent to this
router.
3/23/2016
CST 415 - Computer Networks
19
Host Specific Routes
• Allow administrative ability to predetermine a specific route between two
host machines.
3/23/2016
CST 415 - Computer Networks
20
Routing Algorithm
• The ultimate source and ultimate destination IP
addresses are never altered.
• However, the IP layer selects a new IP address for
packet delivery based on the network the packet is
ultimately destined for.
• To send the packet along without changing the
ultimate addresses in the packet (see IP packet
format)
– IP sends the packet to the MAC layer along with
the “next hop” destination IP.
– The MAC layer forms the physical packet using
the “next hop” IP address to look up the
physical address.
3/23/2016
CST 415 - Computer Networks
21
Routing Algorithm
3/23/2016
CST 415 - Computer Networks
22
Routing Algorithm
(1) The router receives the IP packet from the Link Layer.
(2) The router validates the IP header. Note that IP reassembly is not done, except on IP
fragments to be queued for local delivery in step (4).
(3) The router performs most of the processing of any IP options. Some IP options require
additional processing after the routing decision has been made.
(4) The router examines the destination IP address of the IP datagram to determine how it
should continue to process the IP datagram. There are three possibilities:
o The IP datagram is destined for the router, and should be queued for local delivery,
doing reassembly if needed.
o The IP datagram is not destined for the router, and should be queued for forwarding.
o The IP datagram should be queued for forwarding, but (a copy) must also be queued
for local delivery.
3/23/2016
CST 415 - Computer Networks
23
Routing Algorithm
(5) The forwarder determines the next hop IP address for the packet, usually by
looking up the packet's destination in the router's routing table. This procedure
also decides which network interface should be used to send the packet.
(6) The forwarder verifies that forwarding the packet is permitted. The source and
destination addresses should be valid. If the router supports administrative
constraints on forwarding, those constraints must be satisfied.
(7) The forwarder decrements (by at least one) and checks the packet's TTL.
(8) The forwarder performs any IP option processing that could not be completed
in step 3.
(9) The forwarder performs any necessary IP fragmentation. Since this step occurs
after outbound interface selection (step 5), all fragments of the same datagram
will be transmitted out the same interface.
3/23/2016
CST 415 - Computer Networks
24
Routing Algorithm
(10) The forwarder determines the Link Layer address of the packet's next
hop. The mechanisms for doing this are Link Layer- dependent.
(11) The forwarder encapsulates the IP datagram (or each of the fragments
thereof) in an appropriate Link Layer frame and queues it for output on
the interface selected in step 5.
(12) The forwarder sends an ICMP redirect if necessary.
3/23/2016
CST 415 - Computer Networks
25
Download