{"id":512,"date":"2012-03-02T19:51:35","date_gmt":"2012-03-02T19:51:35","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=512"},"modified":"2012-03-02T19:51:35","modified_gmt":"2012-03-02T19:51:35","slug":"how-the-internet-layer-works","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=512","title":{"rendered":"How the Internet Layer Works"},"content":{"rendered":"<p>In the previous section, we learned about the  Network Access layer. Essentially we learned more about the anatomy of a  frame, physical addressing, and what exactly the physical layer  accomplishes. Don\u2019t relax yet- we still have three layers to go!<\/p>\n<h3>What the Internet Layer Is Responsible For<\/h3>\n<p>The Internet Layer is used to deliver data on a complex  routed network. In some cases, we can get by with simply using physical  addressing. However, this would only work on extremely small LAN  connections that do not use routers. For anything bigger or more  complex, we will need to make use of the Internet Layer.<\/p>\n<p>The Internet Layer uses logical addressing, as compared to physical  addressing. Logical addresses can be read and forwarded among routers,  while physical addresses lack the routed functionality. The Internet  Layer is also responsible for identifying computers on any network so  that data can be successfully sent. Lastly, the Internet Layer is  responsible for converting the logical IP address of the destination  computer to a physical address, so data can be delivered to the correct  computer.<\/p>\n<p>Don\u2019t worry if this is an information overload- we\u2019ll cover all of these aspects more specifically later on in the section.<\/p>\n<h3>The Anatomy of an IP Datagram<\/h3>\n<p>Before we get into how the Internet Layer routes data,  we first have to know what it is routing exactly. Specifically, data at  this level is called a datagram. And from what we learned in previous  sections, we know the Internet Layer attaches an IP header onto data.  But what does this IP header consist of?<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.learn-networking.com\/wp-content\/oldimages\/ip-header-diagram.jpg\" alt=\"ip header diagram\" \/><\/p>\n<p>At first glance, this is a lot of information to digest. But don\u2019t be  dismayed- it is a lot simpler than you may think. Check below for  detailed information on each field.<\/p>\n<p><strong>IP Header Fields Explained<\/strong><\/p>\n<ul>\n<hr \/>\n<li><strong>1. Version &#8211;<\/strong> The version is a binary number that is  four bits long. It indicates which version of IP is being used.  Currently we are using IP version four, although IP version six will  soon make an impact on the networking world.<\/li>\n<li><strong>2. IHL (Internet Header Length) &#8211;<\/strong> The IHL simply measures the length of the IP header in 32-bit words. The minimum header length is five 32-bit words.<\/li>\n<li><strong>3. Type of Service &#8211;<\/strong> This field is for specifying  special routing information. This field in particular relates to Quality  of Service technologies quite well. Essentially, the purpose of this  8-bit field is to prioritize datagrams that are waiting to pass through a  router.<\/li>\n<li><strong>4. Total Length &#8211;<\/strong> This 16-bit field includes the length of the IP datagram. This length includes the IP header and also the data itself.<\/li>\n<li><strong>5. Identification &#8211;<\/strong> This is a 16-bit field that  acts as a means of organizing chunks of data. If a message is too large  to fit in one data packet, it is split up and all of its child packets  are given the same identification number. This is handy to ensure data  is rebuilt on the receiving end properly.<\/li>\n<li><strong>6. Flags &#8211;<\/strong> This field signifies fragmentation  options- such as whether or not fragments are allowed. The Flags field  also has capability to tell the receiving source that more fragments are  on the way, if enabled. This is done with the MF flag, also known as  the more fragments flag.<\/li>\n<li><strong>7. Fragment Offset &#8211;<\/strong> This is a 13-bit field that  assigns a number value to each fragment. The receiving computer will  then use these numbers to reassemble the data correctly. Obviously this  is only applicable if fragments are allowed.<\/li>\n<li><strong>8. Time to Live &#8211;<\/strong> This is often known as TTL. It is  a field that indicates how many hops a data packet should go through  before it is discarded. Every successful pass through a router, known as  a hop, decrements this field by one. When it reaches zero, it is  discarded.<\/li>\n<li><strong>9. Protocol &#8211;<\/strong> This 8-bit field indicates which  protocol should be used to receive the data. Some of the more popular  protocols such as TCP and UDP are identified by the numbers 6 and 17  respectively.<\/li>\n<li><strong>10. Header Checksum &#8211;<\/strong> This 16-bit field holds a  calculated value that is used to verify that the header is still valid.  Each time a packet travels through a router this value is recalculated  to ensure the header is still indeed valid.<\/li>\n<li><strong>11. <\/strong><strong>Destination <\/strong><strong>IP Address &#8211;<\/strong> This 32-bit field holds the IP address of the receiving computer. It is  used to route the packet and to make sure that only the computer with  the IP address in this field obtains the packets.<\/li>\n<li><strong>12. Source IP Address &#8211;<\/strong> This 32-bit field holds the  IP address of the sending computer. It is used to verify correct  delivery, and will also be the return address in case an error occurs.<\/li>\n<li><strong>13. IP Options &#8211;<\/strong> This field can hold a fair number  of optional settings. These settings are primarily used for testing and  security purposes. Although clever settings such as keeping timestamp  data from each router hop may seem handy, it will actually degrade speed  more often than not.<\/li>\n<li><strong>14. Padding &#8211;<\/strong> Since the IP options field varies in  length depending on the configuration, we need to have this field set to  occupy left over bits. This is because the header needs to be ended  after a 32-bit word: no more, no less.<\/li>\n<li><strong>15. Data &#8211;<\/strong> This is fairly self explanatory- it is simply the data that is being sent.<\/li>\n<\/ul>\n<p>The above diagram should be reviewed until a firm grasp is held on  the concept of an IP header. If you feel you have the concepts down well  enough, it\u2019s time to move onto routing the data!<\/p>\n<h3>Routing the Information with the IP Protocol and IP Addresses<\/h3>\n<p>The Internet Protocol, or IP, operates on the Internet  layer. This protocol provides a hardware-independent addressing system  in the form of IP addresses. For every Network Interface Card, or NIC,  there should be a unique IP address. After all, how could we send data  to a specific computer if more than one computer was using an IP  address?<\/p>\n<p>Look at the diagram below and see if you can tell any similarities between the IP addresses.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.learn-networking.com\/wp-content\/oldimages\/ip-address-similar.jpg\" alt=\"ip addresses\" \/><\/p>\n<p>You may have noticed that the first three numbers are identical in  each address. IP addresses are made up of two portions: the network ID  and the host ID. The network ID is responsible for telling other  computers which network the computer resides on (useful if we are using  subnets or multiple LAN segments). The host portion tells us which  specific computer on the network the computer is. In terms of an actual  home address, the network ID would be the street of your home- while the  host ID would be the house number.<\/p>\n<p>IP addresses are divided by what are called octets, or simply 8-bit  segments. IP addresses also use dotted decimal format: meaning each  octet is separated by a period. For every IP address there are four  octets. If you do the math right, you will find that each IP address is  32 bits in size (four octets of eight bits each). Refer to the diagram  below for more information.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.learn-networking.com\/wp-content\/oldimages\/ip-address-layout.jpg\" alt=\"ip addresses\" \/><\/p>\n<p>In case you needed proof that each IP address is 32 bits, count each  one and zero in the binary format. Each 1 or 0 is a bit. Since there are  8 bits in a byte, we can also say that each IP address is 4 bytes in  size.<\/p>\n<p>But we aren\u2019t done yet! Each IP address belongs to a class. You will  likely only see three classes on an average basis: Class A, Class B, and  Class C. These classes dictate which network type an IP address is. We  never actually said which part of the IP address was the network ID and  which was the host ID- so how do we know where the network ID starts and  where the host ID begins? Classes of course! Review the diagram below  for more information.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.learn-networking.com\/wp-content\/oldimages\/network-ranges.jpg\" alt=\"ip addresses\" \/><\/p>\n<p>Notice that each class is dictated through the first octet\u2019s value.  However, there is more going on behind the scenes that we are aware of  with the above diagram. Each class has a specific amount of network and  host octets. Review the diagram below for more information.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.learn-networking.com\/wp-content\/oldimages\/ip-address-classes.jpg\" alt=\"ip addresses\" \/><\/p>\n<p>Remembering the network octets is easy- simply remember that each  class from A to C adds a network octet. Keep in mind that Class D and  Class E addresses exist, but for the sake of simplicity, we will not  cover them just yet since you\u2019ll likely not use one anytime soon. For  now, we have one more thing to learn about concerning IP addresses:  reserved IP addresses.<\/p>\n<h3>Reserved IP Addresses<\/h3>\n<p>There are certain IP addresses that are reserved;  meaning they have a special purpose. For instance, you can\u2019t use all  zeroes for the host octets, since this is the actual network address.  (The Class C address 192.168.2.0 is not usable, for instance.) We also  may not use the broadcast address- which is simply represented as all  1\u2019s in binary, or 255 in decimal. (The Class C address 192.168.2.255 is  not usable, for instance.) Don\u2019t worry- we will cover broadcast  addresses more thoroughly in later sections. Lastly, you may not use the  127.0.0.1 address since it is a loopback address- mainly used for  testing and troubleshooting.<\/p>\n<p>There are certain IP addresses that are used for private networks,  meaning that they aren\u2019t for internet use. These addresses, therefore,  don\u2019t have to be unique and can be used for network use. These private  addresses are:<\/p>\n<p><strong>Reserved IP Addresses<\/strong><\/p>\n<ul>\n<hr \/>\n<li> <strong>1.<\/strong> 10.0.0.0 to 10.255.255.255<\/li>\n<li><strong>2.<\/strong> 172.16.0.0 to 172.31.255.255<\/li>\n<li><strong>3.<\/strong> 192.168.0.0 to 192.168.255.255<\/li>\n<hr \/>\n<\/ul>\n<p>Use these addresses however you see fit on your own network- but also  know that since these are private addresses, you may not access the  internet with them.<\/p>\n<h3>Last but not Least, ARP and RARP<\/h3>\n<p>We certainly have covered a lot so far! Don\u2019t worry- we  only have ARP and RARP to review for now. The Address Resolution  Protocol, or ARP, is used to map IP addresses to physical addresses. To  actually deliver data to a computer we use its physical address. You may  remember that every physical address is unique and is burned into the  NIC card at the factory.<\/p>\n<p>Your Network InterfaceCard is actually a fairly dumb device. All it  does when receiving data is look at incoming information and check to  see if it is addressed to it or not. Ironically, it doesn\u2019t even know  its own IP address! Since we can\u2019t depend on the NIC card we use ARP  tables, otherwise known as the ARP cache.<\/p>\n<p>The best part of the situation is that ARP tables are built  dynamically- no need to configure anything normally. These ARP tables  will associate physical addresses to logical addresses, and will be used  to route data to specific computers. But what if there aren\u2019t any  addresses in the ARP tables, yet we have data being sent to a computer  on a network? In this instance, the host sends a broadcast called an ARP  request frame.<\/p>\n<p>The ARP request frame contains IP address and physical address  information for the host that sent the request. Other hosts on the  network receive the ARP request, and hopefully the unresolved IP address  is found out. If it is, a new entry into the ARP table is made. This  happens more than you\u2019d think since ARP tables actually expire after a  certain amount of time.<\/p>\n<p>Simple enough, right? Next we have RARP, which can be simply seen as  the opposite of ARP. It technically stands for Reverse ARP, so you  wouldn\u2019t be wrong in believing this. RARP is used when the IP address is  known, but the physical address isn\u2019t.<\/p>\n<h3>Closing Comments<\/h3>\n<p>We certainly got through a lot of information! If you haven\u2019t  noticed, the Internet Layer is a lot more complex than the physical  layer. In the next section we will take a look at the Transport Layer in  particular. It is highly recommended that you read our subnetting  article before continuing. If you feel you have a firm grasp on the  subnetting concept, you may continue to the next section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous section, we learned about the Network Access layer. Essentially we learned more about the anatomy of a frame, physical addressing, and what exactly the physical layer accomplishes. Don\u2019t relax yet- we still have three layers to go! What the Internet Layer Is Responsible For The Internet Layer is used to deliver data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-512","post","type-post","status-publish","format-standard","hentry","category-networking-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=512"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":513,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/512\/revisions\/513"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}