








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









In this chapter we will make an important distinction between forwarding and routing. Forwarding is transferring a packet from an incoming link to an outgoing link within a single router. Routing involves all of the network's routers, whose collective interactions determine the path that packets take from source to destination. Routing is calculated via routing algorithms. Every router has a forwarding table. A router forwards a packet by examining the value of a field in the header and compares them to the values in his forwarding table with the corresponding outgoing link. These forwarding tables are determined by the routing algorithms. There is a small difference between link-layer switches and other switches. Link-layer switches base their forwarding decision on values in the field of the link-layer frame. Other routers base it on values in the network-layer field. The network service model defines the characteristics of end-to-end transport between hosts. There are three important network service models:
Just like how the transport layer can provide connectionless application service (UDP) and connection-oriented application service (TCP), can the network layer also provide the two. There are however some crucial differences:
While the Internet is a datagram network, many other networks are virtual-circuits. A VC consist of (1) a path between host and destination, (2) VC numbers, a number for each link in the path and (3) entries in the forwarding tables in each router in the path. A packet belonging to a VC has a VC number in its header. Because each link has its own VC number the router has to change passing packets their VC number. But why does the packet not just keep its VC number? By replacing the VC number we reduce the length of the VC header. We can agree to a common VC number for all links in the path but that would take a lot of messages to communicate through all the participating routers and links. There for it is way easier to randomly select VC numbers for links and just adjust them after each router. A VC network has to maintain connection state information for ongoing connections. Specifically, each time a VC connection is requested, an entry is made in the forwarding table, and when a VC connection is terminated, an entry is deleted. It is crucial whether or not a router maintains connection state information. The VC setup looks awfully a lot like the TCP setup. However there is one big difference between them. While in the transport layer setup there are only two end hosts that determine the parameters, like initial sequence numbers or cwnd sizes. Although the two end systems are aware of the transport-layer connection, the routers in the network layer are complete unaware of it. In a VC network though, the routers are fully aware of the VC connection. Messages that the VC needs to setup/change/close the the connection are called signaling messages with their own signaling protocols. In a datagram network, each time an end system wants to send a packet, it has to stamp the destination address on it and push it into the network. The packet just goes through routers and with their forwarding tables they send the packet the right way. The address printed on the packet is a certain amount of bits long. With 32 you have 4 billion possibilities so how do we find the correct one? We use a prefix in the forwarding tables. If an IP address comes by that fits the prefix, it is send to that corresponding link. When an IP address matches multiple prefixes, the router follows the rule of the longest prefix matching rule. The longer the prefix matches, the more accurate you are to your destination. The roots of a VC network is that from the telephony world where they use real circuits. The datagram network however was created out of necessity to connect computers. Because the Internet's is the best-effort service model results in minimum requirements for interconnecting networks.
A generic router has four components:
In this paragraph we will discuss both IPv4 and IPv6. First we will take a look at the Ipv4 datagram found on the next page:
Each IP datagram is encapsulated within a link-layer protocol which limits the length of an IP datagram. Suppose you are a router and you receive an IP datagram that is too big for it's output port. You split the IP datagram into smaller IP datagrams, called fragments, and passes those down to the link layer. The smaller datagrams are reassembled at the destination. For the end host at the destination to reassemble the fragments Ipv4 has Identifier, flags, fragmentation offset as help. The Identifier is like the group name from the larger IP datagram, the flags are for indicating whether this is the last IP fragment or not and fragmentation offset is for indicating where this datagram fits in the original datagram. Fragmentation does have its costs. First it complicates the routers and end systems which now has to accommodate datagram fragmentation and reassembly. And secondly, fragmentation can be used for a lethal DoS attack. By sending packets with none of the fragmentation offset on 0, which causes the target to collapse trying to reconstruct degenerated packets. When a host wants to send something, it does it via its link. The boundary between host and link is called an interface. Because every host is capable of sending and receiving IP datagrams, IP requires everybody to have its own IP address. An IP address is 32 bits long and is written in dotted-decimal notation. Where each byte is separated by a dot. Each interface on every host and router has to have a globally unique IP address. A subnet is a network of partly the same IP addresses. For example: 223.1.1.0/24. The /24 is known as the subnet mask, it indicates that the leftmost 24 bits of the 32 bit address define the subnet's address. The subnet 223.1.1.0/24 thus consists of the three host interfaces (223.1.1.1, 223.1.1.2, and 223.1.1.3) and one router interface (223.1.1.4) The Internet's address assignment strategy is known as Classless Inter Domain Routing (CIDR). Organizations often get or buy their own subnet. The part indicating the subnet's domain, /24, could also be seen as a prefix. Only the prefix is considered by routers for outside the organization's network. When accessing something in your own organization you would not need the prefix because the remaining of the 32 bit after the prefix determines the specific host. Before CIDR was adopted we used a classfull addressing. There were classes with subnets. For example: class C(/8) has 254 hosts and class B(/16) has 65.000 hosts. This was a problem because class C was mostly too small but class B too big. Sending a message to 255.255.255.255 is sending it to everyone in the subnet.
Below this paragraph is an image of an IPv6 datagram and here are its specifications:
Al this talking about IP and so but what about it's security? For securing IP we use the IPsec. IPsec is compatible with IPv4 and IPv6 and only one of the hosts needs to have it for IPsec to run over the entire track. IPsec provides the following services:
The first router a host sends his datagram to is its default router/ first-hop router / source router and the last router is the destination router. Given that there are costs assigned to edges it is only natural to find the least-cost path to your destination. We define routing algorithms in two categories:
Bellman Ford found a interesting point. For Host A to reach Host C, it must first go to its direct neighbor, Host B. The least-cost path given in this formula: Where X is your starting point, C is the cost, V is your direct neighbor and Y is the destination. Host Z now updates its tables and sees that for Host Y to Host A changed from 5 to 6. Now calculating his distance to X: This will go on and one until the path is longer than going from X to Z over the link that costs 50. This is the count-to-infinity problem. The problem mentioned above here can be fixed by using a technique called poisoned reverse. If Host Z routes through Host Y to get to Host X, then Host Z will advertise to Host Y that from him to Host X the distance is equal to infinity. Host Z is telling Host Y a lie as long as Host Y routes via himself to Host X. This however is only applied on three or less nodes. In distance vector, each node talks only to its direct connected neighbors, but it provides them the least-cost path from itself to all other known nodes. In the LS algorithm, each node talks with all other nodes, but only tells them the costs of their direct links. Lets compare them next to each other:
How we have viewed the routing systems until now is not entirely realistic. As the numbers of routers become larger, the amount of memory needed to store routing information in every single router would be enormous. It is also desirable to run and administer your network whilst being connected to the Internet. Both of these issues can be fixed when organizing routers into autonomous systems (ASs). Routers in the same group run the same routing algorithm. The routing algorithm running within an autonomous system is called an intra-autonomous system routing protocol. The different (ASs) need to be connected to each other so we need to assign some routers in the (ASs) as gateway routers. These routers connect the different (ASs). But how does the gateway router know where to route to when it has no knowledge of anything outside the (AS)? The collecting of information about whether the destination is reachable and sending this information to every router in the (AS) is done by the inter-AS routing protocol. The entirety of the Internet actually runs on one inter-AS routing protocol, named BGP which we will discuss at a later time. In hot-potato routing, the (AS) tries to get rid of the packets as soon and inexpensive as possible. This is done by sending the packet to the closest gateway router.
Intra-AS routing protocol are also referred as interior gateway protocol. Two of them are called the Routing Information Protocol (RIP) and Open Shortest Path First (OSPF). In both RIP ans OSPF the cost is from the host till destination. RIP is a distance vector protocol that counts the amount of hops as costs, each link has a cost of 1. One hop is one subnet traversed, RIP is limited to 15 hops including destination hop. In RIP, routing updates are send every 30 seconds via a RIP response message/RIP advertisement. This message contains up to 25 destinations subnets within the (AS). Whenever a router has not received a RIP message for more than 180 seconds, it is declared as unreachable. These messages are sent using UDP. OSFP and its closely relative, IS-IS are typically upper tier ISP while RIP is more lower tier ISP. OSFP is a link-state information mixed with Dijkstra's algorithm. The administrator can set all edge values to 1 to achieve minimum-hop routing or he can set the values to weights and encourage congestion avoidance or discourage low bandwidth edges. OSPF broadcasts link-state to every node even if nothing has changed because that will increase robustness. The broadcast is send in an OSFP message and send directly via an IP datagram. The OSFP implements its own reliable data transfer and other features like:
In broadcast routing, the network layer provides a service of delivering a packet sent from a source node to all other nodes. Multicast routing enables this in a source node. The simplest way to achieve this is by sending the packet to the N destinations by making N copies of it and the use of unicast routing. This is called N-way-unicast. The first drawback is inefficiency, when a source is connected to the rest of the network via 1 link, then sending the N copies to the first router would be wasting bandwidth. The second drawback is that the source has to know the addresses of the destinations. At last the final drawback is that the unicast routes are computed by the link-state information but that would require broadcast which is not possible without unicast routes. Another obvious way of broadcast is a flooding approach. The source delivers a copy of the packet to every neighbor. A receiving party is to copy and forward the packet to all neighbors except from where it was received. One fatal flaw is that when there is a cycle in the network, then a part of the forwarding will go indefinitely. To prevent this we have a added a broadcast sequence number and its address to the packet. This is called sequence-number- controlled flooding. Each node maintain a list of bypassing addresses and sequence numbers. When a sequence number or address is recognized, the packet is dropped. A second approach was known as reverse path forwarding (RPF). A receiving node only forwards the packet when it arrived on the shortest path back to the source. Otherwise it could discard the packet because the other node is assured to receive a packet via their shortest route. A spanning tree is the minimum tree of nodes for the network to exist. In center-based approach of building a spanning tree, we have a center node, named rendezvous point, defined. Nodes then send three- join messages using unicast. The nodes will keep forwarding the three-join message until it reaches
Multicast service is delivering a packet to a subnet of network nodes. The first two problems are how to identify the subnet nodes and how to route to them. Multicast packets use address indirection. A single identifier is used to pick up that packet and copy and forward it to the group of receivers. The group of receivers associated with the D class addresses is called a multicast group. The Internet Group Management Protocol (IGMP) operates between the host and the direct attached router. IGMP has the means for the host to let the router know an application wants to join a multicast group. Like ICMP, IGMP is packet inside an IP datagram. The router first sends a membership_query message. Which the host will respond with the membership_report message. As last there is a leave_group message which is optional. You can also leave groups by not responding to the membership_query messages. This is an example of the soft state in an IP, you disconnect based on a timeout event. The multicast routing problem is that hosts joined to the multicast group are shaded in color. There are only certain subnets who should receive this multicast packet. You don't have to pass every node to find those subnets. The goal of multicast routing is to find the spanning tree of the subnets who should receive the packet. It is allowed to connect to non receiving nodes but you can skip them. There are two approaches for multicast routing: