Presentation is loading. Please wait.

Presentation is loading. Please wait.

Datagram Forwarding.

Similar presentations


Presentation on theme: "Datagram Forwarding."— Presentation transcript:

1 Datagram Forwarding

2 Routers and the IP Addressing Principle
How to assign IP to a router, which interconnects multiple networks?

3 Routers and the IP Addressing Principle
Each router is assigned two or more IP addresses, one address for each network 3 3

4 Forwarding an IP Datagram
To make the selection of a next hop for an IP datagram, a router uses a forwarding table. 4 4

5 Network Prefix Extraction
The mask field in a forwarding table entry is used to extract the network portion (prefix) of an IP address during lookup if ( (Mask[i] & IP Address) == Destination[i] ) forward to NextHop[i] Examples A datagram to The first entry fails since & ≠ The second entry: & ≠ The third entry: & ≠ The last entry: & ==  Forward to

6 Exercise 1 What is the next hop for IP datagram to ?

7 Longest Matching Prefix
Prefix in the table might overlap! AT&T Pennsylvania  AT&T Pittsburgh Longest matching prefix rule: For each packet, examine entries in the forwarding table with the longest prefix first

8 Exercise 2 Given the following forwarding table:
Determine the next hop for each of the following destination address: Network Next Hop /8 A /12 B /16 C /24 D

9 IP Encapsulation: Virtual Packets
An IP datagram is encapsulated in a frame by network hardware. Datagram: Layer-3 packet Encapsulation requires the sender to supply the MAC address of the next computer Router or host

10 Example: A Tiny Internetwork
NIC-1-1 NIC-1-2 A D R2 NIC-2-1 NIC-2-2 E B NIC-L NIC-R F A /16 /16 R1 /16 R2 F

11 Exercise 3 Complete R2’s forwarding table: F A R2 R1 166.200.0.0/16
/16 R1 /16 R2 F Complete R2’s forwarding table: Network Mask Next Hop

12 Steps for A to send “I like you” to F
P-A will compose the packet I like you NIC-A’s MAC NIC-1-1’s MAC P-A forwards the packet to NIC-A NIC-A calculates the CRC, adds SOH, EOT I like you NIC-A’s MAC NIC-1-1’s MAC SOH EOT CRC NIC-A modulates the packet  send out using CSMA/CD

13 ARP (Address Resolution Protocol)
Internet uses ARP to map the next hop’s IP address to its Link layer (MAC) address always restricted to a single network at a time. ARP uses broadcast to reach all nodes Broadcast MAC address: FF:FF:FF:FF:FF:FF “I'm looking for the MAC address of a computer that has IP address ” “I'm the computer with IP address , and my MAC address is 11:22:33:44:55:66”

14 Steps for A to send “I like you” to F
After a while, NIC-1-1 will receive the m-carrier NIC-1-1 demodulates the m-carrier and put it into the cache NIC-1-1 does address filtering NIC-1-1 does length and CRC checkings If the packet passes all checkings, NIC-1-1 will strip off SOH, EOT, CRC, and forward the frame to P-R1 P-R1 will strip off the Layer-2 (MAC) header: I like you NIC-A’s MAC NIC-1-1’s MAC I like you

15 Steps for A to send “I like you” to F
P-R1 will do routing based on the routing table. Destination address: P-R1 adds the Layer-2 (MAC) header and forward it to NIC-1-2 Network Mask Next Hop Deliver direct (NIC-2-1) I like you NIC-1-2’s MAC NIC-2-1’s MAC

16 Steps for A to send “I like you” to F
NIC-1-2 calculates the CRC, adds SOH, EOT; modulates the packet  send out using CSMA/CD… NIC-2-1 does the same as NIC-1-1… P-R2 does the same as P-R1 except that it will use a different routing table: Destination address: Network Mask Next Hop (NIC-1-2) Deliver direct

17 Steps for A to send “I like you” to F
P-R2 adds the new Layer-2 (MAC) header and forward it to NIC-2-2 NIC-2-2 does the same as NIC-1-2 to send out the frame… The bridge will forward the frame to computer F based on the MAC address as we discussed before (week10-2.pptx) Note: the bridge does not understand IP addresses! After a while, NIC-F will receive the m-carrier… I like you NIC-2-2’s MAC NIC-F’s MAC

18 Exercise 4 Q1: During the whole process, how many processors (incl. computers and routers) have seen the Internet layer header? Q2: During the whole process, how many times is the Internet layer header changed? How about the Link layer header?


Download ppt "Datagram Forwarding."

Similar presentations


Ads by Google