{"id":2014,"date":"2019-06-22T20:23:45","date_gmt":"2019-06-22T20:23:45","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=2014"},"modified":"2020-05-06T23:09:28","modified_gmt":"2020-05-06T23:09:28","slug":"section-6-the-osi-network-layer","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=2014","title":{"rendered":"Section 6: The OSI Network Layer"},"content":{"rendered":"<p><a href=\"http:\/\/wiki.thomasandsofia.com\/?p=2002\">&lt; Section 5<\/a> | <a href=\"\/course-introduction\/\">Home<\/a> | <a href=\"http:\/\/wiki.thomasandsofia.com\/?p=2029\">Section 7 &gt;<\/a><\/p>\n<p>12% Complete<\/p>\n<h1>26: Introduction<\/h1>\n<h1>27: The IP header<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589462#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589462#overview<\/a><\/p>\n<h2>The Network Layer<\/h2>\n<ul>\n<li>The network Layer is responsible for routing packets to their destination and for QoS Quality of Service.<\/li>\n<li>IP (Internet Protocol) is the best known Layer 3 protocol.\u00a0 IPv4 is the focus of this section<\/li>\n<li>It is a connectionless protocol with no acknowledgements at Layer 3\n<ul>\n<li>This is controlled at Layer 4<\/li>\n<\/ul>\n<\/li>\n<li>Other Layer 3 Protocols include ICMP (Internet Control Message Protocol) and IPSec.<\/li>\n<\/ul>\n<h2>IP Addressing<\/h2>\n<ul>\n<li>IP addressing is a logical addressing scheme which is implemented at Layer 3.<\/li>\n<li>Network designers use IP addressing to partition the\u00a0 overall network into smaller &#8216;Subnets&#8217;<\/li>\n<li>This improves performance and security and makes troubleshooting easier.<\/li>\n<li>Layer 2 MAC addresses use one big flat addressing scheme.\u00a0 There is no logical separation between networks at Layer 2.\u00a0 It&#8217;s done at Layer 3.<\/li>\n<\/ul>\n<h2>Layer 3 Encapsulation<\/h2>\n<h3>Overview<\/h3>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/overview-clean.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2015\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/overview-clean.png\" alt=\"\" width=\"613\" height=\"261\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/overview-clean.png 613w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/overview-clean-300x128.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/overview-clean-150x64.png 150w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/a><\/p>\n<h2>\u00a0The IP Header (IPv4)<\/h2>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/ipheader.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2016\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/ipheader.png\" alt=\"\" width=\"469\" height=\"254\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/ipheader.png 469w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/ipheader-300x162.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/ipheader-150x81.png 150w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><\/p>\n<ul>\n<li>IP version type<\/li>\n<li>Size of Layer 3<strong> header<\/strong><\/li>\n<li>Type of service = QoS<\/li>\n<li>Total packet size<\/li>\n<li>ID used for fragment information for different media types\n<ul>\n<li>Includes the flags and fragment offset<\/li>\n<\/ul>\n<\/li>\n<li>TTL\n<ul>\n<li>Every time a packet hits a router, that router will decrement this value by one.\u00a0 Once a packet&#8217;s TTL reaches 0, that router will drop the packet.<\/li>\n<li>This helps prevent packet loops from getting lost forever and never reaching their destination<\/li>\n<li>8 bit protocol specifies the type of protocol (TCP, UDP, etc.)<\/li>\n<li>Checksum validates the packet has not been corrupted during transport.<\/li>\n<li>Source and Destination IPs (32 bits each)<\/li>\n<li>Header Options &#8211; Not commonly used<\/li>\n<li>Any remaining data for the packet.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>28: Unicast. Broadcast and Multicast<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589466#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589466#content<\/a><\/p>\n<h3>Three main types of IP traffic<\/h3>\n<ul>\n<li>Unicast:Goes to a single destination host<\/li>\n<li>Broadcast: Goes to all hosts on the subnet\n<ul>\n<li>You get it if you want it or not<\/li>\n<\/ul>\n<\/li>\n<li>Multicast: Sent to multiple hosts interested in the traffic\n<ul>\n<li>With Unicast and 3 destination hosts, a 1MB packet would be sent 3x, so 3MB total<\/li>\n<li>With Multicast, you only send 1MB but all interested hosts will receive it.\n<ul>\n<li>Think of listeners tuning into a radio station.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>29: How to Count in Binary<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589468#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589468#content<\/a><\/p>\n<p>128 64 32 16 8 4 2 1<\/p>\n<p>236 = 11101100<\/p>\n<h1>30: IPv4 Addressing<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589476#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589476#content<\/a><\/p>\n<p>IPv4 Address<\/p>\n<ul>\n<li>32 total bits<\/li>\n<li>Each &#8216;octet&#8217; (8 bits) is separated with a .\n<ul>\n<li>Each octet can be between 0 &#8211; 255<\/li>\n<\/ul>\n<\/li>\n<li>To see your IP address\n<ul>\n<li>Windows: ipconfig\n<ul>\n<li>also shows the default gateway and subnet mask<\/li>\n<\/ul>\n<\/li>\n<li>Linux\/Mac: ifconfig\n<ul>\n<li>show IP and subnet mask<\/li>\n<li>Default Gateway: ip route<\/li>\n<\/ul>\n<\/li>\n<li>IOS\n<ul>\n<li>IP address: show ip interface breif<\/li>\n<li>subnet mask: show interface\n<ul>\n<li>CIDR notation<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Static and Automatic addressing<\/p>\n<ul>\n<li>IP addresses are usually setup manually on servers, printers and network devices such as routers and switches.<\/li>\n<li>It is often setup automatically on PCs and Laptops using DHCP (Dynamic Host Configuration Protocol)<\/li>\n<\/ul>\n<h1>31: Calculating an IPv4 Address in Binary<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589478#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589478#content<\/a><\/p>\n<h2>IPv4 Octets<\/h2>\n<ul>\n<li>Octets range from 0 &#8211; 255<\/li>\n<li>Convert 192.168.10.15<\/li>\n<\/ul>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2020\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192.png\" alt=\"\" width=\"815\" height=\"160\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192.png 815w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192-300x59.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192-768x151.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192-150x29.png 150w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/168.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2021\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/168.png\" alt=\"\" width=\"810\" height=\"328\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/168.png 810w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/168-300x121.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/168-768x311.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/168-150x61.png 150w\" sizes=\"auto, (max-width: 810px) 100vw, 810px\" \/><\/a><\/p>\n<p>you get the picture<\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192168010015.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2022\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192168010015.png\" alt=\"\" width=\"798\" height=\"375\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192168010015.png 798w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192168010015-300x141.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192168010015-768x361.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/192168010015-150x70.png 150w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/a><\/p>\n<h1>32: The Subnet Mask<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589482?start=0#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589482?start=0#overview<\/a><\/p>\n<h2>Quick Count<\/h2>\n<ul>\n<li>1000 0000 = 128<\/li>\n<li>1100 0000 = 192<\/li>\n<li>1110 0000 = 224<\/li>\n<li>1111 0000 = 140<\/li>\n<li>1111 1000 = 148<\/li>\n<li>1111 1100 = 252<\/li>\n<li>1111 1110 = 254<\/li>\n<li>1111 1111 = 255<\/li>\n<\/ul>\n<h2>Subnet Masks<\/h2>\n<ul>\n<li>A host can send traffic to another host on the same subnet via switches<\/li>\n<li>For a host to send traffic to another host in a different subnet, it must be forwarded by a router\n<ul>\n<li>Routers link different subnets together<\/li>\n<\/ul>\n<\/li>\n<li>The host therefore needs to understand if the destination is on the same or a different subnet in order to know how to send it.\n<ul>\n<li>This is the purpose for the subnet mask<\/li>\n<\/ul>\n<\/li>\n<li>Subnet mask is also 32 bits long and can be written in dotted decimal or slash (CIDR) notation.<\/li>\n<\/ul>\n<h2>Network and Host Portions of an IP<\/h2>\n<ul>\n<li>A Hosts IP is divided into a network portion and a host portion<\/li>\n<li>The subnet mask defins where the boundary is\n<ul>\n<li>Let&#8217;s say the Host&#8217;s IP isd 192.168.10.15 and the subnet mask is 255.255.255.0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2025\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2.png\" alt=\"\" width=\"695\" height=\"123\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2.png 695w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2-300x53.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2-150x27.png 150w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/a><\/p>\n<ul>\n<li>The IP address is compared to the subnet mask.<\/li>\n<li>A &#8216;1&#8217; in the subnet mask means that bit in the IP address is part of the Network address<\/li>\n<li>A &#8216;0&#8217; in the subnet mask indicates that bit is part of the Host address<\/li>\n<li>In this example:\n<ul>\n<li>The network address is 192.168.10.0<\/li>\n<li>The host address is .15<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Local Subnet or Routed Traffic<\/h2>\n<ul>\n<li>if the host wants to communicate with another host with an IP address that also begins with 192.168.10. (for example, 192.168.10.20), it knows it&#8217;s on the same subnet and can send the traffic directly<\/li>\n<li>if the host wants to communicate with another host with any other address (for example, 192.168.11.20, different subnet), it knows it must send the traffic via a router.<\/li>\n<li>For a destination address to be in the same subnet, the network portion has to be exactly 192.168.10<\/li>\n<li>Otherwise it&#8217;s in a different subnet and the traffic must be sent via a router.<\/li>\n<\/ul>\n<h2>Valid Subnet Masks<\/h2>\n<ul>\n<li>The subnet mask always begins with contiguous &#8216;1&#8217;s<\/li>\n<li>For example:\n<ul>\n<li>11111111.11111000.00000000.00000000 is a legal subnet mask<\/li>\n<li>10101010.01010101.00000000.00000000 is not<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>The Host Portion<\/h2>\n<ul>\n<li>The host portion of the address is availabel to be allocated to the different hosts on the subnet.\u00a0 (PCs, Servers, Printers, Router Interfaces, etc.<\/li>\n<li>There are 2 exceptions to this rule:\u00a0 See Reserved Host IPs below\n<ul>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ul>\n<\/li>\n<li>The host portion of the address specifies the individual host and must be unique on that subnet<\/li>\n<li>Hosts DO NOT need to be numbered sequentially\n<ul>\n<li>On subnet 10.10.10.10 you can have a host with 10.10.10.10 and a host with 10.10.10.20<\/li>\n<\/ul>\n<\/li>\n<li>You cannot have two hosts with the same IP!<\/li>\n<li>You can have different hosts the same Host ID as long as they are on different subnets\n<ul>\n<li>10.10.10.10<\/li>\n<li>10.10.11.10<\/li>\n<li>10.10.20.10<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Reserved Host IPs<\/h2>\n<ul>\n<li>All &#8216;0&#8217;s in the host portion designates the Network Address and is not allowed to be allocated to a host\n<ul>\n<li>In our example, the network address is 192.168.10.0<\/li>\n<\/ul>\n<\/li>\n<li>All &#8216;1&#8217;s designates the directed BROADCAST address for the subnet.<\/li>\n<li>Traffic with this destination address will be sent to all hosts in the subnet\n<ul>\n<li>In our example, the broadcast address is 192.168.10.255<\/li>\n<\/ul>\n<\/li>\n<li>This leaves 192.168.10.1 &#8211; 192.168.10.254 for available Host IPs<\/li>\n<\/ul>\n<h1>33: Slash (CIDR) Notation<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589484#overview\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589484#overview<\/a><\/p>\n<ul>\n<li>Because the subnet mask must always begin with contiguous &#8216;1&#8217;s, it will be 1 to 32 bits long counting from the left to right<\/li>\n<li>This allows us to write the subnet mask in slash notation which is more convenient than dotted decimal for network diagrams or in conversation.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2025\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2.png\" alt=\"\" width=\"695\" height=\"123\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2.png 695w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2-300x53.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet2-150x27.png 150w\" sizes=\"auto, (max-width: 695px) 100vw, 695px\" \/><\/a><\/p>\n<ul>\n<li>255.255.255.0 = 24 bits required to create the subnet mask.\u00a0 This can now be displayed by yhr number of bits, or \/24<\/li>\n<li>So the IP and the subnet mask will be 192.168.10.15\/24<\/li>\n<li><strong>The Network Addresss is 192.168.10.0\/24<\/strong><\/li>\n<\/ul>\n<p>Example #2<\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2027\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet3.png\" alt=\"\" width=\"794\" height=\"144\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet3.png 794w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet3-300x54.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet3-768x139.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2019\/06\/subnet3-150x27.png 150w\" sizes=\"auto, (max-width: 794px) 100vw, 794px\" \/><\/a><\/p>\n<ul>\n<li>This can be written as either:\n<ul>\n<li>10.10.10.15 255.0.0.0<\/li>\n<li>10.10.10.15\/8<\/li>\n<\/ul>\n<\/li>\n<li><strong>The Network address is 10.0.0.0\/8<\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>F<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt; Section 5 | Home | Section 7 &gt; 12% Complete 26: Introduction 27: The IP header https:\/\/www.udemy.com\/cisco-icnd1\/learn\/lecture\/8589462#overview The Network Layer The network Layer is responsible for routing packets to their destination and for QoS Quality of Service. IP (Internet Protocol) is the best known Layer 3 protocol.\u00a0 IPv4 is the focus of this section ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=2014\" title=\"read more...\">Read more<\/a><\/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-2014","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2014"}],"version-history":[{"count":8,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2014\/revisions"}],"predecessor-version":[{"id":2855,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2014\/revisions\/2855"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}