Network Services

Tuesday, November 19, 2013

The Network Layer



The Network Layer
The Network layer of the OSI model defines protocols that ensure that the data arrives at the correct destination. This is probably the most commonly discussed layer of the OSI model.

Network Layer Concepts
The following concepts are the most important Network layer concepts:
  • Logical network addressing
  • Routing
Logical Network Addressing
Earlier, you learned that every communicating LAN interface has an address (the MAC address) assigned at the factory and that this address is protocol independent. But as you know, most networks
communicate using protocols that must have their own addressing scheme. If the MAC address is the Data Link layer physical address, the protocol-addressing scheme at the Network
layer defines the logical address.
    Each logical network address is protocol dependent, which is why you may have heard them referred to generically as protocol addresses. For example, a TCP/IP address is not the same as
an IPX address. Additionally, the two protocols can coexist on the same interface without conflict, each simultaneously binding itself to the protocol-independent MAC address for the associated
interface. However, two different interfaces using the same protocol cannot have the same logical network address on the same network. If that happens, neither interface can be seen on the network (see Figure 2.16).

FIGURE 2 . 1 6 Address conflicts on a network





ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ
Understanding Network Address Formats
ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ

Whenever you have to set up a network or add a device, it is important to have an understanding of how network addresses work. Every network address in either TCP/IP or IPX has both a

network portion and a node, or host, portion. The network portion is the number that is assigned to the network segment to which one of the device’s interfaces is connected. The node portion is the unique number that identifies that device on the segment. Together, the network portion and the node portion of an address ensure that a network address will be unique across the entire network.

IPX addresses use a 32-bit value represented as an eight-digit hexadecimal number for the network portion. This number, called the IPX network address, can be assigned randomly by the
installation program or manually by the network administrator. The node portion is the 12-digit hexadecimal MAC address assigned by the manufacturer. A colon separates the two portions.
Here is a sample IPX address:


TCP/IP addresses, on the other hand, use a dotted decimal notation in the format xxx.xxx.xxx.xxx as shown in the following:


The address is a 32-bit value represented as four groups of eight-digit binary numbers (or, more commonly, up to three decimal digits, depending on the value of the bits) called octets, separated by periods. Each decimal number in an IP address can range from 0 through 255. Which portion is the network and which portion is the node depends on the class of the address if the default separation is used, but the subnet mask assigned with the address configures that

separation, which may not adhere to the default classful boundary. A subnet mask is also a dotted decimal number with numbers in the range of 0 through 255. If a subnet mask contains 255 in any position (corresponding to a binary number of all ones), the corresponding part of the IP address is the network address. For example, if you have the mask 255.255.255.0, the first three octets are the network portion and the last portion is the node. It is possible to have one octet in the mask set to one of a small choice of other values, but that’s beyond the scope of this
study guide. The term subnetwork, or subnet for short, is generally used to mean network
(when only default subnetting is used), segment, or immediate link, when IP routing is used.

ــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ

Note:
Address conflicts can be common with TCP/IP because an administrator often
needs to assign IP addresses. IPX addresses don’t suffer from conflict nearly as
often because the MAC address is used as part of the IPX address. The MAC
address is unique and normally can’t be changed (although some utilities are
available on some systems). For more information on network addresses, see
Chapter 4, “TCP/IP Utilities.”



Packets
At the Network layer, data coming from upper-layer protocols are divided into logical chunks called packets. A packet is a unit of data transmission. The size and format of these packets depend on the
Network layer protocol in use. In other words, IP packets differ greatly from IPX packets and Apple- Talk DDP packets, and the three are not compatible. Refer back to Table 2.1, which shows the
names of the protocol data units (PDUs) at the layers that have distinctive data structures.


Routing

Routing is the process of moving data throughout an internetwork, passing through several network segments using devices called routers, which select the path the data takes. Placing routers in
a network to break the network into several smaller subnets turns a network into an entity known as an internetwork. Routers determine which paths to take from internal databases called routing tables. These tables contain information about which router network interface (or port) to place information on in order to send it to a particular subnet. Routers will not pass unknown or broadcast packets by default. A router will route a packet only if it has a specific destination. Even if a default route is configured, the default route is, in fact, a specific destination where the router simply sends everything that doesn’t match any other entry in the routing table to the default route address. Figure 2.17 illustrates conceptual views of routers and their interconnection.

FIGURE 2 . 1 7 An internetwork


Information gets into routing tables in two ways:
  • Through static routing
  • Through dynamic routing
