In understanding the role of the Internet layer of the TCP/IP protocol stack, we need to have a better understanding of the functions of the Internet Protocol, or IP. In a nutshell, IP is responsible for routing packets from source to destination in a network. Packets are the protocol data unit for the Internet layer of TCP/IP, and they are self-contained units of information that include the data to be sent and enough information for each packet to be treated independently and routed across the network. The routing function includes the selection of the best path to get from source to destination. Now, those destinations and sources need to be identified as devices within networks. And so, the second job of the Internet Protocol is to provide addressing of those devices, and that addressing needs to be hierarchical because, again, we are talking about device 1 on network 1, sending packets to device 1 on network 2, and that is only an example of identifying devices in a hierarchical manner.
The third takeaway here is that the Internet Protocol is connectionless in nature. This as opposed to connection-oriented. The connection-oriented session is similar to a telephone conversation in which you need to establish a call before you speak. A connectionless protocol like IP is similar to sending letters through the postal mail. You will send a letter and hope that you will get there, but the protocol itself will not provide any data recovery feature or any guarantee of delivery. In fact, this is what is considered best-effort delivery. It is the responsibility of other layers to provide reliability, and that may be depending on the application. For example, a bulk file transfer may require reliability, but real-time voice will benefit more from speed than too many reliability controls.
If one of the functions of IP as a protocol is to define addressing and identifying devices within the hierarchy of networks, now let's take a look at that structure of an IP address. IP addresses are 32-bit identifiers that uniquely distinguish each device on an IP network. If a host must have an unique address, if that host is to communicate with other hosts, and again, those addresses need to be hierarchical or represent a hierarchy of networks. We want to connect from device 1 on network 1 to device 2 on network 2. Then, we need those components on the IP address. In fact, the IP address will contain the two components: the host ID, which is assigned by organizations to individual devices, and a network identifier, which defines the segment or network that the device belongs to. This is similar to the way streets and cities are laid out in a hierarchical manner. You will have street numbers for houses and buildings, but still they belong to the same street, and so there has to be a consistent way of identifying the house number within the street.
IP PDU Header
So, when sending packets from one device to the other, packets need to contain information in terms of source and destination for that particular packet. That is how packets can be routed across a network of devices. Those devices will look at destination address and calculate the best path to get there. This information is inserted or included in the form of a header of the protocol data unit of the Internet layer. Because of the IP protocol, this protocol data unit happens to be a packet. Knowing that the hierarchy is built into the addresses, then devices like routers can understand that hierarchy and route packets correctly. Similar to what a telephone switch, for example, would do by just looking at the first three numbers or digits on the telephone number, understanding them as an area code and then routing the call correctly to or toward that area code,in a similar fashion, routers will look at the network destination and be able to route correctly toward that destination without even have to read the whole destination address. Other components of the IP header include the type of service for quality of service and the time to live to prevent packets from looping around the network forever. It is sort of an expiration data for the packet.
IP Address Format
In terms of the structure of the IP address, this is a 32-bit word or a string of 32 ones and zeroes. Again, part of this address is going to be the host ID, or part of this address will be the network ID. The binary format is ideal for routers, but we human beings are not that smart, so we require something simpler and something we can remember. That is why we split the 32-bit words into four octets or bytes, where each octet is comprised of 8 bits. Furthermore, we convert those binary octets into decimal numbers. The process of conversion is part of the objectives of this course, and we will detail it later. So, the 32-bit word becomes 4 bytes, which become decimal numbers. We separate those numbers with dots and that becomes a dotted decimal notation that we typically use to refer to IP addresses.
The question becomes: how do we identify the network portion of the address and the host portion of the address?
In the early days of the Internet, the IANA, or Internet Assigned Numbers Authority, came up with the classful addressing scheme in which the class of the address defines the number of bits dedicated to the network ID, and the number of bits dedicated to the host ID, as well as the boundary between the two in or within the IP address. The address classes were identified and defined by a bit sequence at the start of the first octet. And so, just by looking at the first octet, you can tell which class we are talking about. All addresses starting with a zero. In the most significant bit of the first octet will be a class A address. Class A addresses reserve the first octet to represent the network ID while the second, third, and fourth octets represent the host ID. This made sense in the early Internet because we had very few networks with a large number of hosts, typically universities, government, and military sites. Class B addresses are identified by a one and a zero in the first two bits of the first octet, and they reserve two bytes for the network and two bytes for the host. Similarly, class C start with 110 and reserve three octets for the network and one octet for the host. In the end, building an IP address means assigning unique host identifiers to devices within a network, and then giving them all the same network ID because they belong to the same network, similar to house numbers that are different within the street, but the street name is the same.
IP Address Ranges
Two takeaways from the classful strategy: one, as human beings are either not too smart or too lazy to identify the bit sequence in the first octet, and so we convert that to decimal numbers and that gives us a good range of addresses or numbers to identify each class. So, the first octet is between 1 to 126, then we are talking about Class A. Just by looking at the first octet and seeing it between 128 and 191, we are talking about Class B. And, if the range of that first octet is 192 through 223, then this a Class C. Notice that some numbers are missing; 127 is nowhere to be found. Well, 127 is one of the reserved addresses that cannot be assigned to a network and is used for loopback testing. The second takeaway is that we are still working with a finite number of bits, and so the more octets we use for the network, the fewer bits we are going to have for the host and vice versa. And so, if class A reserve 1 byte for the network and three for the host, then we have that number of possible hosts that can be represented with a class A network. Class B has that number, and Class C, and provide up to 254 hosts. This one is surprising due to the fact that class C reserves one octet 8 bits to the host and two to the eighth power, according to binary logic, results in 256 numbers. So initially and conceptually, I should be able to represent up to 256 hosts for a class C. However, there are some reserved addresses that cannot be used to assign to devices.
|IP Address Class||First Octet Binary Value||First Octet Decimal Value||Possible Number of Hosts|
|Class A||1 - 126||00000001 to 01111110||16 777 214|
|Class B||128 - 191||10000000 to 10111111||65 534|
|Class C||192 - 223||11000000 to 11011111||254|
All zeroes in the host portion of an IP address represent the network itself. For example, if I have the 10.0.0.0 address, this cannot be assigned to a device; this represents the network 10 itself. It's got all zeroes in the host portion. Similarly, all ones in the host portion of the address is also reserved. It represents a broadcast within that network. A broadcast is nothing more than information that will reach all devices, so broadcast destination is heard and processed by all devices. All ones, in one octet is translated into the number 255 in decimal notation. So, for example, the address 22.214.171.124 represents a broadcast in the network 200.1.1. 255 again is all ones in the host portion of the address. This type of broadcast is considered a directed broadcast in that network. However, the biggest broadcast is all ones in all bits. This is what is called a local broadcast, and local broadcasts are nonroutable.
Public IP Addresses
The Internet is the network of networks, the ultimate public network that interconnects devices globally. Following basic IP rules, those devices will need to have a unique IP address, this time, again globally, worldwide. Duplication of addresses would cause instability in the Internet, as information may reach the wrong destination if it is duplicated, or to different sources with the same IP would cause inconsistencies at the destination level. The IANA, or Internet Assigned Numbers Authority, created these ranges of public IP addresses per class. With that, they guarantee that there is no duplication, and everything is controlled by a central authority for IP address assignments. If you want to obtain an IP address, public in the Internet in unique, you have to contact IANA and make the formal request. Soon enough, this was distributed in the centralized and multiple authorities raised geographically located, and so, APNIC allocates IP addresses for Asia Pacific geographies. ARIN for the Americas, and RIPE for Europe.
Private IP Addresses
With the volume of devices out in the public network, it became apparent that the 32 bits on the IPv4 IP address would not be sufficient. IPv4 is a current version of IP commercially available and operational on the Internet. The newer IPv6 is starting to gain ground, and soon enough will become the standard on that network. Meanwhile, intermediate solutions were found to allow for more and more devices to obtain an IP address without it needing to be public. The private address ranges listed here for class A, B, and C can be used internally, and the organizational network allocated and assigned according to organizational rules, which are independent of the Internet and then translated to a public address when traffic or packets needed to access a public network. While within the confines of the organizational network, the private addressing can be used when going to the public network, they would have to obtain an public IP address. This process of translation is called NAT, or network address translation. The private address ranges do not have any meaning on the Internet and are not routable on that network, meaning that IP packets with those addresses as a source or destination will be basically dropped on Internet routers. These private addresses are defined on RFC 1918.
|Class||Private Address Range|
|A||10.0.0.0 to 10.255.255.255|
|B||172.16.0.0 to 172.31.255.255|
|C||192.168.0.0 to 192.168.255.255|
Once you have completed your design of IP addresses, you can now allocate, and assign, and configure IP addresses on devices. You would have to follow basic rules. Let's say, all machines or devices in one's network will need to have the same network ID and unique host IDs. The configuration of IP addresses in devices can become cumbersome and difficult to manage, depending on the volume and number of devices. That is why we have protocols such as DHCP, or Dynamic Host Configuration Protocol. This protocol is used to automatically assign IP addresses without human intervention. It uses a central server containing and maintaining all the scopes and ranges of available IP addresses for multiple machines and multiple segments. IP addresses are leased to machines and have a certain expiration time in which time the machine itself will have to renew the lease. Those machines are born without an IP address, and they simply request it from the server. This is done with a series of calls and messages exchanged between clients and servers in order to obtain reserve, allocate, and grant an IP address.
Another support protocol is the Domain Name System, or DNS. This is an application specified in the TCP/IP suite, and it is there due to our propensity as human beings to use things we can remember and utilize in technology. And so, when connecting to a certain device, we want to call it by name and not have to remember its IP address. DNS is there to provide the translation, and allows to type what is known as a URL in our browsers in the form of a name that has a certain hierarchy, like www.ciscotests.org. Your machine will go out the network, find a DNS server, translate the name to an IP address, obtain the information, and then use the regular IP transport to contact the IP address.
In terms of monitoring and verifying the configuration, we could use the ipconfig command in the command-line interface of a Windows machine. This one would lease the IP address along with the subnet mask, default gateway, DHCP servers, and DNS servers, and information in terms of the lease expiration for our IP address. This is because the output also tells us that the network interface card, this time the Ethernet LAN connector, is enabled for DHCP. All these settings can be shown with the /all keyword of the IP config command. There are other keywords, like /release to release an IP address from the DHCP server, /renew to renew it and obtain an IP address, or /? to obtain help in using this command.