Internet Protocol

Internet Protocol (IP) is a widely used networking term that describes a network layer protocol that logically defines a distinct host or end system, such as a PC or router, with an IP address.

An IP address is configured on end systems to allow communication between hosts over wide geographic locations. An IP address is 32 bits in length, with the network mask or subnet mask (also 32 bits in length) defining the host and subnet portion.

Figure 1-6 displays the IP packet header frame format in detail.

Figure 1-6 IP Frame Format

Version

Type of Service

Total Length

Identification

Flags

Fragment Offset

Time-To-Live

Protocol

Header Checksum

Source Address (32 bits)

Destination Address (32 bits)

Options (+ Padding)

Data (Variable)

The following describes the IP packet fields illustrated in Figure 1-6:

■ Version—Indicates the version of IP currently used. IPv4 is the most widely used version. IPv6 is also available. This version is not tested in the CCIE Security written exam yet, but will most likely be included in the future.

■ IP Header Length (IHL)—Indicates the datagram header length in 32-bit words.

■ Type-of-Service (ToS)—Specifies how an upper-layer protocol wants current datagrams to be handled and assigns to datagrams various levels of importance. The ToS field (8 bits) defines the first 3 bits for precedence, of which there are eight possible values:

— 110—Internetwork control

Typically, IP packets are set with the value 000. The remaining 5 bits in the ToS are defined as follows:

— Bit 4—T bit defines normal or high throughput.

— Bit 5—R bit defines normal or high reliability.

■ Total Length—Specifies the entire packet's length in bytes, including the data and header. The mathematically defined limit is calculated as 65,535 bytes (216-1).

■ Identification—Contains an integer that identifies the current datagram. This field helps piece together datagram fragments (16 bits in length).

■ Flags—Consists of a 3-bit field of which the two low-order (least-significant) bits control fragmentation. The low-order bit specifies whether the packet can be fragmented. The middle bit specifies whether the packet is the last fragment in a series of fragmented packets. The third, or high-order, bit is not used.

■ Fragment Offset—Indicates the position of the fragment's data relative to the beginning of the data in the original datagram, which allows the destination IP process to properly reconstruct the original datagram.

■ Time-to-Live—Maintains a counter that gradually decrements to 0, at which point the datagram is discarded. This keeps packets from looping endlessly.

■ Protocol—Indicates which upper-layer protocol receives incoming packets after IP processing is complete. For TCP, this value is 6; for GRE, it is 47; for ICMP, it is 1; for OSPF, it is 89; for UDP, it is 17; for ESP, it is 50; and for AH, it is 51. These are common uses in today's networks. Visit http://www.iana.org/assignments/protocol-numbers for a comprehensive list.

■ Header Checksum—Helps ensure only IP header integrity and not the data field.

■ Source Address—Specifies the sending node (32 bits).

■ Destination Address—Specifies the receiving node (32 bits).

■ Options—Allows IP to support various options, such as security. The Options field varies in length. Some options are Security, Loose Source Routing, Strict Source Routing, Record Route, and Timestamp.

■ Data—Contains upper-layer information.

NOTE A subnet is a network that is segmented by network administrators, allowing a hierarchical routing topology. Subnetting allows great use of IP address space using binary bits from the subnet mask. Examples of subnets appear later in this chapter.

Routing allows communication between these subnets. The host address is a logical, unique address that resides on a subnet.

The Internet Engineering Task Force (IETF) standards body, which consists of more than 80 working groups responsible for developing Internet standards, has defined five address classes and the appropriate address ranges. Table 1-3 displays the five ranges.

Table 1-3 Class A, B, C, D, and E Ranges*

Class of Address

Starting Bit Pattern

Range

Default Subnet Mask

Class A

Oxxxxxxx

1-126, 127**

255.0.0.0

Class B

10xxxxxx

128-191

255.255.0.0

Class C

110xxxxx

192-223

255.255.255.0

Class D

1110xxxx

224-239

Not officially defined

Class E

1111xxxx

240-255

Reserved

*Only Classes A, B, and C have predefined default subnet masks.

**127.0.0.0 is reserved for loopback purposes. Other reserved addresses for private use as defined by RFC 1918 are as follows:

172.16.0.0-172.31.255.255

192.168.0.0-192.168.255.255