In static routing, the network administrator manually updates the router’s routing table. The administrator enters every subnet into the routing table and selects the port on which the router
should place data when the router receives data destined for that subnet from any other port. Unfortunately, on networks with more than a few segments, manually updating routing tables is time intensive and prohibitive.

Note:
When using a Windows serveras a router, use the ROUTE command at a command prompt in order to add, change, or remove static routes. This same utility is available for non-server Windows devices in case you would prefer to use individual static routes or manually set up a default route. For assistance using this command, simply open a command prompt and enter ROUTE /?.
    Dynamic routing, on the other hand, uses route discovery protocols (better known as routing protocols) to talk to other routers and find out which networks they are attached to. Routers
that use dynamic routing send out special packets to request updates of the other routers in the internetwork as well as to send their own updates.
     With dynamic routing, the two categories of routing protocols are distance vector and link state. Older routing protocols, such as Routing Information Protocol (RIP) for TCP/IP and RIP
for IPX, use the distance vector method. In distance vector routing, a router sends out its routing table when the router is brought online and every minute or so thereafter. When another router
receives the contents of the first router’s table, it adds 1 to the hop count of each route in the list of routes and then re-advertises the list. A hop is one pass through a router. The main downside
to distance vector routing is the overhead required in advertising the entire routing table every 30 seconds, in the case of IP RIP.
    Link state routing is more efficient than distance vector routing. Routers using link state routing protocols send out their routing table updates via multicast or unicast, not broadcast, and then only when necessary. If there is an update, only the update is sent. In the worst case, Open Shortest Path First (OSPF) performs a database synchronization about every 30 minutes, hardly a bandwidth hit.

Note:
NetWare Link Services Protocol (NLSP) for IPX and OSPF for TCP/IP are two link state routing protocols.
Several protocols can be routed, but a few protocols can’t be routed. It is important to know which protocols are routable and which aren’t so that you can choose the appropriate protocol
when it comes time to design an internetwork. Table 2.4 shows a few of the most common routable and nonroutable protocols and the routing protocols they use, if any.

TABLE 2 . 4 Routable and Nonroutable Protocols


Note:
When setting up routing on your network, you may have to configure a default
gateway. A default gateway, when configured on a workstation, is the router
interface on the workstation’s subnet that a packet is sent to when the workstation
doesn’t know the specific path to the intended recipient. TCP/IP subnets
sometimes have multiple routers as well and must use this parameter to specify
which router is the default.

One important topic to understand is how to configure a default gateway address when configuring TCP/IP. This involves setting up both the router to actually be the default gateway, and set up the workstation to use that address as the default gateway. The following will walk you through setting up a default gateway on a Windows workstation and a Cisco router, switch, or other device running Cisco Internetwork Operating System (IOS). Occasionally, you will need to be able to establish or change this feature on one of these devices. You’ll find, by going through these steps on live equipment, that you become more comfortable with an array of
other tasks as well, such as altering the routing table and creating static routes. 
     Microsoft Windows allows manual adjustment of the computer’s routing table, which can be quite advanced depending upon such factors as routing protocols being enabled on the computer
and any manual configurations that have been made. The following steps establish a default gateway that forwards all traffic that does not otherwise match any entries in the routing table to the IP address you configure
  1. Open up a command prompt session. One way to do this is to click the Start button and then click Run. Type in cmd and press Enter.
  2. At the command prompt, enter the command route print to view the current routing table.
  3. Make a note of the current default gateway, if any. The default gateway appears on the line that says, “Default Gateway: current_default_gateway.”
  4. In order to minimize disruption of service, use the same IP address from step 3 in the command route add 0.0.0.0 mask 0.0.0.0 current_default_gateway. If none existed, any address will be fine, although for production configuration, you would want to use the actual IP address of the device to which traffic destined for unknown networks should be forwarded. If you receive an error message, it is probably because you chose an IP address that is not on your local IP subnet. Microsoft requires that the default gateway reside on the same IP subnet as your computer’s interface.
  5. To remove a default route, enter the command route delete 0.0.0.0 mask 0.0.0.0 current_default_gateway. Receiving the error message “The route specified was not found” means that you entered the wrong IP address for the current default gateway or that you likely received an error, as described in step 4.
    Cisco’s (IOS) allows you to create a default gateway for the device you are configuring in much the same way you did for Microsoft Windows, with minor differences. A Cisco router (an example of a device that runs Cisco’s IOS) maintains a potentially more complex routing table because the use of dynamic routing protocols tends to be more prevalent on these devices. The following steps establish a gateway of last resort (Cisco’s term for a default gateway) out the serial interface Serial0 toward whatever device lies across the serial link from the router being configured. One caveat: if your router currently has no interface called, or no configuration on, Serial0, then the following procedure will create an entry in your running configuration but no result will be seen
