Chapter 7 Local Area Network Communications Protocols The Network Layer Local area network communications protocols can be thought of as the language of computer networks: They provide the language and grammatical rules that define communication This chapter focuses on local area network protocols, which control communication between hosts on interconnected networks LAYER THREE: THE NETWORK LAYER The third layer of the OSI Network Reference Model is the network layer The network layer is primarily concerned with providing a means for hosts to communicate with other hosts on different network segments. As explained in chapter 4, the datalink layer provides a means for two hosts on a common network segment to communicate. Technologies such as Ethernet and token ring provide this intra-segment connectivity. Network layer protocols expand the capabilities of the network by providing a means of delivering data (called packets) between network segments. A network layer protocol provides a means of addressing a host on the interconnected network and a means of delivering data across the network to destination hosts. Addressing is the process of defining where on the internetwork the host is located and routing is the process of determining the best path to the destination host and delivering the data The datalink layer (layer two) transmits frames of data. The network layer (layer three) transmits packets of data There are two key levels of networking: single segments where every host receives every packet and multisegment networks where some internetworking device forwards packets between network segments Single network segments are commonly referred to as segments, sub-networks, or subnets. Inter-connected segments are commonly referred to as networks or internetworks. Don’t let these varying terms confuse you: if every host sees every frame of data on the LAN, it’s a segment. If more than one segment is used, it’s an internetwork Network Layer Addressing The role of network layer addresses is to provide a means to uniquely identify a host on the internetwork. The network layer address is used in the routing process to deliver a packet of data to the correct network segment for delivery. In this manner, network addresses are used for “end-toend” or “inter-segment” communication There are two basic components to a network layer address: a network segment address and a host address. The network segment address identifies in which network segment the destination host is located. This address is used by the routing process to determine the destination network segment and deliver the packet to that segment. Once the packet has arrived at the correct network segment, the host address is resolved to a physical address and passed to the datalink layer for delivery Collectively, these two parts identify a host on the internetwork. The segment address must be unique to the internetwork to ensure that the packet is delivered to the correct network segment. Similarly, the host address must be unique within a network segment. As shown in Figure 7-2, it is possible to use the same host address on multiple segments. There is no chance for confusion between the hosts, as the packet will be routed to the network segment of the correct host based on the segment address. Network layer addresses are assigned on a per-NIC basis. It is possible for a single device to contain more than one NIC. In this case, each NIC will have its own network layer address (segment address + host address). Devices that contain more than one NIC are said to be multi-homed Network Layer Addressing Figure 7.2: The host address must be unique within a network segment. The packet will be routed to the network segment of the correct host based on the segment address There are several reasons to multi-home a device, including performance, reliability, and stability. However, the primary reason a device is multi-homed is to allow it to forward packets from one network segment to another. By definition a device that performs packet forwarding is known as a router Network Layer vs. Datalink Layer Addressing The network layer is primarily responsible for addressing hosts uniquely on an internetwork and providing a means of delivering data across network segments. The responsibility of moving data within a network segment is that of the datalink layer uses the physical address (also known as the MAC addresses for Ethernet and token ring technologies) of the NIC to deliver data rather than the network layer host address datalink layer The process of determining the physical layer address of an NIC from the network layer address is known as address resolution Each NIC is assigned a single data link layer physical address and one or more network addresses. The network layer address is used by upper-layer protocols to denote which host they wish to communicate with The process of delivering data to a destination host is analogous to the method used to deliver a letter to a person’s house. The street name (network segment address) is used to route the mail to the correct postal route. The mail carrier for that route then looks at the house number (host address) to determine the final destination of the letter. The mail carrier then resolves the house number to a physical mail-box location (physical address) for delivery. This relationship is shown in Figure 7-3 Protocol Encapsulation/Deencapsulation Layer three packet will always contain at least three sections: Source network address, destination network address, and Data As illustrated in Figure 7-4, a packet of data from the network layer is placed in the data section of a datalink layer frame. Known as encapsulation, this process adds both a header and trailer to the packet. The bit stream is finally passed along the shared media that connects the two computing devices. When the full bit stream arrives at the destination server, the reverse process of encapsulation, de-encapsulation takes place Protocol Encapsulation Figure 7.4: A packet of data from the network layer is placed in the data section of a datalink layer frame. This is encapsulation Fragmentation The maximum size of a packet or frame of data is known as the Maximum Transmission Unit (MTU) In the event that a higher-level packet will not fit into a lower layer’s available payload area, the higher-level packet is broken into two or more packet fragments. These packet fragments are sent across the network and re-assembled into a single packet before being sent back up the protocol stack on the destination host. Fragmentation allows large quantities of data to be sent across the network in smaller, more manageable “chunks” of data Data fragmentation is required between the application layer and the network layer for large quantities of application layer data (such as a 10 MB file) to be sent across a network When the source creates a packet that is larger than the underlying layer two transport protocols, each router on path between the source and destination must break the packet into multiple fragments, sending each fragment across the layer two link to the next router. Packet Fragmentation Fragmentation allows large quantities of data to be sent across the network in smaller, more manageable “chunks” of data. Each frame that contains a fragment of the packet must also contain a copy of the packet’s header to ensure that the packet is properly reassembled The next router must collect the fragments, re-assemble them into the original network layer packet, and repeat the process for the next hop. Such repeated packet fragmentation and reassembly places a large processing burden on routers, effectively reducing their overall routing capacity Packet Fragmentation Eliminated Repeated packet fragmentation and reassembly places a large processing burden on routers, effectively reducing their overall routing capacity. Solution? Lower Layer 3 packet size! Routing Routing is the process of moving data across network segments toward its final destination. Routers receive frames of data, de-encapsulate the layer three packet, examine the network layer packet header, determine the next hop of the packet, package the packet into a new data frame and transmit the new frame Routing Is Address Processing Perhaps the most important thing to understand about routing is that it is nothing more than address processing performed when messages need to travel beyond the local LAN Routing as Address Processing The default gateway or local router receives the datalink layer frame explicitly addressed to it and examines the ultimate destination address held in the packet. The router then consults its routing tables to see if it has an entry for a known path to the ultimate destination workstation. That known path may be via another router, or the ultimate destination workstation may be part of a different LAN connected to this same router through a different NIC. In either case, the packet and its addresses are not modified but are instead re-encapsulated in a fresh datalink layer frame with the physical layer destination address of either the ultimate destination workstation, or of the next router along the path to that workstation Routing Tables Hosts and routers decide where to send packets by looking up the destination address in their routing table. A routing table consists of a series of destination networks, the address of the local router that provides service to the destination network, and a cost associated with the route. The cost is used to determine the best route in the event that there are multiple routes to the destination available Regardless of protocol, there should always be a special entry in the routing table for the default router or gateway of last resort. This is the router where a packet should be sent if there is not a route listed in the local routing table for the destination network Routing Protocols when a router is initially started, it only knows about the interfaces connected to it, or static routes that have been configured by an administrator. In order for a network to dynamically build comprehensive routing tables that automatically add new routes and remove old ones, a routing protocol must be used. Routing protocols provide routers a means of automatically exchanging routing tables to ensure that each router knows where to route packets for a given destination There are two basic classes of routing protocols: interior gateway protocols and exterior gateway protocols. The difference between interior and exterior gateway protocols is the scope of the routing information they distribute. Interior gateway protocols distribute routing information within a hierarchical address space such as that assigned to a single organization. As shown in Figure 7-8, these hierarchical address spaces, also known as autonomous units, can be interconnected into an internetwork. When autonomous units are connected into an internetwork, exterior gateway protocols are used to distribute information about the various autonomous units between the routers that provide connectivity between them Just as the post office first needs to get a letter to the right city before worrying about the street names and house numbers, an internetwork must get a packet to the autonomous unit that contains the destination network segment and host Routing Protocols There are two major categories of interior routing protocols: distance vector and link state. Distance vector protocols broadcast their entire routing table periodically. In this manner, changes to the network routing tables slowly make their way through the network. A router using a distance vector algorithm knows nothing about the make-up of the network beyond the next hop to the destination Link state protocols transmit a more complete picture of the network between routers. Through the use of link state packets (LSP), each router learns the structure of the entire network. In this manner, the link state algorithm can make better routing decisions. Link state routing reacts quicker to changes in the routing structure than distance vector routing while using less bandwidth maintaining routing tables