*Only Classes A, B, and C have predefined default subnet masks.

**127.0.0.0 is reserved for loopback purposes. Other reserved addresses for private use as defined by RFC 1918 are as follows:

172.16.0.0-172.31.255.255

192.168.0.0-192.168.255.255

Soon after these ranges were defined and the Internet's popularity extended beyond the Department of Defense in the United States, it became clear that to ensure that a larger community could connect to the World Wide Web, there had to be a way to extend IP address space using subnetting. Subnetting allows an administrator to extend the boundary for any given subnet.

To understand an IP address and subnet portion, determine how many hosts are available on a particular subnet, and learn how to best use an IP address space, consider the following example.

Suppose you are given the IP address 131.108.1.56 and the subnet mask is 255.255.255.0.

You can deduce the subnet for any IP address by performing a logical AND operation for the IP address along with the subnet mask. A logical AND operation follows two basic rules: positive and positive equal positive, and negative and either positive or negative equal negative. In binary (positive is 1 and negative is 0), 0 AND 0 is 0, 0 AND 1 is 0, 1 AND 1 is 1, and 1 AND 0 is 0.

Figure 1-7 displays the logical AND operation used to determine the subnet address.

Figure 1-7 Logical AND Operation

The result of the logical AND operation reveals that the subnet address is 131.108.1.0. The subnet address is reserved and cannot be assigned to end devices.

To determine the number of hosts available in any given subnet, simply apply the formula 2n - 2, where n is the number of borrowed bits. This is best explained with examples. To determine the number of borrowed bits, you must examine the subnet mask in binary. For a default Class C network mask of 11111111.11111111.11111111.00000000 or, in decimal, 255.255.255.0, the last 8 bits represent the borrowed bits. For a Class C network, the number of hosts that can reside is 28 - 2 = 256 - 2 = 254 hosts. You subtract two host addresses because host devices are not permitted to use the subnet address or the broadcast address. In IP, a broadcast address consists of all binary 1s. So, for this example, the broadcast address for the subnet 131.108.1.0 is 131.108.1.255 (255 in binary is 11111111).

Consider another example. Given the host address 171.224.10.67 and the subnet mask of 255.255.255.224, this example shows you how to determine the subnet and the number of hosts that can reside on this network.

IP Address (131.108.1.56) IP Subnet Mask (255.255.255.0) Logical AND In Decimal

1 000001 1.1 1001 1 00.00000001.0011 1 000 1 1 11 1 1 1 1.1 11 1 1 1 1 1.1 11 1 1 1 1 1.00000000 1 000001 1.1 1001 1 00.00000001.00000000 131 108 1 0

To determine the subnet, perform a logical AND. Figure 1-8 displays the operation.

IP Address (171.224.10.67) 1010101 1. 1 1 100000. 00001010. 0100001 1

IP Subnet Mask (255.255.255.224) 1 11 1 1 1 1 1. 1 1 1 1 11 1 1. 1 11 1 1 1 1 1. 1 1 1 00000

Logical AND 1010101 1. 1 1 100000. 00001010. 01000000 In Decimal 171 224 10 64

The subnet is 171.224.10.64. The number of hosts that can reside on this network with a subnet mask of 255.255.255.224 (or 11100000) is 25 - 2 = 32 - 2 = 30 hosts. You can apply this simple example to any Class A, B, or C address, and applying a subnet mask that is not the default or classful kind allows network administrators to extend IP address space and allows a larger number of devices to connect to the IP network.

Table 1-4 displays some common network subnets and the number of hosts available on those subnets.

Table 1-4 Common Subnets in Today's Networks

Decimal

Subnets

Hosts

252 (1111 1100)

64 subnets

2 hosts*

248 (1111 1000)

32 subnets

6 hosts

240 (1111 0000)

16 subnets

14 hosts

224 (1110 0000)

8 subnets

30 hosts

192 (1100 0000)

4 subnets

62 hosts

128 (1000 0000)

2 subnets

126 hosts

*Used commonly for point-to-point WAN circuits when no more than two hosts or routers reside. Point-to-point networks typically connect a remote router to a central router.

*Used commonly for point-to-point WAN circuits when no more than two hosts or routers reside. Point-to-point networks typically connect a remote router to a central router.

0 0

Post a comment