in the routing table. It is still necessary to perform the removal in the last step or else when and if the interface does become active, the default gateway will activate as well. Feel free to substitute
an actual live serial interface for Serial0, if need be, such as Serial1, Serial0/0, and so on. The privileged EXEC mode command show ip interface brief can help you determine the available IP interfaces your device possesses. Choose one with an IP address. One more thing: this procedure assumes you are able to find your way to privileged EXEC mode on a Cisco device and begins with the command to enter global configuration mode:

1. Issue the command show ip route and make sure you see the line Gateway of last resort is not set after the codes and before the routing entries begin.

2. If step 1 did not give the expected results, it would be best to find a device that does give such results. Once you get the results requested for step 1, issue the following command to enter global configuration mode:
Router#configure terminal
Router(config)#

3. Enter the following commands to establish the default gateway through interface Serial0 and return to privileged EXEC mode, noting the space in the middle of the series of zeros:
Router(config)#ip route 0.0.0.0 0.0.0.0 serial0
Router(config)#end
Router#

4. Enter the command show ip route and confirm that the line described in step 1 has changed to Gateway of last resort is 0.0.0.0 to network 0.0.0.0.

5. Enter the following sequence of commands to remove the default gateway you just created:
Router#configure terminal
Router(config)#no ip route 0.0.0.0 0.0.0.0 serial0
Router(config)#end

Router#

     In both Windows and the Cisco IOS, the default gateway was created with a routing table entry of network 0.0.0.0 with a mask of 0.0.0.0. The reason this entry works as the least desirable
routing table entry is because the last series of 0s (zeros) ANDs with any IP address and produces 0.0.0.0, which matches the network number 0.0.0.0 for the default route. Because this
works for any IP address, this entry will never fail, but because the number of 1s in the mask is zero, it will be the least desirable entry in the routing table, with matched entries having masks with one or more 1s being preferred. Nevertheless, if the default route is the only matching entry, then it will be used. The AND operation is a Boolean algebra operand that produces a 0 when any pair of bits other than two 1s are ANDed. This means that with a mask of all 0s, the result will always be all 0s, and that will always match the network entry of all 0s, making the default gateway work in every case as long as a better match does not exist.

Network Layer Devices
Two devices operate at the Network layer:

  • Routers
  • Layer 3 Switches

The Router

Routers are Network layer devices that connect multiple networks or segments to form a larger internetwork. They are also the devices that facilitate communication within this internetwork. They make the choices about how best to send packets within the internetwork so that they arrive at their destination. Routers do not propagate broadcasts from one of their ports to another, meaning that each port on a router is in a different broadcast domain. A broadcast
domain is the collection of all devices that will receive each others’ broadcast frames.
      Several companies manufacture routers, but probably three of the biggest names in the business are Nortel Networks, Juniper Networks, and Cisco Systems. Nortel Networks is the resulting
corporation from the merger of Nortel and Bay Networks, which itself was once separately Welfleet and Synoptics. Cisco has always been a built-from-the-ground-up router company.
These companies make other products as well, and even though Nortel Networks concentrates on large-scale telephony equipment, it manages to provide adequate competition for Cisco and
Juniper in the router and switch market. Cisco has even moved into Nortel Networks’s arena by using its AVVID product line to compete in the growing Voice over IP (VoIP) market.
     Routers have many functions other than simply routing packets. They can connect many small segments into an internetwork as well as connect internetworks to a much larger network, such as a corporate intranet or the Internet. Routers can also connect dissimilar lower-layer topologies. For example, you can connect an Ethernet and a Token Ring network using a router. Additionally,
with added software, routers can perform firewall functions and packet filtering.

Routers are some of the most complex devices on a network today. Consequently, they are likely to be some of the most expensive But simple low-end routers that make Internet connectivity more affordable have been introduced by Nortel Networks, Cisco, and other companies.


Layer 3 Switches
A Network layer device that has received much media attention of late is the Layer 3 Switch. The Layer 3 part of the name corresponds to the Network layer of the OSI model. It performs
the multiport, virtual LAN, data-pipelining functions of a standard Layer 2 Switch, but it can also perform basic routing functions between virtual LANs.

0 comments:

Post a Comment