Network Basics: The OSI Network Layer
The Open Systems Interconnection (OSI) Network layer handles the task of routing network messages from one computer to another. The two most popular layer 3 protocols are IP (which is usually paired with TCP) and IPX (normally paired with SPX for use with Novell and Windows networks).
Network layer protocols provide two important functions: logical addressing and routing. The following sections describe these functions.
Network Logical addressing
Every network device has a physical address called a MAC address, which is assigned to the device at the factory. When you buy a network interface card to install into a computer, the MAC address of that card is fixed and can’t be changed.
But what if you want to use some other addressing scheme to refer to the computers and other devices on your network? This is where the concept of logical addressing comes in; a logical address lets you access a network device by using an address that you assign.
Logical addresses are created and used by Network layer protocols such as IP or IPX. The Network layer protocol translates logical addresses to MAC addresses.
For example, if you use IP as the Network layer protocol, devices on the network are assigned IP addresses such as 188.8.131.52. Because the IP protocol must use a Data Link layer protocol to actually send packets to devices, IP must know how to translate the IP address of a device to the device’s MAC address.
You can use the ipconfig command to see the IP address of your computer. Another way to display this information is to use the System Information command, found on the Start menu under Start→All Programs→Accessories→System Tools→System Information. Notice that the System Information program displays a lot of other useful information about the network besides the IP address.
Although the exact format of logical addresses varies depending on the protocol being used, most protocols divide the logical address into two parts. The network address identifies which network the device resides on, and the device address then identifies the device on that network. For example, in a typical IP address, such as 192.168.1.102, the network address is 192.168.1, and the device address (called a host address in IP) is 102.
Similarly, IPX addresses consist of two parts: a network address and a node address. In an IPX address, the node address is the same as the MAC address. As a result, IPX doesn’t have to translate between layer 3 and layer 2 addresses.
Routing comes into play when a computer on one network needs to send a packet to a computer on another network. In this case, a device called a router is used to forward the packet to the destination network. In some cases, a packet may actually have to travel through several intermediate networks in order to reach its final destination network.
An important feature of routers is that you can use them to connect networks that use different layer 2 protocols. For example, a router can be used to send a packet from an Ethernet to a Token Ring network. As long as both networks support the same layer 3 protocol, it doesn’t matter whether their layer 1 and layer 2 protocols are different.
A protocol is considered routable if it uses addresses that include a network part and a host part. Any protocol that uses physical addresses isn’t routable because physical addresses don’t indicate to which network a device belongs.