310 likes | 445 Views
TCOM 509 – Internet Protocols (TCP/IP) Lecture 05_a Internet Protocol: Routing IP Datagrams, ICMP, IGMP. Instructor: Dr. Li-Chuan Chen Date: 09/29/2003. Routing In An Internet. IP Routing : determine best route to forward packets from source to destination through the networks.
E N D
TCOM 509 – Internet Protocols (TCP/IP)Lecture 05_aInternet Protocol: Routing IP Datagrams, ICMP, IGMP Instructor: Dr. Li-Chuan ChenDate: 09/29/2003
Routing In An Internet • IP Routing: determine best route to forward packets from source to destination through the networks. • Direct Delivery: deliver a packet from source to destination within the same physical network without using routers. • Indirect Delivery: deliver a packet from source to destination from source to destination through various networks using routers.
IP Routing • Internet (IP) routing table • stores information about possible destinations and how to reach them • Routing Methods – Table-Driven • Host-specific • Network-specific • Next-Hop • Default Routes
Host-Specific Routing • Routing table contains all destination IP address • Pros • More control over network use • Access control for security • Debugging network connections or routing tables • Cons • routing tables becomes too big for Internet • routing inefficient
Network-Specific Routing • Routing table contains only network portion of IP address • Pros • routing tables small • routing efficient • Cons • All traffic must take the same path for the same destination network • Only the final router can determine if the host is up or down • Path A B may be different from B A
Next-Hop Routing • Using a routing table to store a next hop for each destination. • Routing table contains (N,R), where • N is the destination IP address • R is the next router IP address (next hop) • Pros • Routing table is small • Efficient
Example Routing Table for R2 Network 4 40.0.0.0 20.0.0.5 30.0.0.6 40.0.0.7 Network 3 30.0.0.0 Network 1 10.0.0.0 Network 2 20.0.0.0 R3 R1 R2 30.0.0.7 10.0.0.5 20.0.0.6
Default Routes • If no routes available in the routing table, then send packet to a default router. • Useful when only one router connect to the rest of internet. Pros • Routing is simple (either local network or use a default for all other destination).
Routing Algorithm Extract destination IP address, D, and compute the network prefix, N • If N matches direct network connectionThen resolving D to a MAC address, encapsulating the datagram, and send it • Else if host-specific route found Then send the datagram • Else if entry exists for network N, send it • Else if entry exists for default route, send it • Else routing error
Routing With IP Address • IP routing does not change the original datagram except • Time to live • Checksum • Where does it store the next hop address? • IP pass the info to the network interface software (nis) • nis binds the next hop address to a physical address • Why not store the physical address instead? • Easy to understand, test, modify, and debug routing problems • Hide details of underlying networks
Handling Incoming Datagrams Host • nis delivers packet to IP module • If destination IP address matchesThen pass it to the higher-level protocolElse discard the packet
Handling Incoming Datagrams Router • Unlike hosts, routers forward the packet if not reach the final destination • If not match any of the local host addresses • Decrement time to live • if the count is 0, discard the packet • Else compute a new checksum and route the packet
Handling Incoming Datagrams Why can’t a host forward a datagram? • Network problems may not surfaced • Waste host resource (CPU time) • Unnecessary network traffic • Error reports won’t be sending back to the original source
Internet Control Message Protocol (ICMP) used by hosts, routers, gateways to communication network-level information error reporting unreachable host, network, port, protocol Errors are reporting back to the sender diagnostic: echo request/reply (used by ping) network-layer “above” IP: ICMP msgs encapsulated in IP datagrams ICMP message:type, code, ICMP checksum, plus first 8 bytes of IP datagram causing error, ICMP
ICMP Header ICMP Data Datagram Header Datagram Data Frame Header Frame Data ICMP Message Encapsulation 8-byte Variable-size Protocol Field in IP datagram = 1 for ICMP
Error-Reporting Destination unreachable (Type 3) Source quench (Type 4) Time exceeded (Type 11) Parameter Problem (Type 12) Redirection (Type 5) Query Echo request or reply (Type 8 or 0) Timestamp request or reply (Type 13 or 14) Address mask request or reply (Type 17 or 18) Router advertisement or solicitation (Type 9 or 10) ICMP Message Types
ICMP Messages TypeCodedescription 0 0 echo reply (ping) – host or router 3 0 dest. network unreachable - router 3 1 dest host unreachable - router 3 2 dest protocol unreachable (tcp, udp, ospf) - host 3 3 dest port unreachable - host 3 6 dest network unknown - router 3 7 dest host unknown - router 4 0 source quench (congestion control) - host or router 5 0-3 Redirect (change a route) - router 8 0 echo request (ping) – host or router 9 0 router advertisement - router 10 0 router solicitation - host 11 0 TTL expired - router11 1 Fragment reassembly expired - host 12 0 bad IP header – host or route 13 0 Timestamp-request (round-trip time) – host or router 14 0 Timestamp-respond (round-trip time) – host or router
No ICMP error messages will be generated for the following rules: IP carrying ICMP message Fragment datagram that is not the first fragment Datagram contains multicast address Datagram contains 127.0.0.0 or 0.0.0.0 ICMP
Multicast: act of sending datagram to multiple receivers with single “transmit” operation Question: how to achieve multicast Multicast via unicast • source sends N unicast datagrams, one addressed to each of N receivers routers forward unicast datagrams multicast receiver (red) not a multicast receiver (grey) Multicast: one sender to many receivers
Multicast: act of sending datagram to multiple receivers with single “transmit” operation analogy: one teacher to many students Question: how to achieve multicast Multicast: one sender to many receivers Network multicast • Router actively participate in multicast, making copies of packets as needed and forwarding towards multicast receivers Multicast routers (red) duplicate and forward multicast datagrams
Multicast: act of sending datagram to multiple receivers with single “transmit” operation analogy: one teacher to many students Question: how to achieve multicast Multicast: one sender to many receivers Application-layer multicast • end systems involved in multicast copy and forward unicast datagrams among themselves
Internet Multicast Service Model 128.59.16.12 multicast group concept: use of indirection • hosts addresses IP datagram to multicast group • routers forward multicast datagrams to hosts that have “joined” that multicast group 128.119.40.186 multicast group 226.17.30.197 128.34.108.63 128.34.108.60
Multicast groups • class D Internet addresses reserved for multicast: • host group semantics: • anyone can “join” (receive) multicast group • anyone can send to multicast group • no network-layer identification to hosts of members • needed: infrastructure to deliver mcast-addressed datagrams to all hosts that have joined that multicast group
IGMP IGMP wide-area multicast routing IGMP Joining a mcast group: two-step process • local: host informs local mcast router of desire to join group: IGMP (Internet Group Management Protocol) • wide area: local router interacts with other routers to receive mcast datagram flow • many protocols (e.g., DVMRP, MOSPF, PIM) • DVMRP: Distance Vector Multicast Routing Protocol • MOSPF: Multicast OSPF • PIM: Protocol Independent Multicast
IGMP: Internet Group Management Protocol • A protocol that manages group membership. • IGMP Message Types • Query (Type 0x11) • General: sent every 125 sec with group address 0.0.0.0 • Special: specific group address • Membership Report (Type 0x16) • Leave Report (Type 0x17) • For each group, only one router handles multicast packets for that group. • Query router • Query messages may crate a lot of responses. To avoid unnecessary traffic, designate one router as the query router for each network. Other routers receives responses and update their lists.
report query IGMP: Internet Group Management Protocol • host: sends IGMP membership report when application joins mcast group • Membership report is sent twice, one after antoher. • router:sends IGMP query at regular intervals • host belonging to a mcast group must reply to query
IGMP version 1 router: Host Membership Query msg broadcaston LAN to all hosts host: Host Membership Report msg to indicate group membership randomized delay before responding implicit leave via no reply to Query RFC 1112 IGMP v2: group-specific Query Leave Group msg last host replying to Query can send explicit Leave Group msg router performs group-specific query to see if any hosts left in group RFC 2236 IGMP v3:under development as Internet draft IGMP
IGMP Header IGMP Group Address Datagram Header Datagram Data Frame Header Frame Data IGMP Message Encapsulation 4-byte 4-byte • IP datagram field: • IP Destination Address - • Query: 224.0.0.1 All host and routers • Leave: 224.0.0.2 All routers • Membership: The multicast group address • IP datagram field: • Protocol Field = 2 for IGMP • TTL = 1, only valid within the LAN
Most WANs do not support physical multicast addressing. Solution: usetunneling Multicast packet is encapsulated in a unicast packet and sent through the network IGMP Header IGMP Group Address Datagram Header Multicast DatagramData Header IP Unicast Data Multicats Tunneling 4-byte 4-byte
Read Chapter 8: all sections Chapter 9: 9.1 – 9.13 Chapter 17: 17.1 – 17.16 Assignments