Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Slide 44Slide 45Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52Slide 53Slide 54Slide 55Slide 56Slide 57Slide 58Slide 59Slide 60Slide 61Slide 62Slide 63Slide 64Slide 65Slide 66Slide 6720.1Chapter 20Network Layer:Internet ProtocolCopyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.20.220-1 INTERNETWORKING20-1 INTERNETWORKINGIn this section, we discuss internetworking, connecting In this section, we discuss internetworking, connecting networks together to make an internetwork or an networks together to make an internetwork or an internet. internet. Need for Network LayerInternet as a Datagram NetworkInternet as a Connectionless NetworkTopics discussed in this section:Topics discussed in this section:20.3Figure 20.1 Links between two hosts20.4Figure 20.2 Network layer in an internetwork20.5Figure 20.3 Network layer at the source, router, and destination20.6Figure 20.3 Network layer at the source, router, and destination (continued)Packet Switching Data transmitted in small packetsTypically 1000 octetsLonger messages split into series of packetsEach packet contains a portion of user data plus some control infoControl infoRouting (addressing) infoPackets are received, stored briefly (buffered) and past on to the next nodeStore and forwardWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.Use of PacketsWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.Switching TechniqueStation breaks long message into packetsPackets sent one at a time to the networkPackets handled in two waysDatagramVirtual circuitWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.DatagramEach packet treated independentlyPackets can take any practical routePackets may arrive out of orderPackets may go missingUp to receiver to re-order packets and recover from missing packetsWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.DatagramDiagramWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.Virtual CircuitPreplanned route established before any packets sentCall request and call accept packets establish connection (handshake)Each packet contains a virtual circuit identifier instead of destination addressNo routing decisions required for each packetClear request to drop circuitNot a dedicated pathWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.VirtualCircuitDiagramWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.Virtual Circuits v DatagramVirtual circuitsNetwork can provide sequencing and error controlPackets are forwarded more quicklyNo routing decisions to makeLess reliableLoss of a node looses all circuits through that nodeDatagramNo call setup phaseBetter if few packetsMore flexibleRouting can be used to avoid congested parts of the networkWilliam Stallings.. Data and Computer Communications, 7/E, Prentice Hall, 2004.20.15Switching at the network layer in the Internet uses the datagram approach to packet switching.Note20.16Communication at the network layer in the Internet is connectionless.Note20.1720-2 IPv420-2 IPv4The Internet Protocol version 4 (The Internet Protocol version 4 (IPv4IPv4) is the delivery ) is the delivery mechanism used by the TCP/IP protocols.mechanism used by the TCP/IP protocols.DatagramFragmentationChecksumOptionsTopics discussed in this section:Topics discussed in this section:20.18Figure 20.4 Position of IPv4 in TCP/IP protocol suite20.19IPv4 is an unreliable and connectionless datagram protocol – a best effort deliveryBest effort means that IPv4 provides no error control (except for error detection on the header) or flow controlIPv4 does its best to get a transmission through to its destination, but with no guaranteesNote20.20Figure 20.5 IPv4 datagram formatIPv4 Datagram FormatVersion (VER): version of the IP protocol. Currently, the version is 4.Header length (HLEN): the total length of the datagram header in 4-byte words.Services: service type or differentiated services.Total length: total length (header plus data) of the datagram in bytes.Total length of data = total length – header length20.21IPv4 Datagram FormatIdentification: used in fragmentation (discussed later).Flags: used in fragmentation (discussed later).Fragmentation offset: used in fragmentation (discussed later).Time to live: today it is used to control the maximum number hops visited by the datagram.Protocol: defines the higher-level protocol that uses the services of the IPV4 layer.20.22IPv4 Datagram FormatChecksum: discussed later.Source address: is the IPv4 address of the source.Destination address: is the IPv4 address of the source.20.2320.24Figure 20.6 Service type or differentiated services20.25The precedence subfield was part of version 4, but never used.Note20.26Table 20.1 Types of service20.27Table 20.2 Default types of service20.28Table 20.3 Values for codepointsCategory Codepoint Assigning Authority1 XXXXX0 Internet2 XXXX11 Local3 XXXX01 Temporary or experimental20.29The total length field defines the total length of the datagram including the header.Note20.30Figure 20.7 Encapsulation of a small datagram in an Ethernet frame20.31Figure 20.8 Protocol field and encapsulated data20.32Table 20.4 Protocol values20.33An IPv4 packet has arrived with the first 8 bits as shown:01000010The receiver discards the packet. Why?SolutionThere is an error in this packet. The 4 leftmost bits (0100) show the version, which is correct. The next 4 bits (0010) show an invalid header length (2 × 4 = 8). The minimum number of bytes in the header must be 20. The packet has been corrupted in transmission.Example 20.120.34In an IPv4 packet, the value of HLEN is 1000 in binary. How many bytes of options are being carried by this packet?SolutionThe HLEN value is 8, which means the total number of bytes in the header is 8 × 4, or 32 bytes. The first 20 bytes are
View Full Document