{"id":2691,"date":"2021-06-11T12:16:18","date_gmt":"2021-06-11T06:46:18","guid":{"rendered":"https:\/\/binaryterms.com\/?p=2691"},"modified":"2021-06-11T16:39:39","modified_gmt":"2021-06-11T11:09:39","slug":"packet-forwarding","status":"publish","type":"post","link":"https:\/\/binaryterms.com\/packet-forwarding.html","title":{"rendered":"Packet Forwarding"},"content":{"rendered":"<p><strong>Packet forwarding<\/strong> is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks. A packet may belong to the same network as of source host or it may be for the destination host in a different network. So, a packet from a source host may have to travel many networks before reaching the destination.<\/p>\n<p>Packet forwarding is the responsibility of the router where the router has to accept the packet from the source host or a router in the path of the packet and place it on the route heading towards the destination host.<\/p>\n<h2>Packet Forwarding<\/h2>\n<ol>\n<li><a href=\"#ForwardingBasedonDestinationAddress\">Forwarding Based on Destination Address<\/a>\n<ul>\n<li><a href=\"#ForwardingTechniques\">Forwarding Techniques<\/a><\/li>\n<li><a href=\"#ForwardingProcess\">Forwarding Process<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#ForwardingBasedonlabel\">Forwarding Based on Label<\/a><\/li>\n<\/ol>\n<p><a name=\"ForwardingBasedonDestinationAddress\"><\/a><\/p>\n<h3>Forwarding Based on Destination Address<\/h3>\n<p>Packet forwarding based on the destination address requires the source host and routers in the path of the packet to have the routing table. Whenever the host is ready with the packet to be sent or the router receives a packet to forward it to the next router or the destination host, they look up the routing table to decide the route of the packet toward the destination host.<\/p>\n<p>But nowadays Internet has grown too far, so many entries in routing make the table lookup inefficient. There are several techniques to minimize the size of the routing table and also manage the security of the routing table.<br \/>\n<a name=\"ForwardingTechniques\"><\/a><\/p>\n<h4>Forwarding Techniques<\/h4>\n<p><strong>1. Next-Hop Method<\/strong><\/p>\n<p>The next-hop method minimizes the size of the routing table by just keeping the details of the <strong>next hop<\/strong> or next router in the path of the packet. Here the routing table does not involve the information about the entire route the packet has to follow.<\/p>\n<p><strong>2. Network-Specific Method<\/strong><\/p>\n<p>Here the routing table does not have an entry for all the destination hosts in the network connected to the router. Instead, it has an entry of the destination networks itself connected to the router.<\/p>\n<p><strong>3. Host-Specific Method<\/strong><\/p>\n<p>It is the reverse of the network-specific method. Here the routing table has an entry for all the destination hosts in the destination network. It reduces the efficiency of the routing table as the size of the routing table is increased. It is usually used for checking the routes and for security purposes.<\/p>\n<p><strong>4. Default Method<\/strong><\/p>\n<p>Consider the situation that a host in a network N<sub>1<\/sub> is connected to two routers where one router R<sub>1<\/sub> is connected to the network N<sub>2<\/sub> and another router R<sub>2<\/sub> connects it to the rest of the internet. So here the routing table has only one entry for the router R<sub>2<\/sub> as a default entry.<br \/>\n<a name=\"ForwardingProcess\"><\/a><\/p>\n<h4>Packet Forwarding Process<\/h4>\n<p><strong>1. Forwarding with Classful Addressing<\/strong><\/p>\n<p>In classful addressing the entire address, space is divided into classes we have studied this in our previous content <a href=\"https:\/\/binaryterms.com\/classful-addressing-in-ipv4.html\" target=\"_blank\" rel=\"noopener noreferrer\">classful addressing<\/a>. The classful addressing has a default mask which makes the packet forwarding easier. We will see packet forwarding in classful addresses with and without subnetting.<\/p>\n<p><strong>a. Forwarding without Subnetting<\/strong><\/p>\n<p>Routers on the global Internet using classful addressing do not perform subnetting. Usually, subnetting is performed inside an organization. Packet forwarding module where subnetting is not involved includes three tables where each table represents a unicast class (A, B, C).<\/p>\n<p>If the routers of the global internet support multicasting a new table is added to handle the class D address. With the different routing tables for each class searching the routing table for next-hop becomes easier. Let us see the structure of the routing table.<\/p>\n<p>In the points below we will discuss the columns of the routing table:<\/p>\n<ul>\n<li>The first column is the network address which defines the address of the network to which the destination host belongs.<\/li>\n<li>The second column is of next-hop which specifies the address of the next router in the path of the packet if it is an indirect delivery. In case it is the direct delivery the next-hop column is empty.<\/li>\n<li>The third column specifies the interface number. The router has many outgoing ports, where each outgoing port connects the router to a different port. Each connection has a different numbered port which we refer to as interface number.<\/li>\n<\/ul>\n<p>The following steps describe the forwarding module that is used to forward packets in the classful addressing where subnetting is not involved.<\/p>\n<ol>\n<li>From the packets header, the destination address is determined.<\/li>\n<li>The destination address is used to determine the class of the address.<\/li>\n<li>After identifying the class of the address, the destination address and class are combinedly used to extract the network address.<\/li>\n<li>Now the class of the destination address is used to decide which table among the three must be referred and the network address extracted is used to determine the next-hop and interface number.<\/li>\n<li>The next-hop (logical address of next router) and interface number are provided to ARP to determine the physical address of the next router.<\/li>\n<\/ol>\n<p><strong>b. Forwarding with Subnetting<\/strong><\/p>\n<p>Subnetting always happens inside the organization and the routers handling the subnetting are either at the boundary of the organization or just inside the border of the organization.<\/p>\n<p>If the variable length subnetting is used then several routing tables will be used else only one routing table will do the work. For the fixed-length subnetting the following steps are used to forward the packet.<\/p>\n<ol>\n<li>First, the destination address is extracted from the packet\u2019s header.<\/li>\n<li>If the extracted destination address goes with any of the host addresses in the table, then the destination address and the mask are used together to determine the subnet address.<\/li>\n<li>Using subnet address as index the next-hop and interface number are determined.<\/li>\n<li>The next-hop address and the interface number are provided to the ARP protocol to determine the physical address of the next hop.<\/li>\n<\/ol>\n<p><strong>2. Forwarding with Classless Addressing<\/strong><\/p>\n<p>In the classless addressing, there is no division of address space into the classes. We have studied classless addressing, in our previous content <a href=\"https:\/\/binaryterms.com\/classless-addressing-in-ipv4.html\" target=\"_blank\" rel=\"noopener noreferrer\">classless addressing<\/a> So, the address of the destination does not provide any information about the destination network. To overcome this issue, we require masking.<\/p>\n<p>So, the routing table of in-classless addressing requires one more column as compared to classful addressing i.e., mask column.<\/p>\n<p><strong>a. Address Aggregation<\/strong><\/p>\n<p>Address Aggregation is similar to subnetting. A set of addresses or a block of addresses are summarized in the routing entries to minimize the size of the routing table.<\/p>\n<p><strong>b. Longest Mask Matching<\/strong><\/p>\n<p>The longest mask matching helps the IP router to select an entry from the routing table. An entry in the routing table may specify a subnetwork. In this case, a destination address may do with more entries. Among these entries, the entry with the longest subnet mask is the most specific one. An this is called longest mask matching.<\/p>\n<p><strong>c. Hierarchical Routing<\/strong><\/p>\n<p>To reduce the size of the routing table, a hierarchy can be implemented in the routing table. Hierarchical routing is achieved by organizing routers in some hierarchy. This reduces the complexity of the network and even increases the routing efficiency.<\/p>\n<p><strong>d. Geographical Routing<\/strong><\/p>\n<p>To further minimize the size of the routing table, above hierarchical routing, geographical routing must be practiced. The geographical routing divides the entire space in the world into few large blocks. For example, we divide the space into blocks such as America, Africa, Asia, Europe, and so on.<\/p>\n<p>In this case, there will be only one entry for Asia, one entry for Europe, one for America, and so on in the routing table.<br \/>\n<a name=\"ForwardingBasedonlabel\"><\/a><\/p>\n<h3>Forwarding Based on Label<\/h3>\n<p>To send IP packets in a connection-oriented fashion the routing was replaced by the switching. We had studied the switching process in our earlier content <a href=\"https:\/\/binaryterms.com\/ip-over-atm.html\" target=\"_blank\" rel=\"noopener noreferrer\">IP Over ATM<\/a>.<\/p>\n<p>In routing, the destination address present in the header of the packet is used to forward the packet. In the switching process, the switch forwards the packet by analyzing the label attached to it. The label contains the identifiers that define which specific virtual path and virtual circuit the packet has to follow.<\/p>\n<p><strong>1. Multiprotocol Label Switching<\/strong><\/p>\n<p>During 1980 most of the vendors were launching the routers with switching technology. Considering this a new protocol was approved which is multi-protocol label switching (MPLS). This packet forwarding technology uses the label to forward the packet.<\/p>\n<p>The MPLS protocol can convert the routing network to an appropriate switching network. So, when required the MPLS router can forward the packet using the destination address and when required it can forward the packet based on the label attached to it.<\/p>\n<p><strong>2. Hierarchical Switching<\/strong><\/p>\n<p>A packet can have stacks of labels for this the MPLS protocol allows hierarchical switching which is similar to hierarchical routing. The top label of the packet is used to route the packet outside the enterprise and the bottom label is used to route the packet inside the enterprise to reach the destination subnet.<\/p>\n<p>So this is all about packet forwarding, we have seen how this is done using a destination address or a label attached to the packet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks. A packet may belong to the same network as of source host or it may be for the destination host in a different network. So, a packet from a source host may [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[5],"tags":[],"class_list":{"0":"post-2691","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-computer-networks","7":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Packet Forwarding? Two Methods - Binary Terms<\/title>\n<meta name=\"description\" content=\"Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/binaryterms.com\/packet-forwarding.html\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Packet Forwarding? Two Methods - Binary Terms\" \/>\n<meta property=\"og:description\" content=\"Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/binaryterms.com\/packet-forwarding.html\" \/>\n<meta property=\"og:site_name\" content=\"Binary Terms\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-11T06:46:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-11T11:09:39+00:00\" \/>\n<meta name=\"author\" content=\"Neha T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Neha T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/binaryterms.com\/packet-forwarding.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/packet-forwarding.html\"},\"author\":{\"name\":\"Neha T\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\"},\"headline\":\"Packet Forwarding\",\"datePublished\":\"2021-06-11T06:46:18+00:00\",\"dateModified\":\"2021-06-11T11:09:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/binaryterms.com\/packet-forwarding.html\"},\"wordCount\":1476,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"articleSection\":[\"Computer Networks\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/binaryterms.com\/packet-forwarding.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryterms.com\/packet-forwarding.html\",\"url\":\"https:\/\/binaryterms.com\/packet-forwarding.html\",\"name\":\"What is Packet Forwarding? Two Methods - Binary Terms\",\"isPartOf\":{\"@id\":\"https:\/\/binaryterms.com\/#website\"},\"datePublished\":\"2021-06-11T06:46:18+00:00\",\"dateModified\":\"2021-06-11T11:09:39+00:00\",\"description\":\"Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks.\",\"breadcrumb\":{\"@id\":\"https:\/\/binaryterms.com\/packet-forwarding.html#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryterms.com\/packet-forwarding.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryterms.com\/packet-forwarding.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryterms.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Packet Forwarding\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryterms.com\/#website\",\"url\":\"https:\/\/binaryterms.com\/\",\"name\":\"Binary Terms\",\"description\":\"The Computer Science &amp; IT Guide\",\"publisher\":{\"@id\":\"https:\/\/binaryterms.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryterms.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/binaryterms.com\/#organization\",\"name\":\"Binary Terms\",\"url\":\"https:\/\/binaryterms.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"contentUrl\":\"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png\",\"width\":400,\"height\":63,\"caption\":\"Binary Terms\"},\"image\":{\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe\",\"name\":\"Neha T\",\"url\":\"https:\/\/binaryterms.com\/author\/author\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is Packet Forwarding? Two Methods - Binary Terms","description":"Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/binaryterms.com\/packet-forwarding.html","og_locale":"en_GB","og_type":"article","og_title":"What is Packet Forwarding? Two Methods - Binary Terms","og_description":"Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks.","og_url":"https:\/\/binaryterms.com\/packet-forwarding.html","og_site_name":"Binary Terms","article_published_time":"2021-06-11T06:46:18+00:00","article_modified_time":"2021-06-11T11:09:39+00:00","author":"Neha T","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Neha T","Estimated reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/binaryterms.com\/packet-forwarding.html#article","isPartOf":{"@id":"https:\/\/binaryterms.com\/packet-forwarding.html"},"author":{"name":"Neha T","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe"},"headline":"Packet Forwarding","datePublished":"2021-06-11T06:46:18+00:00","dateModified":"2021-06-11T11:09:39+00:00","mainEntityOfPage":{"@id":"https:\/\/binaryterms.com\/packet-forwarding.html"},"wordCount":1476,"commentCount":0,"publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"articleSection":["Computer Networks"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/binaryterms.com\/packet-forwarding.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/binaryterms.com\/packet-forwarding.html","url":"https:\/\/binaryterms.com\/packet-forwarding.html","name":"What is Packet Forwarding? Two Methods - Binary Terms","isPartOf":{"@id":"https:\/\/binaryterms.com\/#website"},"datePublished":"2021-06-11T06:46:18+00:00","dateModified":"2021-06-11T11:09:39+00:00","description":"Packet forwarding is the process of directing the packet towards its destination. As we know that Internet is a combination of several networks.","breadcrumb":{"@id":"https:\/\/binaryterms.com\/packet-forwarding.html#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryterms.com\/packet-forwarding.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/binaryterms.com\/packet-forwarding.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryterms.com\/"},{"@type":"ListItem","position":2,"name":"Packet Forwarding"}]},{"@type":"WebSite","@id":"https:\/\/binaryterms.com\/#website","url":"https:\/\/binaryterms.com\/","name":"Binary Terms","description":"The Computer Science &amp; IT Guide","publisher":{"@id":"https:\/\/binaryterms.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryterms.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/binaryterms.com\/#organization","name":"Binary Terms","url":"https:\/\/binaryterms.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/","url":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","contentUrl":"https:\/\/binaryterms.com\/wp-content\/uploads\/2020\/05\/binary-terms-logo1.png","width":400,"height":63,"caption":"Binary Terms"},"image":{"@id":"https:\/\/binaryterms.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/binaryterms.com\/#\/schema\/person\/e495f1d57f5c0a4c521cc3dba95661fe","name":"Neha T","url":"https:\/\/binaryterms.com\/author\/author"}]}},"_links":{"self":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/2691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/comments?post=2691"}],"version-history":[{"count":15,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/2691\/revisions"}],"predecessor-version":[{"id":2706,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/posts\/2691\/revisions\/2706"}],"wp:attachment":[{"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/media?parent=2691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/categories?post=2691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryterms.com\/wp-json\/wp\/v2\/tags?post=2691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}