© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-1 TCP/IP Internetworking Chapter 8 Updated January 2009 Raymond Panko’s Business Data Networks and Telecommunications, 7th edition May only be used by adopters of the book
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-2 Recap Internets –Connect multiple switched networks using routers –70%-80% of internet traffic follows TCP/IP standards –These standards are created by the IETF –Chapter 10 looks in more detail at TCP/IP management
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-3 Frames and Packets Messages at the data link layer are called frames Messages at the internet layer are called packets Within a single network, packets are encapsulated in the data fields of frames Frame Header Packet (Data Field) Frame Trailer Recap
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-4 Internet and Transport Layer Transport Layer end-to-end (host-to-host) TCP is connection-oriented, reliable UDP is connectionless and unreliable Internet Layer (usually IP) hop-by-hop (host-router or router-router) connectionless, unreliable Router 1Router 2 Router 3 Client PC Server Recap
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Major TCP/IP Standards 5 Application User ApplicationsSupervisory Applications HTTPSMTP Many Others DNS Dynamic Routing Protocols Many Others 4 TransportTCPUDP 3 InternetIPARP 2 Data LinkNone: Use OSI Standards 1 PhysicalNone: Use OSI Standards Note: Shaded protocols are discussed in this chapter ICMP TCP/IP has core internet and transport standards: IP, TCP, and UDP. TCP/IP has core internet and transport standards: IP, TCP, and UDP.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Major TCP/IP Standards 5 Application User ApplicationsSupervisory Applications HTTPSMTP Many Others DNS Dynamic Routing Protocols Many Others 4 TransportTCPUDP 3 InternetIPARP 2 Data LinkNone: Use OSI Standards 1 PhysicalNone: Use OSI Standards Note: Shaded protocols are discussed in this chapter ICMP TCP/IP also has many application standards.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Major TCP/IP Standards 5 Application User ApplicationsSupervisory Applications HTTPSMTP Many Others DNS Dynamic Routing Protocols Many Others 4 TransportTCPUDP 3 InternetIPARP 2 Data LinkNone: Use OSI Standards 1 PhysicalNone: Use OSI Standards Note: Shaded protocols are discussed in this chapter ICMP TCP/IP also has many supervisory standards at the internet, transport, and application layers.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-8 IP Addresses 32-Bit Strings Dotted Decimal Notation for Human Reading (e.g., )
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Hierarchical IP Address IP addresses are not simple 32-bit numbers. They usually have 3 parts. Consider the example
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Border Router, Internal Router, Networks, and Subnets Border routers connect different networks on the Internet (In this case, x.x and 60.x.x.x). An “x” indicates anything, so x.x means through
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Border Router, Internal Router, Networks, and Subnets Internal routers connect different subnets in a network. In this case, the three subnets are boxed in red: x, x, and x.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-12 Router Operation
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : IP Network and Subnet Masks The Problem –There is no way to tell by looking at an IP address what sizes the network, subnet, and host parts are—only their total of 32 bits –The solution: masks
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Masks –In spray painting, you often use a mask. –The mask allows part of the paint through but stops the rest from going through. –Network and subnet masks do something similar. 9.5: IP Network and Subnet Masks 14
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : IP Network and Subnet Masks Masking –A mask is a series of initial ones followed by series of final zeros for a total of 32 bits Example: is 16 ones followed by 16 zeros In prefix notation, /16 (Decimal 0 is 8 zeros and Decimal 255 is 8 ones)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Masks are applied to 32-bit IP addresses : IP Network and Subnet Masks IP Address bit1010 Mask bit1100 Result bit1000 If the mask bit = 0, the result is always 0. If the mask bit = 1, the result is always the IP address bit in that position.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : IP Network and Subnet Masks Masking –Eight 0s is 0 –Eight 1s is 255 IP Address Octet Mask Octet Result
© 2009 Pearson Education, Inc. Publishing as Prentice Hall © 2011 Pearson Education, Inc. Publishing as Prentice Hall : IP Network and Subnet Masks Network MaskDotted Decimal Notation Destination IP Address Network Mask Bits in network part, followed by zeros
© 2009 Pearson Education, Inc. Publishing as Prentice Hall © 2011 Pearson Education, Inc. Publishing as Prentice Hall : IP Network and Subnet Masks Subnet MaskDotted Decimal Notation Destination IP Address Subnet Mask255 0 Bits in network part, followed by zeros
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Ethernet Switching Versus IP Routing Destination address is E5-BB D3-56. Ethernet switches are arranged in a hierarchy. So there is only one possible path between hosts. So only one row can match an Ethernet address. Finding this row is very simple and fast. So Ethernet switching is inexpensive per frame handled. One correct row Frame to E5-…
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Ethernet Switching Versus IP Routing Because of multiple alternative routes in router meshes, routers may have several rows that match an IP address. Routers must find All matches and then select the BEST ONE. This is slow and therefore expensive compared to switching. Route 3: CE (Selected)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Routing –Processing an individual packet and passing it on its way is called routing. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall The Routing Table –Each router has a routing table that it uses to make routing decisions. –Routing Table Rows Each row represents a route for a range of IP addresses— often packets going to the same network or subnet. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall ColumnMeaning RowDefine the row in the routing table Destination Range of IP addresses governed by the row MaskMask for the row MetricQuality of the route listed in this row InterfaceThe interface (port) to use to send the packet out Next-Hop Router Device (router or destination host) on the interface subnet to receive the packet 24 Routing Table Columns
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Routing Table Each row represents a route For a range of IP addresses For Row 1, the address range Is to Each row represents a route For a range of IP addresses For Row 1, the address range Is to
© 2009 Pearson Education, Inc. Publishing as Prentice Hall A Routing Decision –Whenever a packet arrives, the router looks at its IP address, then… –Step 1: Finds All Row Matches –Step 2: Finds the Best-Match Row –Step 3: Sends the Packet Back out According to Directions in the Best-Match Row © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process Step 1: Finding All Row Matches –The router looks at the destination IP address in an arriving packet –For each row: Apply the row’s mask to the destination IP address Compare the result with the row’s destination value If the two match, the row is a match
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process A Routing Decision –Step 1: Finding All Row Matches Example 1: A Destination IP Address that is in NOT the Range –Destination IP Address of Arriving Packet –Apply the row’s (Network) Mask –Result of Masking –Row’s destination Column Value –Destination Matches the Masking Result? No –Conclusion Not a match
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process A Routing Decision –Step 1: Finding All Row Matches Example 2: A Destination IP Address that is in the Range –Destination IP Address of Arriving Packet –Apply the row’s Mask –Result of Masking –Row’s destination Column Value –Destination Matches the Masking Result? Yes –Conclusion Row is a match
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process Step 1: Finding All Row Matches –The router do this to ALL rows because there may be multiple matches –This step ends with a set of matching rows
© 2009 Pearson Education, Inc. Publishing as Prentice Hall A Routing Decision –Whenever a packet arrives, the router looks at its IP address, then… –Step 1: Finds All Row Matches –Step 2: Finds the Best-Match Row –Step 3: Sends the Packet Back out According to Directions in the Best-Match Row © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall To find the best-match row, the router uses the mask column and perhaps the metric column. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process RowMaskMetric (Cost) 1/1647 2/
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Step 2: Find the Best-Match Row –The router examines the matching rows it found in Step 1 to find the best-match row. –Basic Rule: it selects the row with the longest match (Initial 1s in the row mask). Row 99 matches, mask is /16 ( ) Row 78 matches, mask is /24 ( ) Select Row 78 as the best-match row. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Step 2: Find the Best-Match Row –Basic Rule: it selects the row with the longest match (Initial 1s in the row mask). –Tie Breaker: if there is a tie for longest match, select among the tie rows based on metric. There is a tie for longest length of match. Row 668 has match length /16, cost metric = 20. Row 790 has match length /16, cost metric = 16. Router selects 790, which has the best cost. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Step 2: Find the Best-Match Row –The following rows are matches. Row / Mask / Metric 220 /24 / speed metric = /18 / speed metric = /8 /speed metric = 40 –Question: What is the best-match row? Why? © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Step 2: Find the Best-Match Row –The following rows match. 107 / 12 / speed metric = / 14 / speed metric = / 18 / speed metric = / 18 / speed metric = 40 –Question: What is the best-match row? Why? © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall A Routing Decision –Whenever a packet arrives, the router looks at its IP address, then… –Step 1: Finds All Row Matches –Step 2: Finds the Best-Match Row –Step 3: Sends the Packet Back out According to Directions in the Best-Match Row © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Step 3: Send the Packet Back out –Send the packet out the router interface (port) designated in the best-match row. –Send the packet to the router in the next-hop router column. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process RowInterfaceNext-Hop Router 12G 21Local 32H Router Port = Interface
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Step 3: Send the Packet Back out –If the address says Local, the destination host is out that interface. Sends the packet to the destination IP address in a frame. © 2011 Pearson Education, Inc. Publishing as Prentice Hall : The Routing Process RowInterfaceNext-Hop Router 12G 21Local 32H
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-7: The Routing Process A Routing Decision –Step 3: Send the Packet Back Out –Example 1: Row 18,924 is the best match –Interface = 4, Next-hop-router is –The router will send the packet out Interface 4, to
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-41 The Internet Protocol (IP) Versions 4 and 6
© 2009 Pearson Education, Inc. Publishing as Prentice Hall IP Class Scheme
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Address Space
© 2009 Pearson Education, Inc. Publishing as Prentice Hall IP Class Scheme From the previous figure, we see that the 32-bit address is split into 4 octets. If the first 4 bits of the first octet are –0xxx: Class A address (0 – 127) –10xx: Class B address(128 – 191) –110x: Class C address (192 – 223) –1110: Class D address (Multicast) –1111: Class E address
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Subnet Mask 45
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-46 The Transmission Control Protocol (TCP)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : TCP Session Openings and Closings SYN SYN/ACK ACK Normal Three-Way Opening A SYN segment is a segment in which the SYN bit is set. One side sends a SYN segment requesting an opening. The other side sends a SYN/acknowledgment segment for the SYN segment. Originating side acknowledges the SYN/ACK.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : TCP Session Openings and Closings FIN ACK FIN ACK Normal Four-Way Close A FIN segment is a segment in which the FIN bit is set. Like both sides saying “good bye” to end a conversation. Data ACK
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : TCP Session Openings and Closings FIN ACK FIN ACK Normal Four-Way Close The side that initiated the close will send no more data segments, but it will still transmit acknowledgements Data ACK
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : TCP Session Openings and Closings RST Abrupt Reset An RST segment is a segment in which the RST bit is set. A single RST segment breaks a connection. Like hanging up during a phone call. There is no acknowledgment because the RST sender is no longer listening.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-51 Port Numbers and Sockets in TCP and UDP
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-52 TCP and UDP Port Numbers Computers are multitasking devices –They run multiple applications at the same time –On a server, a port number designates a specific application Server HTTP Webserver Application SMTP Applications Port 80 Port 25
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-53 TCP and UDP Port Numbers Major Applications Have Well-Known Port Numbers –Well-known port number range is 0 to 1023 for both TCP and UDP –HTTP’s well-known port number is TCP Port 80 –SMTP’s well-known port number is TCP Port 25 Server HTTP Webserver Application SMTP Application Port 80 Port 25
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-54 TCP and UDP Port Numbers Clients Use Ephemeral Port Numbers –1024 to 4999 for Windows Client PCs –A client has a separate port number for each connection to a program on a server Client Port 4400Port 3270 Webserver Application on Webserver Application on Mail Server
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-55 TCP and UDP Port Numbers Client Webserver Port 80 SMTP Server Port 25 A socket is an IP address, a colon, and a port number : : :2849 It represents a specific application (Port number) on a specific server (IP address) Or a specific connection on a specific client. Client PC Port 2849
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Use of TCP (and UDP) Port Numbers Client Webserver Port 80 Source: :2707 Destination: :80 SMTP Server Port 25 This shows sockets for a client packet sent to a webserver application on a webserver
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Use of TCP (and UDP) Port Numbers Client Webserver Port 80 Source: :2707 Destination: :80 Source: :80 Destination: :2707 SMTP Server Port 25 Sockets in two-way transmission
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Use of TCP (and UDP) Port Numbers Client Webserver Port 80 Source: :2707 Destination: :80 Source: :80 Destination: :2707 Source: :4400 Destination: :25 SMTP Server Port 25 Clients use a different ephemeral port number for different connections
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-59 Dynamic Routing Protocols Routing Table Information Dynamic Routing Protocol Router
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Dynamic Routing Protocols How do routers get the information for their routing tables? –The answer is that they constantly talk to each other, sharing routing information –This communication must be standardized –These standards are called dynamic routing protocols –There are several dynamic routing protocols; partners must select one to use –Dynamic routing protocols exchange IP address ranges, masks, metric values, and sometimes other information 8-60
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-61 Dynamic Routing Protocols Here is a simple example of how a dynamic routing protocol works. Here, the metric is the number of hops to the destination IP addresses, x.x 1
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Dynamic Routing Protocols: Interior and Exterior When they talk to other Autonomous systems, they Must negotiate which Exterior DRP they will use. When they talk to other Autonomous systems, they Must negotiate which Exterior DRP they will use. Large organizations and ISPs are autonomous systems. Autonomous systems can Select their interior Dynamic routing protocols. Large organizations and ISPs are autonomous systems. Autonomous systems can Select their interior Dynamic routing protocols. 1
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Dynamic Routing Protocols Dynamic Routing Protocol Interior or Exterior Routing Protocol? Remarks RIP (Routing Information Protocol) InteriorOnly for small autonomous TCP/IP systems with low needs for security OSPF (Open Shortest Path First) InteriorFor large autonomous systems that only use TCP/IP EIGRP (Enhanced Interior Gateway Routing Protocol) InteriorProprietary Cisco Systems protocol. Not limited to TCP/IP routing. Also handles IPX/SPX, SNA, and so forth BGP (Border Gateway Protocol) ExteriorOrganization cannot choose what exterior routing protocol it will use. TCP/IP protocol
© 2009 Pearson Education, Inc. Publishing as Prentice Hall Routing Note that routing has two meanings –Routing means the process by which a router receives a packet, selects the best route for a packet, and sends the packet back out –Routing also means the process by which routers exchange routing table information 8-64
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-65 The Internet Control Message Protocol (ICMP)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Internet Control Message Protocol (ICMP) for Supervisory Messages ICMP is the internet layer supervisory protocol. ICMP messages are encapsulated in the data field of IP packets. These packets have no higher-layer contents. ICMP is the internet layer supervisory protocol. ICMP messages are encapsulated in the data field of IP packets. These packets have no higher-layer contents.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Internet Control Message Protocol (ICMP) for Supervisory Messages At the Windows command line, Type “ping [Enter]” At the Windows command line, Type “ping [Enter]” 1 Pinging a host sends it an ICMP echo message. When the host receives this ping, it sends back. An echo reply message. pinging is a quick way to learn if a host is available. Pinging a host sends it an ICMP echo message. When the host receives this ping, it sends back. An echo reply message. pinging is a quick way to learn if a host is available.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Internet Control Message Protocol (ICMP) for Supervisory Messages If a router cannot deliver a packet, it may send an ICMP error message to the source host. There are several types of ICMP messages, for different types of error. If a router cannot deliver a packet, it may send an ICMP error message to the source host. There are several types of ICMP messages, for different types of error.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-69 Dynamic Host Configuration Protocol (DHCP)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-70 Dynamic Host Configuration Protocol Every Host Must Have a Unique IP address –Server hosts are given static IP addresses (unchanging) –Clients get dynamic (temporary) IP addresses that may be different each time they use an internet Dynamic Host Configuration Protocol (DHCP) –Clients get these dynamic IP addresses from Dynamic Host Configuration Protocol (DHCP) servers
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Dynamic Host Configuration Protocol (DHCP) Client PC A3-4E-CD F DHCP Server DHCP Request Message: “My 48-bit Ethernet address is A3-4E-CD F”. Please give me a 32-bit IP address.” Pool of IP Addresses
© 2009 Pearson Education, Inc. Publishing as Prentice Hall : Dynamic Host Configuration Protocol (DHCP) Client PC A3-4E-CD F DHCP Server DHCP Response Message: “Computer at A3-4E-CD F, your 32-bit IP address is ”. (Usually other configuration parameters as well, including The subnet mask, the IP address of the default router, and the IP addresses of the organization’s DNS servers) Pool of IP Addresses
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 8-73 Why DHCP? If You Give PCs Static Information, –The cost of manual entry of configuration information (subnet mask, default router, DNS servers, etc.) is high –If something changes, such as the IP address of your DNS server, the cost of manually reconfiguring each PC is high –If something changes, your PCs may be inoperable until you make the manual changes With DHCP, users get hot fresh configuration data automatically