Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
ECE 4110 – Internetwork Programming TCP/IP Protocol (cont’d) DIX Ethernet Data Frame Format Destination Source Preamble MAC Address MAC Address (8 Bytes) (6 Bytes) (6 Bytes) Type (2 Bytes) Data CRC (4 Bytes) Gap 12 Bytes Preamble: Alternating 0’s and 1’s with last bit a l. Destination medium access control (MAC) address: Each receiver DL layer compares this to its own hardwired network interface card (NIC) address. Normally a NIC knows its own address and the broadcast address. Source MAC address: Sender’s NIC address. Type: Type of data transporting. E.g.: Internet Protocol. Cyclic Redundancy Check: Used for checking data integrity. Gap: After the Ethernet Frame, a 12 Byte Interframe Gap must always follow. Note: Receiver DL layer does not look at data. Note: Data is in most network technologies called a “packet.” Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 2 Routing Concepts B 3 Computer X Computer Y 4 2 9 A1 A2 A4 1 5 A A3 6 8 7 F 1 C D E Network Number (Address) Router Network Computer X on Network 1 wants to send a message to Computer Y on Network 5 . Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 3 Routing Concepts IEEE 802.3 Frame Preamble Destination Source Length MAC Address MAC address Destination 5:Y (cont’d) Source 1:X DATA Other Stuff CRC Data Network address is software configurable. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 4 Routing Service Connection-oriented Connectionless Delivery Direct Delivery Indirect delivery Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 5 Connection-Oriented vs. Connectionless In connection-oriented services, the network layer protocol first makes a connection. In connectionless services, each packet is treated independently. So, there is no relationship between the packets. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 6 Direct Delivery Source and the destination are on the same physical network. Address mapping is between IP and physical address of the Physical address of the destination is found via ARP. final destination. Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 7 Indirect Delivery Source and destination are on different networks. Address mapping is between IP and physical address of the next hop. Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 8 Routing Methods Next-hop routing Network-specific routing Host-specific routing Default routing Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 9 Next-Hop Routing Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 10 Network-Specific Routing Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 11 Host-Specific Routing Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 12 Default Routing Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 13 Static vs. Dynamic Routing In static routing, routing table is constructed manually. In dynamic routing, routing table is constructed automatically using protocols like RIP, OSPF, or BGP. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 14 Routing Table Flags U G H D M Spring 2003 Tuna Tugcu The router is up and running. The destination is a gateway (indirect delivery). Host-specific address. Added by redirection (by ICMP). Modified by redirection (by ICMP). ECE 4110 – Internetwork Programming 15 Routing Module Spring 2003 Tuna Tugcu * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall ECE 4110 – Internetwork Programming 16 Routing Module (cont’d) Search for route in this order: Direct delivery Host-specific delivery Network-specific delivery Default delivery Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 17 Routing Module For each entry in RT: Apply the mask to destination address If result of mask matches the destination field in the entry in RT, find next-hop address as follows: If G flag is set Else (algorithm) Use next-hop field in RT Use destination address in the packet (direct delivery) Send packet to fragmentation module with the next-hop address Stop Else, send ICMP error message Stop Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 18 Example Topology 19 * From TCP/IP Protocol Suite, B. A. Forouzan, Prentice Hall Routing Table for R1 Mask 255.0.0.0 255.255.255.224 255.255.255.224 Destination 111.0.0.0 193.14.5.160 193.14.5.192 Next Hop - 255.255.255.255 194.17.21.16 111.20.18.14 m0 255.255.255.0 255.255.255.0 192.16.7.0 194.17.21.0 111.15.17.32 111.20.18.14 m0 m0 0.0.0.0 0.0.0.0 111.30.31.18 m0 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming Interface m0 m2 m1 20 Example 1 Router R1 receives 500 packets for destination 192.16.7.14; the algorithm applies the masks row by row to the destination address until a match (with the value in the second column) is found. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 21 Example 1 (Solution) Direct delivery 192.16.7.14 & 255.0.0.0 192.16.7.14 & 255.255.255.224 192.16.7.14 & 255.255.255.224 no match no match no match 192.16.7.14 no match 192.16.7.0 match Host-specific 192.16.7.14 & 255.255.255.255 192.0.0.0 192.16.7.0 192.16.7.0 Network-specific 192.16.7.14 & 255.255.255.0 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 22 Example 2 Router R1 receives 100 packets for destination 193.14.5.176; the algorithm applies the masks row by row to the destination address until a match is found. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 23 Example 2 (Solution) Direct delivery 193.14.5.176 & 255.0.0.0 193.14.5.176 & 255.255.255.224 Spring 2003 Tuna Tugcu 193.0.0.0 193.14.5.160 ECE 4110 – Internetwork Programming no match match 24 Example 3 Router R1 receives 20 packets for destination 200.34.12.34; the algorithm applies the masks row by row to the destination address until a match is found. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 25 Example 3 (Solution) Direct delivery 200.34.12.34 & 255.0.0.0 200.34.12.34 & 255.255.255.224 200.34.12.34 & 255.255.255.224 200.34.12.34 no match 200.34.12.0 200.34.12.0 no match no match 0.0.0.0 match Network-specific 200.34.12.34 & 255.255.255.0 200.34.12.34 & 255.255.255.0 no match no match no match Host-specific 200.34.12.34 & 255.255.255.255 200.0.0.0 200.34.12.32 200.34.12.32 Default 200.34.12.34 & 0.0.0.0 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 26 Example 4 Make the routing table for router R1 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 27 Example 4 (Solution) Mask Destination 255.255.0.0 134.18.0.0 255.255.0.0 129.8.0.0 222.13.16.40 m1 255.255.255.0 220.3.6.0 222.13.16.40 m1 0.0.0.0 0.0.0.0 134.18.5.2 m0 Spring 2003 Tuna Tugcu Next Hop Interface - m0 ECE 4110 – Internetwork Programming 28 Example 5 Make the routing table for router R1 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 29 Example 5 (Solution) Mask 255.255.255.0 Destination 200.8.4.0 Next Hop - 255.255.255.0 80.4.5.0 201.4.10.3 or 200.8.4.12 m1 or m2 255.255.255.0 80.4.6.0 201.4.10.3 or 200.4.8.12 m1 or m2 0.0.0.0 0.0.0.0 ???????????? m0 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming Interface m2 30 Example 6 Given the routing table in the next slide, draw the topology. Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 31 Example 6 (cont’d) Mask 255.255.0.0 Destination 110.70.0.0 Next Hop - Interface m0 255.255.0.0 180.14.0.0 - m2 255.255.0.0 190.17.0.0 - m1 255.255.0.0 130.4.0.0 190.17.6.5 m1 255.255.0.0 140.6.0.0 180.14.2.5 m2 0.0.0.0 0.0.0.0 110.70.4.6 m0 Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 32 Example 6 (Solution) Spring 2003 Tuna Tugcu ECE 4110 – Internetwork Programming 33